Commit Graph

94 Commits

Author SHA1 Message Date
D. Berge
77ff9a047c Pass a different copy of the data to each listener 2020-09-28 23:07:27 +02:00
D. Berge
2886bd4943 Do not react to events until we have at least two of them.
This is to avoid false positives when restarting the API
mid-line.
2020-09-28 21:43:24 +02:00
D. Berge
03563bdaf2 Auto-create FSP/LSP events from nav header.
If the nav header is being received, this will
try to detect the start and end of line and create
an entry in the log.

It doesn't check whether FSP/FGSP LSP/LGSP entries
already do exist for that sequence.

Closes # 28.
2020-09-28 21:36:32 +02:00
D. Berge
7758f08a79 Use array instead of set for storing callbacks 2020-09-28 21:33:16 +02:00
D. Berge
b73dd3fe1e Add function to return project ID from schema name 2020-09-28 21:32:28 +02:00
D. Berge
0d72ea3c88 Purge QCs that are no longer failing.
If a QC has failed in the past there will be a
record of it in raw_lines, raw_shots or preplot_points.

If that QC then stopped failing, e.g., because of a
change of parameters, then the QC results would correctly
reflect the change but not the line/shot tables and
hence, the event log.

This commit hopefully takes care of that.
2020-09-28 14:58:48 +02:00
D. Berge
e75e866285 Tidy up formatting 2020-09-28 13:12:18 +02:00
D. Berge
fd1f1a2c1a Implement sequence patching endpoint.
Allows us to change remarks and meta fields in sequences.
2020-09-27 19:21:59 +02:00
D. Berge
bfcc02a140 Comment out logging statement 2020-09-27 19:19:47 +02:00
D. Berge
acf58df59f Return events in structured sequence export format.
The events endpoint will return data in the format
agreed with Multiseis if the request has an
Accept: application/vnd.seis+json
header.

Related to #12.
2020-09-26 22:55:11 +02:00
D. Berge
b76f1f166b Refactor events middleware.
The reason for refactoring was to accommodate
Multiseis / client sequence exports, which will be
served by this endpoint via a specific Content-Type.

In the process, the cache has been fixed and redesigned.

Related to #12.
2020-09-26 17:41:47 +02:00
D. Berge
42d453f714 Cache event responses at the middleware level.
This is not really a substitute for proper database
design but if deemed useful it might be refactored
into a more generic caching middleware and applied
to other requests as a low-cost alternative to
database refactoring while we gain usage and
performance information.
2020-09-25 18:29:40 +02:00
D. Berge
ab2cf81327 Broadcast an already parsed JSON payload 2020-09-25 18:26:04 +02:00
D. Berge
55cb3856c3 Remove logging statement 2020-09-25 18:23:03 +02:00
D. Berge
33c23c1239 Return event labels directly from events view.
This speeds up the query by orders of magnitude.
2020-09-23 16:31:55 +02:00
D. Berge
80e8ccef9c Add endpoints for setting and retrieving metadata 2020-09-20 18:11:33 +02:00
D. Berge
7e36305472 Remove logging statements 2020-09-20 18:10:25 +02:00
D. Berge
fe3a825bf7 Do not overwrite other qc info 2020-09-20 18:09:43 +02:00
D. Berge
bdb2fb9c3f Cache QC results associated with each shot / sequence.
This is to enable the user to associate information, in
particular “QCAccepted” override labels, to individual
results. The information stays associated with tests
unless the data is removed or the results change (e.g.,
because the data was reprocessed or the test parameters
or algorithm were changed).
2020-09-20 17:10:47 +02:00
D. Berge
cd392a33df When QCs called without projectId, associate pid with results.
Otherwise the return value would be ambiguous as we wouldn't
know to which project the values belong.
2020-09-20 17:09:31 +02:00
D. Berge
2107a5087a Skip disabled items 2020-09-20 17:08:47 +02:00
D. Berge
2bd4b895b7 Save item id in results 2020-09-20 17:08:15 +02:00
D. Berge
1f837b12df Save item type in results.
Not sure if this is actually used though.
2020-09-20 17:05:32 +02:00
D. Berge
5324a71523 Fix assignment of _id values to tests 2020-09-20 17:04:13 +02:00
D. Berge
53077f0baf Remove logging statement 2020-09-13 17:30:25 +02:00
D. Berge
d45e17fce3 Add scripts to launch Dougal services in production 2020-09-13 15:35:36 +02:00
D. Berge
225c710142 Allow taking JWT secret from environment in production 2020-09-13 15:02:58 +02:00
D. Berge
da7a977c59 Change definition of Preplot QC objects 2020-09-12 22:25:45 +02:00
D. Berge
a596a3be48 Implement QC routine.
Even though for practical reasons it's inside lib/www
this is meant to be run by bin/runner.sh at regular
intervals and refresh the QC data. This is a work
in progress. This version does not process or produce
labels, it doesn't create events in the event log and
it doesn't do online data, amongst other things.
2020-09-10 23:18:28 +02:00
D. Berge
db25878fdd Add info API endpoint.
It queries a project's `info` table.
2020-09-09 15:55:04 +02:00
D. Berge
1a612f74d6 Refactor configuration methods in DB 2020-09-09 15:53:01 +02:00
D. Berge
c40a859efa Deal with Hydronav header fields overflowing.
Fixes #21.
2020-09-09 12:43:37 +02:00
D. Berge
2db376e1cc Bubble errors in db.event.post 2020-09-06 23:26:12 +02:00
D. Berge
d285a63746 Remove debug statements 2020-09-06 21:00:06 +02:00
D. Berge
a253578a1b Make SmartSource header less verbose.
PostgreSQL NOTIFY has an 8,000 bytes payload limit
and we were going over that.
2020-09-04 01:33:18 +02:00
D. Berge
5c8f8023d6 Remove debug statement 2020-09-04 01:33:18 +02:00
D. Berge
52907921f1 Add websocket server to emit DB notifications 2020-09-04 01:33:18 +02:00
D. Berge
a9a084b531 Cope with prospect detection not working during approach / runout 2020-09-04 01:31:39 +02:00
D. Berge
d683f00594 Implement SmartSource header parser 2020-09-02 08:59:22 +02:00
D. Berge
0a2f0b0b60 Refactor save() so that we can force a specific CRS.
This was brought about due to the absence of CRS information
in the navigation header outputs. We get either unqualified
easting / northing or unqualified latitude / longitude, neither
of which happen to be WGS84.

This is not a good solution as it involves manual configuration,
but allows us to move forward for the time being.
2020-09-02 08:55:08 +02:00
D. Berge
ff2e30511c Refactor save() call to pass in header.meta options 2020-09-02 08:54:16 +02:00
D. Berge
1f60ebae47 Make selection of headers to parse configurable 2020-09-02 08:52:49 +02:00
D. Berge
c8e0dc5d02 Return only real files from sequence list endpoint.
In other words, filter out real-time data.
2020-09-01 12:30:49 +02:00
D. Berge
eded667d79 Add endpoint for retrieving real-time data as GeoJSON 2020-09-01 10:58:37 +02:00
D. Berge
557d87de72 Add endpoint to retrieve real-time input data 2020-09-01 10:56:25 +02:00
D. Berge
bfc4124b33 Save to real_time_inputs also when we're on a line 2020-09-01 10:52:38 +02:00
D. Berge
bed9cdc69f Add UDP server for navigation system headers 2020-08-31 14:36:56 +02:00
D. Berge
c0c395d9a0 Save online and offline real-time data to database 2020-08-31 14:36:56 +02:00
D. Berge
e4803da149 Add decoders for Hydronav, LABOv3 navigation headers 2020-08-31 13:40:56 +02:00
D. Berge
433daca9ef Add deep properties getter utility function to config.
cfg._("a.deep.property") returns the value of
cfg.a.deep.property if it exists. If the property
or any of its parents do not exist, returns undefined.
2020-08-31 13:07:27 +02:00