F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
SeqDispatcher.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title SeqDispatcher.hpp
3// \author zimri.leisher
4// \brief hpp file for SeqDispatcher component implementation class
5// ======================================================================
6
7#ifndef SeqDispatcher_HPP
8#define SeqDispatcher_HPP
9
12#include "FppConstantsAc.hpp"
15
16namespace Svc {
17
19 public:
20 // ----------------------------------------------------------------------
21 // Construction, initialization, and destruction
22 // ----------------------------------------------------------------------
23
26 SeqDispatcher(const char* const compName
27 );
28
32
33 PROTECTED:
34
36 void
38 FwOpcodeType opCode,
39 U32 cmdSeq,
40 const Fw::CmdResponse& response
41 );
42
45 const Fw::StringBase& fileName
46 );
47
50 const Fw::StringBase& fileName
51 );
52
53 PRIVATE:
54
55 // number of sequences dispatched (successful or otherwise)
56 U32 m_dispatchedCount = 0;
57 // number of errors from dispatched sequences (CmdResponse::EXECUTION_ERROR)
58 U32 m_errorCount = 0;
59 // number of sequencers in state AVAILABLE
60 U32 m_sequencersAvailable = SeqDispatcherSequencerPorts;
61
62 struct DispatchEntry {
63 FwOpcodeType opCode;
64 U32 cmdSeq;
65 // store the state of each sequencer
67 // store the sequence currently running for each sequencer
68 Fw::String sequenceRunning = "<no seq>";
69 } m_entryTable[SeqDispatcherSequencerPorts];
71
72 FwIndexType getNextAvailableSequencerIdx();
73
74 void runSequence(FwIndexType sequencerIdx,
75 const Fw::StringBase& fileName,
76 Fw::Wait block);
77
78 // ----------------------------------------------------------------------
79 // Command handler implementations
80 // ----------------------------------------------------------------------
81
84 void RUN_cmdHandler(const FwOpcodeType opCode,
85 const U32 cmdSeq,
86 const Fw::CmdStringArg& fileName,
87 Fw::Wait block);
88
89 void LOG_STATUS_cmdHandler(const FwOpcodeType opCode,
90 const U32 cmdSeq);
91};
92
93} // end namespace components
94
95#endif
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:55
U32 FwOpcodeType
Definition FpConfig.h:91
PlatformIndexType FwIndexType
Definition FpConfig.h:25
@ SeqDispatcherSequencerPorts
Declares F Prime string base class.
Enum representing a command response.
Wait or don't wait for something.
Auto-generated base for SeqDispatcher component.
void seqDoneIn_handler(NATIVE_INT_TYPE portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler for input port seqDoneIn.
void seqStartIn_handler(NATIVE_INT_TYPE portNum, const Fw::StringBase &fileName)
Handler for input port seqStartIn.
void seqRunIn_handler(NATIVE_INT_TYPE portNum, const Fw::StringBase &fileName)
Handler for input port seqRunIn.