High-level manager for a single INCA measurement experiment run. More...
#include <Experiment.hpp>
Public Member Functions | |
| Experiment (pacemaker::inca::com::IncaOnlineExperimentProxy exp, pacemaker::inca::com::IncaExperimentViewProxy expview, pacemaker::inca::com::ExperimentDeviceProxy device) | |
Constructs an Experiment from its constituent COM proxies. | |
| Experiment (Experiment &&)=default | |
| Move constructor transfers ownership of all COM proxies. | |
| Experiment & | operator= (Experiment &&)=default |
| Move assignment transfers ownership of all COM proxies. | |
| ~Experiment ()=default | |
| Default Destructor; COM proxies are released via their own destructors. | |
| auto | start_recording () -> void |
| Starts a new measurement recording in INCA. | |
| auto | stop_recording (const std::string &filename) -> void |
| Stops the recording, saves the data, and resets all parameters. | |
| auto | add_param (const std::string &name) -> void |
| Registers a calibration parameter for use during the experiment. | |
| auto | set_param (const std::string &name, double value) -> void |
| Sets a registered calibration parameter to the given value. | |
| auto | reset () -> void |
| Resets all registered parameters to their reference-page values and clears the internal parameter table. | |
High-level manager for a single INCA measurement experiment run.
Experiment composes the lower-level COM proxy objects into a coherent workflow for controlling a measurement session:
add_param() for each calibration scalar that the automated run needs to manipulate.start_recording() to begin data capture.set_param() as many times as required during the run.stop_recording() to flush buffered data, save the recording, stop the measurement, and reset all parameters to their reference-page values.Experiment objects are not constructed directly; they are created and returned by Session::connect().
The class is move-constrcutible but not copyable, reflecting the unique ownership of the underlying COM resources.
Definition at line 41 of file Experiment.hpp.
| Experiment | ( | pacemaker::inca::com::IncaOnlineExperimentProxy | exp, |
| pacemaker::inca::com::IncaExperimentViewProxy | expview, | ||
| pacemaker::inca::com::ExperimentDeviceProxy | device ) |
Constructs an Experiment from its constituent COM proxies.
All three proxies are moved into the Experiment, transferring ownership. This constructor is intended to be called exclusively by Session::connect().
| exp | Proxy for the INCA online experiment COM object. |
| expview | Proxy for the INCA experiment-view COM object. |
| device | Proxy for the primary ECU device to use during the run. |
|
default |
Move constructor transfers ownership of all COM proxies.
|
default |
Default Destructor; COM proxies are released via their own destructors.
|
default |
Move assignment transfers ownership of all COM proxies.
| auto start_recording | ( | ) | -> void |
Starts a new measurement recording in INCA.
Delegates to IncaOnlineExperimentProxy::StartRecording(). The recording captures all online measurement signals configured in the open INCA experiment from this point forward.
Call add_param() for any calibration parameters the run needs to control before calling start_recording().
| auto stop_recording | ( | const std::string & | filename | ) | -> void |
Stops the recording, saves the data, and resets all parameters.
The method performs the following steps in order:
k_flush_delay (40 ms) to allow INCA to flush any buffered measurement samples.IncaOnlineExperimentProxy::StopRecordingAndSave().IncaOnlineExperimentProxy::StopMeasurement().reset() to restore all registered calibration parameters to their reference-page values and clear the internal parameter table.| filename | Output recording filename/filepath. |
| auto add_param | ( | const std::string & | name | ) | -> void |
Registers a calibration parameter for use during the experiment.
Looks up the named calibration scalar on the primary device and stores the resulting CalibrationScalarDataProxy internally. The parameter can then be updated during the run via set_param().
Calling add_param() a second time with the same name is a no-op; the parameter is not re-fetched from INCA.
| name | Name fo the calibration parameter as it appears in INCA (e.g. "Engine_TorqueRequest"). |
| std::runtime_error | if the parameter cannot be found on the device (propagated from IncaOnlineExperimentProxy::GetCalibrationValueInDevice()). |
| auto set_param | ( | const std::string & | name, |
| double | value ) -> void |
Sets a registered calibration parameter to the given value.
The parameter must have been previously registered via add_param(). Delegates to CalibrationScalarDataProxy::SetImplValue().
| name | Name of the calibration parameter previously registered with add_param(). |
| value | New value to write to the parameter's implementation page. |
| std::out_of_range | if name was not registered via add_param(). The exception message includes the parameter name. |
| auto reset | ( | ) | -> void |
Resets all registered parameters to their reference-page values and clears the internal parameter table.
Iterates over all stored CalibrationScalarDataProxy objects and calls ResetValueToRP() on each, then clears both the name-to-index map and the proxy vector. After this call the experiment is in the same state as immediately after construction.
This method is called automatically by stop_recording() at the end of each run, but may also be called explicitly if an early reset is required.