F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
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 
10 #include "Fw/Types/StringBase.hpp"
11 #include "Fw/Types/WaitEnumAc.hpp"
15 
16 namespace Svc {
17 
19  public:
20  // ----------------------------------------------------------------------
21  // Construction, initialization, and destruction
22  // ----------------------------------------------------------------------
23 
26  SeqDispatcher(const char* const compName
27  );
28 
32 
33  protected:
35  void seqDoneIn_handler(FwIndexType portNum,
36  FwOpcodeType opCode,
37  U32 cmdSeq,
38  const Fw::CmdResponse& response
39  );
40 
42  void seqStartIn_handler(FwIndexType portNum,
43  const Fw::StringBase& fileName
44  );
45 
47  void seqRunIn_handler(FwIndexType portNum,
48  const Fw::StringBase& fileName
49  );
50 
51  private:
52  // number of sequences dispatched (successful or otherwise)
53  U32 m_dispatchedCount = 0;
54  // number of errors from dispatched sequences (CmdResponse::EXECUTION_ERROR)
55  U32 m_errorCount = 0;
56  // number of sequencers in state AVAILABLE
57  U32 m_sequencersAvailable = SeqDispatcherSequencerPorts;
58 
59  struct DispatchEntry {
60  FwOpcodeType opCode;
61  U32 cmdSeq;
62  // store the state of each sequencer
64  // store the sequence currently running for each sequencer
65  Fw::String sequenceRunning = "<no seq>";
66  } m_entryTable[SeqDispatcherSequencerPorts];
67 
69  FwIndexType getNextAvailableSequencerIdx();
70 
71  void runSequence(FwIndexType sequencerIdx, const Fw::StringBase& fileName, Fw::Wait block);
72 
73  // ----------------------------------------------------------------------
74  // Command handler implementations
75  // ----------------------------------------------------------------------
76 
79  void RUN_cmdHandler(const FwOpcodeType opCode,
80  const U32 cmdSeq,
81  const Fw::CmdStringArg& fileName,
82  Fw::Wait block);
83 
84  void LOG_STATUS_cmdHandler(const FwOpcodeType opCode,
85  const U32 cmdSeq);
86 };
87 
88 } // namespace Svc
89 
90 #endif
FwIdType FwOpcodeType
The type of a command opcode.
Wait or don&#39;t wait for something.
Definition: WaitEnumAc.hpp:17
void seqDoneIn_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler for input port seqDoneIn.
Enum representing a command response.
SeqDispatcher(const char *const compName)
void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &fileName)
Handler for input port seqRunIn.
PlatformIndexType FwIndexType
Auto-generated base for SeqDispatcher component.
RateGroupDivider component implementation.
Declares F Prime string base class.
void seqStartIn_handler(FwIndexType portNum, const Fw::StringBase &fileName)
Handler for input port seqStartIn.