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"
14 #include "Fw/Time/TimePortAc.hpp"
15 #include "Fw/Tlm/TlmPortAc.hpp"
16 #include "Fw/Tlm/TlmString.hpp"
19 
20 namespace Svc {
21 
28  {
29 
30  // ----------------------------------------------------------------------
31  // Friend classes
32  // ----------------------------------------------------------------------
33 
37  friend class PassiveRateGroupTester;
38 
39  protected:
40 
41  // ----------------------------------------------------------------------
42  // Constants
43  // ----------------------------------------------------------------------
44 
46  enum {
48  };
49 
51  enum {
54  };
55 
57  enum {
59  };
60 
62  enum {
66  };
67 
68  public:
69 
70  // ----------------------------------------------------------------------
71  // Component initialization
72  // ----------------------------------------------------------------------
73 
75  void init(
76  FwEnumStoreType instance = 0
77  );
78 
79  public:
80 
81  // ----------------------------------------------------------------------
82  // Getters for typed input ports
83  // ----------------------------------------------------------------------
84 
89  FwIndexType portNum
90  );
91 
92  public:
93 
94  // ----------------------------------------------------------------------
95  // Connect input ports to special output ports
96  // ----------------------------------------------------------------------
97 
100  FwIndexType portNum,
101  Fw::InputTimePort* port
102  );
103 
105  void set_Tlm_OutputPort(
106  FwIndexType portNum,
107  Fw::InputTlmPort* port
108  );
109 
110  public:
111 
112  // ----------------------------------------------------------------------
113  // Connect typed input ports to typed output ports
114  // ----------------------------------------------------------------------
115 
118  FwIndexType portNum,
119  Svc::InputSchedPort* port
120  );
121 
122 #if FW_PORT_SERIALIZATION
123 
124  public:
125 
126  // ----------------------------------------------------------------------
127  // Connect serial input ports to special output ports
128  // ----------------------------------------------------------------------
129 
131  void set_Time_OutputPort(
132  FwIndexType portNum,
133  Fw::InputSerializePort* port
134  );
135 
137  void set_Tlm_OutputPort(
138  FwIndexType portNum,
139  Fw::InputSerializePort* port
140  );
141 
142 #endif
143 
144 #if FW_PORT_SERIALIZATION
145 
146  public:
147 
148  // ----------------------------------------------------------------------
149  // Connect serial input ports to typed output ports
150  // ----------------------------------------------------------------------
151 
154  FwIndexType portNum,
155  Fw::InputSerializePort* port
156  );
157 
158 #endif
159 
160  protected:
161 
162  // ----------------------------------------------------------------------
163  // Component construction and destruction
164  // ----------------------------------------------------------------------
165 
168  const char* compName = ""
169  );
170 
173 
174  protected:
175 
176  // ----------------------------------------------------------------------
177  // Getters for numbers of typed input ports
178  // ----------------------------------------------------------------------
179 
185  }
186 
187  protected:
188 
189  // ----------------------------------------------------------------------
190  // Getters for numbers of special output ports
191  // ----------------------------------------------------------------------
192 
197  return NUM_TIME_OUTPUT_PORTS;
198  }
199 
203  static constexpr FwIndexType getNum_Tlm_OutputPorts() {
204  return NUM_TLM_OUTPUT_PORTS;
205  }
206 
207  protected:
208 
209  // ----------------------------------------------------------------------
210  // Getters for numbers of typed output ports
211  // ----------------------------------------------------------------------
212 
218  }
219 
220  protected:
221 
222  // ----------------------------------------------------------------------
223  // Connection status queries for special output ports
224  // ----------------------------------------------------------------------
225 
230  FwIndexType portNum
231  );
232 
237  FwIndexType portNum
238  );
239 
240  protected:
241 
242  // ----------------------------------------------------------------------
243  // Connection status queries for typed output ports
244  // ----------------------------------------------------------------------
245 
250  FwIndexType portNum
251  );
252 
253  protected:
254 
255  // ----------------------------------------------------------------------
256  // Handlers to implement for typed input ports
257  // ----------------------------------------------------------------------
258 
260  virtual void CycleIn_handler(
261  FwIndexType portNum,
262  Os::RawTime& cycleStart
263  ) = 0;
264 
265  protected:
266 
267  // ----------------------------------------------------------------------
268  // Port handler base-class functions for typed input ports
269  //
270  // Call these functions directly to bypass the corresponding ports
271  // ----------------------------------------------------------------------
272 
274  void CycleIn_handlerBase(
275  FwIndexType portNum,
276  Os::RawTime& cycleStart
277  );
278 
279  protected:
280 
281  // ----------------------------------------------------------------------
282  // Invocation functions for typed output ports
283  // ----------------------------------------------------------------------
284 
287  FwIndexType portNum,
288  U32 context
289  );
290 
291  protected:
292 
293  // ----------------------------------------------------------------------
294  // Telemetry write functions
295  // ----------------------------------------------------------------------
296 
301  U32 arg,
302  Fw::Time _tlmTime = Fw::Time()
303  );
304 
308  void tlmWrite_CycleTime(
309  U32 arg,
310  Fw::Time _tlmTime = Fw::Time()
311  ) const;
312 
316  void tlmWrite_CycleCount(
317  U32 arg,
318  Fw::Time _tlmTime = Fw::Time()
319  ) const;
320 
321  protected:
322 
323  // ----------------------------------------------------------------------
324  // Time
325  // ----------------------------------------------------------------------
326 
330  Fw::Time getTime() const;
331 
332  private:
333 
334  // ----------------------------------------------------------------------
335  // Calls for messages received on typed input ports
336  // ----------------------------------------------------------------------
337 
339  static void m_p_CycleIn_in(
340  Fw::PassiveComponentBase* callComp,
341  FwIndexType portNum,
342  Os::RawTime& cycleStart
343  );
344 
345  private:
346 
347  // ----------------------------------------------------------------------
348  // Typed input ports
349  // ----------------------------------------------------------------------
350 
352  Svc::InputCyclePort m_CycleIn_InputPort[NUM_CYCLEIN_INPUT_PORTS];
353 
354  private:
355 
356  // ----------------------------------------------------------------------
357  // Special output ports
358  // ----------------------------------------------------------------------
359 
361  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
362 
364  Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS];
365 
366  private:
367 
368  // ----------------------------------------------------------------------
369  // Typed output ports
370  // ----------------------------------------------------------------------
371 
373  Svc::OutputSchedPort m_RateGroupMemberOut_OutputPort[NUM_RATEGROUPMEMBEROUT_OUTPUT_PORTS];
374 
375  private:
376 
377  // ----------------------------------------------------------------------
378  // First update flags for telemetry channels
379  // ----------------------------------------------------------------------
380 
382  bool m_first_update_MaxCycleTime = true;
383 
384  private:
385 
386  // ----------------------------------------------------------------------
387  // Last value storage for telemetry channels
388  // ----------------------------------------------------------------------
389 
391  U32 m_last_MaxCycleTime = {};
392 
393  };
394 
395 }
396 
397 #endif
I32 FwEnumStoreType
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 init()
Object initializer.
Definition: ObjBase.cpp:24
bool isConnected_RateGroupMemberOut_OutputPort(FwIndexType portNum)
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].
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 RateGroupMemberOut_out(FwIndexType portNum, U32 context)
Invoke output port RateGroupMemberOut.
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.
static constexpr FwIndexType getNum_CycleIn_InputPorts()
Svc::InputCyclePort * get_CycleIn_InputPort(FwIndexType portNum)