Commit Graph

937 Commits

Author SHA1 Message Date
D. Berge
1b925502bc Update database templates to v0.3.11.
* Redefine augment_event_data()
2022-05-12 21:59:38 +02:00
D. Berge
7cea79a9be Add database upgrade file 24.
This redefines augment_event_data() to use interpolation rather than
nearest neighbour. It now takes an argument indicating the maximum
allowed interpolation timespan. An overload with a default of ten
minutes is also provided, as an in situ replacement for the previous
version.

The ten minute default is based on Triggerfish headers behaviour seen
on crew 248 during soft starts.
2022-05-12 21:58:51 +02:00
D. Berge
69f565f357 Update database templates to v0.3.10.
* Add interpolate_geometry_from_tstamp()
2022-05-12 21:52:31 +02:00
D. Berge
23de4d00d7 Add database upgrade file 23.
This defines a interpolate_geometry_from_tstamp(), taking a timestamp
and a maximum timespan in seconds. It will then interpolate a position
at the exact timestamp based on data from real_time_inputs, provided
that the effective interpolation timespan does not exceed the maximum
requested.

Fixes #243.
2022-05-12 21:51:00 +02:00
D. Berge
1992efe914 Update database templates to v0.3.9.
* Add replace_placeholders()
* Add scan_placeholders() procedure
2022-05-12 21:47:38 +02:00
D. Berge
c7f3f565cd Add database upgrade file 22.
This defines a replace_placeholders() function, taking as arguments
a text string and either a timestamp or a sequence / point pair. It
uses the latter arguments to find metadata from which it can extract
relevant information and replace it into the text string wherever the
appropriate placeholders appear. For instance, given a call such as
replace_placeholders('The position is @POS@', NULL, 11, 2600) it will
replace '@POS@' with the position of point 2600 in sequence 11, if it
exists (or leave the placeholder untouched otherwise).

A scan_placeholders() procedure is also defined, which calls the above
function on the entire event log.

Fixes #229.
2022-05-12 21:45:56 +02:00
D. Berge
1da02738b0 Update database templates to v0.3.8.
* Add event_position()
* Add event_meta()
2022-05-12 21:40:23 +02:00
D. Berge
732d8e9be6 Add database upgrade file 21.
This adds event_position() and event_meta() functions which are used
to retrieve position or metadata, respectively, given either a timestamp
or a sequence / point pair. Intended to be used in the context of #229.
2022-05-12 21:38:28 +02:00
D. Berge
a2bd614b17 Update database templates.
* Optimise public.geometry_from_tstamp()
* Remove index on public.real_time_inputs.meta->>'tstamp'
* Fix adjust_planner()
2022-05-10 21:57:53 +02:00
D. Berge
003c833293 Add database upgrade file 20.
This updates the adjust_planner() procedure to take into account the
new events schema (the `event` view has been replaced by `event_log`).

Fixes #208.
2022-05-10 21:54:46 +02:00
D. Berge
a4c458dc16 Add database upgrade file 19.
Rewrites geometry_from_tstamp() to make it more efficient.

Fixes #241.
2022-05-10 21:52:24 +02:00
D. Berge
f7b6ca3f79 Log runner output to syslog (if so configured).
The variable DOUGAL_LOG_FACILITY must be defined in the environment
(e.g., in ~/.dougalrc) for syslog to be enabled.
2022-05-08 15:30:05 +02:00
D. Berge
a7cce69c81 Add logging statements 2022-05-08 15:26:15 +02:00
D. Berge
2b20a5d69f Update line details on reimport conflict.
To deal with misnamed lines.

Fixes #240.
2022-05-08 15:25:11 +02:00
D. Berge
4fc5d1deda Add links to first / last page.
Fixes #237.
2022-05-07 14:58:16 +02:00
D. Berge
df13343063 Colour map QC events according to their labels.
We take the first label associated with the event (if any) and use
the label's colour for the event marker. We override the colour for
QC events and use a default value for events with no labels or if
the label does not have an associated colour.
2022-05-07 12:07:03 +02:00
D. Berge
a5603cf243 Fix detection of map QC events.
Fixes #236.
2022-05-07 12:05:56 +02:00
D. Berge
b6d4236325 Make prime data stand out.
Fixes #228.
2022-05-06 18:07:09 +02:00
D. Berge
7e8f00d9f2 Explicitly label comment sections in default template 2022-05-06 17:15:09 +02:00
D. Berge
721cfb36d1 Use timestamp from message payload if it has one.
Fixes #221.
2022-05-06 15:17:10 +02:00
D. Berge
222c951e49 Add debugging to navdata/save.
To help track down #221.
2022-05-06 14:31:06 +02:00
D. Berge
45d2e56ed1 Add debug() module.
It uses https://github.com/debug-js/debug but it is meant to be
called like this:

const debug = require("DOUGAL_ROOT/debug")(__filename);

That way the calling module's path is used as the debug namespace.
2022-05-06 14:11:31 +02:00
D. Berge
c5b6c87278 Add DOUGAL_ROOT symlink to node_modules.
This can be used as a shortcut when requiring a module from deep
within the file hierarchy, e.g., instead of:

require("../../../../lib/db");

one can do:

require("DOUGAL_ROOT/lib/db");
2022-05-06 14:08:19 +02:00
D. Berge
fd37e8b8d6 Add context option to accept/unaccept QCs.
Closes #220.
2022-05-04 19:45:20 +02:00
D. Berge
ce0310d0b0 Silence error on non-existent label definition 2022-05-04 19:42:53 +02:00
D. Berge
546bc45861 Remove dead code 2022-05-04 18:35:20 +02:00
D. Berge
602f2c0a34 Merge branch '215-flag-unflag-qc-results-as-accepted' into 'devel'
Resolve "Flag / unflag QC results as accepted"

Closes #215

See merge request wgp/dougal/software!28
2022-05-04 16:32:48 +00:00
D. Berge
37de5ab223 Implement UI for flagging QCs as accepted or unaccepted 2022-05-04 18:21:42 +02:00
D. Berge
d69c6c4150 Add DougalQcAcceptance Vue.js component.
Widget for use in the QC view to show controls for accepting or
unaccepting QCs.
2022-05-04 18:20:28 +02:00
D. Berge
d80f44547b Update API description 2022-05-04 18:13:14 +02:00
D. Berge
6c8515a879 Add QC results accept/unaccept API endpoints 2022-05-04 18:11:05 +02:00
D. Berge
bb9340a0af Add QC results accept/unaccept middleware.
This middleware can only deal with shot QCs, not sequence-wide QCs.
2022-05-04 17:22:18 +02:00
D. Berge
672c14fb67 Add functions to accept/unaccept QCs.
These are only able to deal with shot QCs. At this point, sequence-wide
QCs cannot be marked as accepted.
2022-05-04 17:19:20 +02:00
D. Berge
f4ee798bf0 Implement endpoint for QC deletion.
Closes #217.
2022-05-04 17:15:28 +02:00
D. Berge
c8ef089b28 Log speed value on Hydronav error.
Related to #206.
2022-05-03 23:58:42 +02:00
D. Berge
1f6d560d7e Style log events according to online/offline status.
Strictly speaking, it doesn't consider (or know) what the shooting
status is (but see #214). All it does is colour events differently
if they have all three of: sequence, point and timestamp.

This is probably good enough for the time being to close #134.
2022-05-03 23:42:58 +02:00
D. Berge
f37e07796c Change description of QC test.
It's not an error but only a warning.
2022-05-03 17:27:34 +02:00
D. Berge
349c052db0 Use all sequences to build QC tree.
Fixes #213.
2022-05-03 17:23:50 +02:00
D. Berge
1c291db6c6 Add database upgrade file 18.
* Adds label_in_sequence() function

NOTE: This function is already defined in schema-template.sql but
seemingly never got pushed into production.

Fixes #211.
2022-05-02 13:40:33 +02:00
D. Berge
f46fd4b6bc Cope with non-existing configuration paths.
Fixes #212.
2022-05-02 13:15:41 +02:00
D. Berge
10883eb1a6 Check for invalid speed values in Hydronav header.
Related to #206. If this is indeed what is causing the alerts,
we will change the logic so that it simply logs (or ignores)
invalid speeds rather than throwing.
2022-05-02 13:09:43 +02:00
D. Berge
af6e419aab Run QCs from runner.
When importing an old project, the first QC run could take a while
and cause a bit of backlog, but during normal shooting it is expected
that it will finish quite quickly (and this is monitored anyway).
2022-05-01 21:26:10 +02:00
D. Berge
6516896bae Disable system imports in runner.
They're not really used. Will probably remove at a later date.
2022-05-01 21:24:56 +02:00
D. Berge
c495dce27d Don't show event history widget for guests.
NOTE: guests still do have access to the relevant API endpoint.
In theory, a persistent and computer literate guest user could
visit the API endpoint directly and retrieve the edit history.
As the edit history may need to be given to users who otherwise
do not have write access, it is considered quite acceptable to
allow guest users to access the endpoint.

Closes #194.
2022-05-01 21:20:52 +02:00
D. Berge
40d96230d2 Adjust planner times from runner.
Fixes #167.
2022-05-01 20:27:19 +02:00
D. Berge
d607b4618a Merge branch '182-periodically-scan-the-events-table-for-missing-information' into 'devel'
Resolve "Periodically scan the events table for missing information"

Closes #182

See merge request wgp/dougal/software!26
2022-05-01 18:24:35 +00:00
D. Berge
fd41d2a6fa Launch database housekeeping tasks from runner 2022-05-01 20:10:27 +02:00
D. Berge
39690c991b Update database templates.
* Add index on public.real_time_inputs.meta->>'tstamp'
* Add public.geometry_from_tstamp()
* Add augment_event_data()
2022-05-01 19:47:16 +02:00
D. Berge
09ead4878f Add database upgrade file 17 2022-05-01 19:46:04 +02:00
D. Berge
588d210f24 Fix reporting for “gun pressures” QC test.
Fixes #205.
2022-04-30 17:37:38 +02:00