Skip to content

[Backend] Refactor in Rust - #656

Draft
JavierRibaldelRio wants to merge 260 commits into
base-h12from
new-backend
Draft

JavierRibaldelRio wants to merge 260 commits into
base-h12from
new-backend

Conversation

@JavierRibaldelRio

Copy link
Copy Markdown
Member

No description provided.

pminmic and others added 30 commits October 3, 2026 11:50
… 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)
JavierRibaldelRio and others added 30 commits December 5, 2026 10:24
[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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants