10#if FW_ENABLE_TEXT_LOGGING
32 class ComponentIpcSerializableBuffer :
42 MAX_DATA_SIZE =
sizeof(BuffUnion),
44 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
48 return sizeof(m_buff);
55 const U8* getBuffAddr()
const {
61 U8 m_buff[SERIALIZATION_SIZE];
70 void ActiveRateGroupComponentBase ::
82 port < static_cast<FwIndexType>(this->getNum_CycleIn_InputPorts());
85 this->m_CycleIn_InputPort[port].init();
86 this->m_CycleIn_InputPort[port].addCallComp(
90 this->m_CycleIn_InputPort[port].setPortNum(port);
92#if FW_OBJECT_NAMES == 1
96 this->m_objName.toChar(),
99 this->m_CycleIn_InputPort[port].setObjName(portName.
toChar());
106 port < static_cast<FwIndexType>(this->getNum_PingIn_InputPorts());
109 this->m_PingIn_InputPort[port].init();
110 this->m_PingIn_InputPort[port].addCallComp(
114 this->m_PingIn_InputPort[port].setPortNum(port);
116#if FW_OBJECT_NAMES == 1
120 this->m_objName.toChar(),
123 this->m_PingIn_InputPort[port].setObjName(portName.
toChar());
130 port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
133 this->m_Log_OutputPort[port].init();
135#if FW_OBJECT_NAMES == 1
139 this->m_objName.toChar(),
142 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
146#if FW_ENABLE_TEXT_LOGGING == 1
150 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
153 this->m_LogText_OutputPort[port].init();
155#if FW_OBJECT_NAMES == 1
159 this->m_objName.toChar(),
162 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
170 port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
173 this->m_Time_OutputPort[port].init();
175#if FW_OBJECT_NAMES == 1
179 this->m_objName.toChar(),
182 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
189 port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
192 this->m_Tlm_OutputPort[port].init();
194#if FW_OBJECT_NAMES == 1
198 this->m_objName.toChar(),
201 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
208 port < static_cast<FwIndexType>(this->getNum_PingOut_OutputPorts());
211 this->m_PingOut_OutputPort[port].init();
213#if FW_OBJECT_NAMES == 1
217 this->m_objName.toChar(),
220 this->m_PingOut_OutputPort[port].setObjName(portName.
toChar());
227 port < static_cast<FwIndexType>(this->getNum_RateGroupMemberOut_OutputPorts());
230 this->m_RateGroupMemberOut_OutputPort[port].init();
232#if FW_OBJECT_NAMES == 1
236 this->m_objName.toChar(),
239 this->m_RateGroupMemberOut_OutputPort[port].setObjName(portName.
toChar());
246 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
262 portNum < this->getNum_CycleIn_InputPorts(),
266 return &this->m_CycleIn_InputPort[portNum];
273 portNum < this->getNum_PingIn_InputPorts(),
277 return &this->m_PingIn_InputPort[portNum];
284 void ActiveRateGroupComponentBase ::
291 portNum < this->getNum_Log_OutputPorts(),
295 this->m_Log_OutputPort[portNum].addCallPort(port);
298#if FW_ENABLE_TEXT_LOGGING == 1
300 void ActiveRateGroupComponentBase ::
301 set_LogText_OutputPort(
307 portNum < this->getNum_LogText_OutputPorts(),
311 this->m_LogText_OutputPort[portNum].addCallPort(port);
316 void ActiveRateGroupComponentBase ::
323 portNum < this->getNum_Time_OutputPorts(),
327 this->m_Time_OutputPort[portNum].addCallPort(port);
330 void ActiveRateGroupComponentBase ::
337 portNum < this->getNum_Tlm_OutputPorts(),
341 this->m_Tlm_OutputPort[portNum].addCallPort(port);
348 void ActiveRateGroupComponentBase ::
349 set_PingOut_OutputPort(
355 portNum < this->getNum_PingOut_OutputPorts(),
359 this->m_PingOut_OutputPort[portNum].addCallPort(port);
362 void ActiveRateGroupComponentBase ::
363 set_RateGroupMemberOut_OutputPort(
369 portNum < this->getNum_RateGroupMemberOut_OutputPorts(),
373 this->m_RateGroupMemberOut_OutputPort[portNum].addCallPort(port);
376#if FW_PORT_SERIALIZATION
382 void ActiveRateGroupComponentBase ::
385 Fw::InputSerializePort* port
389 portNum < this->getNum_Log_OutputPorts(),
393 this->m_Log_OutputPort[portNum].registerSerialPort(port);
396#if FW_ENABLE_TEXT_LOGGING == 1
398 void ActiveRateGroupComponentBase ::
399 set_LogText_OutputPort(
401 Fw::InputSerializePort* port
405 portNum < this->getNum_LogText_OutputPorts(),
409 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
414 void ActiveRateGroupComponentBase ::
417 Fw::InputSerializePort* port
421 portNum < this->getNum_Time_OutputPorts(),
425 this->m_Time_OutputPort[portNum].registerSerialPort(port);
428 void ActiveRateGroupComponentBase ::
431 Fw::InputSerializePort* port
435 portNum < this->getNum_Tlm_OutputPorts(),
439 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
444#if FW_PORT_SERIALIZATION
450 void ActiveRateGroupComponentBase ::
451 set_PingOut_OutputPort(
453 Fw::InputSerializePort* port
457 portNum < this->getNum_PingOut_OutputPorts(),
461 this->m_PingOut_OutputPort[portNum].registerSerialPort(port);
464 void ActiveRateGroupComponentBase ::
465 set_RateGroupMemberOut_OutputPort(
467 Fw::InputSerializePort* port
471 portNum < this->getNum_RateGroupMemberOut_OutputPorts(),
475 this->m_RateGroupMemberOut_OutputPort[portNum].registerSerialPort(port);
484 ActiveRateGroupComponentBase ::
485 ActiveRateGroupComponentBase(
const char* compName) :
486 Fw::ActiveComponentBase(compName)
489 this->m_first_update_RgMaxTime =
true;
490 this->m_last_RgMaxTime = 0;
493 this->m_first_update_RgCycleSlips =
true;
494 this->m_last_RgCycleSlips = 0;
497 ActiveRateGroupComponentBase ::
498 ~ActiveRateGroupComponentBase()
508 getNum_CycleIn_InputPorts()
const
514 getNum_PingIn_InputPorts()
const
524 getNum_Log_OutputPorts()
const
529#if FW_ENABLE_TEXT_LOGGING == 1
532 getNum_LogText_OutputPorts()
const
540 getNum_Time_OutputPorts()
const
546 getNum_Tlm_OutputPorts()
const
556 getNum_PingOut_OutputPorts()
const
562 getNum_RateGroupMemberOut_OutputPorts()
const
571 bool ActiveRateGroupComponentBase ::
575 portNum < this->getNum_Log_OutputPorts(),
579 return this->m_Log_OutputPort[portNum].isConnected();
582#if FW_ENABLE_TEXT_LOGGING == 1
584 bool ActiveRateGroupComponentBase ::
585 isConnected_LogText_OutputPort(
FwIndexType portNum)
588 portNum < this->getNum_LogText_OutputPorts(),
592 return this->m_LogText_OutputPort[portNum].isConnected();
597 bool ActiveRateGroupComponentBase ::
601 portNum < this->getNum_Time_OutputPorts(),
605 return this->m_Time_OutputPort[portNum].isConnected();
608 bool ActiveRateGroupComponentBase ::
612 portNum < this->getNum_Tlm_OutputPorts(),
616 return this->m_Tlm_OutputPort[portNum].isConnected();
623 bool ActiveRateGroupComponentBase ::
624 isConnected_PingOut_OutputPort(
FwIndexType portNum)
627 portNum < this->getNum_PingOut_OutputPorts(),
631 return this->m_PingOut_OutputPort[portNum].isConnected();
634 bool ActiveRateGroupComponentBase ::
635 isConnected_RateGroupMemberOut_OutputPort(
FwIndexType portNum)
638 portNum < this->getNum_RateGroupMemberOut_OutputPorts(),
642 return this->m_RateGroupMemberOut_OutputPort[portNum].isConnected();
651 void ActiveRateGroupComponentBase ::
659 portNum < this->getNum_CycleIn_InputPorts(),
668 ComponentIpcSerializableBuffer msg;
672 _status = msg.serialize(
681 _status = msg.serialize(portNum);
688 _status = msg.serialize(cycleStart);
699 this->incNumMsgDropped();
709 void ActiveRateGroupComponentBase ::
717 portNum < this->getNum_PingIn_InputPorts(),
726 ComponentIpcSerializableBuffer msg;
730 _status = msg.serialize(
739 _status = msg.serialize(portNum);
746 _status = msg.serialize(key);
770 void ActiveRateGroupComponentBase ::
779 void ActiveRateGroupComponentBase ::
792 void ActiveRateGroupComponentBase ::
799 portNum < this->getNum_PingOut_OutputPorts(),
802 this->m_PingOut_OutputPort[portNum].invoke(
807 void ActiveRateGroupComponentBase ::
808 RateGroupMemberOut_out(
814 portNum < this->getNum_RateGroupMemberOut_OutputPorts(),
817 this->m_RateGroupMemberOut_OutputPort[portNum].invoke(
826 void ActiveRateGroupComponentBase ::
827 log_DIAGNOSTIC_RateGroupStarted()
const
831 if (this->m_Time_OutputPort[0].isConnected()) {
832 this->m_Time_OutputPort[0].invoke(_logTime);
837 _id = this->getIdBase() + EVENTID_RATEGROUPSTARTED;
840 if (this->m_Log_OutputPort[0].isConnected()) {
843#if FW_AMPCS_COMPATIBLE
853 this->m_Log_OutputPort[0].invoke(
862#if FW_ENABLE_TEXT_LOGGING
863 if (this->m_LogText_OutputPort[0].isConnected()) {
864#if FW_OBJECT_NAMES == 1
865 const char* _formatString =
866 "(%s) %s: Rate group started.";
868 const char* _formatString =
869 "%s: Rate group started.";
876 this->m_objName.toChar(),
881 this->m_LogText_OutputPort[0].invoke(
891 void ActiveRateGroupComponentBase ::
892 log_WARNING_HI_RateGroupCycleSlip(U32 cycle)
const
896 if (this->m_Time_OutputPort[0].isConnected()) {
897 this->m_Time_OutputPort[0].invoke(_logTime);
902 _id = this->getIdBase() + EVENTID_RATEGROUPCYCLESLIP;
905 if (this->m_Log_OutputPort[0].isConnected()) {
909#if FW_AMPCS_COMPATIBLE
918#if FW_AMPCS_COMPATIBLE
921 static_cast<U8>(
sizeof(U32))
934 this->m_Log_OutputPort[0].invoke(
943#if FW_ENABLE_TEXT_LOGGING
944 if (this->m_LogText_OutputPort[0].isConnected()) {
945#if FW_OBJECT_NAMES == 1
946 const char* _formatString =
947 "(%s) %s: Rate group cycle slipped on cycle %" PRIu32
"";
949 const char* _formatString =
950 "%s: Rate group cycle slipped on cycle %" PRIu32
"";
957 this->m_objName.toChar(),
959 "RateGroupCycleSlip ",
963 this->m_LogText_OutputPort[0].invoke(
977 void ActiveRateGroupComponentBase ::
984 if (not this->m_first_update_RgMaxTime) {
986 if (arg == this->m_last_RgMaxTime) {
990 this->m_last_RgMaxTime = arg;
994 this->m_first_update_RgMaxTime =
false;
995 this->m_last_RgMaxTime = arg;
998 if (this->m_Tlm_OutputPort[0].isConnected()) {
1000 this->m_Time_OutputPort[0].isConnected() &&
1003 this->m_Time_OutputPort[0].invoke(_tlmTime);
1015 _id = this->getIdBase() + CHANNELID_RGMAXTIME;
1017 this->m_Tlm_OutputPort[0].invoke(
1025 void ActiveRateGroupComponentBase ::
1026 tlmWrite_RgCycleSlips(
1032 if (not this->m_first_update_RgCycleSlips) {
1034 if (arg == this->m_last_RgCycleSlips) {
1038 this->m_last_RgCycleSlips = arg;
1042 this->m_first_update_RgCycleSlips =
false;
1043 this->m_last_RgCycleSlips = arg;
1046 if (this->m_Tlm_OutputPort[0].isConnected()) {
1048 this->m_Time_OutputPort[0].isConnected() &&
1051 this->m_Time_OutputPort[0].invoke(_tlmTime);
1063 _id = this->getIdBase() + CHANNELID_RGCYCLESLIPS;
1065 this->m_Tlm_OutputPort[0].invoke(
1080 if (this->m_Time_OutputPort[0].isConnected()) {
1082 this->m_Time_OutputPort[0].invoke(_time);
1097 ComponentIpcSerializableBuffer msg;
1120 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
1122 if (msgType == ACTIVERATEGROUP_COMPONENT_EXIT) {
1123 return MSG_DISPATCH_EXIT;
1127 deserStatus = msg.deserialize(portNum);
1135 case CYCLEIN_CYCLE: {
1138 deserStatus = msg.deserialize(cycleStart);
1144 this->CycleIn_handler(
1156 deserStatus = msg.deserialize(key);
1162 this->PingIn_handler(
1171 return MSG_DISPATCH_ERROR;
1174 return MSG_DISPATCH_OK;
1181 void ActiveRateGroupComponentBase ::
1189 ActiveRateGroupComponentBase* compPtr =
static_cast<ActiveRateGroupComponentBase*
>(callComp);
1190 compPtr->CycleIn_handlerBase(
1196 void ActiveRateGroupComponentBase ::
1204 ActiveRateGroupComponentBase* compPtr =
static_cast<ActiveRateGroupComponentBase*
>(callComp);
1205 compPtr->PingIn_handlerBase(
uint8_t U8
8-bit unsigned integer
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
BYTE PingInPortSize[Svc::InputPingPort::SERIALIZED_SIZE]
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
PlatformSizeType FwSizeType
PlatformQueuePriorityType FwQueuePriorityType
PlatformIndexType FwIndexType
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)/*#en...
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
@ WARNING_HI
A serious but recoverable event.
@ DIAGNOSTIC
Software diagnostic events.
void init()
Object initializer.
const char * toChar() const
NATIVE_UINT_TYPE SizeType
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void format(const CHAR *formatString,...)
write formatted string to buffer
@ BLOCKING
Message will block until space is available.
@ NONBLOCKING
Message will return with status when space is unavailable.
Status
status returned from the queue send function
@ FULL
queue was full when attempting to send a message
@ OP_OK
message sent/received okay
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.