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 
11 #include "Fw/FPrimeBasicTypes.hpp"
12 #if !FW_DIRECT_PORT_CALLS
14 #endif
15 #if !FW_DIRECT_PORT_CALLS
17 #endif
18 #include "Fw/Time/TimePortAc.hpp"
19 #include "Fw/Tlm/TlmPortAc.hpp"
20 #include "Fw/Tlm/TlmString.hpp"
23 
24 namespace Svc {
25 
32  {
33 
34  // ----------------------------------------------------------------------
35  // Friend classes
36  // ----------------------------------------------------------------------
37 
41  friend class PassiveRateGroupTester;
42 
43  protected:
44 
45  // ----------------------------------------------------------------------
46  // Constants
47  // ----------------------------------------------------------------------
48 
50  enum {
52  };
53 
55  enum {
58  };
59 
61  enum {
63  };
64 
66  enum {
70  };
71 
72  public:
73 
74  // ----------------------------------------------------------------------
75  // Component initialization
76  // ----------------------------------------------------------------------
77 
79  void init(
80  FwEnumStoreType instance = 0
81  );
82 
83 #if !FW_DIRECT_PORT_CALLS
84 
85  public:
86 
87  // ----------------------------------------------------------------------
88  // Getters for typed input ports
89  // ----------------------------------------------------------------------
90 
95  FwIndexType portNum
96  );
97 
98 #endif
99 
100 #if !FW_DIRECT_PORT_CALLS
101 
102  public:
103 
104  // ----------------------------------------------------------------------
105  // Connect input ports to special output ports
106  // ----------------------------------------------------------------------
107 
109  void set_Time_OutputPort(
110  FwIndexType portNum,
111  Fw::InputTimePort* port
112  );
113 
115  void set_Tlm_OutputPort(
116  FwIndexType portNum,
117  Fw::InputTlmPort* port
118  );
119 
120 #endif
121 
122 #if !FW_DIRECT_PORT_CALLS
123 
124  public:
125 
126  // ----------------------------------------------------------------------
127  // Connect typed input ports to typed output ports
128  // ----------------------------------------------------------------------
129 
132  FwIndexType portNum,
133  Svc::InputSchedPort* port
134  );
135 
136 #endif
137 
138 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
139 
140  public:
141 
142  // ----------------------------------------------------------------------
143  // Connect serial input ports to special output ports
144  // ----------------------------------------------------------------------
145 
147  void set_Time_OutputPort(
148  FwIndexType portNum,
149  Fw::InputSerializePort* port
150  );
151 
153  void set_Tlm_OutputPort(
154  FwIndexType portNum,
155  Fw::InputSerializePort* port
156  );
157 
158 #endif
159 
160 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
161 
162  public:
163 
164  // ----------------------------------------------------------------------
165  // Connect serial input ports to typed output ports
166  // ----------------------------------------------------------------------
167 
170  FwIndexType portNum,
171  Fw::InputSerializePort* port
172  );
173 
174 #endif
175 
176  protected:
177 
178  // ----------------------------------------------------------------------
179  // Component construction and destruction
180  // ----------------------------------------------------------------------
181 
184  const char* compName = ""
185  );
186 
189 
190  protected:
191 
192  // ----------------------------------------------------------------------
193  // Getters for numbers of typed input ports
194  // ----------------------------------------------------------------------
195 
201  }
202 
203  protected:
204 
205  // ----------------------------------------------------------------------
206  // Getters for numbers of special output ports
207  // ----------------------------------------------------------------------
208 
213  return NUM_TIME_OUTPUT_PORTS;
214  }
215 
219  static constexpr FwIndexType getNum_Tlm_OutputPorts() {
220  return NUM_TLM_OUTPUT_PORTS;
221  }
222 
223  protected:
224 
225  // ----------------------------------------------------------------------
226  // Getters for numbers of typed output ports
227  // ----------------------------------------------------------------------
228 
234  }
235 
236  protected:
237 
238  // ----------------------------------------------------------------------
239  // Connection status queries for special output ports
240  // ----------------------------------------------------------------------
241 
246  FwIndexType portNum
247  ) const;
248 
253  FwIndexType portNum
254  ) const;
255 
256  protected:
257 
258  // ----------------------------------------------------------------------
259  // Connection status queries for typed output ports
260  // ----------------------------------------------------------------------
261 
266  FwIndexType portNum
267  ) const;
268 
269  protected:
270 
271  // ----------------------------------------------------------------------
272  // Handlers to implement for typed input ports
273  // ----------------------------------------------------------------------
274 
276  virtual void CycleIn_handler(
277  FwIndexType portNum,
278  Os::RawTime& cycleStart
279  ) = 0;
280 
281 #if FW_DIRECT_PORT_CALLS
282  public:
283 #else
284  protected:
285 #endif
286 
287  // ----------------------------------------------------------------------
288  // Port handler base-class functions for typed input ports
289  //
290  // Call these functions directly to bypass the corresponding ports
291  // ----------------------------------------------------------------------
292 
294  void CycleIn_handlerBase(
295  FwIndexType portNum,
296  Os::RawTime& cycleStart
297  );
298 
299  protected:
300 
301  // ----------------------------------------------------------------------
302  // Invocation functions for typed output ports
303  // ----------------------------------------------------------------------
304 
307  FwIndexType portNum,
308  U32 context
309  ) const;
310 
311  protected:
312 
313  // ----------------------------------------------------------------------
314  // Telemetry serialized write
315  // ----------------------------------------------------------------------
316 
321  void tlmWrite(
322  FwChanIdType id,
323  Fw::TlmBuffer& _tlmBuff,
324  Fw::Time _tlmTime = Fw::Time()
325  ) const;
326 
327  protected:
328 
329  // ----------------------------------------------------------------------
330  // Telemetry write functions
331  // ----------------------------------------------------------------------
332 
337  U32 arg,
338  Fw::Time _tlmTime = Fw::Time()
339  );
340 
344  void tlmWrite_CycleTime(
345  U32 arg,
346  Fw::Time _tlmTime = Fw::Time()
347  ) const;
348 
352  void tlmWrite_CycleCount(
353  U32 arg,
354  Fw::Time _tlmTime = Fw::Time()
355  ) const;
356 
357  protected:
358 
359  // ----------------------------------------------------------------------
360  // Time
361  // ----------------------------------------------------------------------
362 
366  Fw::Time getTime() const;
367 
368  private:
369 
370  // ----------------------------------------------------------------------
371  // Calls for messages received on typed input ports
372  // ----------------------------------------------------------------------
373 
375  static void m_p_CycleIn_in(
376  Fw::PassiveComponentBase* callComp,
377  FwIndexType portNum,
378  Os::RawTime& cycleStart
379  );
380 
381  private:
382 
383  // ----------------------------------------------------------------------
384  // Invocation functions for special output ports
385  // ----------------------------------------------------------------------
386 
388  void Time_out(
389  FwIndexType portNum,
390  Fw::Time& time
391  ) const;
392 
394  void Tlm_out(
395  FwIndexType portNum,
396  FwChanIdType id,
397  Fw::Time& timeTag,
398  Fw::TlmBuffer& val
399  ) const;
400 
401 #if !FW_DIRECT_PORT_CALLS
402 
403  private:
404 
405  // ----------------------------------------------------------------------
406  // Typed input ports
407  // ----------------------------------------------------------------------
408 
410  Svc::InputCyclePort m_CycleIn_InputPort[NUM_CYCLEIN_INPUT_PORTS];
411 
412 #endif
413 
414 #if !FW_DIRECT_PORT_CALLS
415 
416  private:
417 
418  // ----------------------------------------------------------------------
419  // Special output ports
420  // ----------------------------------------------------------------------
421 
423  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
424 
426  Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS];
427 
428 #endif
429 
430 #if !FW_DIRECT_PORT_CALLS
431 
432  private:
433 
434  // ----------------------------------------------------------------------
435  // Typed output ports
436  // ----------------------------------------------------------------------
437 
439  Svc::OutputSchedPort m_RateGroupMemberOut_OutputPort[NUM_RATEGROUPMEMBEROUT_OUTPUT_PORTS];
440 
441 #endif
442 
443  private:
444 
445  // ----------------------------------------------------------------------
446  // First update flags for telemetry channels
447  // ----------------------------------------------------------------------
448 
450  bool m_first_update_MaxCycleTime = true;
451 
452  private:
453 
454  // ----------------------------------------------------------------------
455  // Last value storage for telemetry channels
456  // ----------------------------------------------------------------------
457 
459  U32 m_last_MaxCycleTime = {};
460 
461  };
462 
463 }
464 
465 #endif
I32 FwEnumStoreType
bool isConnected_RateGroupMemberOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_RateGroupMemberOut_OutputPorts()
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.
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
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.
virtual ~PassiveRateGroupComponentBase()
Destroy PassiveRateGroupComponentBase object.
PassiveRateGroupComponentBase(const char *compName="")
Construct PassiveRateGroupComponentBase object.
Auto-generated base for PassiveRateGroup component.
void tlmWrite_MaxCycleTime(U32 arg, Fw::Time _tlmTime=Fw::Time())
static constexpr FwIndexType getNum_Time_OutputPorts()
friend class PassiveRateGroupTesterBase
Friend class tester to support autocoded test harness.
void tlmWrite_CycleCount(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
PlatformIndexType FwIndexType
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.
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
static constexpr FwIndexType getNum_CycleIn_InputPorts()
Svc::InputCyclePort * get_CycleIn_InputPort(FwIndexType portNum)