F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
PassiveRateGroupComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title PassiveRateGroupComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for PassiveRateGroup component base class
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #endif
13 
14 namespace Svc {
15 
16  // ----------------------------------------------------------------------
17  // Component initialization
18  // ----------------------------------------------------------------------
19 
22  {
23  // Initialize base class
25 
26 #if !FW_DIRECT_PORT_CALLS
27  // Connect input port CmdDisp
28  for (
29  FwIndexType port = 0;
30  port < static_cast<FwIndexType>(this->getNum_CmdDisp_InputPorts());
31  port++
32  ) {
33  this->m_CmdDisp_InputPort[port].init();
34  this->m_CmdDisp_InputPort[port].addCallComp(
35  this,
36  m_p_CmdDisp_in
37  );
38  this->m_CmdDisp_InputPort[port].setPortNum(port);
39 
40 #if FW_OBJECT_NAMES == 1
41  Fw::ObjectName portName;
42  portName.format(
43  "%s_CmdDisp_InputPort[%" PRI_FwIndexType "]",
44  this->m_objName.toChar(),
45  port
46  );
47  this->m_CmdDisp_InputPort[port].setObjName(portName.toChar());
48 #endif
49  }
50 #endif
51 
52 #if !FW_DIRECT_PORT_CALLS
53  // Connect input port CycleIn
54  for (
55  FwIndexType port = 0;
56  port < static_cast<FwIndexType>(this->getNum_CycleIn_InputPorts());
57  port++
58  ) {
59  this->m_CycleIn_InputPort[port].init();
60  this->m_CycleIn_InputPort[port].addCallComp(
61  this,
62  m_p_CycleIn_in
63  );
64  this->m_CycleIn_InputPort[port].setPortNum(port);
65 
66 #if FW_OBJECT_NAMES == 1
67  Fw::ObjectName portName;
68  portName.format(
69  "%s_CycleIn_InputPort[%" PRI_FwIndexType "]",
70  this->m_objName.toChar(),
71  port
72  );
73  this->m_CycleIn_InputPort[port].setObjName(portName.toChar());
74 #endif
75  }
76 #endif
77 
78 #if !FW_DIRECT_PORT_CALLS
79  // Connect output port CmdReg
80  for (
81  FwIndexType port = 0;
82  port < static_cast<FwIndexType>(this->getNum_CmdReg_OutputPorts());
83  port++
84  ) {
85  this->m_CmdReg_OutputPort[port].init();
86 
87 #if FW_OBJECT_NAMES == 1
88  Fw::ObjectName portName;
89  portName.format(
90  "%s_CmdReg_OutputPort[%" PRI_FwIndexType "]",
91  this->m_objName.toChar(),
92  port
93  );
94  this->m_CmdReg_OutputPort[port].setObjName(portName.toChar());
95 #endif
96  }
97 #endif
98 
99 #if !FW_DIRECT_PORT_CALLS
100  // Connect output port CmdStatus
101  for (
102  FwIndexType port = 0;
103  port < static_cast<FwIndexType>(this->getNum_CmdStatus_OutputPorts());
104  port++
105  ) {
106  this->m_CmdStatus_OutputPort[port].init();
107 
108 #if FW_OBJECT_NAMES == 1
109  Fw::ObjectName portName;
110  portName.format(
111  "%s_CmdStatus_OutputPort[%" PRI_FwIndexType "]",
112  this->m_objName.toChar(),
113  port
114  );
115  this->m_CmdStatus_OutputPort[port].setObjName(portName.toChar());
116 #endif
117  }
118 #endif
119 
120 #if !FW_DIRECT_PORT_CALLS
121  // Connect output port Time
122  for (
123  FwIndexType port = 0;
124  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
125  port++
126  ) {
127  this->m_Time_OutputPort[port].init();
128 
129 #if FW_OBJECT_NAMES == 1
130  Fw::ObjectName portName;
131  portName.format(
132  "%s_Time_OutputPort[%" PRI_FwIndexType "]",
133  this->m_objName.toChar(),
134  port
135  );
136  this->m_Time_OutputPort[port].setObjName(portName.toChar());
137 #endif
138  }
139 #endif
140 
141 #if !FW_DIRECT_PORT_CALLS
142  // Connect output port Tlm
143  for (
144  FwIndexType port = 0;
145  port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
146  port++
147  ) {
148  this->m_Tlm_OutputPort[port].init();
149 
150 #if FW_OBJECT_NAMES == 1
151  Fw::ObjectName portName;
152  portName.format(
153  "%s_Tlm_OutputPort[%" PRI_FwIndexType "]",
154  this->m_objName.toChar(),
155  port
156  );
157  this->m_Tlm_OutputPort[port].setObjName(portName.toChar());
158 #endif
159  }
160 #endif
161 
162 #if !FW_DIRECT_PORT_CALLS
163  // Connect output port RateGroupMemberOut
164  for (
165  FwIndexType port = 0;
166  port < static_cast<FwIndexType>(this->getNum_RateGroupMemberOut_OutputPorts());
167  port++
168  ) {
169  this->m_RateGroupMemberOut_OutputPort[port].init();
170 
171 #if FW_OBJECT_NAMES == 1
172  Fw::ObjectName portName;
173  portName.format(
174  "%s_RateGroupMemberOut_OutputPort[%" PRI_FwIndexType "]",
175  this->m_objName.toChar(),
176  port
177  );
178  this->m_RateGroupMemberOut_OutputPort[port].setObjName(portName.toChar());
179 #endif
180  }
181 #endif
182  }
183 
184 #if !FW_DIRECT_PORT_CALLS
185 
186  // ----------------------------------------------------------------------
187  // Getters for special input ports
188  // ----------------------------------------------------------------------
189 
192  {
193  FW_ASSERT(
194  (0 <= portNum) && (portNum < this->getNum_CmdDisp_InputPorts()),
195  static_cast<FwAssertArgType>(portNum)
196  );
197 
198  return &this->m_CmdDisp_InputPort[portNum];
199  }
200 
201 #endif
202 
203 #if !FW_DIRECT_PORT_CALLS
204 
205  // ----------------------------------------------------------------------
206  // Getters for typed input ports
207  // ----------------------------------------------------------------------
208 
211  {
212  FW_ASSERT(
213  (0 <= portNum) && (portNum < this->getNum_CycleIn_InputPorts()),
214  static_cast<FwAssertArgType>(portNum)
215  );
216 
217  return &this->m_CycleIn_InputPort[portNum];
218  }
219 
220 #endif
221 
222 #if !FW_DIRECT_PORT_CALLS
223 
224  // ----------------------------------------------------------------------
225  // Connect input ports to special output ports
226  // ----------------------------------------------------------------------
227 
230  FwIndexType portNum,
231  Fw::InputCmdRegPort* port
232  )
233  {
234  FW_ASSERT(
235  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
236  static_cast<FwAssertArgType>(portNum)
237  );
238 
239  this->m_CmdReg_OutputPort[portNum].addCallPort(port);
240  }
241 
244  FwIndexType portNum,
246  )
247  {
248  FW_ASSERT(
249  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
250  static_cast<FwAssertArgType>(portNum)
251  );
252 
253  this->m_CmdStatus_OutputPort[portNum].addCallPort(port);
254  }
255 
258  FwIndexType portNum,
259  Fw::InputTimePort* port
260  )
261  {
262  FW_ASSERT(
263  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
264  static_cast<FwAssertArgType>(portNum)
265  );
266 
267  this->m_Time_OutputPort[portNum].addCallPort(port);
268  }
269 
272  FwIndexType portNum,
273  Fw::InputTlmPort* port
274  )
275  {
276  FW_ASSERT(
277  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
278  static_cast<FwAssertArgType>(portNum)
279  );
280 
281  this->m_Tlm_OutputPort[portNum].addCallPort(port);
282  }
283 
284 #endif
285 
286 #if !FW_DIRECT_PORT_CALLS
287 
288  // ----------------------------------------------------------------------
289  // Connect typed input ports to typed output ports
290  // ----------------------------------------------------------------------
291 
294  FwIndexType portNum,
295  Svc::InputSchedPort* port
296  )
297  {
298  FW_ASSERT(
299  (0 <= portNum) && (portNum < this->getNum_RateGroupMemberOut_OutputPorts()),
300  static_cast<FwAssertArgType>(portNum)
301  );
302 
303  this->m_RateGroupMemberOut_OutputPort[portNum].addCallPort(port);
304  }
305 
306 #endif
307 
308 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
309 
310  // ----------------------------------------------------------------------
311  // Connect serial input ports to special output ports
312  // ----------------------------------------------------------------------
313 
316  FwIndexType portNum,
317  Fw::InputSerializePort* port
318  )
319  {
320  FW_ASSERT(
321  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
322  static_cast<FwAssertArgType>(portNum)
323  );
324 
325  this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
326  }
327 
330  FwIndexType portNum,
331  Fw::InputSerializePort* port
332  )
333  {
334  FW_ASSERT(
335  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
336  static_cast<FwAssertArgType>(portNum)
337  );
338 
339  this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
340  }
341 
344  FwIndexType portNum,
345  Fw::InputSerializePort* port
346  )
347  {
348  FW_ASSERT(
349  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
350  static_cast<FwAssertArgType>(portNum)
351  );
352 
353  this->m_Time_OutputPort[portNum].registerSerialPort(port);
354  }
355 
358  FwIndexType portNum,
359  Fw::InputSerializePort* port
360  )
361  {
362  FW_ASSERT(
363  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
364  static_cast<FwAssertArgType>(portNum)
365  );
366 
367  this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
368  }
369 
370 #endif
371 
372 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
373 
374  // ----------------------------------------------------------------------
375  // Connect serial input ports to typed output ports
376  // ----------------------------------------------------------------------
377 
380  FwIndexType portNum,
381  Fw::InputSerializePort* port
382  )
383  {
384  FW_ASSERT(
385  (0 <= portNum) && (portNum < this->getNum_RateGroupMemberOut_OutputPorts()),
386  static_cast<FwAssertArgType>(portNum)
387  );
388 
389  this->m_RateGroupMemberOut_OutputPort[portNum].registerSerialPort(port);
390  }
391 
392 #endif
393 
394  // ----------------------------------------------------------------------
395  // Command registration
396  // ----------------------------------------------------------------------
397 
400  {
402 
403  this->CmdReg_out(
404  0,
406  );
407  }
408 
409  // ----------------------------------------------------------------------
410  // Component construction and destruction
411  // ----------------------------------------------------------------------
412 
414  PassiveRateGroupComponentBase(const char* compName) :
415  Fw::PassiveComponentBase(compName)
416  {
417 
418  }
419 
422  {
423 
424  }
425 
426 #if !FW_DIRECT_PORT_CALLS
427 
428  // ----------------------------------------------------------------------
429  // Connection status queries for special output ports
430  // ----------------------------------------------------------------------
431 
434  {
435  FW_ASSERT(
436  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
437  static_cast<FwAssertArgType>(portNum)
438  );
439 
440  return this->m_CmdReg_OutputPort[portNum].isConnected();
441  }
442 
445  {
446  FW_ASSERT(
447  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
448  static_cast<FwAssertArgType>(portNum)
449  );
450 
451  return this->m_CmdStatus_OutputPort[portNum].isConnected();
452  }
453 
456  {
457  FW_ASSERT(
458  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
459  static_cast<FwAssertArgType>(portNum)
460  );
461 
462  return this->m_Time_OutputPort[portNum].isConnected();
463  }
464 
467  {
468  FW_ASSERT(
469  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
470  static_cast<FwAssertArgType>(portNum)
471  );
472 
473  return this->m_Tlm_OutputPort[portNum].isConnected();
474  }
475 
476 #endif
477 
478 #if !FW_DIRECT_PORT_CALLS
479 
480  // ----------------------------------------------------------------------
481  // Connection status queries for typed output ports
482  // ----------------------------------------------------------------------
483 
486  {
487  FW_ASSERT(
488  (0 <= portNum) && (portNum < this->getNum_RateGroupMemberOut_OutputPorts()),
489  static_cast<FwAssertArgType>(portNum)
490  );
491 
492  return this->m_RateGroupMemberOut_OutputPort[portNum].isConnected();
493  }
494 
495 #endif
496 
497  // ----------------------------------------------------------------------
498  // Port handler base-class functions for special input ports
499  //
500  // Call these functions directly to bypass the corresponding ports
501  // ----------------------------------------------------------------------
502 
505  FwIndexType portNum,
506  FwOpcodeType opCode,
507  U32 cmdSeq,
508  Fw::CmdArgBuffer& args
509  )
510  {
511 
512  const U32 idBase = this->getIdBase();
513  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
514 
515  // Select base class function based on opcode
516  switch (opCode - idBase) {
519  opCode,
520  cmdSeq,
521  args
522  );
523  break;
524  }
525  default:
526  // Unknown opcode: ignore it
527  break;
528  }
529  }
530 
531  // ----------------------------------------------------------------------
532  // Port handler base-class functions for typed input ports
533  //
534  // Call these functions directly to bypass the corresponding ports
535  // ----------------------------------------------------------------------
536 
539  FwIndexType portNum,
540  Os::RawTime& cycleStart
541  )
542  {
543  // Make sure port number is valid
544  FW_ASSERT(
545  (0 <= portNum) && (portNum < this->getNum_CycleIn_InputPorts()),
546  static_cast<FwAssertArgType>(portNum)
547  );
548 
549  // Call handler function
550  this->CycleIn_handler(
551  portNum,
552  cycleStart
553  );
554  }
555 
556 #if !FW_DIRECT_PORT_CALLS
557 
558  // ----------------------------------------------------------------------
559  // Invocation functions for typed output ports
560  // ----------------------------------------------------------------------
561 
564  FwIndexType portNum,
565  U32 context
566  ) const
567  {
568  FW_ASSERT(
569  (0 <= portNum) && (portNum < this->getNum_RateGroupMemberOut_OutputPorts()),
570  static_cast<FwAssertArgType>(portNum)
571  );
572 
573  FW_ASSERT(
574  this->m_RateGroupMemberOut_OutputPort[portNum].isConnected(),
575  static_cast<FwAssertArgType>(portNum)
576  );
577  this->m_RateGroupMemberOut_OutputPort[portNum].invoke(
578  context
579  );
580  }
581 
582 #endif
583 
584  // ----------------------------------------------------------------------
585  // Command response
586  // ----------------------------------------------------------------------
587 
590  FwOpcodeType opCode,
591  U32 cmdSeq,
592  Fw::CmdResponse response
593  )
594  {
596  this->CmdStatus_out(0, opCode, cmdSeq, response);
597  }
598 
599  // ----------------------------------------------------------------------
600  // Command handler base-class functions
601  //
602  // Call these functions directly to bypass the command input port
603  // ----------------------------------------------------------------------
604 
607  FwOpcodeType opCode,
608  U32 cmdSeq,
609  Fw::CmdArgBuffer& args
610  )
611  {
612 #if FW_CMD_CHECK_RESIDUAL
613  // Make sure there was no data left over.
614  // That means the argument buffer size was incorrect.
615  if (args.getDeserializeSizeLeft() != 0) {
616  if (this->isConnected_CmdStatus_OutputPort(0)) {
617  this->CmdStatus_out(
618  0,
619  opCode,
620  cmdSeq,
622  );
623  }
624  return;
625  }
626 #endif
627 
628  this->CLEAR_STATISTICS_cmdHandler(opCode, cmdSeq);
629  }
630 
631  // ----------------------------------------------------------------------
632  // Telemetry serialized write
633  // ----------------------------------------------------------------------
634 
637  FwChanIdType id,
638  Fw::TlmBuffer& _tlmBuff,
639  Fw::Time _tlmTime
640  ) const
641  {
642  if (this->isConnected_Tlm_OutputPort(0)) {
643  if (
644  this->isConnected_Time_OutputPort(0) &&
645  (_tlmTime == Fw::ZERO_TIME)
646  ) {
647  this->Time_out(0, _tlmTime);
648  }
649 
650  FwChanIdType _id;
651  _id = this->getIdBase() + id;
652 
653  this->Tlm_out(
654  0,
655  _id,
656  _tlmTime,
657  _tlmBuff
658  );
659  }
660  }
661 
662  // ----------------------------------------------------------------------
663  // Telemetry write functions
664  // ----------------------------------------------------------------------
665 
668  U32 arg,
669  Fw::Time _tlmTime
670  )
671  {
672  // Check to see if it is the first time
673  if (not this->m_first_update_MaxCycleTime) {
674  // Check to see if value has changed. If not, don't write it.
675  if (arg == this->m_last_MaxCycleTime) {
676  return;
677  }
678  else {
679  this->m_last_MaxCycleTime = arg;
680  }
681  }
682  else {
683  this->m_first_update_MaxCycleTime = false;
684  this->m_last_MaxCycleTime = arg;
685  }
686 
687  if (this->isConnected_Tlm_OutputPort(0)) {
688  Fw::TlmBuffer _tlmBuff;
689  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
690  FW_ASSERT(
691  _stat == Fw::FW_SERIALIZE_OK,
692  static_cast<FwAssertArgType>(_stat)
693  );
694 
695  this->tlmWrite(
697  _tlmBuff,
698  _tlmTime
699  );
700  }
701  }
702 
705  U32 arg,
706  Fw::Time _tlmTime
707  ) const
708  {
709  if (this->isConnected_Tlm_OutputPort(0)) {
710  Fw::TlmBuffer _tlmBuff;
711  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
712  FW_ASSERT(
713  _stat == Fw::FW_SERIALIZE_OK,
714  static_cast<FwAssertArgType>(_stat)
715  );
716 
717  this->tlmWrite(
719  _tlmBuff,
720  _tlmTime
721  );
722  }
723  }
724 
727  U32 arg,
728  Fw::Time _tlmTime
729  ) const
730  {
731  if (this->isConnected_Tlm_OutputPort(0)) {
732  Fw::TlmBuffer _tlmBuff;
733  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
734  FW_ASSERT(
735  _stat == Fw::FW_SERIALIZE_OK,
736  static_cast<FwAssertArgType>(_stat)
737  );
738 
739  this->tlmWrite(
741  _tlmBuff,
742  _tlmTime
743  );
744  }
745  }
746 
750  Fw::Time _tlmTime
751  ) const
752  {
753  if (this->isConnected_Tlm_OutputPort(0)) {
754  Fw::TlmBuffer _tlmBuff;
755  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
756  FW_ASSERT(
757  _stat == Fw::FW_SERIALIZE_OK,
758  static_cast<FwAssertArgType>(_stat)
759  );
760 
761  this->tlmWrite(
763  _tlmBuff,
764  _tlmTime
765  );
766  }
767  }
768 
772  Fw::Time _tlmTime
773  )
774  {
775  // Check to see if it is the first time
776  if (not this->m_first_update_PortCycleTimeHWM) {
777  // Check to see if value has changed. If not, don't write it.
778  if (arg == this->m_last_PortCycleTimeHWM) {
779  return;
780  }
781  else {
782  this->m_last_PortCycleTimeHWM = arg;
783  }
784  }
785  else {
786  this->m_first_update_PortCycleTimeHWM = false;
787  this->m_last_PortCycleTimeHWM = arg;
788  }
789 
790  if (this->isConnected_Tlm_OutputPort(0)) {
791  Fw::TlmBuffer _tlmBuff;
792  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
793  FW_ASSERT(
794  _stat == Fw::FW_SERIALIZE_OK,
795  static_cast<FwAssertArgType>(_stat)
796  );
797 
798  this->tlmWrite(
800  _tlmBuff,
801  _tlmTime
802  );
803  }
804  }
805 
806  // ----------------------------------------------------------------------
807  // Time
808  // ----------------------------------------------------------------------
809 
811  getTime() const
812  {
813  if (this->isConnected_Time_OutputPort(0)) {
814  Fw::Time _time;
815  this->Time_out(0, _time);
816  return _time;
817  }
818  else {
819  return Fw::Time(TimeBase::TB_NONE, 0, 0);
820  }
821  }
822 
823  // ----------------------------------------------------------------------
824  // Calls for messages received on special input ports
825  // ----------------------------------------------------------------------
826 
827  void PassiveRateGroupComponentBase ::
828  m_p_CmdDisp_in(
829  Fw::PassiveComponentBase* callComp,
830  FwIndexType portNum,
831  FwOpcodeType opCode,
832  U32 cmdSeq,
833  Fw::CmdArgBuffer& args
834  )
835  {
836  FW_ASSERT(callComp != nullptr);
837  PassiveRateGroupComponentBase* compPtr = static_cast<PassiveRateGroupComponentBase*>(callComp);
838  compPtr->CmdDisp_handlerBase(
839  portNum,
840  opCode,
841  cmdSeq,
842  args
843  );
844  }
845 
846  // ----------------------------------------------------------------------
847  // Calls for messages received on typed input ports
848  // ----------------------------------------------------------------------
849 
850  void PassiveRateGroupComponentBase ::
851  m_p_CycleIn_in(
852  Fw::PassiveComponentBase* callComp,
853  FwIndexType portNum,
854  Os::RawTime& cycleStart
855  )
856  {
857  FW_ASSERT(callComp != nullptr);
858  PassiveRateGroupComponentBase* compPtr = static_cast<PassiveRateGroupComponentBase*>(callComp);
859  compPtr->CycleIn_handlerBase(
860  portNum,
861  cycleStart
862  );
863  }
864 
865 #if !FW_DIRECT_PORT_CALLS
866 
867  // ----------------------------------------------------------------------
868  // Invocation functions for special output ports
869  // ----------------------------------------------------------------------
870 
871  void PassiveRateGroupComponentBase ::
872  CmdReg_out(
873  FwIndexType portNum,
874  FwOpcodeType opCode
875  ) const
876  {
877  FW_ASSERT(
878  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
879  static_cast<FwAssertArgType>(portNum)
880  );
881 
882  FW_ASSERT(
883  this->m_CmdReg_OutputPort[portNum].isConnected(),
884  static_cast<FwAssertArgType>(portNum)
885  );
886  this->m_CmdReg_OutputPort[portNum].invoke(
887  opCode
888  );
889  }
890 
891  void PassiveRateGroupComponentBase ::
892  CmdStatus_out(
893  FwIndexType portNum,
894  FwOpcodeType opCode,
895  U32 cmdSeq,
896  const Fw::CmdResponse& response
897  ) const
898  {
899  FW_ASSERT(
900  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
901  static_cast<FwAssertArgType>(portNum)
902  );
903 
904  FW_ASSERT(
905  this->m_CmdStatus_OutputPort[portNum].isConnected(),
906  static_cast<FwAssertArgType>(portNum)
907  );
908  this->m_CmdStatus_OutputPort[portNum].invoke(
909  opCode,
910  cmdSeq,
911  response
912  );
913  }
914 
915  void PassiveRateGroupComponentBase ::
916  Time_out(
917  FwIndexType portNum,
918  Fw::Time& time
919  ) const
920  {
921  FW_ASSERT(
922  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
923  static_cast<FwAssertArgType>(portNum)
924  );
925 
926  FW_ASSERT(
927  this->m_Time_OutputPort[portNum].isConnected(),
928  static_cast<FwAssertArgType>(portNum)
929  );
930  this->m_Time_OutputPort[portNum].invoke(
931  time
932  );
933  }
934 
935  void PassiveRateGroupComponentBase ::
936  Tlm_out(
937  FwIndexType portNum,
938  FwChanIdType id,
939  Fw::Time& timeTag,
940  Fw::TlmBuffer& val
941  ) const
942  {
943  FW_ASSERT(
944  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
945  static_cast<FwAssertArgType>(portNum)
946  );
947 
948  FW_ASSERT(
949  this->m_Tlm_OutputPort[portNum].isConnected(),
950  static_cast<FwAssertArgType>(portNum)
951  );
952  this->m_Tlm_OutputPort[portNum].invoke(
953  id,
954  timeTag,
955  val
956  );
957  }
958 
959 #endif
960 
961 }
void CLEAR_STATISTICS_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Serialization/Deserialization operation was successful.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
FwIdType FwOpcodeType
The type of a command opcode.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CyclePortAc.cpp:79
I32 FwEnumStoreType
bool isConnected_RateGroupMemberOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_RateGroupMemberOut_OutputPorts()
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
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].
const Time ZERO_TIME
Definition: Time.cpp:5
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
Enum representing a command response.
No time base has been established (Required)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
void RateGroupMemberOut_out(FwIndexType portNum, U32 context) const
Invoke output port RateGroupMemberOut.
void init()
Object initializer.
Definition: ObjBase.cpp:24
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
bool isConnected_Time_OutputPort(FwIndexType portNum) const
bool isConnected_CmdReg_OutputPort(FwIndexType portNum) const
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
void init()
Initialization function.
Definition: TimePortAc.cpp:151
void invoke(U32 context) const
Invoke a port connection.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
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
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
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.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Auto-generated base for PassiveRateGroup component.
PassiveRateGroupComponentBase(const char *compName="")
Construct PassiveRateGroupComponentBase object.
Clear max cycle time and port cycle time high water marks (cycle count is not cleared) ...
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void setPortNum(FwIndexType portNum)
void tlmWrite_MaxCycleTime(U32 arg, Fw::Time _tlmTime=Fw::Time())
void init()
Initialization function.
Definition: CyclePortAc.cpp:73
static constexpr FwIndexType getNum_Time_OutputPorts()
static constexpr FwIndexType getNum_CmdReg_OutputPorts()
Command failed to deserialize.
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.
void tlmWrite_CycleCount(U32 arg, Fw::Time _tlmTime=Fw::Time()) const
PlatformIndexType FwIndexType
void init()
Initialization function.
static constexpr FwIndexType getNum_CmdStatus_OutputPorts()
void init()
Initialization function.
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()
Implementation of malloc based allocator.
Svc::InputCyclePort * get_CycleIn_InputPort(FwIndexType portNum)
void init()
Initialization function.
void regCommands()
Register commands with the Command Dispatcher.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void addCallPort(InputSchedPort *callPort)
Register an input port.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.