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)
714 static_cast<FwAssertArgType>(qStatus)
744 #if !FW_DIRECT_PORT_CALLS 758 static_cast<FwAssertArgType>(portNum)
762 this->m_PingOut_OutputPort[portNum].isConnected(),
763 static_cast<FwAssertArgType>(portNum)
765 this->m_PingOut_OutputPort[portNum].
invoke(
778 static_cast<FwAssertArgType>(portNum)
782 this->m_RateGroupMemberOut_OutputPort[portNum].isConnected(),
783 static_cast<FwAssertArgType>(portNum)
785 this->m_RateGroupMemberOut_OutputPort[portNum].
invoke(
802 this->Time_out(0, _logTime);
811 #if FW_AMPCS_COMPATIBLE 817 static_cast<FwAssertArgType>(_status)
831 #if FW_ENABLE_TEXT_LOGGING 832 if (this->isConnected_LogText_OutputPort(0)) {
833 #if FW_OBJECT_NAMES == 1 834 const char* _formatString =
835 "(%s) %s: Rate group started.";
837 const char* _formatString =
838 "%s: Rate group started.";
845 this->m_objName.toChar(),
867 this->Time_out(0, _logTime);
877 #if FW_AMPCS_COMPATIBLE 882 static_cast<FwAssertArgType>(_status)
886 #if FW_AMPCS_COMPATIBLE 889 static_cast<U8>(
sizeof(U32))
893 static_cast<FwAssertArgType>(_status)
899 static_cast<FwAssertArgType>(_status)
912 #if FW_ENABLE_TEXT_LOGGING 913 if (this->isConnected_LogText_OutputPort(0)) {
914 #if FW_OBJECT_NAMES == 1 915 const char* _formatString =
916 "(%s) %s: Rate group cycle slipped on cycle %" PRIu32
"";
918 const char* _formatString =
919 "%s: Rate group cycle slipped on cycle %" PRIu32
"";
926 this->m_objName.toChar(),
928 "RateGroupCycleSlip ",
951 this->m_RateGroupTimeGetErrorThrottle++;
957 this->Time_out(0, _logTime);
967 #if FW_AMPCS_COMPATIBLE 972 static_cast<FwAssertArgType>(_status)
976 #if FW_AMPCS_COMPATIBLE 983 static_cast<FwAssertArgType>(_status)
989 static_cast<FwAssertArgType>(_status)
1002 #if FW_ENABLE_TEXT_LOGGING 1003 if (this->isConnected_LogText_OutputPort(0)) {
1004 #if FW_OBJECT_NAMES == 1 1005 const char* _formatString =
1006 "(%s) %s: Rate group failed to read cycle end time with status %s";
1008 const char* _formatString =
1009 "%s: Rate group failed to read cycle end time with status %s";
1013 status.toString(statusStr);
1016 (void) _logString.
format(
1019 this->m_objName.toChar(),
1021 "RateGroupTimeGetError ",
1044 this->m_RateGroupTimeGetErrorThrottle = 0;
1063 this->Time_out(0, _tlmTime);
1089 if (not this->m_first_update_RgMaxTime) {
1091 if (arg == this->m_last_RgMaxTime) {
1095 this->m_last_RgMaxTime = arg;
1099 this->m_first_update_RgMaxTime =
false;
1100 this->m_last_RgMaxTime = arg;
1108 static_cast<FwAssertArgType>(_stat)
1126 if (not this->m_first_update_RgCycleSlips) {
1128 if (arg == this->m_last_RgCycleSlips) {
1132 this->m_last_RgCycleSlips = arg;
1136 this->m_first_update_RgCycleSlips =
false;
1137 this->m_last_RgCycleSlips = arg;
1145 static_cast<FwAssertArgType>(_stat)
1165 this->Time_out(0, _time);
1180 ComponentIpcSerializableBuffer _msg;
1190 static_cast<FwAssertArgType>(_msgStatus)
1200 static_cast<FwAssertArgType>(_deserStatus)
1203 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
1205 if (_msgType == ACTIVERATEGROUP_COMPONENT_EXIT) {
1210 _deserStatus = _msg.deserializeTo(portNum);
1213 static_cast<FwAssertArgType>(_deserStatus)
1218 case CYCLEIN_CYCLE: {
1221 _deserStatus = _msg.deserializeTo(cycleStart);
1224 static_cast<FwAssertArgType>(_deserStatus)
1239 _deserStatus = _msg.deserializeTo(key);
1242 static_cast<FwAssertArgType>(_deserStatus)
1264 void ActiveRateGroupComponentBase ::
1273 compPtr->CycleIn_handlerBase(
1279 void ActiveRateGroupComponentBase ::
1288 compPtr->PingIn_handlerBase(
1294 #if !FW_DIRECT_PORT_CALLS 1300 void ActiveRateGroupComponentBase ::
1311 static_cast<FwAssertArgType>(portNum)
1315 this->m_Log_OutputPort[portNum].isConnected(),
1316 static_cast<FwAssertArgType>(portNum)
1318 this->m_Log_OutputPort[portNum].
invoke(
1326 #if FW_ENABLE_TEXT_LOGGING 1328 void ActiveRateGroupComponentBase ::
1338 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
1339 static_cast<FwAssertArgType>(portNum)
1343 this->m_LogText_OutputPort[portNum].isConnected(),
1344 static_cast<FwAssertArgType>(portNum)
1346 this->m_LogText_OutputPort[portNum].invoke(
1356 void ActiveRateGroupComponentBase ::
1364 static_cast<FwAssertArgType>(portNum)
1368 this->m_Time_OutputPort[portNum].isConnected(),
1369 static_cast<FwAssertArgType>(portNum)
1371 this->m_Time_OutputPort[portNum].
invoke(
1376 void ActiveRateGroupComponentBase ::
1386 static_cast<FwAssertArgType>(portNum)
1390 this->m_Tlm_OutputPort[portNum].isConnected(),
1391 static_cast<FwAssertArgType>(portNum)
1393 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.
void addCallPort(InputTimePort *callPort)
Register an input port.
void tlmWrite_RgCycleSlips(U32 arg, Fw::Time _tlmTime=Fw::Time())
Warning event that rate group has had a cycle slip.
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
message to exit active component task
void log_WARNING_HI_RateGroupTimeGetError(const Os::RawTimeStatus &status)
void PingOut_out(FwIndexType portNum, U32 key) const
Invoke output port PingOut.
Warning event that reading the cycle end time failed.
bool isConnected_Tlm_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_Time_OutputPorts()
void invoke(U32 key) const
Invoke a port connection.
Informational event that rate group has started.
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.
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].
Channel ID for RgMaxTime.
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Object initializer.
ActiveRateGroupComponentBase(const char *compName="")
Construct ActiveRateGroupComponentBase object.
Throttle reset count for RateGroupTimeGetError.
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
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.
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.
Channel ID for RgCycleSlips.
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
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)
The size of the serial representation.
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.
void addCallPort(InputSchedPort *callPort)
Register an input port.