The reason why need to do it like this instead of relying on a trigger
is because the entry in final_lines is created first and the final_shots
are populated. If we first the trigger on final_lines it is not going
to find any shots; if we fire it as a row trigger on final_shots it
would try to label every point in sequence as it is imported; finally if
we fire it as a statement trigger on final_shots we have no idea which
sequence was imported.
Adds:
* label_in_sequence (_sequence integer, _label text):
Returns events containing the specified label.
* handle_final_line_events (_seq integer, _label text, _column text):
- If _label does not exist in the events for sequence _seq:
it adds a new _label label at the shotpoint obtained from
final_lines_summary[_column].
- If _label does exist (and hasn't been auto-added by this function
in a previous run), it will add information about it to the final
line's metadata.
* final_line_post_import (_seq integer):
Calls handle_final_line_events() on the given sequence to check
for FSP, FGSP, LGSP and LSP labels.
* events_seq_labels_single ():
Trigger function to ensure that labels that have the attribute
`model.multiple` set to `false` occur at most only once per
sequence. If a new instance is added to a sequence, the previous
instance is deleted.
* Trigger on events_seq_labels that calls events_seq_labels_single().
* Trigger on events_timed_labels that calls events_seq_labels_single().
This also implements a generic handler mechanism that can be
reused for other purposes, such as sending email / XMPP notifications,
doing real-time QC checks and so on.
Fixes#113.
If a final sequence file or directory name matches a pattern
which is recognised to indicate a ‘pending acceptance’ status,
the final data (if any exists) for that sequence will be deleted
and a comment added to the effect that the sequence has been
marked as ‘pending’.
To accept the sequence, rename its final file or directory name
accordingly.
Note: it is the *final* data that is searched for a matching
pattern, not the raw.
Closes#91.
If the survey configuration does not itself have a template
we will use the one in etc/defaults/templates/sequence.html.njk.
It is not very likely that the template will be changed all that
often and it avoids issues when people forget to copy it across
to a new survey, etc.
Replaces an existing element with a new one, or inserts it
if there is nothing to replace. The element may be deeply
nested inside a JSON object or array in the `info` table.
Works for both public.info and survey_?.info.
The following options are shown:
* Set line complete:
If a line has been partially shot and still has points
to be acquired.
This option marks remaining virgin points as NTBA=true.
* Set line incomplete:
If a line has been partially shot and remaining virgin
points have been marked as NTBA.
This option marks all points in the line as NTBA=false.
* Set line NTBA:
If a line has not been (successfully) shot at all, i.e.,
all points on the line are virgin.
This option marks the line itself as NTBA=true.
* Unset line NTBA:
If a line has been marked as NTBA.
This option clears the NTBA flag from the line.
`complete` is a boolean.
If true, any virgin points remaining on the line
will be marked as `ntba=true`.
If false, *all* points on the line will be marked
as `ntba=false`.
Virgin points are those that have not been acquired
(and processed) at least once.
Points to be acquired are virgin points that do not
have the `ntba` flag set.
If the location URL contains a hash of either:
* #z/x/y
* #x/y
In the first case it will zoom and pan to the location;
in the second case it will only pan while maintaining the
current (or last used) zoom level.
If the location URL does not contain a hash in one of those
formats, the marker will be removed from the map.