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];
85 this->m_CycleIn_InputPort[port].
init();
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());
109 this->m_PingIn_InputPort[port].
init();
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());
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());
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());
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());
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());
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)
250 static_cast<FwAssertArgType>(qStat)
263 static_cast<FwAssertArgType>(portNum)
266 return &this->m_CycleIn_InputPort[portNum];
274 static_cast<FwAssertArgType>(portNum)
277 return &this->m_PingIn_InputPort[portNum];
292 static_cast<FwAssertArgType>(portNum)
298 #if FW_ENABLE_TEXT_LOGGING == 1 300 void ActiveRateGroupComponentBase ::
301 set_LogText_OutputPort(
307 portNum < this->getNum_LogText_OutputPorts(),
308 static_cast<FwAssertArgType>(portNum)
311 this->m_LogText_OutputPort[portNum].addCallPort(port);
324 static_cast<FwAssertArgType>(portNum)
327 this->m_Time_OutputPort[portNum].
addCallPort(port);
338 static_cast<FwAssertArgType>(portNum)
356 static_cast<FwAssertArgType>(portNum)
359 this->m_PingOut_OutputPort[portNum].
addCallPort(port);
370 static_cast<FwAssertArgType>(portNum)
373 this->m_RateGroupMemberOut_OutputPort[portNum].
addCallPort(port);
376 #if FW_PORT_SERIALIZATION 385 Fw::InputSerializePort* port
390 static_cast<FwAssertArgType>(portNum)
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(),
406 static_cast<FwAssertArgType>(portNum)
409 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
417 Fw::InputSerializePort* port
422 static_cast<FwAssertArgType>(portNum)
425 this->m_Time_OutputPort[portNum].registerSerialPort(port);
431 Fw::InputSerializePort* port
436 static_cast<FwAssertArgType>(portNum)
439 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
444 #if FW_PORT_SERIALIZATION 453 Fw::InputSerializePort* port
458 static_cast<FwAssertArgType>(portNum)
461 this->m_PingOut_OutputPort[portNum].registerSerialPort(port);
467 Fw::InputSerializePort* port
472 static_cast<FwAssertArgType>(portNum)
475 this->m_RateGroupMemberOut_OutputPort[portNum].registerSerialPort(port);
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;
529 #if FW_ENABLE_TEXT_LOGGING == 1 532 getNum_LogText_OutputPorts()
const 576 static_cast<FwAssertArgType>(portNum)
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(),
589 static_cast<FwAssertArgType>(portNum)
592 return this->m_LogText_OutputPort[portNum].isConnected();
602 static_cast<FwAssertArgType>(portNum)
605 return this->m_Time_OutputPort[portNum].
isConnected();
613 static_cast<FwAssertArgType>(portNum)
616 return this->m_Tlm_OutputPort[portNum].
isConnected();
628 static_cast<FwAssertArgType>(portNum)
631 return this->m_PingOut_OutputPort[portNum].
isConnected();
639 static_cast<FwAssertArgType>(portNum)
642 return this->m_RateGroupMemberOut_OutputPort[portNum].
isConnected();
660 static_cast<FwAssertArgType>(portNum)
668 ComponentIpcSerializableBuffer msg;
672 _status = msg.serialize(
673 static_cast<FwEnumStoreType>(CYCLEIN_CYCLE)
677 static_cast<FwAssertArgType>(_status)
681 _status = msg.serialize(portNum);
684 static_cast<FwAssertArgType>(_status)
688 _status = msg.serialize(cycleStart);
691 static_cast<FwAssertArgType>(_status)
698 if (qStatus == Os::Queue::Status::FULL) {
705 static_cast<FwAssertArgType>(qStatus)
718 static_cast<FwAssertArgType>(portNum)
726 ComponentIpcSerializableBuffer msg;
730 _status = msg.serialize(
731 static_cast<FwEnumStoreType>(PINGIN_PING)
735 static_cast<FwAssertArgType>(_status)
739 _status = msg.serialize(portNum);
742 static_cast<FwAssertArgType>(_status)
746 _status = msg.serialize(key);
749 static_cast<FwAssertArgType>(_status)
758 static_cast<FwAssertArgType>(qStatus)
800 static_cast<FwAssertArgType>(portNum)
802 this->m_PingOut_OutputPort[portNum].
invoke(
815 static_cast<FwAssertArgType>(portNum)
817 this->m_RateGroupMemberOut_OutputPort[portNum].
invoke(
831 if (this->m_Time_OutputPort[0].isConnected()) {
832 this->m_Time_OutputPort[0].
invoke(_logTime);
840 if (this->m_Log_OutputPort[0].isConnected()) {
843 #if FW_AMPCS_COMPATIBLE 846 _status = _logBuff.
serialize(static_cast<U8>(0));
849 static_cast<FwAssertArgType>(_status)
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(
896 if (this->m_Time_OutputPort[0].isConnected()) {
897 this->m_Time_OutputPort[0].
invoke(_logTime);
905 if (this->m_Log_OutputPort[0].isConnected()) {
909 #if FW_AMPCS_COMPATIBLE 911 _status = _logBuff.
serialize(static_cast<U8>(1));
914 static_cast<FwAssertArgType>(_status)
918 #if FW_AMPCS_COMPATIBLE 921 static_cast<U8>(
sizeof(U32))
925 static_cast<FwAssertArgType>(_status)
931 static_cast<FwAssertArgType>(_status)
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(
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);
1010 static_cast<FwAssertArgType>(_stat)
1017 this->m_Tlm_OutputPort[0].
invoke(
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);
1058 static_cast<FwAssertArgType>(_stat)
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;
1107 static_cast<FwAssertArgType>(msgStatus)
1117 static_cast<FwAssertArgType>(deserStatus)
1120 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
1122 if (msgType == ACTIVERATEGROUP_COMPONENT_EXIT) {
1127 deserStatus = msg.deserialize(portNum);
1130 static_cast<FwAssertArgType>(deserStatus)
1135 case CYCLEIN_CYCLE: {
1138 deserStatus = msg.deserialize(cycleStart);
1141 static_cast<FwAssertArgType>(deserStatus)
1156 deserStatus = msg.deserialize(key);
1159 static_cast<FwAssertArgType>(deserStatus)
1181 void ActiveRateGroupComponentBase ::
1190 compPtr->CycleIn_handlerBase(
1196 void ActiveRateGroupComponentBase ::
1205 compPtr->PingIn_handlerBase(
void set_PingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to PingOut[portNum].
Serialization/Deserialization operation was successful.
void addCallPort(InputTimePort *callPort)
Register an input port.
void tlmWrite_RgCycleSlips(U32 arg, Fw::Time _tlmTime=Fw::Time())
FwIndexType getNum_Time_OutputPorts() const
void CycleIn_handlerBase(FwIndexType portNum, Os::RawTime &cycleStart)
Handler base-class function for input port CycleIn.
void PingOut_out(FwIndexType portNum, U32 key)
Invoke output port PingOut.
NATIVE_UINT_TYPE SizeType
Status
status returned from the queue send function
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
FwIndexType getNum_PingOut_OutputPorts() const
PlatformSizeType FwSizeType
void invoke(U32 key) const
Invoke a port interface.
FwIndexType getNum_PingIn_InputPorts() const
virtual void PingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port PingIn.
virtual ~ActiveRateGroupComponentBase()
Destroy ActiveRateGroupComponentBase object.
void init()
Initialization function.
Warning event that rate group has had a cycle slip.
bool isConnected_Time_OutputPort(FwIndexType portNum)
PlatformIndexType FwIndexType
BYTE PingInPortSize[Svc::InputPingPort::SERIALIZED_SIZE]
Os::Queue m_queue
queue object for active component
Software diagnostic events.
virtual void CycleIn_preMsgHook(FwIndexType portNum, Os::RawTime &cycleStart)
Pre-message hook for async input port CycleIn.
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Object initializer.
ActiveRateGroupComponentBase(const char *compName="")
Construct ActiveRateGroupComponentBase object.
SerializeStatus
forward declaration for string
void set_RateGroupMemberOut_OutputPort(FwIndexType portNum, Svc::InputSchedPort *port)
Connect port to RateGroupMemberOut[portNum].
Message will block until space is available.
void init()
Initialization function.
bool isConnected_Log_OutputPort(FwIndexType portNum)
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
Channel ID for RgMaxTime.
void invoke(U32 context) const
Invoke a port interface.
void init()
Initialization function.
void invoke(Fw::Time &time) const
Invoke a port interface.
const char * toChar() const
No time base has been established.
void addCallPort(InputPingPort *callPort)
Register an input port.
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
void log_DIAGNOSTIC_RateGroupStarted() const
FwIndexType getNum_RateGroupMemberOut_OutputPorts() const
FwIndexType getNum_Tlm_OutputPorts() const
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void tlmWrite_RgMaxTime(U32 arg, Fw::Time _tlmTime=Fw::Time())
A serious but recoverable event.
Errors dispatching messages.
Channel ID for RgCycleSlips.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
void init()
Initialization function.
uint8_t U8
8-bit unsigned integer
#define PRI_PlatformIntType
void log_WARNING_HI_RateGroupCycleSlip(U32 cycle) const
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
PlatformQueuePriorityType FwQueuePriorityType
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
bool isConnected_RateGroupMemberOut_OutputPort(FwIndexType portNum)
message to exit active component task
virtual void CycleIn_handler(FwIndexType portNum, Os::RawTime &cycleStart)=0
Handler for input port CycleIn.
A message was sent requesting an exit of the loop.
FwIndexType getNum_CycleIn_InputPorts() const
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
void addCallPort(InputLogPort *callPort)
Register an input port.
void init()
Initialization function.
void incNumMsgDropped()
increment the number of messages dropped
Svc::InputPingPort * get_PingIn_InputPort(FwIndexType portNum)
virtual void PingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port PingIn.
message sent/received okay
Informational event that rate group has started.
FwIndexType getNum_Log_OutputPorts() const
bool isConnected_PingOut_OutputPort(FwIndexType portNum)
Message will return with status when space is unavailable.
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Svc::InputCyclePort * get_CycleIn_InputPort(FwIndexType portNum)
void RateGroupMemberOut_out(FwIndexType portNum, U32 context)
Invoke output port RateGroupMemberOut.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void PingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port PingIn.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
void addCallPort(InputSchedPort *callPort)
Register an input port.