 |
F´ Flight Software - C/C++ Documentation
NASA-v2.1.0
A framework for building embedded system applications to NASA flight quality standards.
|
Go to the documentation of this file.
10 #ifndef Svc_CmdSequencerImpl_HPP
11 #define Svc_CmdSequencerImpl_HPP
17 #include "Svc/CmdSequencer/CmdSequencerComponentAc.hpp"
22 public CmdSequencerComponentBase
75 static CmdSequencerComponentImpl::FileReadStage
116 const U32 recordNumber,
122 const U32 numRecords,
128 const U32 currTimeBase,
129 const U32 seqTimeBase
134 const U32 currTimeContext,
135 const U32 seqTimeContext
284 virtual void reset(
void) = 0;
288 virtual void clear(
void) = 0;
324 INITIAL_COMPUTED_VALUE = 0xFFFFFFFFU
398 bool readOpenFile(
void);
403 bool readHeader(
void);
407 bool deserializeHeader(
void);
411 bool readRecordsAndCRC(
void);
415 bool extractCRC(
void);
419 bool validateCRC(
void);
454 bool validateRecords(
void);
497 this->expirationTime = time;
502 this->m_state = CLEAR;
510 if (this->m_state == CLEAR) {
593 void cmdResponseIn_handler(
597 Fw::CommandResponse response
601 void schedIn_handler(
607 void seqRunIn_handler(
620 void seqCancelIn_handler(
632 void CS_AUTO_cmdHandler(
639 void CS_CANCEL_cmdHandler(
646 void CS_MANUAL_cmdHandler(
652 void CS_RUN_cmdHandler(
661 void CS_START_cmdHandler(
669 void CS_STEP_cmdHandler(
676 void CS_VALIDATE_cmdHandler(
686 void CS_JOIN_WAIT_cmdHandler(
704 void performCmd_Cancel(
void);
707 void performCmd_Step(
void);
710 void performCmd_Step_RELATIVE(
715 void performCmd_Step_ABSOLUTE(
720 void commandComplete(
725 void sequenceComplete(
void);
755 FPrimeSequence m_FPrimeSequence;
758 Sequence *m_sequence;
764 U32 m_cancelCmdCount;
776 Sequence::Record m_record;
785 U32 m_totalExecutedCount;
788 U32 m_sequencesCompletedCount;
794 Timer m_cmdTimeoutTimer;
797 SeqBlkState m_blockState;
CmdSequencerComponentImpl(const char *compName)
Construct a CmdSequencer.
Sequence(CmdSequencerComponentImpl &component)
Construct a Sequence object.
NATIVE_INT_TYPE m_allocatorId
The allocator ID.
void deallocateBuffer(Fw::MemAllocator &allocator)
Deallocate the buffer.
Record(void)
Construct a Record object.
void setTimeout(const NATIVE_UINT_TYPE seconds)
Descriptor m_descriptor
The descriptor.
void timeContextMismatch(const U32 currTimeContext, const U32 seqTimeContext)
Time context mismatch.
Header m_header
The sequence header.
SerializeStatus
forward declaration for string
U32 m_computed
Computed CRC.
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.
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.
CmdSequencerComponentImpl & m_component
The enclosing component.
virtual bool loadFile(const Fw::CmdStringArg &fileName)=0
static CmdSequencerComponentImpl::FileReadStage toComponentEnum(const t fileReadStage)
Convert FileReadStage::t to CmdSequencerComponentImpl::FileReadStage.
void fileReadError(void)
File read error.
#define FwTimeContextStoreType
Storage conversion for time context in scripts/ground interface.
Fw::LogStringArg m_logFileName
Copy of file name for events.
bool loadFile(const Fw::CmdStringArg &fileName)
void loadSequence(const Fw::String &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 timeBaseMismatch(const U32 currTimeBase, const U32 seqTimeBase)
Time base mismatch.
A sequence that uses the F Prime binary format.
Fw::ComBuffer m_command
The command.
Fw::CmdStringArg & getFileName(void)
void recordMismatch(const U32 numRecords, const U32 extraBytes)
Record mismatch.
#define FwOpcodeType
Type representation for a command opcode.
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.
static Comparison compare(const Time &time1, const Time &time2)
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.
void init(const NATIVE_INT_TYPE queueDepth, const NATIVE_INT_TYPE instance)
Initialize a CmdSequencer.
#define FwTimeBaseStoreType
Storage conversion for time base in scripts/ground interface.
Events m_events
Event reporting.
~CmdSequencerComponentImpl(void)
Destroy a CmdDispatcherComponentBase.
void init(void)
Initialize computed CRC.
void finalize(void)
Finalize computed CRC.
Fw::LogStringArg & getLogFileName(void)
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.
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 allocateBuffer(NATIVE_INT_TYPE identifier, Fw::MemAllocator &allocator, NATIVE_UINT_TYPE bytes)
Give the sequence representation a memory buffer.
void update(const BYTE *buffer, NATIVE_UINT_TYPE bufferSize)
Update computed CRC.
void setSequenceFormat(Sequence &sequence)