hlcc 2.0.0-beta2+pre1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
hlcc::telifsim::DataContext Class Reference

#include <dataContext.hpp>

Inheritance diagram for hlcc::telifsim::DataContext:

Public Member Functions

 DataContext ()
 
virtual ~DataContext ()
 
void ReloadConfig () override
 
ConfigGetConfig () override
 
void UpdateDb () override
 
OldbInterfaceGetOldbInterface () override
 
ecos::ptk::PositionOnEarth GetSitePosition ()
 
bool ConnectEltpk ()
 
void SetPresetArgs (const std::shared_ptr<::ccsinsif::PresetArgs > &preset_args)
 
void SetObservingWavelength (double wavelength)
 
void SetAltAzPos (double alt_pos, double az_pos)
 
void SetVelocityOffset (const std::shared_ptr<::ccsinsif::VelocityOffset > &velocity_offset_args)
 
void SkyOffset (const std::shared_ptr<::ccsinsif::OffsetSkyArgs > &offset_sky_args)
 
void SetRefrenceAberration (const elt::mal::shared_vector< const double > &ref_aberration)
 
void SetRefrenceFocus (const double &ref_focus)
 
void PublishExtrefInsRef ()
 
void SetStrokeRous (const std::shared_ptr<::ccsinsif::rous::Maneuver > &x)
 
void SetAoMirrorHealth (const std::shared_ptr<::ccsinsif::ao::Health > &x)
 
bool GetReadyForHandover ()
 
std::string GetTelifsimState ()
 
std::string GetEltpkState ()
 
std::string GetCommandSource ()
 
void SetCommandSource (const std::string &)
 
void PublishCommandSource ()
 
DataAcquisitionListGetDataAcquisitionList ()
 
RousDataGetRousData ()
 
void ReadyForHandoverEstimation (rad::SMAdapter &sm_adapter, bool force_update=false)
 
std::shared_ptr< elt::mal::Mal > GetEntityFactory ()
 
std::shared_ptr< elt::mal::Mal > GetEntityFactoryDeterm ()
 
std::shared_ptr< elt::mal::Mal > GetReplyFactory ()
 
void SetPresetSequenceMode (const telifsimif::SequenceMode &seq_mode)
 
telifsimif::SequenceMode GetPresetSequenceMode ()
 
void SetPresetSequence (const std::string &sequence)
 
std::string GetPresetSequence ()
 
void SetOffsetSequenceMode (const telifsimif::SequenceMode &seq_mode)
 
telifsimif::SequenceMode GetOffsetSequenceMode ()
 
void SetOffsetSequence (const std::string &sequence)
 
std::string GetOffsetSequence ()
 
OffsetHandlerGetOffsetHandler ()
 
 DataContext (const DataContext &)=delete
 
DataContextoperator= (const DataContext &)=delete
 Disable copy constructor.
 

Detailed Description

This class provide access to the application run-time data including the in-memory DB.

Constructor & Destructor Documentation

◆ DataContext() [1/2]

hlcc::telifsim::DataContext::DataContext ( )

Default Constructor

◆ ~DataContext()

hlcc::telifsim::DataContext::~DataContext ( )
virtual

Destructor

◆ DataContext() [2/2]

hlcc::telifsim::DataContext::DataContext ( const DataContext )
delete

Member Function Documentation

◆ ConnectEltpk()

bool hlcc::telifsim::DataContext::ConnectEltpk ( )

Manages the connection to eltpk

Returns
true if the connection is established.

◆ GetCommandSource()

std::string hlcc::telifsim::DataContext::GetCommandSource ( )

Reads the command_source from the Oldb

◆ GetConfig()

Config & hlcc::telifsim::DataContext::GetConfig ( )
override
Returns
reference to the Config object.

◆ GetDataAcquisitionList()

DataAcquisitionList & hlcc::telifsim::DataContext::GetDataAcquisitionList ( )
Returns
A reference to the DataAcquisition list object.

◆ GetEltpkState()

std::string hlcc::telifsim::DataContext::GetEltpkState ( )

Reads the Eltpk State Machine current state from the Oldb

◆ GetEntityFactory()

std::shared_ptr< elt::mal::Mal > hlcc::telifsim::DataContext::GetEntityFactory ( )
Returns
A reference to the RousData object.

◆ GetEntityFactoryDeterm()

std::shared_ptr< elt::mal::Mal > hlcc::telifsim::DataContext::GetEntityFactoryDeterm ( )
Returns
A reference to the RousData object.

◆ GetOffsetHandler()

OffsetHandler & hlcc::telifsim::DataContext::GetOffsetHandler ( )
Returns
A reference to the OffsetHandler object.

◆ GetOffsetSequence()

std::string hlcc::telifsim::DataContext::GetOffsetSequence ( )

Sets preset sequence to be used

Returns
string with value read from Oldb

◆ GetOffsetSequenceMode()

telifsimif::SequenceMode hlcc::telifsim::DataContext::GetOffsetSequenceMode ( )

Sets Offset Mode

Returns
telifsimif::SequenceMode with value read from Oldb

◆ GetOldbInterface()

OldbInterface & hlcc::telifsim::DataContext::GetOldbInterface ( )
override
Returns
A reference to the DB interface object.

◆ GetPresetSequence()

std::string hlcc::telifsim::DataContext::GetPresetSequence ( )

Sets preset sequence to be used

Returns
string with value read from Oldb

◆ GetPresetSequenceMode()

telifsimif::SequenceMode hlcc::telifsim::DataContext::GetPresetSequenceMode ( )

Sets Preset Mode

Returns
telifsimif::SequenceMode with value read from Oldb

◆ GetReadyForHandover()

bool hlcc::telifsim::DataContext::GetReadyForHandover ( )

Reads the ready_for_handover flag from the Oldb

◆ GetReplyFactory()

std::shared_ptr< elt::mal::Mal > hlcc::telifsim::DataContext::GetReplyFactory ( )
Returns
A reference to the RousData object.

◆ GetRousData()

RousData & hlcc::telifsim::DataContext::GetRousData ( )
Returns
A reference to the RousData object.

◆ GetSitePosition()

ecos::ptk::PositionOnEarth hlcc::telifsim::DataContext::GetSitePosition ( )

Gets the configured position of the (ELT) telescope.

◆ GetTelifsimState()

std::string hlcc::telifsim::DataContext::GetTelifsimState ( )

Reads the Telifsim State Machine current state from the Oldb

◆ operator=()

DataContext & hlcc::telifsim::DataContext::operator= ( const DataContext )
delete

Disable copy constructor.

◆ PublishCommandSource()

void hlcc::telifsim::DataContext::PublishCommandSource ( )

Publishes the command_source in the Oldb and dds

◆ PublishExtrefInsRef()

void hlcc::telifsim::DataContext::PublishExtrefInsRef ( )

◆ ReadyForHandoverEstimation()

void hlcc::telifsim::DataContext::ReadyForHandoverEstimation ( rad::SMAdapter &  sm_adapter,
bool  force_update = false 
)

Ready for handover estimation This method estimates the the ready for handover region of the On::Operational telifsim state The estimation is based in the ready for handover flag published in Oldb by telmon. Every time the estimation changes an event will be published in the state machine to trigger the state transition. In case the Ready for handover is estimated false we also remove control from instruments

Parameters
[in]sm_adapterReference to the state machine adapter so we can publish events.
[in]force_updateIf true the estimation will be forced to update even if it sees no change.

◆ ReloadConfig()

void hlcc::telifsim::DataContext::ReloadConfig ( )
override

Reload the configuration from file.

◆ SetAltAzPos()

void hlcc::telifsim::DataContext::SetAltAzPos ( double  alt_pos,
double  az_pos 
)

Forwards the position to the eltpk

Exceptions
std::runtime_errorif not successful.

◆ SetAoMirrorHealth()

void hlcc::telifsim::DataContext::SetAoMirrorHealth ( const std::shared_ptr<::ccsinsif::ao::Health > &  x)

Publishes the adaptive optics mirror health to PubSub and Oldb

◆ SetCommandSource()

void hlcc::telifsim::DataContext::SetCommandSource ( const std::string &  cmd_src)

Set and Publish the command_source

◆ SetObservingWavelength()

void hlcc::telifsim::DataContext::SetObservingWavelength ( double  wavelength)

Publishes the wavelength in the Oldb and forwards it to eltpk.

Exceptions
std::runtime_errorif not successful.

◆ SetOffsetSequence()

void hlcc::telifsim::DataContext::SetOffsetSequence ( const std::string &  sequence)

Sets preset sequence to be used

Parameters
[in]sequenceString name of sequence module

◆ SetOffsetSequenceMode()

void hlcc::telifsim::DataContext::SetOffsetSequenceMode ( const telifsimif::SequenceMode &  seq_mode)

Sets Offset Mode

Parameters
[in]seq_modeString with the mode

◆ SetPresetArgs()

void hlcc::telifsim::DataContext::SetPresetArgs ( const std::shared_ptr<::ccsinsif::PresetArgs > &  preset_args)

Stores the Preset data and forwards it to the eltpk application. TODO: Make storage and forwarding depend on simulation mode.

Parameters
preset_argspreset arguments
send_presettrue for sending the preset to eltpk
Exceptions
std::runtime_errorif not successful.

◆ SetPresetSequence()

void hlcc::telifsim::DataContext::SetPresetSequence ( const std::string &  sequence)

Sets preset sequence to be used

Parameters
[in]sequenceString name of sequence module

◆ SetPresetSequenceMode()

void hlcc::telifsim::DataContext::SetPresetSequenceMode ( const telifsimif::SequenceMode &  seq_mode)

Sets Preset Mode

Parameters
[in]seq_modeString with the mode

◆ SetRefrenceAberration()

void hlcc::telifsim::DataContext::SetRefrenceAberration ( const elt::mal::shared_vector< const double > &  ref_aberration)

◆ SetRefrenceFocus()

void hlcc::telifsim::DataContext::SetRefrenceFocus ( const double &  ref_focus)

◆ SetStrokeRous()

void hlcc::telifsim::DataContext::SetStrokeRous ( const std::shared_ptr<::ccsinsif::rous::Maneuver > &  x)

Publishes the ROUS Maneuver state to PubSub and Oldb

◆ SetVelocityOffset()

void hlcc::telifsim::DataContext::SetVelocityOffset ( const std::shared_ptr<::ccsinsif::VelocityOffset > &  velocity_offset_args)

Publishes the velocity offset in the Oldb

Exceptions
std::runtime_errorif not successful.

◆ SkyOffset()

void hlcc::telifsim::DataContext::SkyOffset ( const std::shared_ptr<::ccsinsif::OffsetSkyArgs > &  offset_sky_args)

Forwards the arguments to the eltpk

Parameters
offset_sky_argsoffset arguments
Exceptions
std::runtime_errorif not successful.

◆ UpdateDb()

void hlcc::telifsim::DataContext::UpdateDb ( )
override

Try to connect to the DB and update the application configuration.


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