pacemaker 1.0.1
COM automation for people with deadlines and a hatred of GUIs
 
Loading...
Searching...
No Matches
IncaOnlineExperimentProxy Class Reference

Proxy for the INCA online experiment COM object. More...

#include <IncaOnlineExperimentProxy.hpp>

Inheritance diagram for IncaOnlineExperimentProxy:
Collaboration diagram for IncaOnlineExperimentProxy:

Public Member Functions

 IncaOnlineExperimentProxy (pacemaker::inca::detail::unique_com_ptr<::IDispatch > idispatch)
 Constructs the proxy by narrowing a generic IDispatch to IncaOnlineExperiment_Dispatch.
 
 IncaOnlineExperimentProxy (IncaOnlineExperimentProxy &&)=default
 Move constructor transfers ownership of the COM object.
 
IncaOnlineExperimentProxyoperator= (IncaOnlineExperimentProxy &&)=default
 Move assignment transfers ownership of the COM object.
 
 ~IncaOnlineExperimentProxy ()
 Destructor; releases the underlying COM object.
 
auto GetAllDevices () -> std::vector< pacemaker::inca::detail::unique_com_ptr<::IDispatch > >
 Returns all ECU devices associated with the open experiment.
 
auto StopMeasurement () -> void
 Stops the active measurement session.
 
auto StartRecording () -> void
 Starts a new measurement recording.
 
auto StopRecordingAndSave () -> void
 Stops the current recording and saves the collected data.
 
auto GetCalibrationValueInDevice (const std::string &name, ::ExperimentDevice_Dispatch *const device) -> pacemaker::inca::detail::unique_com_ptr<::IDispatch >
 Retrieves a calibration scalar data item by name from a specific device.
 

Detailed Description

Proxy for the INCA online experiment COM object.

IncaOnlineExperimentProxy wraps the IncaOnlineExperiment_Dispatch COM interface, which controls the active measurement session in INCA. It provides the following capabilities:

  • Enumerating connected ECU devices.
  • Starting and stopping measurement recordings.
  • Retrieving calibration scalar data objects by name from a specific device.

The class is move-only. All SAFEARRAY and BSTR marshalling is handled internally so that callers work exclusively with standard C++ types.

See also
pacemaker::inca::com::ExperimentDeviceProxy
pacemaker::inca::com::CalibrationScalarDataProxy
pacemaker::inca::detail::COMProxy

Definition at line 34 of file IncaOnlineExperimentProxy.hpp.

Constructor & Destructor Documentation

◆ IncaOnlineExperimentProxy() [1/2]

Constructs the proxy by narrowing a generic IDispatch to IncaOnlineExperiment_Dispatch.

Parameters
idispatchOwning pointer to a generic IDispatch representing the online experiment object. Ownership is transferred to the proxy.
Exceptions
std::invalid_argumentif idispatch is null.
std::runtime_errorif QueryInterface fails to obtain IncaOnlineExperiment_Dispatch.

◆ IncaOnlineExperimentProxy() [2/2]

Move constructor transfers ownership of the COM object.

◆ ~IncaOnlineExperimentProxy()

Destructor; releases the underlying COM object.

Member Function Documentation

◆ operator=()

Move assignment transfers ownership of the COM object.

◆ GetAllDevices()

auto GetAllDevices ( ) -> std::vector< pacemaker::inca::detail::unique_com_ptr<::IDispatch > >
nodiscard

Returns all ECU devices associated with the open experiment.

Calls GetAllDevices() on the underlying COM object, unpacks the returned SAFEARRAY of VT_DISPATCH elements, and returns each element as an owning IDispatch pointer. Each pointer can subsequently be used to construct an ExperimentDeviceProxy.

Returns
Vector of owning IDispatch pointers, one per device. The vector si empty if no devices are configured.
Exceptions
std::runtime_errorif the returned SAFEARRAY is not of type VT_ARRAY | VT_VARIANT, if SafeArrayGetElement fails, or if any element is not of type VT_DISPATCH.

◆ StopMeasurement()

auto StopMeasurement ( ) -> void

Stops the active measurement session.

Delegates directly to IncaOnlineExperiment_Dispatch::StopMeasurement(). Call this after StopRecordingAndSave() to fully stop the measurement.

◆ StartRecording()

auto StartRecording ( ) -> void

Starts a new measurement recording.

Delegates directly to IncaOnlineExperiment_Dispatch::StartRecording(). The recording captures all online measurement signals configured in the open INCA experiment.

◆ StopRecordingAndSave()

auto StopRecordingAndSave ( ) -> void

Stops the current recording and saves the collected data.

Delegates directly to IncaOnlineExperiment_Dispatch::StopRecordingAndSave(). The data is persisted by INCA to the location configured in the experiment. Call StopMeasurement() afterwards to fully stop the session.

Note
A short flush delay should be observed before calling this method to ensure all buffered measurement samples have been written. pacemaker::inca::Experiment::stop_recording() handles this automatically.

◆ GetCalibrationValueInDevice()

auto GetCalibrationValueInDevice ( const std::string & name,
::ExperimentDevice_Dispatch *const device ) -> pacemaker::inca::detail::unique_com_ptr<::IDispatch >

Retrieves a calibration scalar data item by name from a specific device.

Looks up the named calibration parameter on the given device and returns an owning IDispatch pointer that can be used to construct a CalibrationScalarDataProxy.

Parameters
nameName of the calibration parameter as configured in INCA.
deviceNon-owning raw pointer to the device from which the parameter is retrieved. Obtain this via ExperimentDeviceProxy::get().
Returns
Owning IDispatch pointer to the calibration scalar data object.
Exceptions
std::runtime_errorif the parameter is not found on the device (the underlying COM call returns a nullptr).

The documentation for this class was generated from the following file: