STFC-ICD-Research-and-Design / supermusr-data-pipeline

Prototype data acquisition pipeline for Super-MuSR
GNU General Public License v3.0
0 stars 3 forks source link

Improve simulator functionality #249

Closed Modularius closed 3 weeks ago

Modularius commented 3 weeks ago

Summary of changes

  1. Changed unwraps to expects in build_messages.rs
  2. Changed send_trace_message to send_digitiser_trace_message and integrated edits in send_messages.rs, simulation.rs, engine.rs and others.
  3. Added Trace struct for channel traces in event_lists.rs and refactored
  4. Added IntConstant and TextConstant types
  5. Added EnsureDelayMs action
  6. Improved error handling

Instruction for review/testing

General code review as the simulator was successfully tested in the pipeline.

Modularius commented 3 weeks ago

There were considerably more unwraps than I realised. I've replaced them with anyhows (they inform the user of invalid JSON), and all remaining excepts should be impossible. The remaining unwraps are all part of test modules.

DanNixon commented 3 weeks ago

I've replaced them with anyhows (they inform the user of invalid JSON)

See https://github.com/STFC-ICD-Research-and-Design/supermusr-data-pipeline/blob/main/docs/style.md#crab-error-handling-rules, anyhow outside of the return type of main() is prohibited.