F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ActiveRateGroupComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ActiveRateGroupComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for ActiveRateGroup component base class
5 // ======================================================================
6 
7 #ifndef Svc_ActiveRateGroupComponentAc_HPP
8 #define Svc_ActiveRateGroupComponentAc_HPP
9 
10 #include "FpConfig.hpp"
12 #include "Fw/Log/LogPortAc.hpp"
13 #include "Fw/Log/LogString.hpp"
14 #if FW_ENABLE_TEXT_LOGGING == 1
15 #include "Fw/Log/LogTextPortAc.hpp"
16 #endif
19 #include "Fw/Time/TimePortAc.hpp"
20 #include "Fw/Tlm/TlmPortAc.hpp"
21 #include "Fw/Tlm/TlmString.hpp"
23 #include "Svc/Ping/PingPortAc.hpp"
25 
26 namespace Svc {
27 
34  {
35 
36  // ----------------------------------------------------------------------
37  // Friend classes
38  // ----------------------------------------------------------------------
39 
42 
43  PROTECTED:
44 
45  // ----------------------------------------------------------------------
46  // Constants
47  // ----------------------------------------------------------------------
48 
50  enum {
53  };
54 
56  enum {
61  };
62 
64  enum {
67  };
68 
70  enum {
73  };
74 
76  enum {
79  };
80 
81  public:
82 
83  // ----------------------------------------------------------------------
84  // Component initialization
85  // ----------------------------------------------------------------------
86 
88  void init(
89  FwSizeType queueDepth,
90  FwEnumStoreType instance = 0
91  );
92 
93  public:
94 
95  // ----------------------------------------------------------------------
96  // Getters for typed input ports
97  // ----------------------------------------------------------------------
98 
103  FwIndexType portNum
104  );
105 
110  FwIndexType portNum
111  );
112 
113  public:
114 
115  // ----------------------------------------------------------------------
116  // Connect input ports to special output ports
117  // ----------------------------------------------------------------------
118 
120  void set_Log_OutputPort(
121  FwIndexType portNum,
122  Fw::InputLogPort* port
123  );
124 
125 #if FW_ENABLE_TEXT_LOGGING == 1
126 
128  void set_LogText_OutputPort(
129  FwIndexType portNum,
130  Fw::InputLogTextPort* port
131  );
132 
133 #endif
134 
136  void set_Time_OutputPort(
137  FwIndexType portNum,
138  Fw::InputTimePort* port
139  );
140 
142  void set_Tlm_OutputPort(
143  FwIndexType portNum,
144  Fw::InputTlmPort* port
145  );
146 
147  public:
148 
149  // ----------------------------------------------------------------------
150  // Connect typed input ports to typed output ports
151  // ----------------------------------------------------------------------
152 
155  FwIndexType portNum,
156  Svc::InputPingPort* port
157  );
158 
161  FwIndexType portNum,
162  Svc::InputSchedPort* port
163  );
164 
165 #if FW_PORT_SERIALIZATION
166 
167  public:
168 
169  // ----------------------------------------------------------------------
170  // Connect serial input ports to special output ports
171  // ----------------------------------------------------------------------
172 
174  void set_Log_OutputPort(
175  FwIndexType portNum,
176  Fw::InputSerializePort* port
177  );
178 
179 #if FW_ENABLE_TEXT_LOGGING == 1
180 
182  void set_LogText_OutputPort(
183  FwIndexType portNum,
184  Fw::InputSerializePort* port
185  );
186 
187 #endif
188 
190  void set_Time_OutputPort(
191  FwIndexType portNum,
192  Fw::InputSerializePort* port
193  );
194 
196  void set_Tlm_OutputPort(
197  FwIndexType portNum,
198  Fw::InputSerializePort* port
199  );
200 
201 #endif
202 
203 #if FW_PORT_SERIALIZATION
204 
205  public:
206 
207  // ----------------------------------------------------------------------
208  // Connect serial input ports to typed output ports
209  // ----------------------------------------------------------------------
210 
213  FwIndexType portNum,
214  Fw::InputSerializePort* port
215  );
216 
219  FwIndexType portNum,
220  Fw::InputSerializePort* port
221  );
222 
223 #endif
224 
225  PROTECTED:
226 
227  // ----------------------------------------------------------------------
228  // Component construction and destruction
229  // ----------------------------------------------------------------------
230 
233  const char* compName = ""
234  );
235 
238 
239  PROTECTED:
240 
241  // ----------------------------------------------------------------------
242  // Getters for numbers of typed input ports
243  // ----------------------------------------------------------------------
244 
249 
254 
255  PROTECTED:
256 
257  // ----------------------------------------------------------------------
258  // Getters for numbers of special output ports
259  // ----------------------------------------------------------------------
260 
265 
266 #if FW_ENABLE_TEXT_LOGGING == 1
267 
271  FwIndexType getNum_LogText_OutputPorts() const;
272 
273 #endif
274 
279 
284 
285  PROTECTED:
286 
287  // ----------------------------------------------------------------------
288  // Getters for numbers of typed output ports
289  // ----------------------------------------------------------------------
290 
295 
300 
301  PROTECTED:
302 
303  // ----------------------------------------------------------------------
304  // Connection status queries for special output ports
305  // ----------------------------------------------------------------------
306 
311  FwIndexType portNum
312  );
313 
314 #if FW_ENABLE_TEXT_LOGGING == 1
315 
319  bool isConnected_LogText_OutputPort(
320  FwIndexType portNum
321  );
322 
323 #endif
324 
329  FwIndexType portNum
330  );
331 
336  FwIndexType portNum
337  );
338 
339  PROTECTED:
340 
341  // ----------------------------------------------------------------------
342  // Connection status queries for typed output ports
343  // ----------------------------------------------------------------------
344 
349  FwIndexType portNum
350  );
351 
356  FwIndexType portNum
357  );
358 
359  PROTECTED:
360 
361  // ----------------------------------------------------------------------
362  // Handlers to implement for typed input ports
363  // ----------------------------------------------------------------------
364 
366  virtual void CycleIn_handler(
367  FwIndexType portNum,
368  Os::RawTime& cycleStart
369  ) = 0;
370 
372  virtual void PingIn_handler(
373  FwIndexType portNum,
374  U32 key
375  ) = 0;
376 
377  PROTECTED:
378 
379  // ----------------------------------------------------------------------
380  // Port handler base-class functions for typed input ports
381  //
382  // Call these functions directly to bypass the corresponding ports
383  // ----------------------------------------------------------------------
384 
386  void CycleIn_handlerBase(
387  FwIndexType portNum,
388  Os::RawTime& cycleStart
389  );
390 
392  void PingIn_handlerBase(
393  FwIndexType portNum,
394  U32 key
395  );
396 
397  PROTECTED:
398 
399  // ----------------------------------------------------------------------
400  // Pre-message hooks for typed async input ports
401  //
402  // Each of these functions is invoked just before processing a message
403  // on the corresponding port. By default, they do nothing. You can
404  // override them to provide specific pre-message behavior.
405  // ----------------------------------------------------------------------
406 
408  virtual void CycleIn_preMsgHook(
409  FwIndexType portNum,
410  Os::RawTime& cycleStart
411  );
412 
414  virtual void PingIn_preMsgHook(
415  FwIndexType portNum,
416  U32 key
417  );
418 
419  PROTECTED:
420 
421  // ----------------------------------------------------------------------
422  // Invocation functions for typed output ports
423  // ----------------------------------------------------------------------
424 
426  void PingOut_out(
427  FwIndexType portNum,
428  U32 key
429  );
430 
433  FwIndexType portNum,
434  U32 context
435  );
436 
437  PROTECTED:
438 
439  // ----------------------------------------------------------------------
440  // Event logging functions
441  // ----------------------------------------------------------------------
442 
447 
452  U32 cycle
453  );
454 
455  PROTECTED:
456 
457  // ----------------------------------------------------------------------
458  // Telemetry write functions
459  // ----------------------------------------------------------------------
460 
464  void tlmWrite_RgMaxTime(
465  U32 arg,
466  Fw::Time _tlmTime = Fw::Time()
467  );
468 
473  U32 arg,
474  Fw::Time _tlmTime = Fw::Time()
475  );
476 
477  PROTECTED:
478 
479  // ----------------------------------------------------------------------
480  // Time
481  // ----------------------------------------------------------------------
482 
486  Fw::Time getTime();
487 
488  PRIVATE:
489 
490  // ----------------------------------------------------------------------
491  // Message dispatch functions
492  // ----------------------------------------------------------------------
493 
495  virtual MsgDispatchStatus doDispatch();
496 
497  PRIVATE:
498 
499  // ----------------------------------------------------------------------
500  // Calls for messages received on typed input ports
501  // ----------------------------------------------------------------------
502 
504  static void m_p_CycleIn_in(
505  Fw::PassiveComponentBase* callComp,
506  FwIndexType portNum,
507  Os::RawTime& cycleStart
508  );
509 
511  static void m_p_PingIn_in(
512  Fw::PassiveComponentBase* callComp,
513  FwIndexType portNum,
514  U32 key
515  );
516 
517  PRIVATE:
518 
519  // ----------------------------------------------------------------------
520  // Typed input ports
521  // ----------------------------------------------------------------------
522 
524  Svc::InputCyclePort m_CycleIn_InputPort[NUM_CYCLEIN_INPUT_PORTS];
525 
527  Svc::InputPingPort m_PingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
528 
529  PRIVATE:
530 
531  // ----------------------------------------------------------------------
532  // Special output ports
533  // ----------------------------------------------------------------------
534 
536  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
537 
538 #if FW_ENABLE_TEXT_LOGGING == 1
539 
541  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
542 
543 #endif
544 
546  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
547 
549  Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS];
550 
551  PRIVATE:
552 
553  // ----------------------------------------------------------------------
554  // Typed output ports
555  // ----------------------------------------------------------------------
556 
558  Svc::OutputPingPort m_PingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
559 
561  Svc::OutputSchedPort m_RateGroupMemberOut_OutputPort[NUM_RATEGROUPMEMBEROUT_OUTPUT_PORTS];
562 
563  PRIVATE:
564 
565  // ----------------------------------------------------------------------
566  // First update flags for telemetry channels
567  // ----------------------------------------------------------------------
568 
570  bool m_first_update_RgMaxTime;
571 
573  bool m_first_update_RgCycleSlips;
574 
575  PRIVATE:
576 
577  // ----------------------------------------------------------------------
578  // Last value storage for telemetry channels
579  // ----------------------------------------------------------------------
580 
582  U32 m_last_RgMaxTime;
583 
585  U32 m_last_RgCycleSlips;
586 
587  };
588 
589 }
590 
591 #endif
I32 FwEnumStoreType
Definition: FpConfig.h:64
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
void init()
Object initializer.
Definition: ObjBase.cpp:27
Definition: Time.hpp:9
Auto-generated base for ActiveRateGroup component.
void tlmWrite_RgMaxTime(U32 arg, Fw::Time _tlmTime=Fw::Time())
void set_PingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to PingOut[portNum].
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void tlmWrite_RgCycleSlips(U32 arg, Fw::Time _tlmTime=Fw::Time())
bool isConnected_Time_OutputPort(FwIndexType portNum)
@ EVENTID_RATEGROUPSTARTED
Informational event that rate group has started.
@ EVENTID_RATEGROUPCYCLESLIP
Warning event that rate group has had a cycle slip.
virtual ~ActiveRateGroupComponentBase()
Destroy ActiveRateGroupComponentBase object.
void RateGroupMemberOut_out(FwIndexType portNum, U32 context)
Invoke output port RateGroupMemberOut.
virtual void PingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port PingIn.
virtual void CycleIn_handler(FwIndexType portNum, Os::RawTime &cycleStart)=0
Handler for input port CycleIn.
bool isConnected_PingOut_OutputPort(FwIndexType portNum)
ActiveRateGroupComponentBase(const char *compName="")
Construct ActiveRateGroupComponentBase object.
@ CHANNELID_RGMAXTIME
Channel ID for RgMaxTime.
@ CHANNELID_RGCYCLESLIPS
Channel ID for RgCycleSlips.
bool isConnected_Log_OutputPort(FwIndexType portNum)
friend class ActiveRateGroupComponentBaseFriend
Friend class for white-box testing.
Svc::InputPingPort * get_PingIn_InputPort(FwIndexType portNum)
virtual void PingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port PingIn.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
bool isConnected_RateGroupMemberOut_OutputPort(FwIndexType portNum)
void CycleIn_handlerBase(FwIndexType portNum, Os::RawTime &cycleStart)
Handler base-class function for input port CycleIn.
virtual void CycleIn_preMsgHook(FwIndexType portNum, Os::RawTime &cycleStart)
Pre-message hook for async input port CycleIn.
void set_RateGroupMemberOut_OutputPort(FwIndexType portNum, Svc::InputSchedPort *port)
Connect port to RateGroupMemberOut[portNum].
Svc::InputCyclePort * get_CycleIn_InputPort(FwIndexType portNum)
void PingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port PingIn.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void PingOut_out(FwIndexType portNum, U32 key)
Invoke output port PingOut.