![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Svc/CmdSequencer/CmdSequencerImpl.hpp>
Classes | |
class | FPrimeSequence |
A sequence that uses the F Prime binary format. More... | |
class | Sequence |
A sequence with unspecified binary format. More... | |
Public Member Functions | |
CmdSequencerComponentImpl (const char *compName) | |
Construct a CmdSequencer. | |
void | setTimeout (const NATIVE_UINT_TYPE seconds) |
void | setSequenceFormat (Sequence &sequence) |
void | allocateBuffer (const NATIVE_INT_TYPE identifier, Fw::MemAllocator &allocator, const NATIVE_UINT_TYPE bytes) |
void | loadSequence (const Fw::StringBase &fileName) |
void | deallocateBuffer (Fw::MemAllocator &allocator) |
Return allocated buffer. Call during shutdown. | |
~CmdSequencerComponentImpl () | |
Destroy a CmdDispatcherComponentBase. | |
![]() | |
void | init (FwSizeType queueDepth, FwEnumStoreType instance=0) |
Initialize CmdSequencerComponentBase object. | |
Fw::InputCmdPort * | get_cmdIn_InputPort (FwIndexType portNum) |
Fw::InputCmdResponsePort * | get_cmdResponseIn_InputPort (FwIndexType portNum) |
Svc::InputPingPort * | get_pingIn_InputPort (FwIndexType portNum) |
Svc::InputSchedPort * | get_schedIn_InputPort (FwIndexType portNum) |
Svc::InputCmdSeqCancelPort * | get_seqCancelIn_InputPort (FwIndexType portNum) |
Svc::InputCmdSeqInPort * | get_seqRunIn_InputPort (FwIndexType portNum) |
void | set_cmdRegOut_OutputPort (FwIndexType portNum, Fw::InputCmdRegPort *port) |
Connect port to cmdRegOut[portNum]. | |
void | set_cmdResponseOut_OutputPort (FwIndexType portNum, Fw::InputCmdResponsePort *port) |
Connect port to cmdResponseOut[portNum]. | |
void | set_logOut_OutputPort (FwIndexType portNum, Fw::InputLogPort *port) |
Connect port to logOut[portNum]. | |
void | set_timeCaller_OutputPort (FwIndexType portNum, Fw::InputTimePort *port) |
Connect port to timeCaller[portNum]. | |
void | set_tlmOut_OutputPort (FwIndexType portNum, Fw::InputTlmPort *port) |
Connect port to tlmOut[portNum]. | |
void | set_comCmdOut_OutputPort (FwIndexType portNum, Fw::InputComPort *port) |
Connect port to comCmdOut[portNum]. | |
void | set_pingOut_OutputPort (FwIndexType portNum, Svc::InputPingPort *port) |
Connect port to pingOut[portNum]. | |
void | set_seqDone_OutputPort (FwIndexType portNum, Fw::InputCmdResponsePort *port) |
Connect port to seqDone[portNum]. | |
void | set_seqStartOut_OutputPort (FwIndexType portNum, Svc::InputCmdSeqInPort *port) |
Connect port to seqStartOut[portNum]. | |
void | regCommands () |
Register commands with the Command Dispatcher. | |
![]() | |
void | start (Os::Task::ParamType priority=Os::Task::TASK_DEFAULT, Os::Task::ParamType stackSize=Os::Task::TASK_DEFAULT, Os::Task::ParamType cpuAffinity=Os::Task::TASK_DEFAULT, Os::Task::ParamType identifier=Os::Task::TASK_DEFAULT) |
called by instantiator when task is to be started | |
void | exit () |
exit task in active component | |
Os::Task::Status | join () |
Join the thread. | |
DEPRECATED (Os::Task::Status join(void **value_ptr), "Switch to .join()") | |
Join to thread with discarded value_ptr. | |
![]() | |
void | setIdBase (const U32) |
Set the ID base. | |
U32 | getIdBase () const |
Additional Inherited Members | |
![]() | |
enum | { ACTIVE_COMPONENT_EXIT } |
![]() | |
enum | MsgDispatchStatus { MSG_DISPATCH_OK , MSG_DISPATCH_EMPTY , MSG_DISPATCH_ERROR , MSG_DISPATCH_EXIT } |
![]() | |
enum | { NUM_CMDIN_INPUT_PORTS = 1 } |
Enumerations for numbers of special input ports. More... | |
enum | { NUM_CMDRESPONSEIN_INPUT_PORTS = 1 , NUM_PINGIN_INPUT_PORTS = 1 , NUM_SCHEDIN_INPUT_PORTS = 1 , NUM_SEQCANCELIN_INPUT_PORTS = 1 , NUM_SEQRUNIN_INPUT_PORTS = 1 } |
Enumerations for numbers of typed input ports. More... | |
enum | { NUM_LOGTEXT_OUTPUT_PORTS = 1 , NUM_CMDREGOUT_OUTPUT_PORTS = 1 , NUM_CMDRESPONSEOUT_OUTPUT_PORTS = 1 , NUM_LOGOUT_OUTPUT_PORTS = 1 , NUM_TIMECALLER_OUTPUT_PORTS = 1 , NUM_TLMOUT_OUTPUT_PORTS = 1 } |
Enumerations for numbers of special output ports. More... | |
enum | { NUM_COMCMDOUT_OUTPUT_PORTS = 1 , NUM_PINGOUT_OUTPUT_PORTS = 1 , NUM_SEQDONE_OUTPUT_PORTS = 1 , NUM_SEQSTARTOUT_OUTPUT_PORTS = 1 } |
Enumerations for numbers of typed output ports. More... | |
enum | { OPCODE_CS_RUN = 0x0 , OPCODE_CS_VALIDATE = 0x1 , OPCODE_CS_CANCEL = 0x2 , OPCODE_CS_START = 0x3 , OPCODE_CS_STEP = 0x4 , OPCODE_CS_AUTO = 0x5 , OPCODE_CS_MANUAL = 0x6 , OPCODE_CS_JOIN_WAIT = 0x7 } |
Command opcodes. More... | |
enum | { EVENTID_CS_SEQUENCELOADED = 0x0 , EVENTID_CS_SEQUENCECANCELED = 0x1 , EVENTID_CS_FILEREADERROR = 0x2 , EVENTID_CS_FILEINVALID = 0x3 , EVENTID_CS_RECORDINVALID = 0x4 , EVENTID_CS_FILESIZEERROR = 0x5 , EVENTID_CS_FILENOTFOUND = 0x6 , EVENTID_CS_FILECRCFAILURE = 0x7 , EVENTID_CS_COMMANDCOMPLETE = 0x8 , EVENTID_CS_SEQUENCECOMPLETE = 0x9 , EVENTID_CS_COMMANDERROR = 0xa , EVENTID_CS_INVALIDMODE = 0xb , EVENTID_CS_RECORDMISMATCH = 0xc , EVENTID_CS_TIMEBASEMISMATCH = 0xd , EVENTID_CS_TIMECONTEXTMISMATCH = 0xe , EVENTID_CS_PORTSEQUENCESTARTED = 0xf , EVENTID_CS_UNEXPECTEDCOMPLETION = 0x10 , EVENTID_CS_MODESWITCHED = 0x11 , EVENTID_CS_NOSEQUENCEACTIVE = 0x12 , EVENTID_CS_SEQUENCEVALID = 0x13 , EVENTID_CS_SEQUENCETIMEOUT = 0x14 , EVENTID_CS_CMDSTEPPED = 0x15 , EVENTID_CS_CMDSTARTED = 0x16 , EVENTID_CS_JOINWAITING = 0x17 , EVENTID_CS_JOINWAITINGNOTCOMPLETE = 0x18 , EVENTID_CS_NORECORDS = 0x19 } |
Event IDs. More... | |
enum | { CHANNELID_CS_LOADCOMMANDS = 0x0 , CHANNELID_CS_CANCELCOMMANDS = 0x1 , CHANNELID_CS_ERRORS = 0x2 , CHANNELID_CS_COMMANDSEXECUTED = 0x3 , CHANNELID_CS_SEQUENCESCOMPLETED = 0x4 } |
Channel IDs. More... | |
![]() | |
enum | Lifecycle { CREATED , DISPATCHING , FINALIZING , DONE } |
Tracks the lifecycle of the component. More... | |
![]() | |
CmdSequencerComponentBase (const char *compName="") | |
Construct CmdSequencerComponentBase object. | |
virtual | ~CmdSequencerComponentBase () |
Destroy CmdSequencerComponentBase object. | |
FwIndexType | getNum_cmdIn_InputPorts () const |
FwIndexType | getNum_cmdResponseIn_InputPorts () const |
FwIndexType | getNum_pingIn_InputPorts () const |
FwIndexType | getNum_schedIn_InputPorts () const |
FwIndexType | getNum_seqCancelIn_InputPorts () const |
FwIndexType | getNum_seqRunIn_InputPorts () const |
FwIndexType | getNum_cmdRegOut_OutputPorts () const |
FwIndexType | getNum_cmdResponseOut_OutputPorts () const |
FwIndexType | getNum_logOut_OutputPorts () const |
FwIndexType | getNum_timeCaller_OutputPorts () const |
FwIndexType | getNum_tlmOut_OutputPorts () const |
FwIndexType | getNum_comCmdOut_OutputPorts () const |
FwIndexType | getNum_pingOut_OutputPorts () const |
FwIndexType | getNum_seqDone_OutputPorts () const |
FwIndexType | getNum_seqStartOut_OutputPorts () const |
bool | isConnected_cmdRegOut_OutputPort (FwIndexType portNum) |
bool | isConnected_cmdResponseOut_OutputPort (FwIndexType portNum) |
bool | isConnected_logOut_OutputPort (FwIndexType portNum) |
bool | isConnected_timeCaller_OutputPort (FwIndexType portNum) |
bool | isConnected_tlmOut_OutputPort (FwIndexType portNum) |
bool | isConnected_comCmdOut_OutputPort (FwIndexType portNum) |
bool | isConnected_pingOut_OutputPort (FwIndexType portNum) |
bool | isConnected_seqDone_OutputPort (FwIndexType portNum) |
bool | isConnected_seqStartOut_OutputPort (FwIndexType portNum) |
virtual void | schedIn_handler (FwIndexType portNum, U32 context)=0 |
Handler for input port schedIn. | |
void | cmdResponseIn_handlerBase (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) |
Handler base-class function for input port cmdResponseIn. | |
void | pingIn_handlerBase (FwIndexType portNum, U32 key) |
Handler base-class function for input port pingIn. | |
void | schedIn_handlerBase (FwIndexType portNum, U32 context) |
Handler base-class function for input port schedIn. | |
void | seqCancelIn_handlerBase (FwIndexType portNum) |
Handler base-class function for input port seqCancelIn. | |
void | seqRunIn_handlerBase (FwIndexType portNum, const Fw::StringBase &filename) |
Handler base-class function for input port seqRunIn. | |
virtual void | cmdResponseIn_preMsgHook (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) |
Pre-message hook for async input port cmdResponseIn. | |
virtual void | pingIn_preMsgHook (FwIndexType portNum, U32 key) |
Pre-message hook for async input port pingIn. | |
virtual void | schedIn_preMsgHook (FwIndexType portNum, U32 context) |
Pre-message hook for async input port schedIn. | |
virtual void | seqCancelIn_preMsgHook (FwIndexType portNum) |
Pre-message hook for async input port seqCancelIn. | |
virtual void | seqRunIn_preMsgHook (FwIndexType portNum, const Fw::StringBase &filename) |
Pre-message hook for async input port seqRunIn. | |
void | comCmdOut_out (FwIndexType portNum, Fw::ComBuffer &data, U32 context) |
Invoke output port comCmdOut. | |
void | pingOut_out (FwIndexType portNum, U32 key) |
Invoke output port pingOut. | |
void | seqDone_out (FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) |
Invoke output port seqDone. | |
void | seqStartOut_out (FwIndexType portNum, const Fw::StringBase &filename) |
Invoke output port seqStartOut. | |
void | cmdResponse_out (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response) |
Emit command response. | |
void | CS_RUN_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) |
void | CS_VALIDATE_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) |
void | CS_CANCEL_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) |
void | CS_START_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) |
void | CS_STEP_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) |
void | CS_AUTO_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) |
void | CS_MANUAL_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) |
void | CS_JOIN_WAIT_cmdHandlerBase (FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args) |
virtual void | CS_RUN_preMsgHook (FwOpcodeType opCode, U32 cmdSeq) |
Pre-message hook for command CS_RUN. | |
virtual void | CS_VALIDATE_preMsgHook (FwOpcodeType opCode, U32 cmdSeq) |
Pre-message hook for command CS_VALIDATE. | |
virtual void | CS_CANCEL_preMsgHook (FwOpcodeType opCode, U32 cmdSeq) |
Pre-message hook for command CS_CANCEL. | |
virtual void | CS_START_preMsgHook (FwOpcodeType opCode, U32 cmdSeq) |
Pre-message hook for command CS_START. | |
virtual void | CS_STEP_preMsgHook (FwOpcodeType opCode, U32 cmdSeq) |
Pre-message hook for command CS_STEP. | |
virtual void | CS_AUTO_preMsgHook (FwOpcodeType opCode, U32 cmdSeq) |
Pre-message hook for command CS_AUTO. | |
virtual void | CS_MANUAL_preMsgHook (FwOpcodeType opCode, U32 cmdSeq) |
Pre-message hook for command CS_MANUAL. | |
virtual void | CS_JOIN_WAIT_preMsgHook (FwOpcodeType opCode, U32 cmdSeq) |
Pre-message hook for command CS_JOIN_WAIT. | |
void | log_ACTIVITY_LO_CS_SequenceLoaded (const Fw::StringBase &fileName) const |
void | log_ACTIVITY_HI_CS_SequenceCanceled (const Fw::StringBase &fileName) const |
void | log_WARNING_HI_CS_FileReadError (const Fw::StringBase &fileName) const |
void | log_WARNING_HI_CS_FileInvalid (const Fw::StringBase &fileName, Svc::CmdSequencer_FileReadStage stage, I32 error) const |
void | log_WARNING_HI_CS_RecordInvalid (const Fw::StringBase &fileName, U32 recordNumber, I32 error) const |
void | log_WARNING_HI_CS_FileSizeError (const Fw::StringBase &fileName, U32 size) const |
void | log_WARNING_HI_CS_FileNotFound (const Fw::StringBase &fileName) const |
void | log_WARNING_HI_CS_FileCrcFailure (const Fw::StringBase &fileName, U32 storedCRC, U32 computedCRC) const |
void | log_ACTIVITY_LO_CS_CommandComplete (const Fw::StringBase &fileName, U32 recordNumber, U32 opCode) const |
void | log_ACTIVITY_HI_CS_SequenceComplete (const Fw::StringBase &fileName) const |
void | log_WARNING_HI_CS_CommandError (const Fw::StringBase &fileName, U32 recordNumber, U32 opCode, U32 errorStatus) const |
void | log_WARNING_HI_CS_InvalidMode () const |
void | log_WARNING_HI_CS_RecordMismatch (const Fw::StringBase &fileName, U32 header_records, U32 extra_bytes) const |
void | log_WARNING_HI_CS_TimeBaseMismatch (const Fw::StringBase &fileName, U16 time_base, U16 seq_time_base) const |
void | log_WARNING_HI_CS_TimeContextMismatch (const Fw::StringBase &fileName, U8 currTimeBase, U8 seqTimeBase) const |
void | log_ACTIVITY_HI_CS_PortSequenceStarted (const Fw::StringBase &filename) const |
void | log_WARNING_HI_CS_UnexpectedCompletion (U32 opcode) const |
void | log_ACTIVITY_HI_CS_ModeSwitched (Svc::CmdSequencer_SeqMode mode) const |
void | log_WARNING_LO_CS_NoSequenceActive () const |
void | log_ACTIVITY_HI_CS_SequenceValid (const Fw::StringBase &filename) const |
void | log_WARNING_HI_CS_SequenceTimeout (const Fw::StringBase &filename, U32 command) const |
void | log_ACTIVITY_HI_CS_CmdStepped (const Fw::StringBase &filename, U32 command) const |
void | log_ACTIVITY_HI_CS_CmdStarted (const Fw::StringBase &filename) const |
void | log_ACTIVITY_HI_CS_JoinWaiting (const Fw::StringBase &filename, U32 recordNumber, U32 opCode) const |
void | log_WARNING_HI_CS_JoinWaitingNotComplete () const |
void | log_WARNING_LO_CS_NoRecords (const Fw::StringBase &fileName) const |
Log event CS_NoRecords. | |
void | tlmWrite_CS_LoadCommands (U32 arg, Fw::Time _tlmTime=Fw::Time()) const |
void | tlmWrite_CS_CancelCommands (U32 arg, Fw::Time _tlmTime=Fw::Time()) const |
void | tlmWrite_CS_Errors (U32 arg, Fw::Time _tlmTime=Fw::Time()) const |
void | tlmWrite_CS_CommandsExecuted (U32 arg, Fw::Time _tlmTime=Fw::Time()) const |
void | tlmWrite_CS_SequencesCompleted (U32 arg, Fw::Time _tlmTime=Fw::Time()) const |
Fw::Time | getTime () |
![]() | |
ActiveComponentBase (const char *name) | |
Constructor. | |
virtual | ~ActiveComponentBase () |
Destructor. | |
void | init (NATIVE_INT_TYPE instance) |
initialization code | |
virtual void | preamble () |
A function that will be called before the event loop is entered. | |
MsgDispatchStatus | dispatch () |
The function that will dispatching messages. | |
virtual void | finalizer () |
A function that will be called after exiting the loop. | |
![]() | |
QueuedComponentBase (const char *name) | |
Constructor. | |
virtual | ~QueuedComponentBase () |
Destructor. | |
void | init (NATIVE_INT_TYPE instance) |
initialization function | |
Os::Queue::Status | createQueue (FwSizeType depth, FwSizeType msgSize) |
NATIVE_INT_TYPE | getNumMsgsDropped () |
return number of messages dropped | |
void | incNumMsgDropped () |
increment the number of messages dropped | |
![]() | |
PassiveComponentBase (const char *name) | |
Named constructor. | |
virtual | ~PassiveComponentBase () |
Destructor. | |
void | init (NATIVE_INT_TYPE instance) |
Initialization function. | |
NATIVE_INT_TYPE | getInstance () const |
![]() | |
ObjBase (const char *name) | |
ObjBase constructor. | |
virtual | ~ObjBase () |
Destructor. | |
void | init () |
Object initializer. | |
![]() | |
Os::Task | m_task |
task object for active component | |
![]() | |
Os::Queue | m_queue |
queue object for active component | |
Definition at line 22 of file CmdSequencerImpl.hpp.
Svc::CmdSequencerComponentImpl::CmdSequencerComponentImpl | ( | const char * | compName | ) |
Construct a CmdSequencer.
compName | The component name |
Definition at line 25 of file CmdSequencerImpl.cpp.
Svc::CmdSequencerComponentImpl::~CmdSequencerComponentImpl | ( | ) |
Destroy a CmdDispatcherComponentBase.
Definition at line 82 of file CmdSequencerImpl.cpp.
void Svc::CmdSequencerComponentImpl::allocateBuffer | ( | const NATIVE_INT_TYPE | identifier, |
Fw::MemAllocator & | allocator, | ||
const NATIVE_UINT_TYPE | bytes | ||
) |
Give the sequence a memory buffer. Call this after constructor and init, and after setting the sequence format, but before task is spawned.
identifier | The identifier |
allocator | The allocator |
bytes | The number of bytes |
Definition at line 57 of file CmdSequencerImpl.cpp.
void Svc::CmdSequencerComponentImpl::deallocateBuffer | ( | Fw::MemAllocator & | allocator | ) |
Return allocated buffer. Call during shutdown.
allocator | The allocator |
Definition at line 76 of file CmdSequencerImpl.cpp.
void Svc::CmdSequencerComponentImpl::loadSequence | ( | const Fw::StringBase & | fileName | ) |
(Optional) Load a sequence to run later. When you call this function, the event ports must be connected.
fileName | The file name |
Definition at line 67 of file CmdSequencerImpl.cpp.
void Svc::CmdSequencerComponentImpl::setSequenceFormat | ( | Sequence & | sequence | ) |
(Optional) Set the sequence format. CmdSequencer will use the sequence object you pass in to load and run sequences. By default, it uses an FPrimeSequence object.
sequence | The sequence object |
Definition at line 51 of file CmdSequencerImpl.cpp.
void Svc::CmdSequencerComponentImpl::setTimeout | ( | const NATIVE_UINT_TYPE | seconds | ) |
(Optional) Set a timeout. Sequence will quit if a command takes longer than the number of seconds in the timeout value.
seconds | The number of seconds |
Definition at line 47 of file CmdSequencerImpl.cpp.