Commit Graph

959 Commits

Author SHA1 Message Date
D. Berge
632a056f98 Include NTBA status in line endpoint response 2020-10-02 20:39:48 +02:00
D. Berge
de2deedfd2 Do not refresh sequence list on raw_shots event.
Otherwise, it will get refreshed continuously while
online, which is not great.
2020-10-02 19:30:24 +02:00
D. Berge
eb37a6b6c6 Listen also to shot events.
We need this because the *_lines event will
always fire before any shots have been imported.
2020-10-02 18:35:05 +02:00
D. Berge
198d0072d4 Show sequence remarks + NTBP status on map.
Closes #50.
2020-10-02 17:58:44 +02:00
D. Berge
e8c230ccc2 React to sequence change notifications in SequenceList 2020-10-02 16:33:06 +02:00
D. Berge
cf1678ed25 Increase body-parser limits.
Fixes #51.
2020-10-02 15:28:43 +02:00
D. Berge
940aea8c7b Run events manager in a separate process.
Not sure if this is going to do anything in
terms of improving the handling of and reacting
to events, but it doesn't seem to hurt terribly.

Eventually, all this will probably need to be
refactored to use EventEmitter.
2020-10-02 01:34:49 +02:00
D. Berge
c404edc4b3 Improve reliability of reaction to events.
Hopefully.
2020-10-02 01:33:58 +02:00
D. Berge
7451433aa4 Remove debugging statements 2020-10-02 01:33:33 +02:00
D. Berge
cf9cb393a9 Fix table labelling 2020-10-02 00:47:39 +02:00
D. Berge
b77ffa5d0f Ensure line statuses are visible on mobile 2020-10-02 00:42:19 +02:00
D. Berge
f30f108e08 React to preplot_lines notifications 2020-10-02 00:41:16 +02:00
D. Berge
746e3405fb Let websocket listen to all DB notification channels 2020-10-02 00:39:53 +02:00
D. Berge
902338f835 Restrict patching actions to vessel lines only.
These are the only type of lines returned by list().
2020-10-01 18:37:49 +02:00
D. Berge
381e3773c6 Allow editing of remarks in preplot lines list 2020-10-01 18:28:59 +02:00
D. Berge
f9ef971802 Add preplot line patching endpoint.
Allows us to change remarks, meta and ntba
fields in preplot lines.
2020-10-01 18:28:02 +02:00
D. Berge
3a87f8959a Add slot for empty line status 2020-10-01 15:31:24 +02:00
D. Berge
79a751393c Highlight active row in preplot lines list 2020-09-30 20:12:15 +02:00
D. Berge
60000eeaf1 Make preplot lines list searchable 2020-09-30 20:04:35 +02:00
D. Berge
d2c65b480b Add status information to preplot lines list 2020-09-30 19:44:15 +02:00
D. Berge
589fe07ad6 Add <dougal-line-status/> component.
It shows a graphical representation of the
acquisition status of a preplot line, as
stacked bars where each bar represents the
acquisition extent of a sequence. This is
complemented by colour denoting the raw/final/
ntbp status of the sequence and by a tooltip
with the same information. Sequence bars may be
made clickable by providing a function to the
"sequence-href" property; this function should
take a sequence object and return a URL.
2020-09-30 19:41:09 +02:00
D. Berge
bdf573d4a6 Add Dougal-specific data to structured sequence exports 2020-09-30 15:54:16 +02:00
D. Berge
873c29ad00 Remove logging statement 2020-09-30 15:40:31 +02:00
D. Berge
32d97a4856 Fix errors in Multiseis export 2020-09-29 20:28:56 +02:00
D. Berge
e7099643f5 Try harder to produce Multiseis export files.
We try to ensure that for each sequence we have
at least FSP and LSP entries. We do this by:

* If there exists a FGSP / LGSP, we clone those as
FSP / LSP respectively.

* Otherwise, we take the first and last shots
found in the final P1 which have a preplot.

We also include log comments whenever possible and
format the azimuth a bit better.
2020-09-29 18:05:46 +02:00
D. Berge
2733223037 Refresh the log more aggressively.
On the backend, the events endpoint caches responses
by ETag in order to reduce the load on the database
and response times. That cache is supposed to be
invalidated with the middleware receives a notification
that the underlying data has changed. However, that
change might arrive just *after* the HTTP request,
meaning that if we let the browser do its thing we
will probably be returning stale data.

So what we do is we explicitly request a non-cached
response when we know that something has changed
because we changed it ourselves.

What we do not do is bypass the cache if we receive
a change event notification, as we assume that the
HTTP roundtrip will be more than sufficient for
the server to have invalidated (and perhaps even
refreshed) its response.
2020-09-29 00:30:40 +02:00
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
bf313dd8e5 Allow editing of remarks in sequence list 2020-09-27 19:25:45 +02:00
D. Berge
371030e61e Add optional callback to Vuex API action.
The callback has the signature (err, res) where
res is the result object from the fetch() request
and err is non-null if an error occurred and fetch()
threw.

The callback is called before res.json() has had a
chance to run it is really not recommended to
consume the body from this callback as this will cause
an error in the API action itself.
2020-09-27 19:23:04 +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
be242e109a Request map events from server as GeoJSON 2020-09-26 18:06:22 +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
ae8a25f240 Avoid making unnecessary map requests 2020-09-26 01:34:14 +02:00
D. Berge
39b425b392 Add comment 2020-09-26 01:24:12 +02:00
D. Berge
f2024a7b99 Abort pending requests on successive map refreshes 2020-09-26 01:18:12 +02:00
D. Berge
b383f4e4c0 Slightly increase size of event markers 2020-09-26 01:17:34 +02:00
D. Berge
1d8036b429 Protect against events without payload.
These will eventually arrive when we stop ignoring
events > 8 KiB.
2020-09-26 01:16:25 +02:00
D. Berge
358eb44de3 Don't report error if a fetch was aborted 2020-09-26 01:15:32 +02:00
D. Berge
6badff2f76 Switch event map layers to ‘push’ style update.
Still no updating on new / deleted events though.
2020-09-25 22:42:33 +02:00
D. Berge
949f42c1dc Show events on map.
Partial implementation. Notably, it does not yet update
when events are added/modified/deleted.

Related to #48.
2020-09-25 18:33:55 +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