|
ifw-ccf
3.0.0-pre2
|
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. More... | |
| int | Execute (int argc, char *argv[]) |
| Initialise and execute the application. More... | |
| void | CreateThreads () |
| void | LoadInitSetup () |
| Load the Initialisation Setup specified in the configuration and install it. More... | |
| void | HandleSetup () |
| Handle the setup of the application. More... | |
| void | Dismantle () |
| bool | GetAcquisitionActive () |
| Returns true if image acquisition is active. More... | |
| void | StartAcquistion () |
| Instruct the system to start an acquisition (finite or infnite). More... | |
| void | StopAcquistion () |
| void | CheckStopAcquistion () |
| Check if the conditions are met to stop an ongoing acqusition session. More... | |
| void | IncrementFrameCounter () |
| Increment frame counter, counting the number of complete frames received. More... | |
| std::string | GetState () |
| Return the current state (status) of the SCXML state machine. More... | |
| void | SetRequestStatus (const std::string &request, const std::string &status) |
| Set status of the given request. More... | |
| std::string | GetRequestStatus (const std::string &request) const |
| Get the status of the given request. More... | |
| std::string | ListAdapters () |
| List the available adapters registered in this executable. More... | |
| 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. More... | |
| ccf::common::ComAdptBase & | GetComAdapter () |
| void | ConnectDevice () |
| Connect to the associated device. More... | |
| void | DisconnectDevice () |
| Disconnect from the associated device. More... | |
| const std::vector< std::string > & | GetProcThreadNames () const |
| Get the names of the Processing Threads running. More... | |
| 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. More... | |
| const std::list< PubThread * > & | GetPubThreads () const |
| Get the IDs of the Publisher Threads running. More... | |
| bool | IsProcThread (const std::string &thread_name) |
| Returns bool if the thread is a Processing Thread. More... | |
| bool | IsPubThread (const std::string &thread_name) |
| Returns bool if the thread is a Publisher Thread. More... | |
| Application (const Application &)=delete | |
| Application & | operator= (const Application &)=delete |
| Disable copy constructor. More... | |
| void | UpdateRecordingStatus () |
| Disable assignment operator. More... | |
| void | SetActiveRecStatusObj (std::shared_ptr< recif::RecStatus > &active_rec) |
| Set the Active Recording Status Object. More... | |
| void | UpdateActiveRecStatusObj (const ccf::common::PublisherStatus &sum_rec_pub_status) |
| Update the Active Recording Status Object in memory and in the OLDB. More... | |
| void | UpdateRecStatusInDb () |
| Update the status of the current Recording Session in the DB. More... | |
| void | GetActiveRecStatus (std::shared_ptr< recif::RecStatus > &active_rec) const |
| Get the currently active Recording status. More... | |
| void | MoveActiveRecStatusToHistory (const ccf::PubStatus status, std::shared_ptr< recif::RecStatus > &active_rec) |
| Move the Active Rec Status object to the Rec Status History. More... | |
| void | SetRecordingStatus (const ccf::PubStatus status) |
| Set the status of the an active Recording Session (Active Recording Object). More... | |
| 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. More... | |
| void | GetMostRecentRecStatus (std::shared_ptr< recif::RecStatus > &active_rec) const |
| Get the information about the most recent Recording (active or in the history). More... | |
| void | AddRecWaitRequest (std::shared_ptr< RecWaitRequest > &req_wait_req) |
| Add a ReqWaitRequest in the internal registry. More... | |
| void | CheckRecWaitRequests (const bool recording_completed=false) |
| Check if there are pending requests from RecWait Requests and send response if needed. More... | |
| void | CleanUpRecWaitRequests () |
| Check if there are RecWait Requests that can be removed from the queue. More... | |
Public Member Functions inherited from ccf::common::AppBase | |
| AppBase () | |
| ~AppBase () | |
Static Public Member Functions | |
| static Application & | Instance () |
| Return reference to unique instance of the application class. More... | |
Static Public Member Functions inherited from ccf::common::AppBase | |
| static rad::SMAdapter & | StateMachine () |
| Return reference to state machine engine. More... | |
| static bool | RecordingActive () |
| Return true if a Recording Session is ongoing. More... | |
| static boost::asio::io_context & | IoContext () |
| Return reference to Asio I/O Service instance. More... | |
Static Public Attributes | |
| static Application * | s_app_instance = nullptr |
| Singleton instance. More... | |
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 ccf::control::Application::AddRecWaitRequest | ( | std::shared_ptr< RecWaitRequest > & | req_wait_req | ) |
Add a ReqWaitRequest in the internal registry.
| void ccf::control::Application::CheckRecWaitRequests | ( | const bool | recording_completed = false | ) |
Check if there are pending requests from RecWait Requests and send response if needed.
| void ccf::control::Application::CheckStopAcquistion | ( | ) |
Check if the conditions are met to stop an ongoing acqusition session.
| void ccf::control::Application::CleanUpRecWaitRequests | ( | ) |
Check if there are RecWait Requests that can be removed from the queue.
| void ccf::control::Application::ConnectDevice | ( | ) |
Connect to the associated device.
| void ccf::control::Application::CreateThreads | ( | ) |
Create the internal worker threads according to the configuration loaded. Existing threads will be deleted first.
| void ccf::control::Application::DisconnectDevice | ( | ) |
Disconnect from the associated device.
| void ccf::control::Application::Dismantle | ( | ) |
Dismantle the application, releasing resources. E.g. the "Dismantle()" methods of the Recipe and Publisher Adapters are invoked.
| int ccf::control::Application::Execute | ( | int | argc, |
| char * | argv[] | ||
| ) |
Initialise and execute the application.
| bool ccf::control::Application::GetAcquisitionActive | ( | ) |
Returns true if image acquisition is active.
| void ccf::control::Application::GetActiveRecStatus | ( | std::shared_ptr< recif::RecStatus > & | active_rec | ) | const |
Get the currently active Recording status.
| ccf::common::ComAdptBase & ccf::control::Application::GetComAdapter | ( | ) |
Return the reference to the appropriate Communication Adapter (real mode or simulation adapter).
| elt::mal::Mal & ccf::control::Application::GetMal | ( | ) |
Return reference to the MAL (Singleton) instance.
| void 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).
| const std::vector< std::string > & ccf::control::Application::GetProcThreadNames | ( | ) | const |
Get the names of the Processing Threads running.
| const std::vector< std::string > & 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< ccf::control::PubThread * > & ccf::control::Application::GetPubThreads | ( | ) | const |
Get the IDs of the Publisher Threads running.
| void 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 ccf::control::Application::GetRequestStatus | ( | const std::string & | request | ) | const |
Get the status of the given request.
| std::string ccf::control::Application::GetState | ( | ) |
Return the current state (status) of the SCXML state machine.
| void ccf::control::Application::HandleSetup | ( | ) |
Handle the setup of the application.
| void 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 ccf::control::Application::IsProcThread | ( | const std::string & | thread_name | ) |
Returns bool if the thread is a Processing Thread.
| bool ccf::control::Application::IsPubThread | ( | const std::string & | thread_name | ) |
Returns bool if the thread is a Publisher Thread.
| std::string ccf::control::Application::ListAdapters | ( | ) |
List the available adapters registered in this executable.
| void ccf::control::Application::LoadInitSetup | ( | ) |
Load the Initialisation Setup specified in the configuration and install it.
| void ccf::control::Application::MoveActiveRecStatusToHistory | ( | const 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.
| void ccf::control::Application::SetActiveRecStatusObj | ( | std::shared_ptr< recif::RecStatus > & | active_rec | ) |
Set the Active Recording Status Object.
| void ccf::control::Application::SetRecordingStatus | ( | const ccf::PubStatus | status | ) |
Set the status of the an active Recording Session (Active Recording Object).
| void ccf::control::Application::SetRequestStatus | ( | const std::string & | request, |
| const std::string & | status | ||
| ) |
Set status of the given request.
| void ccf::control::Application::StartAcquistion | ( | ) |
Instruct the system to start an acquisition (finite or infnite).
| void ccf::control::Application::StopAcquistion | ( | ) |
Instruct the system to stopt an ongoing acquisition. If none is active, no actions are performed.
| void ccf::control::Application::UpdateActiveRecStatusObj | ( | const ccf::common::PublisherStatus & | sum_rec_pub_status | ) |
Update the Active Recording Status Object in memory and in the OLDB.
| void ccf::control::Application::UpdateRecordingStatus | ( | ) |
Disable assignment operator.
Update the Recording status in the active recording object and in the OLDB.
| void ccf::control::Application::UpdateRecStatusInDb | ( | ) |
Update the status of the current Recording Session in the DB.
|
static |
Singleton instance.