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];
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 (0 <= portNum) && (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 (0 <= portNum) && (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)
506 static_cast<FwAssertArgType>(portNum)
509 return this->m_Log_OutputPort[portNum].
isConnected();
512 #if FW_ENABLE_TEXT_LOGGING == 1 514 bool ActiveRateGroupComponentBase ::
515 isConnected_LogText_OutputPort(
FwIndexType portNum)
518 (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
519 static_cast<FwAssertArgType>(portNum)
522 return this->m_LogText_OutputPort[portNum].isConnected();
532 static_cast<FwAssertArgType>(portNum)
535 return this->m_Time_OutputPort[portNum].
isConnected();
543 static_cast<FwAssertArgType>(portNum)
546 return this->m_Tlm_OutputPort[portNum].
isConnected();
558 static_cast<FwAssertArgType>(portNum)
561 return this->m_PingOut_OutputPort[portNum].
isConnected();
569 static_cast<FwAssertArgType>(portNum)
572 return this->m_RateGroupMemberOut_OutputPort[portNum].
isConnected();
590 static_cast<FwAssertArgType>(portNum)
598 ComponentIpcSerializableBuffer msg;
602 _status = msg.serializeFrom(
603 static_cast<FwEnumStoreType>(CYCLEIN_CYCLE)
607 static_cast<FwAssertArgType>(_status)
611 _status = msg.serializeFrom(portNum);
614 static_cast<FwAssertArgType>(_status)
618 _status = msg.serializeFrom(cycleStart);
621 static_cast<FwAssertArgType>(_status)
628 if (qStatus == Os::Queue::Status::FULL) {
635 static_cast<FwAssertArgType>(qStatus)
648 static_cast<FwAssertArgType>(portNum)
656 ComponentIpcSerializableBuffer msg;
660 _status = msg.serializeFrom(
661 static_cast<FwEnumStoreType>(PINGIN_PING)
665 static_cast<FwAssertArgType>(_status)
669 _status = msg.serializeFrom(portNum);
672 static_cast<FwAssertArgType>(_status)
676 _status = msg.serializeFrom(key);
679 static_cast<FwAssertArgType>(_status)
688 static_cast<FwAssertArgType>(qStatus)
730 static_cast<FwAssertArgType>(portNum)
734 this->m_PingOut_OutputPort[portNum].isConnected(),
735 static_cast<FwAssertArgType>(portNum)
737 this->m_PingOut_OutputPort[portNum].
invoke(
750 static_cast<FwAssertArgType>(portNum)
754 this->m_RateGroupMemberOut_OutputPort[portNum].isConnected(),
755 static_cast<FwAssertArgType>(portNum)
757 this->m_RateGroupMemberOut_OutputPort[portNum].
invoke(
771 if (this->m_Time_OutputPort[0].isConnected()) {
772 this->m_Time_OutputPort[0].
invoke(_logTime);
780 if (this->m_Log_OutputPort[0].isConnected()) {
783 #if FW_AMPCS_COMPATIBLE 789 static_cast<FwAssertArgType>(_status)
793 this->m_Log_OutputPort[0].
invoke(
802 #if FW_ENABLE_TEXT_LOGGING 803 if (this->m_LogText_OutputPort[0].isConnected()) {
804 #if FW_OBJECT_NAMES == 1 805 const char* _formatString =
806 "(%s) %s: Rate group started.";
808 const char* _formatString =
809 "%s: Rate group started.";
816 this->m_objName.toChar(),
821 this->m_LogText_OutputPort[0].invoke(
836 if (this->m_Time_OutputPort[0].isConnected()) {
837 this->m_Time_OutputPort[0].
invoke(_logTime);
845 if (this->m_Log_OutputPort[0].isConnected()) {
849 #if FW_AMPCS_COMPATIBLE 854 static_cast<FwAssertArgType>(_status)
858 #if FW_AMPCS_COMPATIBLE 861 static_cast<U8>(
sizeof(U32))
865 static_cast<FwAssertArgType>(_status)
871 static_cast<FwAssertArgType>(_status)
874 this->m_Log_OutputPort[0].
invoke(
883 #if FW_ENABLE_TEXT_LOGGING 884 if (this->m_LogText_OutputPort[0].isConnected()) {
885 #if FW_OBJECT_NAMES == 1 886 const char* _formatString =
887 "(%s) %s: Rate group cycle slipped on cycle %" PRIu32
"";
889 const char* _formatString =
890 "%s: Rate group cycle slipped on cycle %" PRIu32
"";
897 this->m_objName.toChar(),
899 "RateGroupCycleSlip ",
903 this->m_LogText_OutputPort[0].invoke(
924 if (not this->m_first_update_RgMaxTime) {
926 if (arg == this->m_last_RgMaxTime) {
930 this->m_last_RgMaxTime = arg;
934 this->m_first_update_RgMaxTime =
false;
935 this->m_last_RgMaxTime = arg;
938 if (this->m_Tlm_OutputPort[0].isConnected()) {
940 this->m_Time_OutputPort[0].isConnected() &&
943 this->m_Time_OutputPort[0].
invoke(_tlmTime);
950 static_cast<FwAssertArgType>(_stat)
957 this->m_Tlm_OutputPort[0].
invoke(
972 if (not this->m_first_update_RgCycleSlips) {
974 if (arg == this->m_last_RgCycleSlips) {
978 this->m_last_RgCycleSlips = arg;
982 this->m_first_update_RgCycleSlips =
false;
983 this->m_last_RgCycleSlips = arg;
986 if (this->m_Tlm_OutputPort[0].isConnected()) {
988 this->m_Time_OutputPort[0].isConnected() &&
991 this->m_Time_OutputPort[0].
invoke(_tlmTime);
998 static_cast<FwAssertArgType>(_stat)
1005 this->m_Tlm_OutputPort[0].
invoke(
1020 if (this->m_Time_OutputPort[0].isConnected()) {
1022 this->m_Time_OutputPort[0].
invoke(_time);
1037 ComponentIpcSerializableBuffer _msg;
1047 static_cast<FwAssertArgType>(_msgStatus)
1057 static_cast<FwAssertArgType>(_deserStatus)
1060 MsgTypeEnum _msgType =
static_cast<MsgTypeEnum
>(_desMsg);
1062 if (_msgType == ACTIVERATEGROUP_COMPONENT_EXIT) {
1067 _deserStatus = _msg.deserializeTo(portNum);
1070 static_cast<FwAssertArgType>(_deserStatus)
1075 case CYCLEIN_CYCLE: {
1078 _deserStatus = _msg.deserializeTo(cycleStart);
1081 static_cast<FwAssertArgType>(_deserStatus)
1096 _deserStatus = _msg.deserializeTo(key);
1099 static_cast<FwAssertArgType>(_deserStatus)
1121 void ActiveRateGroupComponentBase ::
1130 compPtr->CycleIn_handlerBase(
1136 void ActiveRateGroupComponentBase ::
1145 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())
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
void PingOut_out(FwIndexType portNum, U32 key)
Invoke output port PingOut.
Channel ID for RgCycleSlips.
static constexpr FwIndexType getNum_Log_OutputPorts()
Status
status returned from the queue send function
static constexpr FwIndexType getNum_Time_OutputPorts()
void invoke(U32 key) const
Invoke a port interface.
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)
bool isConnected_Time_OutputPort(FwIndexType portNum)
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].
Warning event that rate group has had a cycle slip.
void addCallPort(InputTlmPort *callPort)
Register an input port.
Channel ID for RgMaxTime.
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.
FwIdType FwEventIdType
The type of an event identifier.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
void init()
Initialization function.
bool isConnected_Log_OutputPort(FwIndexType portNum)
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
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
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
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
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 interface.
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
void init()
Initialization function.
uint8_t U8
8-bit unsigned integer
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 interface.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
bool isConnected_RateGroupMemberOut_OutputPort(FwIndexType portNum)
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 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
Informational event that rate group has started.
message to exit active component task
bool isConnected_PingOut_OutputPort(FwIndexType portNum)
Message will return with status when space is unavailable.
Implementation of malloc based allocator.
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.
void addCallPort(InputSchedPort *callPort)
Register an input port.