F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
PassiveRateGroupComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title PassiveRateGroupComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for PassiveRateGroup component base class
5 // ======================================================================
6 
7 #ifndef Svc_PassiveRateGroupComponentAc_HPP
8 #define Svc_PassiveRateGroupComponentAc_HPP
9 
10 #include "Fw/Cmd/CmdPortAc.hpp"
11 #include "Fw/Cmd/CmdRegPortAc.hpp"
13 #include "Fw/Cmd/CmdString.hpp"
15 #include "Fw/FPrimeBasicTypes.hpp"
16 #if !FW_DIRECT_PORT_CALLS
18 #endif
19 #if !FW_DIRECT_PORT_CALLS
21 #endif
22 #include "Fw/Time/TimePortAc.hpp"
23 #include "Fw/Tlm/TlmPortAc.hpp"
24 #include "Fw/Tlm/TlmString.hpp"
28 
29 namespace Svc {
30 
37  {
38 
39  // ----------------------------------------------------------------------
40  // Friend classes
41  // ----------------------------------------------------------------------
42 
46  friend class PassiveRateGroupTester;
47 
48  protected:
49 
50  // ----------------------------------------------------------------------
51  // Constants
52  // ----------------------------------------------------------------------
53 
55  enum {
57  };
58 
60  enum {
62  };
63 
65  enum {
70  };
71 
73  enum {
75  };
76 
78  enum {
80  };
81 
83  enum {
89  };
90 
91  public:
92 
93  // ----------------------------------------------------------------------
94  // Component initialization
95  // ----------------------------------------------------------------------
96 
98  void init(
99  FwEnumStoreType instance = 0
100  );
101 
102 #if !FW_DIRECT_PORT_CALLS
103 
104  public:
105 
106  // ----------------------------------------------------------------------
107  // Getters for special input ports
108  // ----------------------------------------------------------------------
109 
114  FwIndexType portNum
115  );
116 
117 #endif
118 
119 #if !FW_DIRECT_PORT_CALLS
120 
121  public:
122 
123  // ----------------------------------------------------------------------
124  // Getters for typed input ports
125  // ----------------------------------------------------------------------
126 
131  FwIndexType portNum
132  );
133 
134 #endif
135 
136 #if !FW_DIRECT_PORT_CALLS
137 
138  public:
139 
140  // ----------------------------------------------------------------------
141  // Connect input ports to special output ports
142  // ----------------------------------------------------------------------
143 
146  FwIndexType portNum,
147  Fw::InputCmdRegPort* port
148  );
149 
152  FwIndexType portNum,
154  );
155 
157  void set_Time_OutputPort(
158  FwIndexType portNum,
159  Fw::InputTimePort* port
160  );
161 
163  void set_Tlm_OutputPort(
164  FwIndexType portNum,
165  Fw::InputTlmPort* port
166  );
167 
168 #endif
169 
170 #if !FW_DIRECT_PORT_CALLS
171 
172  public:
173 
174  // ----------------------------------------------------------------------
175  // Connect typed input ports to typed output ports
176  // ----------------------------------------------------------------------
177 
180  FwIndexType portNum,
181  Svc::InputSchedPort* port
182  );
183 
184 #endif
185 
186 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
187 
188  public:
189 
190  // ----------------------------------------------------------------------
191  // Connect serial input ports to special output ports
192  // ----------------------------------------------------------------------
193 
196  FwIndexType portNum,
197  Fw::InputSerializePort* port
198  );
199 
202  FwIndexType portNum,
203  Fw::InputSerializePort* port
204  );
205 
207  void set_Time_OutputPort(
208  FwIndexType portNum,
209  Fw::InputSerializePort* port
210  );
211 
213  void set_Tlm_OutputPort(
214  FwIndexType portNum,
215  Fw::InputSerializePort* port
216  );
217 
218 #endif
219 
220 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
221 
222  public:
223 
224  // ----------------------------------------------------------------------
225  // Connect serial input ports to typed output ports
226  // ----------------------------------------------------------------------
227 
230  FwIndexType portNum,
231  Fw::InputSerializePort* port
232  );
233 
234 #endif
235 
236  public:
237 
238  // ----------------------------------------------------------------------
239  // Command registration
240  // ----------------------------------------------------------------------
241 
245  void regCommands();
246 
247  protected:
248 
249  // ----------------------------------------------------------------------
250  // Component construction and destruction
251  // ----------------------------------------------------------------------
252 
255  const char* compName = ""
256  );
257 
260 
261  protected:
262 
263  // ----------------------------------------------------------------------
264  // Getters for numbers of special input ports
265  // ----------------------------------------------------------------------
266 
272  }
273 
274  protected:
275 
276  // ----------------------------------------------------------------------
277  // Getters for numbers of typed input ports
278  // ----------------------------------------------------------------------
279 
285  }
286 
287  protected:
288 
289  // ----------------------------------------------------------------------
290  // Getters for numbers of special output ports
291  // ----------------------------------------------------------------------
292 
298  }
299 
305  }
306 
311  return NUM_TIME_OUTPUT_PORTS;
312  }
313 
317  static constexpr FwIndexType getNum_Tlm_OutputPorts() {
318  return NUM_TLM_OUTPUT_PORTS;
319  }
320 
321  protected:
322 
323  // ----------------------------------------------------------------------
324  // Getters for numbers of typed output ports
325  // ----------------------------------------------------------------------
326 
332  }
333 
334  protected:
335 
336  // ----------------------------------------------------------------------
337  // Connection status queries for special output ports
338  // ----------------------------------------------------------------------
339 
344  FwIndexType portNum
345  ) const;
346 
351  FwIndexType portNum
352  ) const;
353 
358  FwIndexType portNum
359  ) const;
360 
365  FwIndexType portNum
366  ) const;
367 
368  protected:
369 
370  // ----------------------------------------------------------------------
371  // Connection status queries for typed output ports
372  // ----------------------------------------------------------------------
373 
378  FwIndexType portNum
379  ) const;
380 
381 #if FW_DIRECT_PORT_CALLS
382  public:
383 #else
384  protected:
385 #endif
386 
387  // ----------------------------------------------------------------------
388  // Port handler base-class functions for special input ports
389  //
390  // Call these functions directly to bypass the corresponding ports
391  // ----------------------------------------------------------------------
392 
394  void CmdDisp_handlerBase(
395  FwIndexType portNum,
396  FwOpcodeType opCode,
397  U32 cmdSeq,
398  Fw::CmdArgBuffer& args
399  );
400 
401  protected:
402 
403  // ----------------------------------------------------------------------
404  // Handlers to implement for typed input ports
405  // ----------------------------------------------------------------------
406 
408  virtual void CycleIn_handler(
409  FwIndexType portNum,
410  Os::RawTime& cycleStart
411  ) = 0;
412 
413 #if FW_DIRECT_PORT_CALLS
414  public:
415 #else
416  protected:
417 #endif
418 
419  // ----------------------------------------------------------------------
420  // Port handler base-class functions for typed input ports
421  //
422  // Call these functions directly to bypass the corresponding ports
423  // ----------------------------------------------------------------------
424 
426  void CycleIn_handlerBase(
427  FwIndexType portNum,
428  Os::RawTime& cycleStart
429  );
430 
431  protected:
432 
433  // ----------------------------------------------------------------------
434  // Invocation functions for typed output ports
435  // ----------------------------------------------------------------------
436 
439  FwIndexType portNum,
440  U32 context
441  ) const;
442 
443  protected:
444 
445  // ----------------------------------------------------------------------
446  // Command response
447  // ----------------------------------------------------------------------
448 
450  void cmdResponse_out(
451  FwOpcodeType opCode,
452  U32 cmdSeq,
453  Fw::CmdResponse response
454  );
455 
456  protected:
457 
458  // ----------------------------------------------------------------------
459  // Command handlers to implement
460  // ----------------------------------------------------------------------
461 
465  virtual void CLEAR_STATISTICS_cmdHandler(
466  FwOpcodeType opCode,
467  U32 cmdSeq
468  ) = 0;
469 
470  protected:
471 
472  // ----------------------------------------------------------------------
473  // Command handler base-class functions
474  //
475  // Call these functions directly to bypass the command input port
476  // ----------------------------------------------------------------------
477 
482  FwOpcodeType opCode,
483  U32 cmdSeq,
484  Fw::CmdArgBuffer& args
485  );
486 
487  protected:
488 
489  // ----------------------------------------------------------------------
490  // Telemetry serialized write
491  // ----------------------------------------------------------------------
492 
497  void tlmWrite(
498  FwChanIdType id,
499  Fw::TlmBuffer& _tlmBuff,
500  Fw::Time _tlmTime = Fw::Time()
501  ) const;
502 
503  protected:
504 
505  // ----------------------------------------------------------------------
506  // Telemetry write functions
507  // ----------------------------------------------------------------------
508 
513  U32 arg,
514  Fw::Time _tlmTime = Fw::Time()
515  );
516 
520  void tlmWrite_CycleTime(
521  U32 arg,
522  Fw::Time _tlmTime = Fw::Time()
523  ) const;
524 
528  void tlmWrite_CycleCount(
529  U32 arg,
530  Fw::Time _tlmTime = Fw::Time()
531  ) const;
532 
536  Fw::Time _tlmTime = Fw::Time()
537  ) const;
538 
544  Fw::Time _tlmTime = Fw::Time()
545  );
546 
547  protected:
548 
549  // ----------------------------------------------------------------------
550  // Time
551  // ----------------------------------------------------------------------
552 
556  Fw::Time getTime() const;
557 
558  private:
559 
560  // ----------------------------------------------------------------------
561  // Calls for messages received on special input ports
562  // ----------------------------------------------------------------------
563 
565  static void m_p_CmdDisp_in(
566  Fw::PassiveComponentBase* callComp,
567  FwIndexType portNum,
568  FwOpcodeType opCode,
569  U32 cmdSeq,
570  Fw::CmdArgBuffer& args
571  );
572 
573  private:
574 
575  // ----------------------------------------------------------------------
576  // Calls for messages received on typed input ports
577  // ----------------------------------------------------------------------
578 
580  static void m_p_CycleIn_in(
581  Fw::PassiveComponentBase* callComp,
582  FwIndexType portNum,
583  Os::RawTime& cycleStart
584  );
585 
586  private:
587 
588  // ----------------------------------------------------------------------
589  // Invocation functions for special output ports
590  // ----------------------------------------------------------------------
591 
593  void CmdReg_out(
594  FwIndexType portNum,
595  FwOpcodeType opCode
596  ) const;
597 
599  void CmdStatus_out(
600  FwIndexType portNum,
601  FwOpcodeType opCode,
602  U32 cmdSeq,
603  const Fw::CmdResponse& response
604  ) const;
605 
607  void Time_out(
608  FwIndexType portNum,
609  Fw::Time& time
610  ) const;
611 
613  void Tlm_out(
614  FwIndexType portNum,
615  FwChanIdType id,
616  Fw::Time& timeTag,
617  Fw::TlmBuffer& val
618  ) const;
619 
620 #if !FW_DIRECT_PORT_CALLS
621 
622  private:
623 
624  // ----------------------------------------------------------------------
625  // Special input ports
626  // ----------------------------------------------------------------------
627 
629  Fw::InputCmdPort m_CmdDisp_InputPort[NUM_CMDDISP_INPUT_PORTS];
630 
631 #endif
632 
633 #if !FW_DIRECT_PORT_CALLS
634 
635  private:
636 
637  // ----------------------------------------------------------------------
638  // Typed input ports
639  // ----------------------------------------------------------------------
640 
642  Svc::InputCyclePort m_CycleIn_InputPort[NUM_CYCLEIN_INPUT_PORTS];
643 
644 #endif
645 
646 #if !FW_DIRECT_PORT_CALLS
647 
648  private:
649 
650  // ----------------------------------------------------------------------
651  // Special output ports
652  // ----------------------------------------------------------------------
653 
655  Fw::OutputCmdRegPort m_CmdReg_OutputPort[NUM_CMDREG_OUTPUT_PORTS];
656 
659 
661  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
662 
664  Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS];
665 
666 #endif
667 
668 #if !FW_DIRECT_PORT_CALLS
669 
670  private:
671 
672  // ----------------------------------------------------------------------
673  // Typed output ports
674  // ----------------------------------------------------------------------
675 
677  Svc::OutputSchedPort m_RateGroupMemberOut_OutputPort[NUM_RATEGROUPMEMBEROUT_OUTPUT_PORTS];
678 
679 #endif
680 
681  private:
682 
683  // ----------------------------------------------------------------------
684  // First update flags for telemetry channels
685  // ----------------------------------------------------------------------
686 
688  bool m_first_update_MaxCycleTime = true;
689 
691  bool m_first_update_PortCycleTimeHWM = true;
692 
693  private:
694 
695  // ----------------------------------------------------------------------
696  // Last value storage for telemetry channels
697  // ----------------------------------------------------------------------
698 
700  U32 m_last_MaxCycleTime = {};
701 
703  Svc::PassiveRateGroup_CycleTime m_last_PortCycleTimeHWM = {};
704 
705  };
706 
707 }
708 
709 #endif
void CLEAR_STATISTICS_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
FwIdType FwOpcodeType
The type of a command opcode.
I32 FwEnumStoreType
bool isConnected_RateGroupMemberOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_RateGroupMemberOut_OutputPorts()
void set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
friend class PassiveRateGroupTester
Friend class tester implementation to support white-box testing.
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum) const
Enum representing a command response.
void RateGroupMemberOut_out(FwIndexType portNum, U32 context) const
Invoke output port RateGroupMemberOut.
void init()
Object initializer.
Definition: ObjBase.cpp:24
bool isConnected_Time_OutputPort(FwIndexType portNum) const
bool isConnected_CmdReg_OutputPort(FwIndexType portNum) const
void tlmWrite_CycleTime(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
bool isConnected_Tlm_OutputPort(FwIndexType portNum) const
FwIdType FwChanIdType
The type of a telemetry channel identifier.
static constexpr FwIndexType getNum_CmdDisp_InputPorts()
virtual void CLEAR_STATISTICS_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
virtual ~PassiveRateGroupComponentBase()
Destroy PassiveRateGroupComponentBase object.
PassiveRateGroupComponentBase(const char *compName="")
Construct PassiveRateGroupComponentBase object.
Auto-generated base for PassiveRateGroup component.
Clear max cycle time and port cycle time high water marks (cycle count is not cleared) ...
void tlmWrite_MaxCycleTime(U32 arg, Fw::Time _tlmTime=Fw::Time())
static constexpr FwIndexType getNum_Time_OutputPorts()
static constexpr FwIndexType getNum_CmdReg_OutputPorts()
void tlmWrite_PortCycleTimeHWM(const Svc::PassiveRateGroup_CycleTime &arg, Fw::Time _tlmTime=Fw::Time())
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
friend class PassiveRateGroupTesterBase
Friend class tester to support autocoded test harness.
void tlmWrite_CycleCount(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
PlatformIndexType FwIndexType
static constexpr FwIndexType getNum_CmdStatus_OutputPorts()
void set_RateGroupMemberOut_OutputPort(FwIndexType portNum, Svc::InputSchedPort *port)
Connect port to RateGroupMemberOut[portNum].
virtual void CycleIn_handler(FwIndexType portNum, Os::RawTime &cycleStart)=0
Handler for input port CycleIn.
void CmdDisp_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port CmdDisp.
RateGroupDivider component implementation.
static constexpr FwIndexType getNum_Tlm_OutputPorts()
void CycleIn_handlerBase(FwIndexType portNum, Os::RawTime &cycleStart)
Handler base-class function for input port CycleIn.
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
void tlmWrite_PortCycleTime(const Svc::PassiveRateGroup_CycleTime &arg, Fw::Time _tlmTime=Fw::Time()) const
Write telemetry channel PortCycleTime.
static constexpr FwIndexType getNum_CycleIn_InputPorts()
Svc::InputCyclePort * get_CycleIn_InputPort(FwIndexType portNum)
void regCommands()
Register commands with the Command Dispatcher.