9 #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];
79 #if !FW_DIRECT_PORT_CALLS 86 this->m_CycleIn_InputPort[port].
init();
91 this->m_CycleIn_InputPort[port].
setPortNum(port);
93 #if FW_OBJECT_NAMES == 1 97 this->m_objName.toChar(),
100 this->m_CycleIn_InputPort[port].setObjName(portName.
toChar());
105 #if !FW_DIRECT_PORT_CALLS 112 this->m_PingIn_InputPort[port].
init();
117 this->m_PingIn_InputPort[port].
setPortNum(port);
119 #if FW_OBJECT_NAMES == 1 123 this->m_objName.toChar(),
126 this->m_PingIn_InputPort[port].setObjName(portName.
toChar());
131 #if !FW_DIRECT_PORT_CALLS 138 this->m_Log_OutputPort[port].
init();
140 #if FW_OBJECT_NAMES == 1 144 this->m_objName.toChar(),
147 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
152 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING 156 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
159 this->m_LogText_OutputPort[port].
init();
161 #if FW_OBJECT_NAMES == 1 165 this->m_objName.toChar(),
168 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
173 #if !FW_DIRECT_PORT_CALLS 180 this->m_Time_OutputPort[port].
init();
182 #if FW_OBJECT_NAMES == 1 186 this->m_objName.toChar(),
189 this->m_Time_OutputPort[port].setObjName(portName.
toChar());
194 #if !FW_DIRECT_PORT_CALLS 201 this->m_Tlm_OutputPort[port].
init();
203 #if FW_OBJECT_NAMES == 1 207 this->m_objName.toChar(),
210 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
215 #if !FW_DIRECT_PORT_CALLS 222 this->m_PingOut_OutputPort[port].
init();
224 #if FW_OBJECT_NAMES == 1 228 this->m_objName.toChar(),
231 this->m_PingOut_OutputPort[port].setObjName(portName.
toChar());
236 #if !FW_DIRECT_PORT_CALLS 243 this->m_RateGroupMemberOut_OutputPort[port].
init();
245 #if FW_OBJECT_NAMES == 1 249 this->m_objName.toChar(),
252 this->m_RateGroupMemberOut_OutputPort[port].setObjName(portName.
toChar());
260 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
264 static_cast<FwAssertArgType>(qStat)
268 #if !FW_DIRECT_PORT_CALLS 279 static_cast<FwAssertArgType>(portNum)
282 return &this->m_CycleIn_InputPort[portNum];
290 static_cast<FwAssertArgType>(portNum)
293 return &this->m_PingIn_InputPort[portNum];
298 #if !FW_DIRECT_PORT_CALLS 312 static_cast<FwAssertArgType>(portNum)
318 #if FW_ENABLE_TEXT_LOGGING == 1 320 void ActiveRateGroupComponentBase ::
321 set_LogText_OutputPort(
327 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
328 static_cast<FwAssertArgType>(portNum)
331 this->m_LogText_OutputPort[portNum].addCallPort(port);
344 static_cast<FwAssertArgType>(portNum)
347 this->m_Time_OutputPort[portNum].
addCallPort(port);
358 static_cast<FwAssertArgType>(portNum)
366 #if !FW_DIRECT_PORT_CALLS 380 static_cast<FwAssertArgType>(portNum)
383 this->m_PingOut_OutputPort[portNum].
addCallPort(port);
394 static_cast<FwAssertArgType>(portNum)
397 this->m_RateGroupMemberOut_OutputPort[portNum].
addCallPort(port);
402 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 411 Fw::InputSerializePort* port
416 static_cast<FwAssertArgType>(portNum)
419 this->m_Log_OutputPort[portNum].registerSerialPort(port);
422 #if FW_ENABLE_TEXT_LOGGING == 1 424 void ActiveRateGroupComponentBase ::
425 set_LogText_OutputPort(
427 Fw::InputSerializePort* port
431 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
432 static_cast<FwAssertArgType>(portNum)
435 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
443 Fw::InputSerializePort* port
448 static_cast<FwAssertArgType>(portNum)
451 this->m_Time_OutputPort[portNum].registerSerialPort(port);
457 Fw::InputSerializePort* port
462 static_cast<FwAssertArgType>(portNum)
465 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
470 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION 479 Fw::InputSerializePort* port
484 static_cast<FwAssertArgType>(portNum)
487 this->m_PingOut_OutputPort[portNum].registerSerialPort(port);
493 Fw::InputSerializePort* port
498 static_cast<FwAssertArgType>(portNum)
501 this->m_RateGroupMemberOut_OutputPort[portNum].registerSerialPort(port);
512 Fw::ActiveComponentBase(compName)
523 #if !FW_DIRECT_PORT_CALLS 534 static_cast<FwAssertArgType>(portNum)
537 return this->m_Log_OutputPort[portNum].
isConnected();
540 #if FW_ENABLE_TEXT_LOGGING == 1 542 bool ActiveRateGroupComponentBase ::
543 isConnected_LogText_OutputPort(
FwIndexType portNum)
const 546 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
547 static_cast<FwAssertArgType>(portNum)
550 return this->m_LogText_OutputPort[portNum].isConnected();
560 static_cast<FwAssertArgType>(portNum)
563 return this->m_Time_OutputPort[portNum].
isConnected();
571 static_cast<FwAssertArgType>(portNum)
574 return this->m_Tlm_OutputPort[portNum].
isConnected();
579 #if !FW_DIRECT_PORT_CALLS 590 static_cast<FwAssertArgType>(portNum)
593 return this->m_PingOut_OutputPort[portNum].
isConnected();
601 static_cast<FwAssertArgType>(portNum)
604 return this->m_RateGroupMemberOut_OutputPort[portNum].
isConnected();
624 static_cast<FwAssertArgType>(portNum)
632 ComponentIpcSerializableBuffer msg;
636 _status = msg.serializeFrom(
637 static_cast<FwEnumStoreType>(CYCLEIN_CYCLE)
641 static_cast<FwAssertArgType>(_status)
645 _status = msg.serializeFrom(portNum);
648 static_cast<FwAssertArgType>(_status)
652 _status = msg.serializeFrom(cycleStart);
655 static_cast<FwAssertArgType>(_status)
662 if (qStatus == Os::Queue::Status::FULL) {
669 static_cast<FwAssertArgType>(qStatus)
682 static_cast<FwAssertArgType>(portNum)
690 ComponentIpcSerializableBuffer msg;
694 _status = msg.serializeFrom(
695 static_cast<FwEnumStoreType>(PINGIN_PING)
699 static_cast<FwAssertArgType>(_status)
703 _status = msg.serializeFrom(portNum);
706 static_cast<FwAssertArgType>(_status)
710 _status = msg.serializeFrom(key);
713 static_cast<FwAssertArgType>(_status)
722 static_cast<FwAssertArgType>(qStatus)
752 #if !FW_DIRECT_PORT_CALLS 766 static_cast<FwAssertArgType>(portNum)
770 this->m_PingOut_OutputPort[portNum].isConnected(),
771 static_cast<FwAssertArgType>(portNum)
773 this->m_PingOut_OutputPort[portNum].
invoke(
786 static_cast<FwAssertArgType>(portNum)
790 this->m_RateGroupMemberOut_OutputPort[portNum].isConnected(),
791 static_cast<FwAssertArgType>(portNum)
793 this->m_RateGroupMemberOut_OutputPort[portNum].
invoke(
810 this->Time_out(0, _logTime);
819 #if FW_AMPCS_COMPATIBLE 825 static_cast<FwAssertArgType>(_status)
839 #if FW_ENABLE_TEXT_LOGGING 840 if (this->isConnected_LogText_OutputPort(0)) {
841 #if FW_OBJECT_NAMES == 1 842 const char* _formatString =
843 "(%s) %s: Rate group started.";
845 const char* _formatString =
846 "%s: Rate group started.";
853 this->m_objName.toChar(),
875 this->Time_out(0, _logTime);
885 #if FW_AMPCS_COMPATIBLE 890 static_cast<FwAssertArgType>(_status)
894 #if FW_AMPCS_COMPATIBLE 897 static_cast<U8>(
sizeof(U32))
901 static_cast<FwAssertArgType>(_status)
907 static_cast<FwAssertArgType>(_status)
920 #if FW_ENABLE_TEXT_LOGGING 921 if (this->isConnected_LogText_OutputPort(0)) {
922 #if FW_OBJECT_NAMES == 1 923 const char* _formatString =
924 "(%s) %s: Rate group cycle slipped on cycle %" PRIu32
"";
926 const char* _formatString =
927 "%s: Rate group cycle slipped on cycle %" PRIu32
"";
934 this->m_objName.toChar(),
936 "RateGroupCycleSlip ",
967 this->Time_out(0, _tlmTime);
993 if (not this->m_first_update_RgMaxTime) {
995 if (arg == this->m_last_RgMaxTime) {
999 this->m_last_RgMaxTime = arg;
1003 this->m_first_update_RgMaxTime =
false;
1004 this->m_last_RgMaxTime = arg;
1012 static_cast<FwAssertArgType>(_stat)
1030 if (not this->m_first_update_RgCycleSlips) {
1032 if (arg == this->m_last_RgCycleSlips) {
1036 this->m_last_RgCycleSlips = arg;
1040 this->m_first_update_RgCycleSlips =
false;
1041 this->m_last_RgCycleSlips = arg;
1049 static_cast<FwAssertArgType>(_stat)
1069 this->Time_out(0, _time);
1084 ComponentIpcSerializableBuffer _msg;
1094 static_cast<FwAssertArgType>(_msgStatus)
1104 static_cast<FwAssertArgType>(_deserStatus)
1107 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
1109 if (_msgType == ACTIVERATEGROUP_COMPONENT_EXIT) {
1114 _deserStatus = _msg.deserializeTo(portNum);
1117 static_cast<FwAssertArgType>(_deserStatus)
1122 case CYCLEIN_CYCLE: {
1125 _deserStatus = _msg.deserializeTo(cycleStart);
1128 static_cast<FwAssertArgType>(_deserStatus)
1143 _deserStatus = _msg.deserializeTo(key);
1146 static_cast<FwAssertArgType>(_deserStatus)
1168 void ActiveRateGroupComponentBase ::
1177 compPtr->CycleIn_handlerBase(
1183 void ActiveRateGroupComponentBase ::
1192 compPtr->PingIn_handlerBase(
1198 #if !FW_DIRECT_PORT_CALLS 1204 void ActiveRateGroupComponentBase ::
1215 static_cast<FwAssertArgType>(portNum)
1219 this->m_Log_OutputPort[portNum].isConnected(),
1220 static_cast<FwAssertArgType>(portNum)
1222 this->m_Log_OutputPort[portNum].
invoke(
1230 #if FW_ENABLE_TEXT_LOGGING 1232 void ActiveRateGroupComponentBase ::
1242 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
1243 static_cast<FwAssertArgType>(portNum)
1247 this->m_LogText_OutputPort[portNum].isConnected(),
1248 static_cast<FwAssertArgType>(portNum)
1250 this->m_LogText_OutputPort[portNum].invoke(
1260 void ActiveRateGroupComponentBase ::
1268 static_cast<FwAssertArgType>(portNum)
1272 this->m_Time_OutputPort[portNum].isConnected(),
1273 static_cast<FwAssertArgType>(portNum)
1275 this->m_Time_OutputPort[portNum].
invoke(
1280 void ActiveRateGroupComponentBase ::
1290 static_cast<FwAssertArgType>(portNum)
1294 this->m_Tlm_OutputPort[portNum].isConnected(),
1295 static_cast<FwAssertArgType>(portNum)
1297 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())
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
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
Warning event that rate group has had a cycle slip.
void PingOut_out(FwIndexType portNum, U32 key) const
Invoke output port PingOut.
Informational event that rate group has started.
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.
void init()
Initialization function.
No time base has been established (Required)
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
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 invoke(U32 context) const
Invoke a port connection.
void init()
Initialization function.
void invoke(Fw::Time &time) const
Invoke a port connection.
message to exit active component task
const char * toChar() const
Convert to a C-style char*.
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.
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].
Channel ID for RgMaxTime.
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)
Channel ID for RgCycleSlips.
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.