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  const Svc::SeqArgs& args
45  );
46 
48  void seqRunIn_handler(FwIndexType portNum,
49  const Fw::StringBase& fileName,
50  const Svc::SeqArgs& args
51  );
52 
53  private:
54  // number of sequences dispatched (successful or otherwise)
55  U32 m_dispatchedCount = 0;
56  // number of errors from dispatched sequences (CmdResponse::EXECUTION_ERROR)
57  U32 m_errorCount = 0;
58  // number of sequencers in state AVAILABLE
59  U32 m_sequencersAvailable = SeqDispatcherSequencerPorts;
60 
61  struct DispatchEntry {
62  FwOpcodeType opCode;
63  U32 cmdSeq;
64  // store the state of each sequencer
66  // store the sequence currently running for each sequencer
67  Fw::String sequenceRunning = "<no seq>";
68  } m_entryTable[SeqDispatcherSequencerPorts];
69 
71  FwIndexType getNextAvailableSequencerIdx();
72 
73  void runSequence(FwIndexType sequencerIdx,
74  const Fw::ConstStringBase& fileName,
75  Fw::Wait block,
76  const Svc::SeqArgs& args);
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 
91  void RUN_ARGS_cmdHandler(const FwOpcodeType opCode,
92  const U32 cmdSeq,
93  const Fw::CmdStringArg& fileName,
94  Fw::Wait block,
95  Svc::SeqArgs buffer);
97  void LOG_STATUS_cmdHandler(const FwOpcodeType opCode,
98  const U32 cmdSeq);
99 };
100 
101 } // namespace Svc
102 
103 #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.
void seqRunIn_handler(FwIndexType portNum, const Fw::StringBase &fileName, const Svc::SeqArgs &args)
Handler for input port seqRunIn.
void seqStartIn_handler(FwIndexType portNum, const Fw::StringBase &fileName, const Svc::SeqArgs &args)
Handler for input port seqStartIn.
SeqDispatcher(const char *const compName)
A read-only abstract superclass for StringBase.
PlatformIndexType FwIndexType
Auto-generated base for SeqDispatcher component.
RateGroupDivider component implementation.
Declares F Prime string base class.