10 #if FW_ENABLE_TEXT_LOGGING
32 class ComponentIpcSerializableBuffer :
47 return sizeof(m_buff);
54 const U8* getBuffAddr()
const {
60 U8 m_buff[SERIALIZATION_SIZE];
84 this->m_CycleIn_InputPort[port].
init();
89 this->m_CycleIn_InputPort[port].
setPortNum(port);
91 #if FW_OBJECT_NAMES == 1
95 this->m_objName.toChar(),
98 this->m_CycleIn_InputPort[port].setObjName(portName.
toChar());
108 this->m_PingIn_InputPort[port].
init();
113 this->m_PingIn_InputPort[port].
setPortNum(port);
115 #if FW_OBJECT_NAMES == 1
119 this->m_objName.toChar(),
122 this->m_PingIn_InputPort[port].setObjName(portName.
toChar());
132 this->m_Log_OutputPort[port].
init();
134 #if FW_OBJECT_NAMES == 1
138 this->m_objName.toChar(),
141 this->m_Log_OutputPort[port].setObjName(portName.
toChar());
145 #if FW_ENABLE_TEXT_LOGGING == 1
149 port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
152 this->m_LogText_OutputPort[port].
init();
154 #if FW_OBJECT_NAMES == 1
158 this->m_objName.toChar(),
161 this->m_LogText_OutputPort[port].setObjName(portName.
toChar());
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());
191 this->m_Tlm_OutputPort[port].
init();
193 #if FW_OBJECT_NAMES == 1
197 this->m_objName.toChar(),
200 this->m_Tlm_OutputPort[port].setObjName(portName.
toChar());
210 this->m_PingOut_OutputPort[port].
init();
212 #if FW_OBJECT_NAMES == 1
216 this->m_objName.toChar(),
219 this->m_PingOut_OutputPort[port].setObjName(portName.
toChar());
229 this->m_RateGroupMemberOut_OutputPort[port].
init();
231 #if FW_OBJECT_NAMES == 1
235 this->m_objName.toChar(),
238 this->m_RateGroupMemberOut_OutputPort[port].setObjName(portName.
toChar());
244 static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
264 return &this->m_CycleIn_InputPort[portNum];
275 return &this->m_PingIn_InputPort[portNum];
296 #if FW_ENABLE_TEXT_LOGGING == 1
298 void ActiveRateGroupComponentBase ::
299 set_LogText_OutputPort(
305 portNum < this->getNum_LogText_OutputPorts(),
309 this->m_LogText_OutputPort[portNum].addCallPort(port);
325 this->m_Time_OutputPort[portNum].
addCallPort(port);
357 this->m_PingOut_OutputPort[portNum].
addCallPort(port);
371 this->m_RateGroupMemberOut_OutputPort[portNum].
addCallPort(port);
374 #if FW_PORT_SERIALIZATION
383 Fw::InputSerializePort* port
391 this->m_Log_OutputPort[portNum].registerSerialPort(port);
394 #if FW_ENABLE_TEXT_LOGGING == 1
396 void ActiveRateGroupComponentBase ::
397 set_LogText_OutputPort(
399 Fw::InputSerializePort* port
403 portNum < this->getNum_LogText_OutputPorts(),
407 this->m_LogText_OutputPort[portNum].registerSerialPort(port);
415 Fw::InputSerializePort* port
423 this->m_Time_OutputPort[portNum].registerSerialPort(port);
429 Fw::InputSerializePort* port
437 this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
442 #if FW_PORT_SERIALIZATION
451 Fw::InputSerializePort* port
459 this->m_PingOut_OutputPort[portNum].registerSerialPort(port);
465 Fw::InputSerializePort* port
473 this->m_RateGroupMemberOut_OutputPort[portNum].registerSerialPort(port);
484 Fw::ActiveComponentBase(compName)
487 this->m_first_update_RgMaxTime =
true;
488 this->m_last_RgMaxTime = 0;
491 this->m_first_update_RgCycleSlips =
true;
492 this->m_last_RgCycleSlips = 0;
527 #if FW_ENABLE_TEXT_LOGGING == 1
530 getNum_LogText_OutputPorts()
const
577 return this->m_Log_OutputPort[portNum].
isConnected();
580 #if FW_ENABLE_TEXT_LOGGING == 1
582 bool ActiveRateGroupComponentBase ::
583 isConnected_LogText_OutputPort(
FwIndexType portNum)
586 portNum < this->getNum_LogText_OutputPorts(),
590 return this->m_LogText_OutputPort[portNum].isConnected();
603 return this->m_Time_OutputPort[portNum].
isConnected();
614 return this->m_Tlm_OutputPort[portNum].
isConnected();
629 return this->m_PingOut_OutputPort[portNum].
isConnected();
640 return this->m_RateGroupMemberOut_OutputPort[portNum].
isConnected();
666 ComponentIpcSerializableBuffer msg;
670 _status = msg.serialize(
679 _status = msg.serialize(portNum);
686 _status = msg.serialize(cycleStart);
696 if (qStatus == Os::Queue::Status::FULL) {
724 ComponentIpcSerializableBuffer msg;
728 _status = msg.serialize(
737 _status = msg.serialize(portNum);
744 _status = msg.serialize(key);
800 this->m_PingOut_OutputPort[portNum].
invoke(
815 this->m_RateGroupMemberOut_OutputPort[portNum].
invoke(
829 if (this->m_Time_OutputPort[0].isConnected()) {
830 this->m_Time_OutputPort[0].
invoke(_logTime);
838 if (this->m_Log_OutputPort[0].isConnected()) {
841 #if FW_AMPCS_COMPATIBLE
851 this->m_Log_OutputPort[0].
invoke(
860 #if FW_ENABLE_TEXT_LOGGING
861 if (this->m_LogText_OutputPort[0].isConnected()) {
862 #if FW_OBJECT_NAMES == 1
863 const char* _formatString =
864 "(%s) %s: Rate group started.";
866 const char* _formatString =
867 "%s: Rate group started.";
874 this->m_objName.toChar(),
879 this->m_LogText_OutputPort[0].invoke(
894 if (this->m_Time_OutputPort[0].isConnected()) {
895 this->m_Time_OutputPort[0].
invoke(_logTime);
903 if (this->m_Log_OutputPort[0].isConnected()) {
907 #if FW_AMPCS_COMPATIBLE
916 #if FW_AMPCS_COMPATIBLE
919 static_cast<U8>(
sizeof(U32))
932 this->m_Log_OutputPort[0].
invoke(
941 #if FW_ENABLE_TEXT_LOGGING
942 if (this->m_LogText_OutputPort[0].isConnected()) {
943 #if FW_OBJECT_NAMES == 1
944 const char* _formatString =
945 "(%s) %s: Rate group cycle slipped on cycle %" PRIu32
"";
947 const char* _formatString =
948 "%s: Rate group cycle slipped on cycle %" PRIu32
"";
955 this->m_objName.toChar(),
957 "RateGroupCycleSlip ",
961 this->m_LogText_OutputPort[0].invoke(
982 if (not this->m_first_update_RgMaxTime) {
984 if (arg == this->m_last_RgMaxTime) {
988 this->m_last_RgMaxTime = arg;
992 this->m_first_update_RgMaxTime =
false;
993 this->m_last_RgMaxTime = arg;
996 if (this->m_Tlm_OutputPort[0].isConnected()) {
998 this->m_Time_OutputPort[0].isConnected() &&
1001 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1015 this->m_Tlm_OutputPort[0].
invoke(
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;
1044 if (this->m_Tlm_OutputPort[0].isConnected()) {
1046 this->m_Time_OutputPort[0].isConnected() &&
1049 this->m_Time_OutputPort[0].
invoke(_tlmTime);
1063 this->m_Tlm_OutputPort[0].
invoke(
1078 if (this->m_Time_OutputPort[0].isConnected()) {
1080 this->m_Time_OutputPort[0].
invoke(_time);
1095 ComponentIpcSerializableBuffer msg;
1118 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
1120 if (msgType == ACTIVERATEGROUP_COMPONENT_EXIT) {
1125 deserStatus = msg.deserialize(portNum);
1133 case CYCLEIN_CYCLE: {
1154 deserStatus = msg.deserialize(key);
1179 void ActiveRateGroupComponentBase ::
1188 compPtr->CycleIn_handlerBase(
1194 void ActiveRateGroupComponentBase ::
1203 compPtr->PingIn_handlerBase(
uint8_t U8
8-bit unsigned integer
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
BYTE PingInPortSize[Svc::InputPingPort::SERIALIZED_SIZE]
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
PlatformSizeType FwSizeType
PlatformQueuePriorityType FwQueuePriorityType
PlatformIndexType FwIndexType
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
@ WARNING_HI
A serious but recoverable event.
@ DIAGNOSTIC
Software diagnostic events.
void init()
Object initializer.
const char * toChar() const
void init()
Initialization function.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
void addCallPort(InputLogPort *callPort)
Register an input port.
void addCallPort(InputTimePort *callPort)
Register an input port.
void invoke(Fw::Time &time)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputTlmPort *callPort)
Register an input port.
void init()
Initialization function.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
Os::Queue m_queue
queue object for active component
void incNumMsgDropped()
increment the number of messages dropped
@ MSG_DISPATCH_OK
Dispatch was normal.
@ MSG_DISPATCH_EXIT
A message was sent requesting an exit of the loop.
@ MSG_DISPATCH_ERROR
Errors dispatching messages.
NATIVE_UINT_TYPE SizeType
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void format(const CHAR *formatString,...)
write formatted string to buffer
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
@ BLOCKING
Message will block until space is available.
@ NONBLOCKING
Message will return with status when space is unavailable.
Status
status returned from the queue send function
@ OP_OK
message sent/received okay
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer) override
Deserialize the contents of the RawTimeInterface object from a buffer.
FwIndexType getNum_Log_OutputPorts() const
FwIndexType getNum_PingIn_InputPorts() const
void tlmWrite_RgMaxTime(U32 arg, Fw::Time _tlmTime=Fw::Time())
void set_PingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to PingOut[portNum].
FwIndexType getNum_Time_OutputPorts() const
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void tlmWrite_RgCycleSlips(U32 arg, Fw::Time _tlmTime=Fw::Time())
FwIndexType getNum_CycleIn_InputPorts() const
bool isConnected_Time_OutputPort(FwIndexType portNum)
@ EVENTID_RATEGROUPSTARTED
Informational event that rate group has started.
@ EVENTID_RATEGROUPCYCLESLIP
Warning event that rate group has had a cycle slip.
virtual ~ActiveRateGroupComponentBase()
Destroy ActiveRateGroupComponentBase object.
void RateGroupMemberOut_out(FwIndexType portNum, U32 context)
Invoke output port RateGroupMemberOut.
virtual void PingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port PingIn.
virtual void CycleIn_handler(FwIndexType portNum, Os::RawTime &cycleStart)=0
Handler for input port CycleIn.
bool isConnected_PingOut_OutputPort(FwIndexType portNum)
ActiveRateGroupComponentBase(const char *compName="")
Construct ActiveRateGroupComponentBase object.
FwIndexType getNum_RateGroupMemberOut_OutputPorts() const
@ CHANNELID_RGMAXTIME
Channel ID for RgMaxTime.
@ CHANNELID_RGCYCLESLIPS
Channel ID for RgCycleSlips.
bool isConnected_Log_OutputPort(FwIndexType portNum)
void log_WARNING_HI_RateGroupCycleSlip(U32 cycle)
FwIndexType getNum_PingOut_OutputPorts() const
Svc::InputPingPort * get_PingIn_InputPort(FwIndexType portNum)
virtual void PingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port PingIn.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
bool isConnected_RateGroupMemberOut_OutputPort(FwIndexType portNum)
void log_DIAGNOSTIC_RateGroupStarted()
void CycleIn_handlerBase(FwIndexType portNum, Os::RawTime &cycleStart)
Handler base-class function for input port CycleIn.
virtual void CycleIn_preMsgHook(FwIndexType portNum, Os::RawTime &cycleStart)
Pre-message hook for async input port CycleIn.
void set_RateGroupMemberOut_OutputPort(FwIndexType portNum, Svc::InputSchedPort *port)
Connect port to RateGroupMemberOut[portNum].
Svc::InputCyclePort * get_CycleIn_InputPort(FwIndexType portNum)
void PingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port PingIn.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
FwIndexType getNum_Tlm_OutputPorts() const
void PingOut_out(FwIndexType portNum, U32 key)
Invoke output port PingOut.
void invoke(U32 key)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputPingPort *callPort)
Register an input port.
void init()
Initialization function.
void addCallPort(InputSchedPort *callPort)
Register an input port.
void invoke(U32 context)
Invoke a port interface.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
@ OP_OK
Operation succeeded.