9 #if FW_ENABLE_TEXT_LOGGING 32 class ComponentIpcSerializableBuffer :
42 MAX_DATA_SIZE =
sizeof(BuffUnion),
44 SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
47 ComponentIpcSerializableBuffer() :
Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
53 U8 m_buff[SERIALIZATION_SIZE];
71 #if !FW_DIRECT_PORT_CALLS 78 this->m_CycleIn_InputPort[port].
init();
83 this->m_CycleIn_InputPort[port].
setPortNum(port);
85 #if FW_OBJECT_NAMES == 1 89 this->m_objName.toChar(),
92 this->m_CycleIn_InputPort[port].setObjName(portName.
toChar());
97 #if !FW_DIRECT_PORT_CALLS 104 this->m_PingIn_InputPort[port].
init();
109 this->m_PingIn_InputPort[port].
setPortNum(port);
111 #if FW_OBJECT_NAMES == 1 115 this->m_objName.toChar(),
118 this->m_PingIn_InputPort[port].setObjName(portName.
toChar());
123 #if !FW_DIRECT_PORT_CALLS 130 this->m_Log_OutputPort[port].
init();
132 #if FW_OBJECT_NAMES == 1 136 this->m_objName.toChar(),
139 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
144 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING 148 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
151 this->m_LogText_OutputPort[port].
init();
153 #if FW_OBJECT_NAMES == 1 157 this->m_objName.toChar(),
160 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
165 #if !FW_DIRECT_PORT_CALLS 172 this->m_Time_OutputPort[port].
init();
174 #if FW_OBJECT_NAMES == 1 178 this->m_objName.toChar(),
181 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
186 #if !FW_DIRECT_PORT_CALLS 193 this->m_Tlm_OutputPort[port].
init();
195 #if FW_OBJECT_NAMES == 1 199 this->m_objName.toChar(),
202 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
207 #if !FW_DIRECT_PORT_CALLS 214 this->m_PingOut_OutputPort[port].
init();
216 #if FW_OBJECT_NAMES == 1 220 this->m_objName.toChar(),
223 this->m_PingOut_OutputPort[port].setObjName(portName.
toChar());
228 #if !FW_DIRECT_PORT_CALLS 235 this->m_RateGroupMemberOut_OutputPort[port].
init();
237 #if FW_OBJECT_NAMES == 1 241 this->m_objName.toChar(),
244 this->m_RateGroupMemberOut_OutputPort[port].setObjName(portName.
toChar());
252 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
256 static_cast<FwAssertArgType>(qStat)
260 #if !FW_DIRECT_PORT_CALLS 271 static_cast<FwAssertArgType>(portNum)
274 return &this->m_CycleIn_InputPort[portNum];
282 static_cast<FwAssertArgType>(portNum)
285 return &this->m_PingIn_InputPort[portNum];
290 #if !FW_DIRECT_PORT_CALLS 304 static_cast<FwAssertArgType>(portNum)
310 #if FW_ENABLE_TEXT_LOGGING == 1 312 void ActiveRateGroupComponentBase ::
313 set_LogText_OutputPort(
319 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
320 static_cast<FwAssertArgType>(portNum)
323 this->m_LogText_OutputPort[portNum].addCallPort(port);
336 static_cast<FwAssertArgType>(portNum)
339 this->m_Time_OutputPort[portNum].
addCallPort(port);
350 static_cast<FwAssertArgType>(portNum)
358 #if !FW_DIRECT_PORT_CALLS 372 static_cast<FwAssertArgType>(portNum)
375 this->m_PingOut_OutputPort[portNum].
addCallPort(port);
386 static_cast<FwAssertArgType>(portNum)
389 this->m_RateGroupMemberOut_OutputPort[portNum].
addCallPort(port);
394 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 403 Fw::InputSerializePort* port
408 static_cast<FwAssertArgType>(portNum)
411 this->m_Log_OutputPort[portNum].registerSerialPort(port);
414 #if FW_ENABLE_TEXT_LOGGING == 1 416 void ActiveRateGroupComponentBase ::
417 set_LogText_OutputPort(
419 Fw::InputSerializePort* port
423 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
424 static_cast<FwAssertArgType>(portNum)
427 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
435 Fw::InputSerializePort* port
440 static_cast<FwAssertArgType>(portNum)
443 this->m_Time_OutputPort[portNum].registerSerialPort(port);
449 Fw::InputSerializePort* port
454 static_cast<FwAssertArgType>(portNum)
457 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
462 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 471 Fw::InputSerializePort* port
476 static_cast<FwAssertArgType>(portNum)
479 this->m_PingOut_OutputPort[portNum].registerSerialPort(port);
485 Fw::InputSerializePort* port
490 static_cast<FwAssertArgType>(portNum)
493 this->m_RateGroupMemberOut_OutputPort[portNum].registerSerialPort(port);
504 Fw::ActiveComponentBase(compName)
506 this->m_RateGroupTimeGetErrorThrottle = 0;
515 #if !FW_DIRECT_PORT_CALLS 526 static_cast<FwAssertArgType>(portNum)
529 return this->m_Log_OutputPort[portNum].
isConnected();
532 #if FW_ENABLE_TEXT_LOGGING == 1 534 bool ActiveRateGroupComponentBase ::
535 isConnected_LogText_OutputPort(
FwIndexType portNum)
const 538 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
539 static_cast<FwAssertArgType>(portNum)
542 return this->m_LogText_OutputPort[portNum].isConnected();
552 static_cast<FwAssertArgType>(portNum)
555 return this->m_Time_OutputPort[portNum].
isConnected();
563 static_cast<FwAssertArgType>(portNum)
566 return this->m_Tlm_OutputPort[portNum].
isConnected();
571 #if !FW_DIRECT_PORT_CALLS 582 static_cast<FwAssertArgType>(portNum)
585 return this->m_PingOut_OutputPort[portNum].
isConnected();
593 static_cast<FwAssertArgType>(portNum)
596 return this->m_RateGroupMemberOut_OutputPort[portNum].
isConnected();
616 static_cast<FwAssertArgType>(portNum)
624 ComponentIpcSerializableBuffer msg;
628 _status = msg.serializeFrom(
629 static_cast<FwEnumStoreType>(CYCLEIN_CYCLE)
633 static_cast<FwAssertArgType>(_status)
637 _status = msg.serializeFrom(portNum);
640 static_cast<FwAssertArgType>(_status)
644 _status = msg.serializeFrom(cycleStart);
647 static_cast<FwAssertArgType>(_status)
654 if (qStatus == Os::Queue::Status::FULL) {
661 static_cast<FwAssertArgType>(qStatus)
674 static_cast<FwAssertArgType>(portNum)
682 ComponentIpcSerializableBuffer msg;
686 _status = msg.serializeFrom(
687 static_cast<FwEnumStoreType>(PINGIN_PING)
691 static_cast<FwAssertArgType>(_status)
695 _status = msg.serializeFrom(portNum);
698 static_cast<FwAssertArgType>(_status)
702 _status = msg.serializeFrom(key);
705 static_cast<FwAssertArgType>(_status)
712 if (qStatus == Os::Queue::Status::FULL) {
719 static_cast<FwAssertArgType>(qStatus)
749 #if !FW_DIRECT_PORT_CALLS 763 static_cast<FwAssertArgType>(portNum)
767 this->m_PingOut_OutputPort[portNum].isConnected(),
768 static_cast<FwAssertArgType>(portNum)
770 this->m_PingOut_OutputPort[portNum].
invoke(
783 static_cast<FwAssertArgType>(portNum)
787 this->m_RateGroupMemberOut_OutputPort[portNum].isConnected(),
788 static_cast<FwAssertArgType>(portNum)
790 this->m_RateGroupMemberOut_OutputPort[portNum].
invoke(
807 this->Time_out(0, _logTime);
816 #if FW_AMPCS_COMPATIBLE 822 static_cast<FwAssertArgType>(_status)
836 #if FW_ENABLE_TEXT_LOGGING 837 if (this->isConnected_LogText_OutputPort(0)) {
838 #if FW_OBJECT_NAMES == 1 839 const char* _formatString =
840 "(%s) %s: Rate group started.";
842 const char* _formatString =
843 "%s: Rate group started.";
850 this->m_objName.toChar(),
872 this->Time_out(0, _logTime);
882 #if FW_AMPCS_COMPATIBLE 887 static_cast<FwAssertArgType>(_status)
891 #if FW_AMPCS_COMPATIBLE 894 static_cast<U8>(
sizeof(U32))
898 static_cast<FwAssertArgType>(_status)
904 static_cast<FwAssertArgType>(_status)
917 #if FW_ENABLE_TEXT_LOGGING 918 if (this->isConnected_LogText_OutputPort(0)) {
919 #if FW_OBJECT_NAMES == 1 920 const char* _formatString =
921 "(%s) %s: Rate group cycle slipped on cycle %" PRIu32
"";
923 const char* _formatString =
924 "%s: Rate group cycle slipped on cycle %" PRIu32
"";
931 this->m_objName.toChar(),
933 "RateGroupCycleSlip ",
956 this->m_RateGroupTimeGetErrorThrottle++;
962 this->Time_out(0, _logTime);
972 #if FW_AMPCS_COMPATIBLE 977 static_cast<FwAssertArgType>(_status)
981 #if FW_AMPCS_COMPATIBLE 988 static_cast<FwAssertArgType>(_status)
994 static_cast<FwAssertArgType>(_status)
1007 #if FW_ENABLE_TEXT_LOGGING 1008 if (this->isConnected_LogText_OutputPort(0)) {
1009 #if FW_OBJECT_NAMES == 1 1010 const char* _formatString =
1011 "(%s) %s: Rate group failed to read cycle end time with status %s";
1013 const char* _formatString =
1014 "%s: Rate group failed to read cycle end time with status %s";
1018 status.toString(statusStr);
1021 (void) _logString.
format(
1024 this->m_objName.toChar(),
1026 "RateGroupTimeGetError ",
1049 this->m_RateGroupTimeGetErrorThrottle = 0;
1068 this->Time_out(0, _tlmTime);
1094 if (not this->m_first_update_RgMaxTime) {
1096 if (arg == this->m_last_RgMaxTime) {
1100 this->m_last_RgMaxTime = arg;
1104 this->m_first_update_RgMaxTime =
false;
1105 this->m_last_RgMaxTime = arg;
1113 static_cast<FwAssertArgType>(_stat)
1131 if (not this->m_first_update_RgCycleSlips) {
1133 if (arg == this->m_last_RgCycleSlips) {
1137 this->m_last_RgCycleSlips = arg;
1141 this->m_first_update_RgCycleSlips =
false;
1142 this->m_last_RgCycleSlips = arg;
1150 static_cast<FwAssertArgType>(_stat)
1170 this->Time_out(0, _time);
1185 ComponentIpcSerializableBuffer _msg;
1195 static_cast<FwAssertArgType>(_msgStatus)
1205 static_cast<FwAssertArgType>(_deserStatus)
1208 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
1210 if (_msgType == ACTIVERATEGROUP_COMPONENT_EXIT) {
1215 _deserStatus = _msg.deserializeTo(portNum);
1218 static_cast<FwAssertArgType>(_deserStatus)
1223 case CYCLEIN_CYCLE: {
1226 _deserStatus = _msg.deserializeTo(cycleStart);
1229 static_cast<FwAssertArgType>(_deserStatus)
1244 _deserStatus = _msg.deserializeTo(key);
1247 static_cast<FwAssertArgType>(_deserStatus)
1269 void ActiveRateGroupComponentBase ::
1278 compPtr->CycleIn_handlerBase(
1284 void ActiveRateGroupComponentBase ::
1293 compPtr->PingIn_handlerBase(
1299 #if !FW_DIRECT_PORT_CALLS 1305 void ActiveRateGroupComponentBase ::
1316 static_cast<FwAssertArgType>(portNum)
1320 this->m_Log_OutputPort[portNum].isConnected(),
1321 static_cast<FwAssertArgType>(portNum)
1323 this->m_Log_OutputPort[portNum].
invoke(
1331 #if FW_ENABLE_TEXT_LOGGING 1333 void ActiveRateGroupComponentBase ::
1343 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
1344 static_cast<FwAssertArgType>(portNum)
1348 this->m_LogText_OutputPort[portNum].isConnected(),
1349 static_cast<FwAssertArgType>(portNum)
1351 this->m_LogText_OutputPort[portNum].invoke(
1361 void ActiveRateGroupComponentBase ::
1369 static_cast<FwAssertArgType>(portNum)
1373 this->m_Time_OutputPort[portNum].isConnected(),
1374 static_cast<FwAssertArgType>(portNum)
1376 this->m_Time_OutputPort[portNum].
invoke(
1381 void ActiveRateGroupComponentBase ::
1391 static_cast<FwAssertArgType>(portNum)
1395 this->m_Tlm_OutputPort[portNum].isConnected(),
1396 static_cast<FwAssertArgType>(portNum)
1398 this->m_Tlm_OutputPort[portNum].
invoke(
void set_PingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to PingOut[portNum].
Serialization/Deserialization operation was successful.
Warning event that reading the cycle end time failed.
void addCallPort(InputTimePort *callPort)
Register an input port.
message to exit active component task
void tlmWrite_RgCycleSlips(U32 arg, Fw::Time _tlmTime=Fw::Time())
FPP shadow-enum representing Os::RawTime::Status.
FwIdType getIdBase() const
PlatformSizeType FwSizeType
static constexpr FwIndexType getNum_PingIn_InputPorts()
static constexpr FwIndexType getNum_RateGroupMemberOut_OutputPorts()
void CycleIn_handlerBase(FwIndexType portNum, Os::RawTime &cycleStart)
Handler base-class function for input port CycleIn.
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
static constexpr FwIndexType getNum_Log_OutputPorts()
Status
status returned from the queue send function
void log_WARNING_HI_RateGroupTimeGetError(const Os::RawTimeStatus &status)
void PingOut_out(FwIndexType portNum, U32 key) const
Invoke output port PingOut.
bool isConnected_Tlm_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_Time_OutputPorts()
void invoke(U32 key) const
Invoke a port connection.
virtual void PingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port PingIn.
virtual ~ActiveRateGroupComponentBase()
Destroy ActiveRateGroupComponentBase object.
Warning event that rate group has had a cycle slip.
void init()
Initialization function.
No time base has been established (Required)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
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
bool isConnected_Time_OutputPort(FwIndexType portNum) const
void set_RateGroupMemberOut_OutputPort(FwIndexType portNum, Svc::InputSchedPort *port)
Connect port to RateGroupMemberOut[portNum].
Message will block until space is available.
FwIdType FwEventIdType
The type of an event identifier.
bool isConnected_PingOut_OutputPort(FwIndexType portNum) const
The size of the serial representation.
static constexpr FwSizeType CAPACITY
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
void init()
Initialization function.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
void log_WARNING_HI_RateGroupTimeGetError_ThrottleClear()
Reset throttle value for RateGroupTimeGetError.
void invoke(U32 context) const
Invoke a port connection.
void init()
Initialization function.
void invoke(Fw::Time &time) const
Invoke a port connection.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
Throttle reset count for RateGroupTimeGetError.
static constexpr FwIndexType getNum_PingOut_OutputPorts()
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
void tlmWrite_RgMaxTime(U32 arg, Fw::Time _tlmTime=Fw::Time())
A serious but recoverable event.
Errors dispatching messages.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
const char * toChar() const
Convert to a C-style char*.
Enum representing event severity.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
void init()
Initialization function.
uint8_t U8
8-bit unsigned integer
bool isConnected_Log_OutputPort(FwIndexType portNum) const
void RateGroupMemberOut_out(FwIndexType portNum, U32 context) const
Invoke output port RateGroupMemberOut.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
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 connection.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
static constexpr FwSizeType CAPACITY
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.
PlatformIndexType FwIndexType
Channel ID for RgCycleSlips.
static constexpr FwIndexType getNum_Tlm_OutputPorts()
void addCallPort(InputLogPort *callPort)
Register an input port.
void init()
Initialization function.
static constexpr FwIndexType getNum_CycleIn_InputPorts()
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
void incNumMsgDropped()
increment the number of messages dropped
Svc::InputPingPort * get_PingIn_InputPort(FwIndexType portNum)
RateGroupDivider component implementation.
virtual void PingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port PingIn.
message sent/received okay
Message will return with status when space is unavailable.
bool isConnected_RateGroupMemberOut_OutputPort(FwIndexType portNum) const
Implementation of malloc based allocator.
Svc::InputCyclePort * get_CycleIn_InputPort(FwIndexType portNum)
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.
Channel ID for RgMaxTime.
void addCallPort(InputSchedPort *callPort)
Register an input port.
Informational event that rate group has started.