F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TimeConverterComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TimeConverterComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for TimeConverter 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 cmdIn
28  for (
29  FwIndexType port = 0;
30  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
31  port++
32  ) {
33  this->m_cmdIn_InputPort[port].init();
34  this->m_cmdIn_InputPort[port].addCallComp(
35  this,
36  m_p_cmdIn_in
37  );
38  this->m_cmdIn_InputPort[port].setPortNum(port);
39 
40 #if FW_OBJECT_NAMES == 1
41  Fw::ObjectName portName;
42  portName.format(
43  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
44  this->m_objName.toChar(),
45  port
46  );
47  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
48 #endif
49  }
50 #endif
51 
52 #if !FW_DIRECT_PORT_CALLS
53  // Connect input port convertTime
54  for (
55  FwIndexType port = 0;
56  port < static_cast<FwIndexType>(this->getNum_convertTime_InputPorts());
57  port++
58  ) {
59  this->m_convertTime_InputPort[port].init();
60  this->m_convertTime_InputPort[port].addCallComp(
61  this,
62  m_p_convertTime_in
63  );
64  this->m_convertTime_InputPort[port].setPortNum(port);
65 
66 #if FW_OBJECT_NAMES == 1
67  Fw::ObjectName portName;
68  portName.format(
69  "%s_convertTime_InputPort[%" PRI_FwIndexType "]",
70  this->m_objName.toChar(),
71  port
72  );
73  this->m_convertTime_InputPort[port].setObjName(portName.toChar());
74 #endif
75  }
76 #endif
77 
78 #if !FW_DIRECT_PORT_CALLS
79  // Connect input port offsetUpdate
80  for (
81  FwIndexType port = 0;
82  port < static_cast<FwIndexType>(this->getNum_offsetUpdate_InputPorts());
83  port++
84  ) {
85  this->m_offsetUpdate_InputPort[port].init();
86  this->m_offsetUpdate_InputPort[port].addCallComp(
87  this,
88  m_p_offsetUpdate_in
89  );
90  this->m_offsetUpdate_InputPort[port].setPortNum(port);
91 
92 #if FW_OBJECT_NAMES == 1
93  Fw::ObjectName portName;
94  portName.format(
95  "%s_offsetUpdate_InputPort[%" PRI_FwIndexType "]",
96  this->m_objName.toChar(),
97  port
98  );
99  this->m_offsetUpdate_InputPort[port].setObjName(portName.toChar());
100 #endif
101  }
102 #endif
103 
104 #if !FW_DIRECT_PORT_CALLS
105  // Connect output port cmdRegOut
106  for (
107  FwIndexType port = 0;
108  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
109  port++
110  ) {
111  this->m_cmdRegOut_OutputPort[port].init();
112 
113 #if FW_OBJECT_NAMES == 1
114  Fw::ObjectName portName;
115  portName.format(
116  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
117  this->m_objName.toChar(),
118  port
119  );
120  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
121 #endif
122  }
123 #endif
124 
125 #if !FW_DIRECT_PORT_CALLS
126  // Connect output port cmdResponseOut
127  for (
128  FwIndexType port = 0;
129  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
130  port++
131  ) {
132  this->m_cmdResponseOut_OutputPort[port].init();
133 
134 #if FW_OBJECT_NAMES == 1
135  Fw::ObjectName portName;
136  portName.format(
137  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
138  this->m_objName.toChar(),
139  port
140  );
141  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
142 #endif
143  }
144 #endif
145 
146 #if !FW_DIRECT_PORT_CALLS
147  // Connect output port eventOut
148  for (
149  FwIndexType port = 0;
150  port < static_cast<FwIndexType>(this->getNum_eventOut_OutputPorts());
151  port++
152  ) {
153  this->m_eventOut_OutputPort[port].init();
154 
155 #if FW_OBJECT_NAMES == 1
156  Fw::ObjectName portName;
157  portName.format(
158  "%s_eventOut_OutputPort[%" PRI_FwIndexType "]",
159  this->m_objName.toChar(),
160  port
161  );
162  this->m_eventOut_OutputPort[port].setObjName(portName.toChar());
163 #endif
164  }
165 #endif
166 
167 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
168  // Connect output port textEventOut
169  for (
170  FwIndexType port = 0;
171  port < static_cast<FwIndexType>(this->getNum_textEventOut_OutputPorts());
172  port++
173  ) {
174  this->m_textEventOut_OutputPort[port].init();
175 
176 #if FW_OBJECT_NAMES == 1
177  Fw::ObjectName portName;
178  portName.format(
179  "%s_textEventOut_OutputPort[%" PRI_FwIndexType "]",
180  this->m_objName.toChar(),
181  port
182  );
183  this->m_textEventOut_OutputPort[port].setObjName(portName.toChar());
184 #endif
185  }
186 #endif
187 
188 #if !FW_DIRECT_PORT_CALLS
189  // Connect output port timeCaller
190  for (
191  FwIndexType port = 0;
192  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
193  port++
194  ) {
195  this->m_timeCaller_OutputPort[port].init();
196 
197 #if FW_OBJECT_NAMES == 1
198  Fw::ObjectName portName;
199  portName.format(
200  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
201  this->m_objName.toChar(),
202  port
203  );
204  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
205 #endif
206  }
207 #endif
208  }
209 
210 #if !FW_DIRECT_PORT_CALLS
211 
212  // ----------------------------------------------------------------------
213  // Getters for special input ports
214  // ----------------------------------------------------------------------
215 
218  {
219  FW_ASSERT(
220  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
221  static_cast<FwAssertArgType>(portNum)
222  );
223 
224  return &this->m_cmdIn_InputPort[portNum];
225  }
226 
227 #endif
228 
229 #if !FW_DIRECT_PORT_CALLS
230 
231  // ----------------------------------------------------------------------
232  // Getters for typed input ports
233  // ----------------------------------------------------------------------
234 
237  {
238  FW_ASSERT(
239  (0 <= portNum) && (portNum < this->getNum_convertTime_InputPorts()),
240  static_cast<FwAssertArgType>(portNum)
241  );
242 
243  return &this->m_convertTime_InputPort[portNum];
244  }
245 
248  {
249  FW_ASSERT(
250  (0 <= portNum) && (portNum < this->getNum_offsetUpdate_InputPorts()),
251  static_cast<FwAssertArgType>(portNum)
252  );
253 
254  return &this->m_offsetUpdate_InputPort[portNum];
255  }
256 
257 #endif
258 
259 #if !FW_DIRECT_PORT_CALLS
260 
261  // ----------------------------------------------------------------------
262  // Connect input ports to special output ports
263  // ----------------------------------------------------------------------
264 
267  FwIndexType portNum,
268  Fw::InputCmdRegPort* port
269  )
270  {
271  FW_ASSERT(
272  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
273  static_cast<FwAssertArgType>(portNum)
274  );
275 
276  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
277  }
278 
281  FwIndexType portNum,
283  )
284  {
285  FW_ASSERT(
286  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
287  static_cast<FwAssertArgType>(portNum)
288  );
289 
290  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
291  }
292 
295  FwIndexType portNum,
296  Fw::InputLogPort* port
297  )
298  {
299  FW_ASSERT(
300  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
301  static_cast<FwAssertArgType>(portNum)
302  );
303 
304  this->m_eventOut_OutputPort[portNum].addCallPort(port);
305  }
306 
307 #if FW_ENABLE_TEXT_LOGGING == 1
308 
309  void TimeConverterComponentBase ::
310  set_textEventOut_OutputPort(
311  FwIndexType portNum,
313  )
314  {
315  FW_ASSERT(
316  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
317  static_cast<FwAssertArgType>(portNum)
318  );
319 
320  this->m_textEventOut_OutputPort[portNum].addCallPort(port);
321  }
322 
323 #endif
324 
327  FwIndexType portNum,
328  Fw::InputTimePort* port
329  )
330  {
331  FW_ASSERT(
332  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
333  static_cast<FwAssertArgType>(portNum)
334  );
335 
336  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
337  }
338 
339 #endif
340 
341 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
342 
343  // ----------------------------------------------------------------------
344  // Connect serial input ports to special output ports
345  // ----------------------------------------------------------------------
346 
349  FwIndexType portNum,
350  Fw::InputSerializePort* port
351  )
352  {
353  FW_ASSERT(
354  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
355  static_cast<FwAssertArgType>(portNum)
356  );
357 
358  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
359  }
360 
363  FwIndexType portNum,
364  Fw::InputSerializePort* port
365  )
366  {
367  FW_ASSERT(
368  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
369  static_cast<FwAssertArgType>(portNum)
370  );
371 
372  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
373  }
374 
377  FwIndexType portNum,
378  Fw::InputSerializePort* port
379  )
380  {
381  FW_ASSERT(
382  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
383  static_cast<FwAssertArgType>(portNum)
384  );
385 
386  this->m_eventOut_OutputPort[portNum].registerSerialPort(port);
387  }
388 
389 #if FW_ENABLE_TEXT_LOGGING == 1
390 
391  void TimeConverterComponentBase ::
392  set_textEventOut_OutputPort(
393  FwIndexType portNum,
394  Fw::InputSerializePort* port
395  )
396  {
397  FW_ASSERT(
398  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
399  static_cast<FwAssertArgType>(portNum)
400  );
401 
402  this->m_textEventOut_OutputPort[portNum].registerSerialPort(port);
403  }
404 
405 #endif
406 
409  FwIndexType portNum,
410  Fw::InputSerializePort* port
411  )
412  {
413  FW_ASSERT(
414  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
415  static_cast<FwAssertArgType>(portNum)
416  );
417 
418  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
419  }
420 
421 #endif
422 
423  // ----------------------------------------------------------------------
424  // Command registration
425  // ----------------------------------------------------------------------
426 
429  {
431 
432  this->cmdRegOut_out(
433  0,
434  this->getIdBase() + OPCODE_SET_OFFSET
435  );
436 
437  this->cmdRegOut_out(
438  0,
440  );
441 
442  this->cmdRegOut_out(
443  0,
444  this->getIdBase() + OPCODE_GET_OFFSET
445  );
446 
447  this->cmdRegOut_out(
448  0,
450  );
451  }
452 
453  // ----------------------------------------------------------------------
454  // Component construction and destruction
455  // ----------------------------------------------------------------------
456 
458  TimeConverterComponentBase(const char* compName) :
459  Fw::PassiveComponentBase(compName)
460  {
461  this->m_NoConversionAvailableThrottle = 0;
462  this->m_InvalidTimeThrottle = 0;
463  this->m_OffsetTableFullThrottle = 0;
464  this->m_IdenticalTimeBasesThrottle = 0;
465  this->m_OffsetOutOfRangeThrottle = 0;
466  this->m_UnusableTimeBaseThrottle = 0;
467  }
468 
471  {
472 
473  }
474 
475 #if !FW_DIRECT_PORT_CALLS
476 
477  // ----------------------------------------------------------------------
478  // Connection status queries for special output ports
479  // ----------------------------------------------------------------------
480 
483  {
484  FW_ASSERT(
485  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
486  static_cast<FwAssertArgType>(portNum)
487  );
488 
489  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
490  }
491 
494  {
495  FW_ASSERT(
496  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
497  static_cast<FwAssertArgType>(portNum)
498  );
499 
500  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
501  }
502 
505  {
506  FW_ASSERT(
507  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
508  static_cast<FwAssertArgType>(portNum)
509  );
510 
511  return this->m_eventOut_OutputPort[portNum].isConnected();
512  }
513 
514 #if FW_ENABLE_TEXT_LOGGING == 1
515 
516  bool TimeConverterComponentBase ::
517  isConnected_textEventOut_OutputPort(FwIndexType portNum) const
518  {
519  FW_ASSERT(
520  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
521  static_cast<FwAssertArgType>(portNum)
522  );
523 
524  return this->m_textEventOut_OutputPort[portNum].isConnected();
525  }
526 
527 #endif
528 
531  {
532  FW_ASSERT(
533  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
534  static_cast<FwAssertArgType>(portNum)
535  );
536 
537  return this->m_timeCaller_OutputPort[portNum].isConnected();
538  }
539 
540 #endif
541 
542  // ----------------------------------------------------------------------
543  // Port handler base-class functions for special input ports
544  //
545  // Call these functions directly to bypass the corresponding ports
546  // ----------------------------------------------------------------------
547 
550  FwIndexType portNum,
551  FwOpcodeType opCode,
552  U32 cmdSeq,
553  Fw::CmdArgBuffer& args
554  )
555  {
556 
557  const U32 idBase = this->getIdBase();
558  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
559 
560  // Select base class function based on opcode
561  switch (opCode - idBase) {
562  case OPCODE_SET_OFFSET: {
564  opCode,
565  cmdSeq,
566  args
567  );
568  break;
569  }
570 
571  case OPCODE_CLEAR_OFFSETS: {
573  opCode,
574  cmdSeq,
575  args
576  );
577  break;
578  }
579 
580  case OPCODE_GET_OFFSET: {
582  opCode,
583  cmdSeq,
584  args
585  );
586  break;
587  }
588 
589  case OPCODE_DUMP_OFFSETS: {
591  opCode,
592  cmdSeq,
593  args
594  );
595  break;
596  }
597  default:
598  // Unknown opcode: ignore it
599  break;
600  }
601  }
602 
603  // ----------------------------------------------------------------------
604  // Port handler base-class functions for typed input ports
605  //
606  // Call these functions directly to bypass the corresponding ports
607  // ----------------------------------------------------------------------
608 
611  FwIndexType portNum,
612  const Fw::Time& in_time,
613  Fw::Time& out_time
614  )
615  {
616  // Make sure port number is valid
617  FW_ASSERT(
618  (0 <= portNum) && (portNum < this->getNum_convertTime_InputPorts()),
619  static_cast<FwAssertArgType>(portNum)
620  );
621 
622  Svc::ConvertTimeStatus retVal;
623 
624  // Lock guard mutex before calling
625  this->lock();
626 
627  // Call handler function
628  retVal = this->convertTime_handler(
629  portNum,
630  in_time,
631  out_time
632  );
633 
634  // Unlock guard mutex
635  this->unLock();
636 
637  return retVal;
638  }
639 
642  FwIndexType portNum,
643  const Svc::TimeOffset& offset
644  )
645  {
646  // Make sure port number is valid
647  FW_ASSERT(
648  (0 <= portNum) && (portNum < this->getNum_offsetUpdate_InputPorts()),
649  static_cast<FwAssertArgType>(portNum)
650  );
651 
652  // Lock guard mutex before calling
653  this->lock();
654 
655  // Call handler function
656  this->offsetUpdate_handler(
657  portNum,
658  offset
659  );
660 
661  // Unlock guard mutex
662  this->unLock();
663  }
664 
665  // ----------------------------------------------------------------------
666  // Command response
667  // ----------------------------------------------------------------------
668 
671  FwOpcodeType opCode,
672  U32 cmdSeq,
673  Fw::CmdResponse response
674  )
675  {
677  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
678  }
679 
680  // ----------------------------------------------------------------------
681  // Command handler base-class functions
682  //
683  // Call these functions directly to bypass the command input port
684  // ----------------------------------------------------------------------
685 
688  FwOpcodeType opCode,
689  U32 cmdSeq,
690  Fw::CmdArgBuffer& args
691  )
692  {
693  // Deserialize the arguments
695 
696  // Reset the buffer
697  args.resetDeser();
698 
699  TimeBase from;
700  _status = args.deserializeTo(from);
701  if (_status != Fw::FW_SERIALIZE_OK) {
703  this->cmdResponseOut_out(
704  0,
705  opCode,
706  cmdSeq,
708  );
709  }
710  return;
711  }
712 
713  TimeBase to;
714  _status = args.deserializeTo(to);
715  if (_status != Fw::FW_SERIALIZE_OK) {
717  this->cmdResponseOut_out(
718  0,
719  opCode,
720  cmdSeq,
722  );
723  }
724  return;
725  }
726 
727  I64 offset_us;
728  _status = args.deserializeTo(offset_us);
729  if (_status != Fw::FW_SERIALIZE_OK) {
731  this->cmdResponseOut_out(
732  0,
733  opCode,
734  cmdSeq,
736  );
737  }
738  return;
739  }
740 
741 #if FW_CMD_CHECK_RESIDUAL
742  // Make sure there was no data left over.
743  // That means the argument buffer size was incorrect.
744  if (args.getDeserializeSizeLeft() != 0) {
746  this->cmdResponseOut_out(
747  0,
748  opCode,
749  cmdSeq,
751  );
752  }
753  return;
754  }
755 #endif
756 
757  this->lock();
758 
759  this->SET_OFFSET_cmdHandler(
760  opCode, cmdSeq,
761  from,
762  to,
763  offset_us
764  );
765 
766  this->unLock();
767  }
768 
771  FwOpcodeType opCode,
772  U32 cmdSeq,
773  Fw::CmdArgBuffer& args
774  )
775  {
776 #if FW_CMD_CHECK_RESIDUAL
777  // Make sure there was no data left over.
778  // That means the argument buffer size was incorrect.
779  if (args.getDeserializeSizeLeft() != 0) {
781  this->cmdResponseOut_out(
782  0,
783  opCode,
784  cmdSeq,
786  );
787  }
788  return;
789  }
790 #endif
791 
792  this->lock();
793 
794  this->CLEAR_OFFSETS_cmdHandler(opCode, cmdSeq);
795 
796  this->unLock();
797  }
798 
801  FwOpcodeType opCode,
802  U32 cmdSeq,
803  Fw::CmdArgBuffer& args
804  )
805  {
806  // Deserialize the arguments
808 
809  // Reset the buffer
810  args.resetDeser();
811 
812  TimeBase from;
813  _status = args.deserializeTo(from);
814  if (_status != Fw::FW_SERIALIZE_OK) {
816  this->cmdResponseOut_out(
817  0,
818  opCode,
819  cmdSeq,
821  );
822  }
823  return;
824  }
825 
826  TimeBase to;
827  _status = args.deserializeTo(to);
828  if (_status != Fw::FW_SERIALIZE_OK) {
830  this->cmdResponseOut_out(
831  0,
832  opCode,
833  cmdSeq,
835  );
836  }
837  return;
838  }
839 
840 #if FW_CMD_CHECK_RESIDUAL
841  // Make sure there was no data left over.
842  // That means the argument buffer size was incorrect.
843  if (args.getDeserializeSizeLeft() != 0) {
845  this->cmdResponseOut_out(
846  0,
847  opCode,
848  cmdSeq,
850  );
851  }
852  return;
853  }
854 #endif
855 
856  this->lock();
857 
858  this->GET_OFFSET_cmdHandler(
859  opCode, cmdSeq,
860  from,
861  to
862  );
863 
864  this->unLock();
865  }
866 
869  FwOpcodeType opCode,
870  U32 cmdSeq,
871  Fw::CmdArgBuffer& args
872  )
873  {
874 #if FW_CMD_CHECK_RESIDUAL
875  // Make sure there was no data left over.
876  // That means the argument buffer size was incorrect.
877  if (args.getDeserializeSizeLeft() != 0) {
879  this->cmdResponseOut_out(
880  0,
881  opCode,
882  cmdSeq,
884  );
885  }
886  return;
887  }
888 #endif
889 
890  this->lock();
891 
892  this->DUMP_OFFSETS_cmdHandler(opCode, cmdSeq);
893 
894  this->unLock();
895  }
896 
897  // ----------------------------------------------------------------------
898  // Event logging functions
899  // ----------------------------------------------------------------------
900 
903  const TimeBase& in_tb,
904  const TimeBase& out_tb
905  )
906  {
907  // Check throttle value
908  if (this->m_NoConversionAvailableThrottle >= EVENTID_NOCONVERSIONAVAILABLE_THROTTLE) {
909  return;
910  }
911  else {
912  this->m_NoConversionAvailableThrottle++;
913  }
914 
915  // Get the time
916  Fw::Time _logTime;
917  if (this->isConnected_timeCaller_OutputPort(0)) {
918  this->timeCaller_out(0, _logTime);
919  }
920 
922 
923  // Emit the event on the log port
924  if (this->isConnected_eventOut_OutputPort(0)) {
925  Fw::LogBuffer _logBuff;
927 
928 #if FW_AMPCS_COMPATIBLE
929  // Serialize the number of arguments
930  _status = _logBuff.serializeFrom(static_cast<U8>(2));
931  FW_ASSERT(
932  _status == Fw::FW_SERIALIZE_OK,
933  static_cast<FwAssertArgType>(_status)
934  );
935 #endif
936 
937 #if FW_AMPCS_COMPATIBLE
938  // Serialize the argument size
939  _status = _logBuff.serializeFrom(
940  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
941  );
942  FW_ASSERT(
943  _status == Fw::FW_SERIALIZE_OK,
944  static_cast<FwAssertArgType>(_status)
945  );
946 #endif
947  _status = _logBuff.serializeFrom(in_tb);
948  FW_ASSERT(
949  _status == Fw::FW_SERIALIZE_OK,
950  static_cast<FwAssertArgType>(_status)
951  );
952 
953 #if FW_AMPCS_COMPATIBLE
954  // Serialize the argument size
955  _status = _logBuff.serializeFrom(
956  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
957  );
958  FW_ASSERT(
959  _status == Fw::FW_SERIALIZE_OK,
960  static_cast<FwAssertArgType>(_status)
961  );
962 #endif
963  _status = _logBuff.serializeFrom(out_tb);
964  FW_ASSERT(
965  _status == Fw::FW_SERIALIZE_OK,
966  static_cast<FwAssertArgType>(_status)
967  );
968 
969  this->eventOut_out(
970  0,
971  _id,
972  _logTime,
974  _logBuff
975  );
976  }
977 
978  // Emit the event on the text log port
979 #if FW_ENABLE_TEXT_LOGGING
980  if (this->isConnected_textEventOut_OutputPort(0)) {
981 #if FW_OBJECT_NAMES == 1
982  const char* _formatString =
983  "(%s) %s: No known conversion from %s to %s";
984 #else
985  const char* _formatString =
986  "%s: No known conversion from %s to %s";
987 #endif
988 
989  Fw::String in_tbStr;
990  in_tb.toString(in_tbStr);
991  Fw::String out_tbStr;
992  out_tb.toString(out_tbStr);
993 
994  Fw::TextLogString _logString;
995  (void) _logString.format(
996  _formatString,
997 #if FW_OBJECT_NAMES == 1
998  this->m_objName.toChar(),
999 #endif
1000  "NoConversionAvailable ",
1001  in_tbStr.toChar(),
1002  out_tbStr.toChar()
1003  );
1004 
1005  this->textEventOut_out(
1006  0,
1007  _id,
1008  _logTime,
1010  _logString
1011  );
1012  }
1013 #endif
1014  }
1015 
1018  const TimeBase& in_tb,
1019  const TimeBase& out_tb,
1020  I64 offset_us,
1021  I64 in_time_us
1022  )
1023  {
1024  // Check throttle value
1025  if (this->m_InvalidTimeThrottle >= EVENTID_INVALIDTIME_THROTTLE) {
1026  return;
1027  }
1028  else {
1029  this->m_InvalidTimeThrottle++;
1030  }
1031 
1032  // Get the time
1033  Fw::Time _logTime;
1034  if (this->isConnected_timeCaller_OutputPort(0)) {
1035  this->timeCaller_out(0, _logTime);
1036  }
1037 
1038  const FwEventIdType _id = this->getIdBase() + EVENTID_INVALIDTIME;
1039 
1040  // Emit the event on the log port
1041  if (this->isConnected_eventOut_OutputPort(0)) {
1042  Fw::LogBuffer _logBuff;
1044 
1045 #if FW_AMPCS_COMPATIBLE
1046  // Serialize the number of arguments
1047  _status = _logBuff.serializeFrom(static_cast<U8>(4));
1048  FW_ASSERT(
1049  _status == Fw::FW_SERIALIZE_OK,
1050  static_cast<FwAssertArgType>(_status)
1051  );
1052 #endif
1053 
1054 #if FW_AMPCS_COMPATIBLE
1055  // Serialize the argument size
1056  _status = _logBuff.serializeFrom(
1057  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1058  );
1059  FW_ASSERT(
1060  _status == Fw::FW_SERIALIZE_OK,
1061  static_cast<FwAssertArgType>(_status)
1062  );
1063 #endif
1064  _status = _logBuff.serializeFrom(in_tb);
1065  FW_ASSERT(
1066  _status == Fw::FW_SERIALIZE_OK,
1067  static_cast<FwAssertArgType>(_status)
1068  );
1069 
1070 #if FW_AMPCS_COMPATIBLE
1071  // Serialize the argument size
1072  _status = _logBuff.serializeFrom(
1073  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1074  );
1075  FW_ASSERT(
1076  _status == Fw::FW_SERIALIZE_OK,
1077  static_cast<FwAssertArgType>(_status)
1078  );
1079 #endif
1080  _status = _logBuff.serializeFrom(out_tb);
1081  FW_ASSERT(
1082  _status == Fw::FW_SERIALIZE_OK,
1083  static_cast<FwAssertArgType>(_status)
1084  );
1085 
1086 #if FW_AMPCS_COMPATIBLE
1087  // Serialize the argument size
1088  _status = _logBuff.serializeFrom(
1089  static_cast<U8>(sizeof(I64))
1090  );
1091  FW_ASSERT(
1092  _status == Fw::FW_SERIALIZE_OK,
1093  static_cast<FwAssertArgType>(_status)
1094  );
1095 #endif
1096  _status = _logBuff.serializeFrom(offset_us);
1097  FW_ASSERT(
1098  _status == Fw::FW_SERIALIZE_OK,
1099  static_cast<FwAssertArgType>(_status)
1100  );
1101 
1102 #if FW_AMPCS_COMPATIBLE
1103  // Serialize the argument size
1104  _status = _logBuff.serializeFrom(
1105  static_cast<U8>(sizeof(I64))
1106  );
1107  FW_ASSERT(
1108  _status == Fw::FW_SERIALIZE_OK,
1109  static_cast<FwAssertArgType>(_status)
1110  );
1111 #endif
1112  _status = _logBuff.serializeFrom(in_time_us);
1113  FW_ASSERT(
1114  _status == Fw::FW_SERIALIZE_OK,
1115  static_cast<FwAssertArgType>(_status)
1116  );
1117 
1118  this->eventOut_out(
1119  0,
1120  _id,
1121  _logTime,
1123  _logBuff
1124  );
1125  }
1126 
1127  // Emit the event on the text log port
1128 #if FW_ENABLE_TEXT_LOGGING
1129  if (this->isConnected_textEventOut_OutputPort(0)) {
1130 #if FW_OBJECT_NAMES == 1
1131  const char* _formatString =
1132  "(%s) %s: Conversion from %s to %s (offset %" PRIi64 " us) of time %" PRIi64 " us is out of range";
1133 #else
1134  const char* _formatString =
1135  "%s: Conversion from %s to %s (offset %" PRIi64 " us) of time %" PRIi64 " us is out of range";
1136 #endif
1137 
1138  Fw::String in_tbStr;
1139  in_tb.toString(in_tbStr);
1140  Fw::String out_tbStr;
1141  out_tb.toString(out_tbStr);
1142 
1143  Fw::TextLogString _logString;
1144  (void) _logString.format(
1145  _formatString,
1146 #if FW_OBJECT_NAMES == 1
1147  this->m_objName.toChar(),
1148 #endif
1149  "InvalidTime ",
1150  in_tbStr.toChar(),
1151  out_tbStr.toChar(),
1152  offset_us,
1153  in_time_us
1154  );
1155 
1156  this->textEventOut_out(
1157  0,
1158  _id,
1159  _logTime,
1161  _logString
1162  );
1163  }
1164 #endif
1165  }
1166 
1169  const TimeBase& from,
1170  const TimeBase& to,
1171  I64 offset_us
1172  ) const
1173  {
1174  // Get the time
1175  Fw::Time _logTime;
1176  if (this->isConnected_timeCaller_OutputPort(0)) {
1177  this->timeCaller_out(0, _logTime);
1178  }
1179 
1180  const FwEventIdType _id = this->getIdBase() + EVENTID_OFFSETSET;
1181 
1182  // Emit the event on the log port
1183  if (this->isConnected_eventOut_OutputPort(0)) {
1184  Fw::LogBuffer _logBuff;
1186 
1187 #if FW_AMPCS_COMPATIBLE
1188  // Serialize the number of arguments
1189  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1190  FW_ASSERT(
1191  _status == Fw::FW_SERIALIZE_OK,
1192  static_cast<FwAssertArgType>(_status)
1193  );
1194 #endif
1195 
1196 #if FW_AMPCS_COMPATIBLE
1197  // Serialize the argument size
1198  _status = _logBuff.serializeFrom(
1199  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1200  );
1201  FW_ASSERT(
1202  _status == Fw::FW_SERIALIZE_OK,
1203  static_cast<FwAssertArgType>(_status)
1204  );
1205 #endif
1206  _status = _logBuff.serializeFrom(from);
1207  FW_ASSERT(
1208  _status == Fw::FW_SERIALIZE_OK,
1209  static_cast<FwAssertArgType>(_status)
1210  );
1211 
1212 #if FW_AMPCS_COMPATIBLE
1213  // Serialize the argument size
1214  _status = _logBuff.serializeFrom(
1215  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1216  );
1217  FW_ASSERT(
1218  _status == Fw::FW_SERIALIZE_OK,
1219  static_cast<FwAssertArgType>(_status)
1220  );
1221 #endif
1222  _status = _logBuff.serializeFrom(to);
1223  FW_ASSERT(
1224  _status == Fw::FW_SERIALIZE_OK,
1225  static_cast<FwAssertArgType>(_status)
1226  );
1227 
1228 #if FW_AMPCS_COMPATIBLE
1229  // Serialize the argument size
1230  _status = _logBuff.serializeFrom(
1231  static_cast<U8>(sizeof(I64))
1232  );
1233  FW_ASSERT(
1234  _status == Fw::FW_SERIALIZE_OK,
1235  static_cast<FwAssertArgType>(_status)
1236  );
1237 #endif
1238  _status = _logBuff.serializeFrom(offset_us);
1239  FW_ASSERT(
1240  _status == Fw::FW_SERIALIZE_OK,
1241  static_cast<FwAssertArgType>(_status)
1242  );
1243 
1244  this->eventOut_out(
1245  0,
1246  _id,
1247  _logTime,
1249  _logBuff
1250  );
1251  }
1252 
1253  // Emit the event on the text log port
1254 #if FW_ENABLE_TEXT_LOGGING
1255  if (this->isConnected_textEventOut_OutputPort(0)) {
1256 #if FW_OBJECT_NAMES == 1
1257  const char* _formatString =
1258  "(%s) %s: Stored offset %s us from %s to %" PRIi64 "";
1259 #else
1260  const char* _formatString =
1261  "%s: Stored offset %s us from %s to %" PRIi64 "";
1262 #endif
1263 
1264  Fw::String fromStr;
1265  from.toString(fromStr);
1266  Fw::String toStr;
1267  to.toString(toStr);
1268 
1269  Fw::TextLogString _logString;
1270  (void) _logString.format(
1271  _formatString,
1272 #if FW_OBJECT_NAMES == 1
1273  this->m_objName.toChar(),
1274 #endif
1275  "OffsetSet ",
1276  fromStr.toChar(),
1277  toStr.toChar(),
1278  offset_us
1279  );
1280 
1281  this->textEventOut_out(
1282  0,
1283  _id,
1284  _logTime,
1286  _logString
1287  );
1288  }
1289 #endif
1290  }
1291 
1294  const TimeBase& from,
1295  const TimeBase& to,
1296  U32 capacity
1297  )
1298  {
1299  // Check throttle value
1300  if (this->m_OffsetTableFullThrottle >= EVENTID_OFFSETTABLEFULL_THROTTLE) {
1301  return;
1302  }
1303  else {
1304  this->m_OffsetTableFullThrottle++;
1305  }
1306 
1307  // Get the time
1308  Fw::Time _logTime;
1309  if (this->isConnected_timeCaller_OutputPort(0)) {
1310  this->timeCaller_out(0, _logTime);
1311  }
1312 
1313  const FwEventIdType _id = this->getIdBase() + EVENTID_OFFSETTABLEFULL;
1314 
1315  // Emit the event on the log port
1316  if (this->isConnected_eventOut_OutputPort(0)) {
1317  Fw::LogBuffer _logBuff;
1319 
1320 #if FW_AMPCS_COMPATIBLE
1321  // Serialize the number of arguments
1322  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1323  FW_ASSERT(
1324  _status == Fw::FW_SERIALIZE_OK,
1325  static_cast<FwAssertArgType>(_status)
1326  );
1327 #endif
1328 
1329 #if FW_AMPCS_COMPATIBLE
1330  // Serialize the argument size
1331  _status = _logBuff.serializeFrom(
1332  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1333  );
1334  FW_ASSERT(
1335  _status == Fw::FW_SERIALIZE_OK,
1336  static_cast<FwAssertArgType>(_status)
1337  );
1338 #endif
1339  _status = _logBuff.serializeFrom(from);
1340  FW_ASSERT(
1341  _status == Fw::FW_SERIALIZE_OK,
1342  static_cast<FwAssertArgType>(_status)
1343  );
1344 
1345 #if FW_AMPCS_COMPATIBLE
1346  // Serialize the argument size
1347  _status = _logBuff.serializeFrom(
1348  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1349  );
1350  FW_ASSERT(
1351  _status == Fw::FW_SERIALIZE_OK,
1352  static_cast<FwAssertArgType>(_status)
1353  );
1354 #endif
1355  _status = _logBuff.serializeFrom(to);
1356  FW_ASSERT(
1357  _status == Fw::FW_SERIALIZE_OK,
1358  static_cast<FwAssertArgType>(_status)
1359  );
1360 
1361 #if FW_AMPCS_COMPATIBLE
1362  // Serialize the argument size
1363  _status = _logBuff.serializeFrom(
1364  static_cast<U8>(sizeof(U32))
1365  );
1366  FW_ASSERT(
1367  _status == Fw::FW_SERIALIZE_OK,
1368  static_cast<FwAssertArgType>(_status)
1369  );
1370 #endif
1371  _status = _logBuff.serializeFrom(capacity);
1372  FW_ASSERT(
1373  _status == Fw::FW_SERIALIZE_OK,
1374  static_cast<FwAssertArgType>(_status)
1375  );
1376 
1377  this->eventOut_out(
1378  0,
1379  _id,
1380  _logTime,
1382  _logBuff
1383  );
1384  }
1385 
1386  // Emit the event on the text log port
1387 #if FW_ENABLE_TEXT_LOGGING
1388  if (this->isConnected_textEventOut_OutputPort(0)) {
1389 #if FW_OBJECT_NAMES == 1
1390  const char* _formatString =
1391  "(%s) %s: Cannot store offset from %s to %s: table is full at %" PRIu32 " entries";
1392 #else
1393  const char* _formatString =
1394  "%s: Cannot store offset from %s to %s: table is full at %" PRIu32 " entries";
1395 #endif
1396 
1397  Fw::String fromStr;
1398  from.toString(fromStr);
1399  Fw::String toStr;
1400  to.toString(toStr);
1401 
1402  Fw::TextLogString _logString;
1403  (void) _logString.format(
1404  _formatString,
1405 #if FW_OBJECT_NAMES == 1
1406  this->m_objName.toChar(),
1407 #endif
1408  "OffsetTableFull ",
1409  fromStr.toChar(),
1410  toStr.toChar(),
1411  capacity
1412  );
1413 
1414  this->textEventOut_out(
1415  0,
1416  _id,
1417  _logTime,
1419  _logString
1420  );
1421  }
1422 #endif
1423  }
1424 
1427  {
1428  // Get the time
1429  Fw::Time _logTime;
1430  if (this->isConnected_timeCaller_OutputPort(0)) {
1431  this->timeCaller_out(0, _logTime);
1432  }
1433 
1434  const FwEventIdType _id = this->getIdBase() + EVENTID_OFFSETSCLEARED;
1435 
1436  // Emit the event on the log port
1437  if (this->isConnected_eventOut_OutputPort(0)) {
1438  Fw::LogBuffer _logBuff;
1440 
1441 #if FW_AMPCS_COMPATIBLE
1442  // Serialize the number of arguments
1443  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1444  FW_ASSERT(
1445  _status == Fw::FW_SERIALIZE_OK,
1446  static_cast<FwAssertArgType>(_status)
1447  );
1448 #endif
1449 
1450 #if FW_AMPCS_COMPATIBLE
1451  // Serialize the argument size
1452  _status = _logBuff.serializeFrom(
1453  static_cast<U8>(sizeof(U32))
1454  );
1455  FW_ASSERT(
1456  _status == Fw::FW_SERIALIZE_OK,
1457  static_cast<FwAssertArgType>(_status)
1458  );
1459 #endif
1460  _status = _logBuff.serializeFrom(entries);
1461  FW_ASSERT(
1462  _status == Fw::FW_SERIALIZE_OK,
1463  static_cast<FwAssertArgType>(_status)
1464  );
1465 
1466  this->eventOut_out(
1467  0,
1468  _id,
1469  _logTime,
1471  _logBuff
1472  );
1473  }
1474 
1475  // Emit the event on the text log port
1476 #if FW_ENABLE_TEXT_LOGGING
1477  if (this->isConnected_textEventOut_OutputPort(0)) {
1478 #if FW_OBJECT_NAMES == 1
1479  const char* _formatString =
1480  "(%s) %s: Discarded %" PRIu32 " stored offsets";
1481 #else
1482  const char* _formatString =
1483  "%s: Discarded %" PRIu32 " stored offsets";
1484 #endif
1485 
1486  Fw::TextLogString _logString;
1487  (void) _logString.format(
1488  _formatString,
1489 #if FW_OBJECT_NAMES == 1
1490  this->m_objName.toChar(),
1491 #endif
1492  "OffsetsCleared ",
1493  entries
1494  );
1495 
1496  this->textEventOut_out(
1497  0,
1498  _id,
1499  _logTime,
1501  _logString
1502  );
1503  }
1504 #endif
1505  }
1506 
1509  const TimeBase& from,
1510  const TimeBase& to,
1511  I64 offset_us
1512  ) const
1513  {
1514  // Get the time
1515  Fw::Time _logTime;
1516  if (this->isConnected_timeCaller_OutputPort(0)) {
1517  this->timeCaller_out(0, _logTime);
1518  }
1519 
1520  const FwEventIdType _id = this->getIdBase() + EVENTID_OFFSETREPORT;
1521 
1522  // Emit the event on the log port
1523  if (this->isConnected_eventOut_OutputPort(0)) {
1524  Fw::LogBuffer _logBuff;
1526 
1527 #if FW_AMPCS_COMPATIBLE
1528  // Serialize the number of arguments
1529  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1530  FW_ASSERT(
1531  _status == Fw::FW_SERIALIZE_OK,
1532  static_cast<FwAssertArgType>(_status)
1533  );
1534 #endif
1535 
1536 #if FW_AMPCS_COMPATIBLE
1537  // Serialize the argument size
1538  _status = _logBuff.serializeFrom(
1539  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1540  );
1541  FW_ASSERT(
1542  _status == Fw::FW_SERIALIZE_OK,
1543  static_cast<FwAssertArgType>(_status)
1544  );
1545 #endif
1546  _status = _logBuff.serializeFrom(from);
1547  FW_ASSERT(
1548  _status == Fw::FW_SERIALIZE_OK,
1549  static_cast<FwAssertArgType>(_status)
1550  );
1551 
1552 #if FW_AMPCS_COMPATIBLE
1553  // Serialize the argument size
1554  _status = _logBuff.serializeFrom(
1555  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1556  );
1557  FW_ASSERT(
1558  _status == Fw::FW_SERIALIZE_OK,
1559  static_cast<FwAssertArgType>(_status)
1560  );
1561 #endif
1562  _status = _logBuff.serializeFrom(to);
1563  FW_ASSERT(
1564  _status == Fw::FW_SERIALIZE_OK,
1565  static_cast<FwAssertArgType>(_status)
1566  );
1567 
1568 #if FW_AMPCS_COMPATIBLE
1569  // Serialize the argument size
1570  _status = _logBuff.serializeFrom(
1571  static_cast<U8>(sizeof(I64))
1572  );
1573  FW_ASSERT(
1574  _status == Fw::FW_SERIALIZE_OK,
1575  static_cast<FwAssertArgType>(_status)
1576  );
1577 #endif
1578  _status = _logBuff.serializeFrom(offset_us);
1579  FW_ASSERT(
1580  _status == Fw::FW_SERIALIZE_OK,
1581  static_cast<FwAssertArgType>(_status)
1582  );
1583 
1584  this->eventOut_out(
1585  0,
1586  _id,
1587  _logTime,
1589  _logBuff
1590  );
1591  }
1592 
1593  // Emit the event on the text log port
1594 #if FW_ENABLE_TEXT_LOGGING
1595  if (this->isConnected_textEventOut_OutputPort(0)) {
1596 #if FW_OBJECT_NAMES == 1
1597  const char* _formatString =
1598  "(%s) %s: Offset from %s to %s is %" PRIi64 " us";
1599 #else
1600  const char* _formatString =
1601  "%s: Offset from %s to %s is %" PRIi64 " us";
1602 #endif
1603 
1604  Fw::String fromStr;
1605  from.toString(fromStr);
1606  Fw::String toStr;
1607  to.toString(toStr);
1608 
1609  Fw::TextLogString _logString;
1610  (void) _logString.format(
1611  _formatString,
1612 #if FW_OBJECT_NAMES == 1
1613  this->m_objName.toChar(),
1614 #endif
1615  "OffsetReport ",
1616  fromStr.toChar(),
1617  toStr.toChar(),
1618  offset_us
1619  );
1620 
1621  this->textEventOut_out(
1622  0,
1623  _id,
1624  _logTime,
1626  _logString
1627  );
1628  }
1629 #endif
1630  }
1631 
1634  const TimeBase& from,
1635  const TimeBase& to
1636  ) const
1637  {
1638  // Get the time
1639  Fw::Time _logTime;
1640  if (this->isConnected_timeCaller_OutputPort(0)) {
1641  this->timeCaller_out(0, _logTime);
1642  }
1643 
1644  const FwEventIdType _id = this->getIdBase() + EVENTID_NOOFFSETSTORED;
1645 
1646  // Emit the event on the log port
1647  if (this->isConnected_eventOut_OutputPort(0)) {
1648  Fw::LogBuffer _logBuff;
1650 
1651 #if FW_AMPCS_COMPATIBLE
1652  // Serialize the number of arguments
1653  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1654  FW_ASSERT(
1655  _status == Fw::FW_SERIALIZE_OK,
1656  static_cast<FwAssertArgType>(_status)
1657  );
1658 #endif
1659 
1660 #if FW_AMPCS_COMPATIBLE
1661  // Serialize the argument size
1662  _status = _logBuff.serializeFrom(
1663  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1664  );
1665  FW_ASSERT(
1666  _status == Fw::FW_SERIALIZE_OK,
1667  static_cast<FwAssertArgType>(_status)
1668  );
1669 #endif
1670  _status = _logBuff.serializeFrom(from);
1671  FW_ASSERT(
1672  _status == Fw::FW_SERIALIZE_OK,
1673  static_cast<FwAssertArgType>(_status)
1674  );
1675 
1676 #if FW_AMPCS_COMPATIBLE
1677  // Serialize the argument size
1678  _status = _logBuff.serializeFrom(
1679  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1680  );
1681  FW_ASSERT(
1682  _status == Fw::FW_SERIALIZE_OK,
1683  static_cast<FwAssertArgType>(_status)
1684  );
1685 #endif
1686  _status = _logBuff.serializeFrom(to);
1687  FW_ASSERT(
1688  _status == Fw::FW_SERIALIZE_OK,
1689  static_cast<FwAssertArgType>(_status)
1690  );
1691 
1692  this->eventOut_out(
1693  0,
1694  _id,
1695  _logTime,
1697  _logBuff
1698  );
1699  }
1700 
1701  // Emit the event on the text log port
1702 #if FW_ENABLE_TEXT_LOGGING
1703  if (this->isConnected_textEventOut_OutputPort(0)) {
1704 #if FW_OBJECT_NAMES == 1
1705  const char* _formatString =
1706  "(%s) %s: No offset stored from %s to %s";
1707 #else
1708  const char* _formatString =
1709  "%s: No offset stored from %s to %s";
1710 #endif
1711 
1712  Fw::String fromStr;
1713  from.toString(fromStr);
1714  Fw::String toStr;
1715  to.toString(toStr);
1716 
1717  Fw::TextLogString _logString;
1718  (void) _logString.format(
1719  _formatString,
1720 #if FW_OBJECT_NAMES == 1
1721  this->m_objName.toChar(),
1722 #endif
1723  "NoOffsetStored ",
1724  fromStr.toChar(),
1725  toStr.toChar()
1726  );
1727 
1728  this->textEventOut_out(
1729  0,
1730  _id,
1731  _logTime,
1733  _logString
1734  );
1735  }
1736 #endif
1737  }
1738 
1741  {
1742  // Get the time
1743  Fw::Time _logTime;
1744  if (this->isConnected_timeCaller_OutputPort(0)) {
1745  this->timeCaller_out(0, _logTime);
1746  }
1747 
1748  const FwEventIdType _id = this->getIdBase() + EVENTID_OFFSETTABLEEMPTY;
1749 
1750  // Emit the event on the log port
1751  if (this->isConnected_eventOut_OutputPort(0)) {
1752  Fw::LogBuffer _logBuff;
1753 
1754 #if FW_AMPCS_COMPATIBLE
1756  // Serialize the number of arguments
1757  _status = _logBuff.serializeFrom(static_cast<U8>(0));
1758  FW_ASSERT(
1759  _status == Fw::FW_SERIALIZE_OK,
1760  static_cast<FwAssertArgType>(_status)
1761  );
1762 #endif
1763 
1764  this->eventOut_out(
1765  0,
1766  _id,
1767  _logTime,
1769  _logBuff
1770  );
1771  }
1772 
1773  // Emit the event on the text log port
1774 #if FW_ENABLE_TEXT_LOGGING
1775  if (this->isConnected_textEventOut_OutputPort(0)) {
1776 #if FW_OBJECT_NAMES == 1
1777  const char* _formatString =
1778  "(%s) %s: No offsets are stored";
1779 #else
1780  const char* _formatString =
1781  "%s: No offsets are stored";
1782 #endif
1783 
1784  Fw::TextLogString _logString;
1785  (void) _logString.format(
1786  _formatString,
1787 #if FW_OBJECT_NAMES == 1
1788  this->m_objName.toChar(),
1789 #endif
1790  "OffsetTableEmpty "
1791  );
1792 
1793  this->textEventOut_out(
1794  0,
1795  _id,
1796  _logTime,
1798  _logString
1799  );
1800  }
1801 #endif
1802  }
1803 
1806  {
1807  // Check throttle value
1808  if (this->m_IdenticalTimeBasesThrottle >= EVENTID_IDENTICALTIMEBASES_THROTTLE) {
1809  return;
1810  }
1811  else {
1812  this->m_IdenticalTimeBasesThrottle++;
1813  }
1814 
1815  // Get the time
1816  Fw::Time _logTime;
1817  if (this->isConnected_timeCaller_OutputPort(0)) {
1818  this->timeCaller_out(0, _logTime);
1819  }
1820 
1821  const FwEventIdType _id = this->getIdBase() + EVENTID_IDENTICALTIMEBASES;
1822 
1823  // Emit the event on the log port
1824  if (this->isConnected_eventOut_OutputPort(0)) {
1825  Fw::LogBuffer _logBuff;
1827 
1828 #if FW_AMPCS_COMPATIBLE
1829  // Serialize the number of arguments
1830  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1831  FW_ASSERT(
1832  _status == Fw::FW_SERIALIZE_OK,
1833  static_cast<FwAssertArgType>(_status)
1834  );
1835 #endif
1836 
1837 #if FW_AMPCS_COMPATIBLE
1838  // Serialize the argument size
1839  _status = _logBuff.serializeFrom(
1840  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1841  );
1842  FW_ASSERT(
1843  _status == Fw::FW_SERIALIZE_OK,
1844  static_cast<FwAssertArgType>(_status)
1845  );
1846 #endif
1847  _status = _logBuff.serializeFrom(tb);
1848  FW_ASSERT(
1849  _status == Fw::FW_SERIALIZE_OK,
1850  static_cast<FwAssertArgType>(_status)
1851  );
1852 
1853  this->eventOut_out(
1854  0,
1855  _id,
1856  _logTime,
1858  _logBuff
1859  );
1860  }
1861 
1862  // Emit the event on the text log port
1863 #if FW_ENABLE_TEXT_LOGGING
1864  if (this->isConnected_textEventOut_OutputPort(0)) {
1865 #if FW_OBJECT_NAMES == 1
1866  const char* _formatString =
1867  "(%s) %s: Time base %s was supplied as both ends of an offset";
1868 #else
1869  const char* _formatString =
1870  "%s: Time base %s was supplied as both ends of an offset";
1871 #endif
1872 
1873  Fw::String tbStr;
1874  tb.toString(tbStr);
1875 
1876  Fw::TextLogString _logString;
1877  (void) _logString.format(
1878  _formatString,
1879 #if FW_OBJECT_NAMES == 1
1880  this->m_objName.toChar(),
1881 #endif
1882  "IdenticalTimeBases ",
1883  tbStr.toChar()
1884  );
1885 
1886  this->textEventOut_out(
1887  0,
1888  _id,
1889  _logTime,
1891  _logString
1892  );
1893  }
1894 #endif
1895  }
1896 
1899  const TimeBase& from,
1900  const TimeBase& to,
1901  I64 offset_us
1902  )
1903  {
1904  // Check throttle value
1905  if (this->m_OffsetOutOfRangeThrottle >= EVENTID_OFFSETOUTOFRANGE_THROTTLE) {
1906  return;
1907  }
1908  else {
1909  this->m_OffsetOutOfRangeThrottle++;
1910  }
1911 
1912  // Get the time
1913  Fw::Time _logTime;
1914  if (this->isConnected_timeCaller_OutputPort(0)) {
1915  this->timeCaller_out(0, _logTime);
1916  }
1917 
1918  const FwEventIdType _id = this->getIdBase() + EVENTID_OFFSETOUTOFRANGE;
1919 
1920  // Emit the event on the log port
1921  if (this->isConnected_eventOut_OutputPort(0)) {
1922  Fw::LogBuffer _logBuff;
1924 
1925 #if FW_AMPCS_COMPATIBLE
1926  // Serialize the number of arguments
1927  _status = _logBuff.serializeFrom(static_cast<U8>(3));
1928  FW_ASSERT(
1929  _status == Fw::FW_SERIALIZE_OK,
1930  static_cast<FwAssertArgType>(_status)
1931  );
1932 #endif
1933 
1934 #if FW_AMPCS_COMPATIBLE
1935  // Serialize the argument size
1936  _status = _logBuff.serializeFrom(
1937  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1938  );
1939  FW_ASSERT(
1940  _status == Fw::FW_SERIALIZE_OK,
1941  static_cast<FwAssertArgType>(_status)
1942  );
1943 #endif
1944  _status = _logBuff.serializeFrom(from);
1945  FW_ASSERT(
1946  _status == Fw::FW_SERIALIZE_OK,
1947  static_cast<FwAssertArgType>(_status)
1948  );
1949 
1950 #if FW_AMPCS_COMPATIBLE
1951  // Serialize the argument size
1952  _status = _logBuff.serializeFrom(
1953  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
1954  );
1955  FW_ASSERT(
1956  _status == Fw::FW_SERIALIZE_OK,
1957  static_cast<FwAssertArgType>(_status)
1958  );
1959 #endif
1960  _status = _logBuff.serializeFrom(to);
1961  FW_ASSERT(
1962  _status == Fw::FW_SERIALIZE_OK,
1963  static_cast<FwAssertArgType>(_status)
1964  );
1965 
1966 #if FW_AMPCS_COMPATIBLE
1967  // Serialize the argument size
1968  _status = _logBuff.serializeFrom(
1969  static_cast<U8>(sizeof(I64))
1970  );
1971  FW_ASSERT(
1972  _status == Fw::FW_SERIALIZE_OK,
1973  static_cast<FwAssertArgType>(_status)
1974  );
1975 #endif
1976  _status = _logBuff.serializeFrom(offset_us);
1977  FW_ASSERT(
1978  _status == Fw::FW_SERIALIZE_OK,
1979  static_cast<FwAssertArgType>(_status)
1980  );
1981 
1982  this->eventOut_out(
1983  0,
1984  _id,
1985  _logTime,
1987  _logBuff
1988  );
1989  }
1990 
1991  // Emit the event on the text log port
1992 #if FW_ENABLE_TEXT_LOGGING
1993  if (this->isConnected_textEventOut_OutputPort(0)) {
1994 #if FW_OBJECT_NAMES == 1
1995  const char* _formatString =
1996  "(%s) %s: Offset %s us from %s to %" PRIi64 " exceeds the representable time range";
1997 #else
1998  const char* _formatString =
1999  "%s: Offset %s us from %s to %" PRIi64 " exceeds the representable time range";
2000 #endif
2001 
2002  Fw::String fromStr;
2003  from.toString(fromStr);
2004  Fw::String toStr;
2005  to.toString(toStr);
2006 
2007  Fw::TextLogString _logString;
2008  (void) _logString.format(
2009  _formatString,
2010 #if FW_OBJECT_NAMES == 1
2011  this->m_objName.toChar(),
2012 #endif
2013  "OffsetOutOfRange ",
2014  fromStr.toChar(),
2015  toStr.toChar(),
2016  offset_us
2017  );
2018 
2019  this->textEventOut_out(
2020  0,
2021  _id,
2022  _logTime,
2024  _logString
2025  );
2026  }
2027 #endif
2028  }
2029 
2032  {
2033  // Check throttle value
2034  if (this->m_UnusableTimeBaseThrottle >= EVENTID_UNUSABLETIMEBASE_THROTTLE) {
2035  return;
2036  }
2037  else {
2038  this->m_UnusableTimeBaseThrottle++;
2039  }
2040 
2041  // Get the time
2042  Fw::Time _logTime;
2043  if (this->isConnected_timeCaller_OutputPort(0)) {
2044  this->timeCaller_out(0, _logTime);
2045  }
2046 
2047  const FwEventIdType _id = this->getIdBase() + EVENTID_UNUSABLETIMEBASE;
2048 
2049  // Emit the event on the log port
2050  if (this->isConnected_eventOut_OutputPort(0)) {
2051  Fw::LogBuffer _logBuff;
2053 
2054 #if FW_AMPCS_COMPATIBLE
2055  // Serialize the number of arguments
2056  _status = _logBuff.serializeFrom(static_cast<U8>(1));
2057  FW_ASSERT(
2058  _status == Fw::FW_SERIALIZE_OK,
2059  static_cast<FwAssertArgType>(_status)
2060  );
2061 #endif
2062 
2063 #if FW_AMPCS_COMPATIBLE
2064  // Serialize the argument size
2065  _status = _logBuff.serializeFrom(
2066  static_cast<U8>(TimeBase::SERIALIZED_SIZE)
2067  );
2068  FW_ASSERT(
2069  _status == Fw::FW_SERIALIZE_OK,
2070  static_cast<FwAssertArgType>(_status)
2071  );
2072 #endif
2073  _status = _logBuff.serializeFrom(tb);
2074  FW_ASSERT(
2075  _status == Fw::FW_SERIALIZE_OK,
2076  static_cast<FwAssertArgType>(_status)
2077  );
2078 
2079  this->eventOut_out(
2080  0,
2081  _id,
2082  _logTime,
2084  _logBuff
2085  );
2086  }
2087 
2088  // Emit the event on the text log port
2089 #if FW_ENABLE_TEXT_LOGGING
2090  if (this->isConnected_textEventOut_OutputPort(0)) {
2091 #if FW_OBJECT_NAMES == 1
2092  const char* _formatString =
2093  "(%s) %s: Time base %s denotes no clock and cannot be converted";
2094 #else
2095  const char* _formatString =
2096  "%s: Time base %s denotes no clock and cannot be converted";
2097 #endif
2098 
2099  Fw::String tbStr;
2100  tb.toString(tbStr);
2101 
2102  Fw::TextLogString _logString;
2103  (void) _logString.format(
2104  _formatString,
2105 #if FW_OBJECT_NAMES == 1
2106  this->m_objName.toChar(),
2107 #endif
2108  "UnusableTimeBase ",
2109  tbStr.toChar()
2110  );
2111 
2112  this->textEventOut_out(
2113  0,
2114  _id,
2115  _logTime,
2117  _logString
2118  );
2119  }
2120 #endif
2121  }
2122 
2123  // ----------------------------------------------------------------------
2124  // Event throttle reset functions
2125  // ----------------------------------------------------------------------
2126 
2129  {
2130  // Reset throttle counter
2131  this->m_NoConversionAvailableThrottle = 0;
2132  }
2133 
2136  {
2137  // Reset throttle counter
2138  this->m_InvalidTimeThrottle = 0;
2139  }
2140 
2143  {
2144  // Reset throttle counter
2145  this->m_OffsetTableFullThrottle = 0;
2146  }
2147 
2150  {
2151  // Reset throttle counter
2152  this->m_IdenticalTimeBasesThrottle = 0;
2153  }
2154 
2157  {
2158  // Reset throttle counter
2159  this->m_OffsetOutOfRangeThrottle = 0;
2160  }
2161 
2164  {
2165  // Reset throttle counter
2166  this->m_UnusableTimeBaseThrottle = 0;
2167  }
2168 
2169  // ----------------------------------------------------------------------
2170  // Time
2171  // ----------------------------------------------------------------------
2172 
2174  getTime() const
2175  {
2176  if (this->isConnected_timeCaller_OutputPort(0)) {
2177  Fw::Time _time;
2178  this->timeCaller_out(0, _time);
2179  return _time;
2180  }
2181  else {
2182  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2183  }
2184  }
2185 
2186  // ----------------------------------------------------------------------
2187  // Mutex operations for guarded ports
2188  //
2189  // You can override these operations to provide more sophisticated
2190  // synchronization
2191  // ----------------------------------------------------------------------
2192 
2195  {
2196  this->m_guardedPortMutex.lock();
2197  }
2198 
2201  {
2202  this->m_guardedPortMutex.unLock();
2203  }
2204 
2205  // ----------------------------------------------------------------------
2206  // Calls for messages received on special input ports
2207  // ----------------------------------------------------------------------
2208 
2209  void TimeConverterComponentBase ::
2210  m_p_cmdIn_in(
2211  Fw::PassiveComponentBase* callComp,
2212  FwIndexType portNum,
2213  FwOpcodeType opCode,
2214  U32 cmdSeq,
2215  Fw::CmdArgBuffer& args
2216  )
2217  {
2218  FW_ASSERT(callComp != nullptr);
2219  TimeConverterComponentBase* compPtr = static_cast<TimeConverterComponentBase*>(callComp);
2220  compPtr->cmdIn_handlerBase(
2221  portNum,
2222  opCode,
2223  cmdSeq,
2224  args
2225  );
2226  }
2227 
2228  // ----------------------------------------------------------------------
2229  // Calls for messages received on typed input ports
2230  // ----------------------------------------------------------------------
2231 
2232  Svc::ConvertTimeStatus TimeConverterComponentBase ::
2233  m_p_convertTime_in(
2234  Fw::PassiveComponentBase* callComp,
2235  FwIndexType portNum,
2236  const Fw::Time& in_time,
2237  Fw::Time& out_time
2238  )
2239  {
2240  FW_ASSERT(callComp != nullptr);
2241  TimeConverterComponentBase* compPtr = static_cast<TimeConverterComponentBase*>(callComp);
2242  return compPtr->convertTime_handlerBase(
2243  portNum,
2244  in_time,
2245  out_time
2246  );
2247  }
2248 
2249  void TimeConverterComponentBase ::
2250  m_p_offsetUpdate_in(
2251  Fw::PassiveComponentBase* callComp,
2252  FwIndexType portNum,
2253  const Svc::TimeOffset& offset
2254  )
2255  {
2256  FW_ASSERT(callComp != nullptr);
2257  TimeConverterComponentBase* compPtr = static_cast<TimeConverterComponentBase*>(callComp);
2258  compPtr->offsetUpdate_handlerBase(
2259  portNum,
2260  offset
2261  );
2262  }
2263 
2264 #if !FW_DIRECT_PORT_CALLS
2265 
2266  // ----------------------------------------------------------------------
2267  // Invocation functions for special output ports
2268  // ----------------------------------------------------------------------
2269 
2270  void TimeConverterComponentBase ::
2271  cmdRegOut_out(
2272  FwIndexType portNum,
2273  FwOpcodeType opCode
2274  ) const
2275  {
2276  FW_ASSERT(
2277  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
2278  static_cast<FwAssertArgType>(portNum)
2279  );
2280 
2281  FW_ASSERT(
2282  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
2283  static_cast<FwAssertArgType>(portNum)
2284  );
2285  this->m_cmdRegOut_OutputPort[portNum].invoke(
2286  opCode
2287  );
2288  }
2289 
2290  void TimeConverterComponentBase ::
2291  cmdResponseOut_out(
2292  FwIndexType portNum,
2293  FwOpcodeType opCode,
2294  U32 cmdSeq,
2295  const Fw::CmdResponse& response
2296  ) const
2297  {
2298  FW_ASSERT(
2299  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
2300  static_cast<FwAssertArgType>(portNum)
2301  );
2302 
2303  FW_ASSERT(
2304  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
2305  static_cast<FwAssertArgType>(portNum)
2306  );
2307  this->m_cmdResponseOut_OutputPort[portNum].invoke(
2308  opCode,
2309  cmdSeq,
2310  response
2311  );
2312  }
2313 
2314  void TimeConverterComponentBase ::
2315  eventOut_out(
2316  FwIndexType portNum,
2317  FwEventIdType id,
2318  Fw::Time& timeTag,
2319  const Fw::LogSeverity& severity,
2320  Fw::LogBuffer& args
2321  ) const
2322  {
2323  FW_ASSERT(
2324  (0 <= portNum) && (portNum < this->getNum_eventOut_OutputPorts()),
2325  static_cast<FwAssertArgType>(portNum)
2326  );
2327 
2328  FW_ASSERT(
2329  this->m_eventOut_OutputPort[portNum].isConnected(),
2330  static_cast<FwAssertArgType>(portNum)
2331  );
2332  this->m_eventOut_OutputPort[portNum].invoke(
2333  id,
2334  timeTag,
2335  severity,
2336  args
2337  );
2338  }
2339 
2340 #if FW_ENABLE_TEXT_LOGGING
2341 
2342  void TimeConverterComponentBase ::
2343  textEventOut_out(
2344  FwIndexType portNum,
2345  FwEventIdType id,
2346  Fw::Time& timeTag,
2347  const Fw::LogSeverity& severity,
2348  Fw::TextLogString& text
2349  ) const
2350  {
2351  FW_ASSERT(
2352  (0 <= portNum) && (portNum < this->getNum_textEventOut_OutputPorts()),
2353  static_cast<FwAssertArgType>(portNum)
2354  );
2355 
2356  FW_ASSERT(
2357  this->m_textEventOut_OutputPort[portNum].isConnected(),
2358  static_cast<FwAssertArgType>(portNum)
2359  );
2360  this->m_textEventOut_OutputPort[portNum].invoke(
2361  id,
2362  timeTag,
2363  severity,
2364  text
2365  );
2366  }
2367 
2368 #endif
2369 
2370  void TimeConverterComponentBase ::
2371  timeCaller_out(
2372  FwIndexType portNum,
2373  Fw::Time& time
2374  ) const
2375  {
2376  FW_ASSERT(
2377  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
2378  static_cast<FwAssertArgType>(portNum)
2379  );
2380 
2381  FW_ASSERT(
2382  this->m_timeCaller_OutputPort[portNum].isConnected(),
2383  static_cast<FwAssertArgType>(portNum)
2384  );
2385  this->m_timeCaller_OutputPort[portNum].invoke(
2386  time
2387  );
2388  }
2389 
2390 #endif
2391 
2392 }
void log_WARNING_LO_InvalidTime_ThrottleClear()
Reset throttle value for InvalidTime.
Serialization/Deserialization operation was successful.
void log_WARNING_LO_InvalidTime(const TimeBase &in_tb, const TimeBase &out_tb, I64 offset_us, I64 in_time_us)
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
No offset is stored for the requested pair of time bases.
void log_ACTIVITY_HI_OffsetReport(const TimeBase &from, const TimeBase &to, I64 offset_us) const
FwIdType FwOpcodeType
The type of a command opcode.
void init()
Initialization function.
virtual Svc::ConvertTimeStatus convertTime_handler(FwIndexType portNum, const Fw::Time &in_time, Fw::Time &out_time)=0
Handler for input port convertTime.
void log_WARNING_LO_IdenticalTimeBases_ThrottleClear()
Reset throttle value for IdenticalTimeBases.
I32 FwEnumStoreType
static constexpr FwIndexType getNum_offsetUpdate_InputPorts()
A time base that denotes no clock was supplied as an end of a pair.
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:41
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
Auto-generated base for TimeConverter component.
virtual void offsetUpdate_handler(FwIndexType portNum, const Svc::TimeOffset &offset)=0
Handler for input port offsetUpdate.
TimeConverterComponentBase(const char *compName="")
Construct TimeConverterComponentBase object.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void log_WARNING_HI_OffsetTableFull(const TimeBase &from, const TimeBase &to, U32 capacity)
static constexpr FwIndexType getNum_eventOut_OutputPorts()
Svc::InputTimeOffsetSendPort * get_offsetUpdate_InputPort(FwIndexType portNum)
void CLEAR_OFFSETS_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
bool isConnected_eventOut_OutputPort(FwIndexType portNum) const
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 set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void set_eventOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to eventOut[portNum].
void log_WARNING_HI_OffsetTableFull_ThrottleClear()
Reset throttle value for OffsetTableFull.
void init()
Initialization function.
An offset was stored for a pair of time bases by command.
Svc::ConvertTimeStatus convertTime_handlerBase(FwIndexType portNum, const Fw::Time &in_time, Fw::Time &out_time)
Handler base-class function for input port convertTime.
An offset was supplied for a single time base rather than a pair.
virtual void CLEAR_OFFSETS_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
virtual void unLock()
Unlock the guarded mutex.
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
virtual void DUMP_OFFSETS_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
FwIdType FwEventIdType
The type of an event identifier.
void log_WARNING_LO_NoConversionAvailable(const TimeBase &in_tb, const TimeBase &out_tb)
Conversion result is not representable as an Fw::Time.
virtual void SET_OFFSET_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const TimeBase &from, const TimeBase &to, I64 offset_us)=0
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
void init()
Initialization function.
Definition: TimePortAc.cpp:151
void log_WARNING_HI_UnusableTimeBase_ThrottleClear()
Reset throttle value for UnusableTimeBase.
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_convertTime_InputPorts()
void log_WARNING_HI_UnusableTimeBase(const TimeBase &tb)
A less serious but recoverable event.
An offset could not be stored because the offset table is full.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
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.
Report the offset stored for a pair of time bases as an event.
void log_WARNING_HI_OffsetOutOfRange(const TimeBase &from, const TimeBase &to, I64 offset_us)
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
A serious but recoverable event.
void DUMP_OFFSETS_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
void GET_OFFSET_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Result of a time base conversion.
No offset is stored for the requested pair of time bases.
#define PRI_FwIndexType
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
virtual void lock()
Lock the guarded mutex.
void regCommands()
Register commands with the Command Dispatcher.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void setPortNum(FwIndexType portNum)
void offsetUpdate_handlerBase(FwIndexType portNum, const Svc::TimeOffset &offset)
Handler base-class function for input port offsetUpdate.
void log_ACTIVITY_HI_OffsetsCleared(U32 entries) const
void log_ACTIVITY_HI_OffsetSet(const TimeBase &from, const TimeBase &to, I64 offset_us) const
void SET_OFFSET_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Command failed to deserialize.
virtual ~TimeConverterComponentBase()
Destroy TimeConverterComponentBase object.
static constexpr FwIndexType getNum_cmdIn_InputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Important informational events.
void log_WARNING_LO_NoConversionAvailable_ThrottleClear()
Reset throttle value for NoConversionAvailable.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
Svc::InputConvertTimePort * get_convertTime_InputPort(FwIndexType portNum)
The size of the serial representation.
PlatformIndexType FwIndexType
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
void init()
Initialization function.
RateGroupDivider component implementation.
An offset was rejected because no time can be shifted that far.
void log_WARNING_LO_IdenticalTimeBases(const TimeBase &tb)
Implementation of malloc based allocator.
void log_WARNING_HI_OffsetOutOfRange_ThrottleClear()
Reset throttle value for OffsetOutOfRange.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
virtual void GET_OFFSET_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const TimeBase &from, const TimeBase &to)=0
Set the offset between a pair of time bases.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
Define enumeration for Time base types.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
void log_WARNING_LO_NoOffsetStored(const TimeBase &from, const TimeBase &to) const