diff --git a/README.md b/README.md index 65f39e1..9201b29 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,33 @@ # ITC Pressure Optimizer -Optimize the pressure setpoint on Mercury ITC depending on Temperature parameters read from the (same) Mercury ITC. +Optimize the pressure setpoint on a Mercury ITC depending on temperature parameters read from the (same) Mercury ITC. +Pressures are calculated as a function of temperature setpoint, actual temperature, heater power, and currently set pressure. +This driver is a port of mitcpresscio.c, with an event -Pressure are calculated in function of temperature setpoint, actual temperature, heater power and currently set pressure. +# Preview +![alt text](img/odb_equipment_interface.png) -This driver is only a port of mitcpresscio.c, using the c++ TRIUMF framework instead of legacy C +# Download -# ITC Pressure Optimizer DD Settings for associated Equipment +```bash +$ git clone .... +``` -Path : ```/Equipment//Settings/Devices/MITCPRESSC/DD/``` +# Compile +```bash +$ cmake -B build +$ cmake --build build +``` +# Run +```bash +$ $pwd/build/itcPressureOptimizer +``` +# Configuration + +In ```/Equipment//Settings/Devices/MITCPRESSC/DD/```, you can modify settings regarding where to read/write values to the equipment. + +Default values are : | Equipment | variox0 | heliox0 | |-----------|---------|---------| @@ -23,3 +41,20 @@ Path : ```/Equipment//Settings/Devices/MITCPRESSC/DD/``` *NOTE: OutputPressSPIndex and InputVarioxPowIndex are different for variox0 and heliox0* + + +# Usage + +In ```/Equipment//Variables/Demand``` you can specify demand to the equipment. See **Preview** + +# Project structure + +This is the execution flow graph. + +![alt text](out/doc/graph/graph.png) + +For cleaner code, all execution and data flow pass through an EventBus. Objects can subscribe to one or many specific event types. They can also publish an event, which will be dispatched to all subscribers by invoking their callbacks. + +`OdbHotlink` triggers the execution flow whenever a value changes. Only `DemandHandler` and `InputHandler` are registered. + +`itc_pressure_optimizer` instantiates all components and publishes an `InitEvent` first, allowing all handlers to initialize and connect to the ODB. It also periodically publishes a `PollEvent` every second to update time-dependent averages. \ No newline at end of file diff --git a/doc/graph.puml b/doc/graph.puml index c90dae7..c096fd7 100644 --- a/doc/graph.puml +++ b/doc/graph.puml @@ -6,15 +6,15 @@ class EventBus <> { + subscribe() } -class Demand -class itc -class Settings -class Input -class Pressure { +class Demand as "DemandHandler" +class itc as "itc_pressure_optimizer" +class Settings as "SettingsHandler" +class Input as "InputHandler" +class Pressure as "PressureCalculator" { class Average } -class Output -class Feedback +class Output as "OutputHandler" +class Feedback as "FeedbackHandler" Demand -.> Pressure Demand -.> Feedback @@ -31,4 +31,5 @@ Input -.> Output Input -.> Pressure Pressure -.> Feedback + @enduml \ No newline at end of file diff --git a/out/doc/graph/graph.png b/out/doc/graph/graph.png index f12381a..070678d 100644 Binary files a/out/doc/graph/graph.png and b/out/doc/graph/graph.png differ