|
ifw-ccf 5.0.2
|
Implements the core CCF Control Application. More...
#include <application.hpp>
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::ComAdptBase & | GetComAdapter () |
| ifw::ccf::common::MonAdptBase & | GetMonAdapter () |
| Return the reference to the Monitoring Adapter. | |
| ifw::ccf::common::ExecAdptBase & | GetExecAdapter () |
| 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. | |
| ProcThread & | GetProcThread (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 | |
| Application & | operator= (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 Application & | Instance () |
| 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 Application * | s_app_instance = nullptr |
| Singleton instance. | |
Implements the core CCF Control Application.
It initialises and dismantles the application and provides access to the various, common data of the application.
|
virtual |
|
delete |
| void ifw::ccf::control::Application::AcqAutoStartedAtRecStart | ( | ) |
Invoke to signal that the Acqusition was auto started at RecStart.
| bool ifw::ccf::control::Application::AcquisitionActive | ( | ) |
| void ifw::ccf::control::Application::ActivateRecording | ( | ) |
Selects publishers and activate the recording.
| void ifw::ccf::control::Application::AddRecWaitRequest | ( | std::shared_ptr< RecWaitRequest > & | req_wait_req | ) |
Add a ReqWaitRequest in the internal registry.
| 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.
| void ifw::ccf::control::Application::CheckStopAcquistion | ( | ) |
Check if the conditions are met to stop an ongoing acqusition session.
| void ifw::ccf::control::Application::CleanUpRecWaitRequests | ( | ) |
Check if there are RecWait Requests that can be removed from the queue.
| void ifw::ccf::control::Application::ConnectDevice | ( | ) |
Connect to the associated device.
| void ifw::ccf::control::Application::CreateThreads | ( | ) |
Create the internal worker threads according to the configuration loaded. Existing threads will be deleted first.
| void ifw::ccf::control::Application::DisconnectDevice | ( | ) |
Disconnect from the associated device.
| void ifw::ccf::control::Application::Dismantle | ( | ) |
Dismantle the application, releasing resources. E.g. the "Dismantle()" methods of the Recipe and Publisher Adapters are invoked.
| int ifw::ccf::control::Application::Execute | ( | int | argc, |
| char * | argv[] ) |
Initialise and execute the application.
| void ifw::ccf::control::Application::GetActiveRecStatus | ( | std::shared_ptr< recif::RecStatus > & | active_rec | ) | const |
Get the currently active Recording status.
| ifw::ccf::common::ComAdptBase & ifw::ccf::control::Application::GetComAdapter | ( | ) |
Return the reference to the Communication Adapter currently in use(real mode or simulation adapter).
| ifw::ccf::common::ExecAdptBase & ifw::ccf::control::Application::GetExecAdapter | ( | ) |
Return the reference to the Execution Adapter.
| int ifw::ccf::control::Application::GetFramesRemainingActiveRecStatus | ( | ) | const |
| elt::mal::Mal & ifw::ccf::control::Application::GetMal | ( | ) |
Return reference to the MAL (Singleton) instance.
| ifw::ccf::common::MonAdptBase & ifw::ccf::control::Application::GetMonAdapter | ( | ) |
Return the reference to the Monitoring Adapter.
| 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).
| ProcThread & ifw::ccf::control::Application::GetProcThread | ( | const std::string & | proc_thread_name | ) |
Get reference to Processing Thread object.
| const std::vector< std::string > & ifw::ccf::control::Application::GetProcThreadNames | ( | ) | const |
Get the names of the Processing Threads running.
| 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.
| const std::list< ifw::ccf::control::PubThread * > & ifw::ccf::control::Application::GetPubThreads | ( | ) | const |
Get the IDs of the Publisher Threads running.
| 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.
| std::string ifw::ccf::control::Application::GetRequestStatus | ( | const std::string & | request | ) | const |
Get the status of the given request.
| std::string ifw::ccf::control::Application::GetState | ( | ) |
Return the current state (status) of the SCXML state machine.
| void ifw::ccf::control::Application::HandleSetup | ( | ) |
Handle the setup of the application.
| void ifw::ccf::control::Application::HandleTelemetry | ( | const double | time_now | ) |
| void ifw::ccf::control::Application::IncrementFrameCounter | ( | ) |
Increment frame counter, counting the number of complete frames received.
|
static |
Return reference to unique instance of the application class.
| bool ifw::ccf::control::Application::IsProcThread | ( | const std::string & | thread_name | ) |
Returns bool if the thread is a Processing Thread.
| bool ifw::ccf::control::Application::IsPubThread | ( | const std::string & | thread_name | ) |
Returns bool if the thread is a Publisher Thread.
| std::string ifw::ccf::control::Application::ListAdapters | ( | ) |
List the available adapters registered in this executable.
| void ifw::ccf::control::Application::LoadInitSetup | ( | ) |
Load the Initialisation Setup specified in the configuration and install it.
| 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.
|
delete |
Disable copy constructor.
|
inline |
Method to allocate and register the Communication Adapters.
|
inline |
Method to allocate and register the Execution Adapter.
|
inline |
Method to allocate and register the Monitor Adapters.
| void ifw::ccf::control::Application::SetActiveRecStatusObj | ( | std::shared_ptr< recif::RecStatus > & | active_rec | ) |
Set the Active Recording Status Object.
| void ifw::ccf::control::Application::SetRecordingStatus | ( | const ifw::ccf::PubStatus | status | ) |
Set the status of the an active Recording Session (Active Recording Object).
| void ifw::ccf::control::Application::SetRequestStatus | ( | const std::string & | request, |
| const std::string & | status ) |
Set status of the given request.
| 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).
| void ifw::ccf::control::Application::StopAcquistion | ( | ) |
Instruct the system to stopt an ongoing acquisition. If none is active, no actions are performed.
| std::map< std::string, TelemetryCacheEntry > & ifw::ccf::control::Application::TelemetryCache | ( | ) |
| 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.
| void ifw::ccf::control::Application::UpdateControlSetupPars | ( | ) |
Update setup parameters used internally in the application for flow control.
| void ifw::ccf::control::Application::UpdateRecordingStatus | ( | ) |
Disable assignment operator.
Update the Recording status in the active recording object and in the OLDB.
| void ifw::ccf::control::Application::UpdateRecStatusInDb | ( | ) |
Update the status of the current Recording Session in the DB.
|
static |
Singleton instance.