Repository navigation
[Backend] Refactor in Rust - #656
Draft
JavierRibaldelRio wants to merge 260 commits into
Draft
JavierRibaldelRio wants to merge 260 commits into
JavierRibaldelRio wants to merge 260 commits into
Conversation
…n start_ntp_server function
… it can be used in new tests. Added comments and changed implementation of protection ID asignation and bit mapping. Created two tests as requested (review this as Gemini was used)
…for news that is not an error
[Backend] Problem becomes Notice, with an Info level
Subscribe to protection/update and keep the last protection of each measurement, keyed by the low 13 bits of the compound protection id. The measurement row turns red with a shield icon until the messages are cleared, since the new protocol sends no recovery event. Measurements are matched by a new optional Variable.adjId (numeric ADJ id), which the new adj/DataPackets catalog has to fill.
- Fetch packets, orders and protections from adj/DataPackets, adj/OrderPackets and adj/ProtectionPackets - Identify measurements by alias and command params by a measurements array with their protections instead of safe/warning ranges - Show triggered protections as messages and categorize messages by the topic they arrive on (message/update, backend/update) - Update mocks to the new shapes
- Key podData/update measurements by alias (the backend sends numeric ADJ ids) - Read backend messages from backend/message - Messages and protections carry the full date in their timestamp - Keep a topic subscribed while any useTopic listener is left: the backend keeps one subscription per topic and connection, so one listener unmounting stopped the topic for the rest
…backend sends them - Protections boards send on message/update are shown as protections (warnings, which only carry a text, as messages), with the value rounded and its limits: "Value: 74.05 (Limit: 70)" - protection/update shows the rounded value and its condition, and says which protection it is when the ADJ doesn't have it - backend/message shows the board it concerns, or Backend, and its text as title - Closed messages show their icon at the end of the row
[Frontend] feat(testing-view): adapt to the new backend's catalogs and WebSocket topics
- station README and lib.rs list every module, pipeline included. - main.rs and readme-demo.md: the pipeline stand-in counts telemetry and shows connections, notices and orders; the real pipeline needs the websocket broker, which main does not start yet.
…lator - The fixture gets a second board (BCU, data packet 661). - Every flush publishes the whole podData map; an empty window nothing. - Every board disconnected at startup; connections only on change. - pipeline stops when the broker is gone, closing both queues. - Accumulator: non-data ids, clock stepping back, malformed packets.
Feat(backend, pipeline): pipeline module
event::Channels renamed problems to notices and telemetry now reaches pipeline on its own queue (pipeline_data), so the event integration test waits there. Also formats the two files this branch touches and commits the Cargo.lock order left by the merge.
A full input queue is backpressure: event waits for a slot and logging keeps recording. Stopping the session on it lost every later record, and right after a start that opens many files it could stop the session that had just begun. Only write errors stop a session now.
The catalog only reads the boards. main already shares Arc<PodData> with net and event (and moves pod_data out of the Adj), so logging can take that same Arc instead of a separate copy of the whole ADJ.
…e error Logging takes a clone of event's notices sender (②) and sends a Warning when a session ends with StopReason::WriteError, so the operator learns that recording stopped. It uses try_send: the router may be waiting for room in logging's input, and waiting on ② would block both.
…of stopping A NaN or infinite order parameter is bad input, not a disk failure. The catalog now rejects it like any other invalid order (warning, row not written) and the session keeps recording, instead of stopping it as a write error.
LoggerCommand, the Commands fields and OrderForwarder::new were pub(crate), so main (a separate binary crate) could not build the Commands that connect the frontends to logging and event's orders.
serve_commands consumes websocket's LoggerCommand queue and drives
Logging: logger/variables ("<board>/<alias>") selects the next session,
logger/enable starts or stops it, and every enable is answered on
logger/response with the actual state. Without a selection every data
measurement is recorded, as competition-view expects.
Feat[Backend]: `logging` module in `station` crate
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.