F´ Flight Software - C/C++ Documentation
NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
|
Go to the documentation of this file.
13 #ifndef Svc_CmdSequencerImpl_HPP
14 #define Svc_CmdSequencerImpl_HPP
119 const U32 recordNumber,
125 const U32 numRecords,
327 INITIAL_COMPUTED_VALUE = 0xFFFFFFFFU
505 this->m_state = CLEAR;
513 if (this->m_state == CLEAR) {
CmdSequencerComponentImpl(const char *compName)
Construct a CmdSequencer.
NATIVE_UINT_TYPE m_timeout
timeout value
Fw::SerializeStatus deserializeRecord(Record &record)
U32 m_sequencesCompletedCount
The total number of sequences completed.
PRIVATE FwOpcodeType opcode
The command opcode.
Sequence(CmdSequencerComponentImpl &component)
Construct a Sequence object.
NATIVE_INT_TYPE m_allocatorId
The allocator ID.
void deallocateBuffer(Fw::MemAllocator &allocator)
Deallocate the buffer.
void set(Fw::Time time)
Set the expiration time.
Auto-generated base for CmdSequencer component.
Fw::SerializeStatus deserializeTimeTag(Fw::Time &timeTag)
Record(void)
Construct a Record object.
void clear(void)
Clear the timer.
#define PRIVATE
overridable private for unit testing
Descriptor m_descriptor
The descriptor.
PROTECTED FileReadStage_MAX FileReadStage
Header m_header
The sequence header.
void CS_RUN_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName)
Handler for command CS_RUN.
void setTimeout(NATIVE_UINT_TYPE seconds)
void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key)
Handler for ping port.
SerializeStatus
forward declaration for string
U32 m_computed
Computed CRC.
void CS_CANCEL_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)
Fw::Time expirationTime
The expiration time.
RunMode m_runMode
The run mode.
virtual void clear(void)=0
Defines a base class for a memory allocator for classes.
@ END_OF_SEQUENCE
end of sequence
Fw::CmdStringArg m_fileName
The sequence file name.
Events(Sequence &sequence)
Construct an Events object.
PRIVATE FwOpcodeType U32 Fw::CommandResponse response
< The command response
void performCmd_Step(void)
Perform a Step command.
bool validateRecords(void)
void fileInvalid(const FileReadStage::t stage, const I32 error)
File invalid.
virtual ~Sequence(void)
Destroy a Sequence object.
void fileCRCFailure(const U32 storedCRC, const U32 computedCRC)
File CRC failure.
Defines a file class to validate files or generate a file validator file.
void fileSizeError(const U32 size)
File size error.
virtual bool loadFile(const Fw::CmdStringArg &fileName)=0
bool requireRunMode(RunMode mode)
PRIVATE NATIVE_INT_TYPE portNum
static CmdSequencerComponentImpl::FileReadStage toComponentEnum(const t fileReadStage)
Convert FileReadStage::t to CmdSequencerComponentImpl::FileReadStage.
U32 m_totalExecutedCount
The total number of commands executed across all sequences.
void fileReadError(void)
File read error.
#define FwTimeContextStoreType
Storage conversion for time context in scripts/ground interface.
virtual void cmdResponseIn_handler(NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CommandResponse response)=0
Handler for input port cmdResponseIn.
Fw::LogStringArg m_logFileName
Copy of file name for events.
void CS_START_cmdHandler(FwOpcodeType opcode, U32 cmdSeq)
bool loadFile(const Fw::CmdStringArg &fileName)
void fileNotFound(void)
File not found.
bool hasMoreRecords(void) const
void allocateBuffer(const NATIVE_INT_TYPE identifier, Fw::MemAllocator &allocator, const NATIVE_UINT_TYPE bytes)
virtual void reset(void)=0
File read stage for error reporting.
Container for computed and stored CRC values.
void init(void)
Object initializer.
void CS_MANUAL_cmdHandler(FwOpcodeType opcode, U32 cmdSeq)
A sequence that uses the F Prime binary format.
Fw::SerializeStatus deserializeRecordSize(U32 &recordSize)
bool readRecordsAndCRC(void)
void sequenceComplete(void)
Record a sequence complete event.
Fw::SerializeStatus deserializeDescriptor(Record::Descriptor &descriptor)
Fw::ComBuffer m_command
The command.
PRIVATE FwOpcodeType U32 cmdSeq
The command sequence number.
void timeContextMismatch(const FwTimeContextStoreType currTimeContext, const FwTimeContextStoreType seqTimeContext)
Time context mismatch.
Fw::CmdStringArg & getFileName(void)
void recordMismatch(const U32 numRecords, const U32 extraBytes)
Record mismatch.
void allocateBuffer(const NATIVE_INT_TYPE identifier, Fw::MemAllocator &allocator, const NATIVE_UINT_TYPE bytes)
Give the sequence representation a memory buffer.
virtual void CS_AUTO_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
Handler for command CS_AUTO.
#define FwOpcodeType
Type representation for a command opcode.
void commandError(const U32 number, const U32 opCode, const U32 error)
Record an error in executing a sequence command.
U32 m_executedCount
The number of commands executed in this sequence.
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
void nextRecord(Record &record)
void deallocateBuffer(Fw::MemAllocator &allocator)
Return allocated buffer. Call during shutdown.
CRC(void)
Construct a CRC.
void timeBaseMismatch(const FwTimeBaseStoreType currTimeBase, const FwTimeBaseStoreType seqTimeBase)
Time base mismatch.
Timer m_cmdTimeoutTimer
timeout timer
static Comparison compare(const Time &time1, const Time &time2)
void performCmd_Step_ABSOLUTE(Fw::Time ¤tTime)
Perform a Step command with an absolute time.
Sequence event reporting.
void setFileName(const Fw::CmdStringArg &fileName)
Set the file name. Also sets the log file name.
const Header & getHeader(void) const
Get the sequence header.
FPrimeSequence(CmdSequencerComponentImpl &component)
Construct an FPrimeSequence.
bool isExpiredAt(Fw::Time time)
StepMode m_stepMode
The step mode.
void error(void)
Record an error.
void performCmd_Step_RELATIVE(Fw::Time ¤tTime)
Perform a Step command with a relative time.
Fw::SerializeStatus copyCommand(Fw::ComBuffer &comBuffer, const U32 recordSize)
PROTECTED U32 const Fw::CmdStringArg & fileName
bool deserializeHeader(void)
void performCmd_Cancel(void)
Perform a Cancel command.
#define FwTimeBaseStoreType
Storage conversion for time base in scripts/ground interface.
void CS_VALIDATE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg &fileName)
Events m_events
Event reporting.
void CS_STEP_cmdHandler(FwOpcodeType opcode, U32 cmdSeq)
~CmdSequencerComponentImpl(void)
Destroy a CmdDispatcherComponentBase.
U32 m_errorCount
The number of errors.
U32 m_cancelCmdCount
The number of Cancel commands executed.
U32 m_loadCmdCount
The number of Load commands executed.
void init(void)
Initialize computed CRC.
void finalize(void)
Finalize computed CRC.
Sequence * m_sequence
The abstract sequence.
Timer m_cmdTimer
The command time timer.
Fw::LogStringArg & getLogFileName(void)
Sequence::Record m_record
The sequence record currently being processed.
virtual void nextRecord(Record &record)=0
void recordInvalid(const U32 recordNumber, const I32 error)
Record invalid.
Fw::ExternalSerializeBuffer m_buffer
Serialize buffer to hold the binary sequence data.
A sequence with unspecified binary format.
void setCmdTimeout(const Fw::Time ¤tTime)
Set command timeout timer.
Fw::Time m_timeTag
The time tag. NOTE: timeBase and context not filled in.
int NATIVE_INT_TYPE
native integer type declaration
virtual bool hasMoreRecords(void) const =0
void commandComplete(const U32 opCode)
Record a completed command.
void schedIn_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE order)
Handler for input port schedIn.
void update(const BYTE *buffer, NATIVE_UINT_TYPE bufferSize)
Update computed CRC.
Timer(void)
Construct a Timer object.
void setSequenceFormat(Sequence &sequence)
Os::File m_sequenceFile
The sequence file.
void seqRunIn_handler(NATIVE_INT_TYPE portNum, Fw::EightyCharString &filename)
Handler for input port seqRunIn.
void loadSequence(const Fw::EightyCharString &fileName)