ifw-ccf 5.0.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ifw::ccf::control::Application Class Reference

Implements the core CCF Control Application. More...

#include <application.hpp>

Inheritance diagram for ifw::ccf::control::Application:
ifw::ccf::common::AppBase

Public Member Functions

virtual ~Application ()
 
elt::mal::Mal & GetMal ()
 Return reference to the MAL (Singleton) instance.
 
int Execute (int argc, char *argv[])
 Initialise and execute the application.
 
void CreateThreads ()
 
void LoadInitSetup ()
 Load the Initialisation Setup specified in the configuration and install it.
 
void HandleSetup ()
 Handle the setup of the application.
 
void Dismantle ()
 
bool AcquisitionActive ()
 
void StartAcquistion (bool force=false, bool exec_com_adapter_start=true)
 Instruct the system to start an acquisition (finite or infnite).
 
void StopAcquistion ()
 
void CheckStopAcquistion ()
 Check if the conditions are met to stop an ongoing acqusition session.
 
void IncrementFrameCounter ()
 Increment frame counter, counting the number of complete frames received.
 
std::string GetState ()
 Return the current state (status) of the SCXML state machine.
 
void SetRequestStatus (const std::string &request, const std::string &status)
 Set status of the given request.
 
std::string GetRequestStatus (const std::string &request) const
 Get the status of the given request.
 
std::string ListAdapters ()
 List the available adapters registered in this executable.
 
template<class COM_ADPT_TYPE , class SIM_COM_ADPT_TYPE >
void RegisterComAdapters (const COM_ADPT_TYPE &com_adapter_factory_obj, const SIM_COM_ADPT_TYPE &sim_com_adapter_factory_obj)
 Method to allocate and register the Communication Adapters.
 
template<class MON_ADPT_TYPE >
void RegisterMonAdapter (const MON_ADPT_TYPE &mon_adapter_factory_obj)
 Method to allocate and register the Monitor Adapters.
 
template<class EXEC_ADPT_TYPE >
void RegisterExecAdapter (const EXEC_ADPT_TYPE &exec_adapter_factory_obj)
 Method to allocate and register the Execution Adapter.
 
ifw::ccf::common::ComAdptBaseGetComAdapter ()
 
ifw::ccf::common::MonAdptBaseGetMonAdapter ()
 Return the reference to the Monitoring Adapter.
 
ifw::ccf::common::ExecAdptBaseGetExecAdapter ()
 Return the reference to the Execution Adapter.
 
void ConnectDevice ()
 Connect to the associated device.
 
void DisconnectDevice ()
 Disconnect from the associated device.
 
const std::vector< std::string > & GetProcThreadNames () const
 Get the names of the Processing Threads running.
 
const std::vector< std::string > & GetPubThreadNames (const std::string &proc_thread_name) const
 Get the names of the Publisher Threads running for a specific Processing Thread.
 
const std::list< PubThread * > & GetPubThreads () const
 Get the IDs of the Publisher Threads running.
 
ProcThreadGetProcThread (const std::string &proc_thread_name)
 Get reference to Processing Thread object.
 
bool IsProcThread (const std::string &thread_name)
 Returns bool if the thread is a Processing Thread.
 
bool IsPubThread (const std::string &thread_name)
 Returns bool if the thread is a Publisher Thread.
 
 Application (const Application &)=delete
 
Applicationoperator= (const Application &)=delete
 Disable copy constructor.
 
void UpdateRecordingStatus ()
 Disable assignment operator.
 
void SetActiveRecStatusObj (std::shared_ptr< recif::RecStatus > &active_rec)
 Set the Active Recording Status Object.
 
void UpdateActiveRecStatusObj (const ifw::ccf::common::PublisherStatus &sum_rec_pub_status)
 Update the Active Recording Status Object in memory and in the OLDB.
 
void UpdateRecStatusInDb ()
 Update the status of the current Recording Session in the DB.
 
void GetActiveRecStatus (std::shared_ptr< recif::RecStatus > &active_rec) const
 Get the currently active Recording status.
 
int GetFramesRemainingActiveRecStatus () const
 
void MoveActiveRecStatusToHistory (const ifw::ccf::PubStatus status, std::shared_ptr< recif::RecStatus > &active_rec)
 Move the Active Rec Status object to the Rec Status History.
 
void SetRecordingStatus (const ifw::ccf::PubStatus status)
 Set the status of the an active Recording Session (Active Recording Object).
 
void GetRecStatus (const std::string &rec_id, std::shared_ptr< recif::RecStatus > &active_rec) const
 Check if a Recording with the given ID is found and returns its status.
 
void GetMostRecentRecStatus (std::shared_ptr< recif::RecStatus > &active_rec) const
 Get the information about the most recent Recording (active or in the history).
 
void AddRecWaitRequest (std::shared_ptr< RecWaitRequest > &req_wait_req)
 Add a ReqWaitRequest in the internal registry.
 
void CheckRecWaitRequests (const bool recording_completed=false)
 Check if there are pending requests from RecWait Requests and send response if needed.
 
void CleanUpRecWaitRequests ()
 Check if there are RecWait Requests that can be removed from the queue.
 
void AcqAutoStartedAtRecStart ()
 Invoke to signal that the Acqusition was auto started at RecStart.
 
void UpdateControlSetupPars ()
 Update setup parameters used internally in the application for flow control.
 
void ActivateRecording ()
 Selects publishers and activate the recording.
 
void HandleTelemetry (const double time_now)
 
std::map< std::string, TelemetryCacheEntry > & TelemetryCache ()
 
- Public Member Functions inherited from ifw::ccf::common::AppBase
 AppBase ()
 
 ~AppBase ()
 

Static Public Member Functions

static ApplicationInstance ()
 Return reference to unique instance of the application class.
 
- Static Public Member Functions inherited from ifw::ccf::common::AppBase
static rad::SMAdapter & StateMachine ()
 Return reference to state machine engine.
 
static bool RecordingActive ()
 Return true if a Recording Session is ongoing.
 
static boost::asio::io_context & IoContext ()
 Return reference to Asio I/O Service instance.
 

Static Public Attributes

static Applications_app_instance = nullptr
 Singleton instance.
 

Detailed Description

Implements the core CCF Control Application.

It initialises and dismantles the application and provides access to the various, common data of the application.

Constructor & Destructor Documentation

◆ ~Application()

ifw::ccf::control::Application::~Application ( )
virtual

◆ Application()

ifw::ccf::control::Application::Application ( const Application & )
delete

Member Function Documentation

◆ AcqAutoStartedAtRecStart()

void ifw::ccf::control::Application::AcqAutoStartedAtRecStart ( )

Invoke to signal that the Acqusition was auto started at RecStart.

◆ AcquisitionActive()

bool ifw::ccf::control::Application::AcquisitionActive ( )

◆ ActivateRecording()

void ifw::ccf::control::Application::ActivateRecording ( )

Selects publishers and activate the recording.

◆ AddRecWaitRequest()

void ifw::ccf::control::Application::AddRecWaitRequest ( std::shared_ptr< RecWaitRequest > & req_wait_req)

Add a ReqWaitRequest in the internal registry.

◆ CheckRecWaitRequests()

void ifw::ccf::control::Application::CheckRecWaitRequests ( const bool recording_completed = false)

Check if there are pending requests from RecWait Requests and send response if needed.

◆ CheckStopAcquistion()

void ifw::ccf::control::Application::CheckStopAcquistion ( )

Check if the conditions are met to stop an ongoing acqusition session.

◆ CleanUpRecWaitRequests()

void ifw::ccf::control::Application::CleanUpRecWaitRequests ( )

Check if there are RecWait Requests that can be removed from the queue.

◆ ConnectDevice()

void ifw::ccf::control::Application::ConnectDevice ( )

Connect to the associated device.

◆ CreateThreads()

void ifw::ccf::control::Application::CreateThreads ( )

Create the internal worker threads according to the configuration loaded. Existing threads will be deleted first.

◆ DisconnectDevice()

void ifw::ccf::control::Application::DisconnectDevice ( )

Disconnect from the associated device.

◆ Dismantle()

void ifw::ccf::control::Application::Dismantle ( )

Dismantle the application, releasing resources. E.g. the "Dismantle()" methods of the Recipe and Publisher Adapters are invoked.

◆ Execute()

int ifw::ccf::control::Application::Execute ( int argc,
char * argv[] )

Initialise and execute the application.

◆ GetActiveRecStatus()

void ifw::ccf::control::Application::GetActiveRecStatus ( std::shared_ptr< recif::RecStatus > & active_rec) const

Get the currently active Recording status.

◆ GetComAdapter()

ifw::ccf::common::ComAdptBase & ifw::ccf::control::Application::GetComAdapter ( )

Return the reference to the Communication Adapter currently in use(real mode or simulation adapter).

◆ GetExecAdapter()

ifw::ccf::common::ExecAdptBase & ifw::ccf::control::Application::GetExecAdapter ( )

Return the reference to the Execution Adapter.

◆ GetFramesRemainingActiveRecStatus()

int ifw::ccf::control::Application::GetFramesRemainingActiveRecStatus ( ) const

◆ GetMal()

elt::mal::Mal & ifw::ccf::control::Application::GetMal ( )

Return reference to the MAL (Singleton) instance.

◆ GetMonAdapter()

ifw::ccf::common::MonAdptBase & ifw::ccf::control::Application::GetMonAdapter ( )

Return the reference to the Monitoring Adapter.

◆ GetMostRecentRecStatus()

void ifw::ccf::control::Application::GetMostRecentRecStatus ( std::shared_ptr< recif::RecStatus > & active_rec) const

Get the information about the most recent Recording (active or in the history).

◆ GetProcThread()

ProcThread & ifw::ccf::control::Application::GetProcThread ( const std::string & proc_thread_name)

Get reference to Processing Thread object.

◆ GetProcThreadNames()

const std::vector< std::string > & ifw::ccf::control::Application::GetProcThreadNames ( ) const

Get the names of the Processing Threads running.

◆ GetPubThreadNames()

const std::vector< std::string > & ifw::ccf::control::Application::GetPubThreadNames ( const std::string & proc_thread_name) const

Get the names of the Publisher Threads running for a specific Processing Thread.

◆ GetPubThreads()

const std::list< ifw::ccf::control::PubThread * > & ifw::ccf::control::Application::GetPubThreads ( ) const

Get the IDs of the Publisher Threads running.

◆ GetRecStatus()

void ifw::ccf::control::Application::GetRecStatus ( const std::string & rec_id,
std::shared_ptr< recif::RecStatus > & active_rec ) const

Check if a Recording with the given ID is found and returns its status.

◆ GetRequestStatus()

std::string ifw::ccf::control::Application::GetRequestStatus ( const std::string & request) const

Get the status of the given request.

◆ GetState()

std::string ifw::ccf::control::Application::GetState ( )

Return the current state (status) of the SCXML state machine.

◆ HandleSetup()

void ifw::ccf::control::Application::HandleSetup ( )

Handle the setup of the application.

◆ HandleTelemetry()

void ifw::ccf::control::Application::HandleTelemetry ( const double time_now)

◆ IncrementFrameCounter()

void ifw::ccf::control::Application::IncrementFrameCounter ( )

Increment frame counter, counting the number of complete frames received.

◆ Instance()

Application & ifw::ccf::control::Application::Instance ( )
static

Return reference to unique instance of the application class.

◆ IsProcThread()

bool ifw::ccf::control::Application::IsProcThread ( const std::string & thread_name)

Returns bool if the thread is a Processing Thread.

◆ IsPubThread()

bool ifw::ccf::control::Application::IsPubThread ( const std::string & thread_name)

Returns bool if the thread is a Publisher Thread.

◆ ListAdapters()

std::string ifw::ccf::control::Application::ListAdapters ( )

List the available adapters registered in this executable.

◆ LoadInitSetup()

void ifw::ccf::control::Application::LoadInitSetup ( )

Load the Initialisation Setup specified in the configuration and install it.

◆ MoveActiveRecStatusToHistory()

void ifw::ccf::control::Application::MoveActiveRecStatusToHistory ( const ifw::ccf::PubStatus status,
std::shared_ptr< recif::RecStatus > & active_rec )

Move the Active Rec Status object to the Rec Status History.

◆ operator=()

Application & ifw::ccf::control::Application::operator= ( const Application & )
delete

Disable copy constructor.

◆ RegisterComAdapters()

template<class COM_ADPT_TYPE , class SIM_COM_ADPT_TYPE >
void ifw::ccf::control::Application::RegisterComAdapters ( const COM_ADPT_TYPE & com_adapter_factory_obj,
const SIM_COM_ADPT_TYPE & sim_com_adapter_factory_obj )
inline

Method to allocate and register the Communication Adapters.

◆ RegisterExecAdapter()

template<class EXEC_ADPT_TYPE >
void ifw::ccf::control::Application::RegisterExecAdapter ( const EXEC_ADPT_TYPE & exec_adapter_factory_obj)
inline

Method to allocate and register the Execution Adapter.

◆ RegisterMonAdapter()

template<class MON_ADPT_TYPE >
void ifw::ccf::control::Application::RegisterMonAdapter ( const MON_ADPT_TYPE & mon_adapter_factory_obj)
inline

Method to allocate and register the Monitor Adapters.

◆ SetActiveRecStatusObj()

void ifw::ccf::control::Application::SetActiveRecStatusObj ( std::shared_ptr< recif::RecStatus > & active_rec)

Set the Active Recording Status Object.

◆ SetRecordingStatus()

void ifw::ccf::control::Application::SetRecordingStatus ( const ifw::ccf::PubStatus status)

Set the status of the an active Recording Session (Active Recording Object).

◆ SetRequestStatus()

void ifw::ccf::control::Application::SetRequestStatus ( const std::string & request,
const std::string & status )

Set status of the given request.

◆ StartAcquistion()

void ifw::ccf::control::Application::StartAcquistion ( bool force = false,
bool exec_com_adapter_start = true )

Instruct the system to start an acquisition (finite or infnite).

◆ StopAcquistion()

void ifw::ccf::control::Application::StopAcquistion ( )

Instruct the system to stopt an ongoing acquisition. If none is active, no actions are performed.

◆ TelemetryCache()

std::map< std::string, TelemetryCacheEntry > & ifw::ccf::control::Application::TelemetryCache ( )

◆ UpdateActiveRecStatusObj()

void ifw::ccf::control::Application::UpdateActiveRecStatusObj ( const ifw::ccf::common::PublisherStatus & sum_rec_pub_status)

Update the Active Recording Status Object in memory and in the OLDB.

◆ UpdateControlSetupPars()

void ifw::ccf::control::Application::UpdateControlSetupPars ( )

Update setup parameters used internally in the application for flow control.

◆ UpdateRecordingStatus()

void ifw::ccf::control::Application::UpdateRecordingStatus ( )

Disable assignment operator.

Update the Recording status in the active recording object and in the OLDB.

◆ UpdateRecStatusInDb()

void ifw::ccf::control::Application::UpdateRecStatusInDb ( )

Update the status of the current Recording Session in the DB.

Member Data Documentation

◆ s_app_instance

Application * ifw::ccf::control::Application::s_app_instance = nullptr
static

Singleton instance.


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