17 #if FW_ENABLE_TEXT_LOGGING
48 class ComponentIpcSerializableBuffer :
63 return sizeof(m_buff);
66 U8* getBuffAddr(
void) {
70 const U8* getBuffAddr(
void)
const {
76 U8 m_buff[SERIALIZATION_SIZE];
90 return &this->m_comIn_InputPort[
portNum];
118 this->m_timeCaller_OutputPort[
portNum].addCallPort(port);
161 #if FW_ENABLE_TEXT_LOGGING == 1
162 void ComLoggerComponentBase ::
163 set_LogText_OutputPort(
169 this->m_LogText_OutputPort[
portNum].addCallPort(port);
177 #if FW_PORT_SERIALIZATION
182 Fw::InputSerializePort *port
186 return this->m_timeCaller_OutputPort[
portNum].registerSerialPort(port);
192 Fw::InputSerializePort *port
202 Fw::InputSerializePort *port
212 Fw::InputSerializePort *port
222 Fw::InputSerializePort *port
229 #if FW_ENABLE_TEXT_LOGGING == 1
230 void ComLoggerComponentBase ::
231 set_LogText_OutputPort(
233 Fw::InputSerializePort *port
237 return this->m_LogText_OutputPort[
portNum].registerSerialPort(port);
261 #if FW_OBJECT_NAMES == 1
263 Fw::ActiveComponentBase(compName)
266 Fw::ActiveComponentBase()
287 port < this->getNum_comIn_InputPorts();
291 this->m_comIn_InputPort[port].init();
292 this->m_comIn_InputPort[port].addCallComp(
296 this->m_comIn_InputPort[port].setPortNum(port);
298 #if FW_OBJECT_NAMES == 1
303 "%s_comIn_InputPort[%d]",
307 this->m_comIn_InputPort[port].setObjName(portName);
326 #if FW_OBJECT_NAMES == 1
331 "%s_cmdIn_InputPort[%d]",
354 #if FW_OBJECT_NAMES == 1
359 "%s_pingIn_InputPort[%d]",
371 port < this->getNum_timeCaller_OutputPorts();
374 this->m_timeCaller_OutputPort[port].
init();
376 #if FW_OBJECT_NAMES == 1
381 "%s_timeCaller_OutputPort[%d]",
385 this->m_timeCaller_OutputPort[port].setObjName(portName);
398 #if FW_OBJECT_NAMES == 1
403 "%s_cmdRegOut_OutputPort[%d]",
420 #if FW_OBJECT_NAMES == 1
425 "%s_logOut_OutputPort[%d]",
442 #if FW_OBJECT_NAMES == 1
447 "%s_cmdResponseOut_OutputPort[%d]",
464 #if FW_OBJECT_NAMES == 1
469 "%s_pingOut_OutputPort[%d]",
479 #if FW_ENABLE_TEXT_LOGGING == 1
482 port < this->getNum_LogText_OutputPorts();
485 this->m_LogText_OutputPort[port].
init();
487 #if FW_OBJECT_NAMES == 1
492 "%s_LogText_OutputPort[%d]",
496 this->m_LogText_OutputPort[port].setObjName(portName);
505 ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
523 void ComLoggerComponentBase ::
538 getNum_comIn_InputPorts(
void)
541 this->m_comIn_InputPort
546 getNum_timeCaller_OutputPorts(
void)
549 this->m_timeCaller_OutputPort
601 #if FW_ENABLE_TEXT_LOGGING == 1
603 getNum_LogText_OutputPorts(
void)
606 this->m_LogText_OutputPort
615 bool ComLoggerComponentBase ::
619 portNum < this->getNum_timeCaller_OutputPorts(),
622 return this->m_timeCaller_OutputPort[
portNum].isConnected();
665 #if FW_ENABLE_TEXT_LOGGING == 1
666 bool ComLoggerComponentBase ::
670 portNum < this->getNum_LogText_OutputPorts(),
673 return this->m_LogText_OutputPort[
portNum].isConnected();
696 const U32 idBase = callComp->
getIdBase();
697 FW_ASSERT(opCode >= idBase, opCode, idBase);
698 switch (opCode - idBase) {
700 case OPCODE_CLOSEFILE:
701 compPtr->CloseFile_cmdHandlerBase(
709 compPtr->cmdResponse_out(
720 void ComLoggerComponentBase ::
735 void ComLoggerComponentBase ::
736 CloseFile_cmdHandlerBase(
744 this->CloseFile_preMsgHook(opCode,
cmdSeq);
748 ComponentIpcSerializableBuffer msg;
760 _status = msg.serialize(port);
766 _status = msg.serialize(opCode);
772 _status = msg.serialize(
cmdSeq);
778 _status = msg.serialize(
args);
796 void ComLoggerComponentBase::
797 CloseFile_preMsgHook(
812 if (this->m_timeCaller_OutputPort[0].isConnected()) {
814 this->m_timeCaller_OutputPort[0].invoke(_time);
825 void ComLoggerComponentBase ::
826 log_WARNING_HI_FileOpenError(
834 if (this->m_timeCaller_OutputPort[0].isConnected()) {
835 this->m_timeCaller_OutputPort[0].invoke( _logTime);
840 _id = this->
getIdBase() + EVENTID_FILEOPENERROR;
848 #if FW_AMPCS_COMPATIBLE
857 #if FW_AMPCS_COMPATIBLE
860 static_cast<U8>(
sizeof(errornum))
891 #if FW_ENABLE_TEXT_LOGGING
892 if (this->m_LogText_OutputPort[0].isConnected()) {
894 #if FW_OBJECT_NAMES == 1
895 const char* _formatString =
896 "(%s) %s: Error %d opening file %s";
898 const char* _formatString =
899 "%s: Error %d opening file %s";
919 this->m_LogText_OutputPort[0].invoke(
940 if (this->m_timeCaller_OutputPort[0].isConnected()) {
941 this->m_timeCaller_OutputPort[0].invoke( _logTime);
954 #if FW_AMPCS_COMPATIBLE
963 #if FW_AMPCS_COMPATIBLE
966 static_cast<U8>(
sizeof(errornum))
980 #if FW_AMPCS_COMPATIBLE
983 static_cast<U8>(
sizeof(bytesWritten))
991 _status = _logBuff.
serialize(bytesWritten);
997 #if FW_AMPCS_COMPATIBLE
1000 static_cast<U8>(
sizeof(bytesToWrite))
1008 _status = _logBuff.
serialize(bytesToWrite);
1031 #if FW_ENABLE_TEXT_LOGGING
1032 if (this->m_LogText_OutputPort[0].isConnected()) {
1034 #if FW_OBJECT_NAMES == 1
1035 const char* _formatString =
1036 "(%s) %s: Error %d while writing %d of %d bytes to %s";
1038 const char* _formatString =
1039 "%s: Error %d while writing %d of %d bytes to %s";
1061 this->m_LogText_OutputPort[0].invoke(
1082 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1083 this->m_timeCaller_OutputPort[0].invoke( _logTime);
1096 #if FW_AMPCS_COMPATIBLE
1106 _status = _logBuff.
serialize(validationFile);
1119 #if FW_AMPCS_COMPATIBLE
1122 static_cast<U8>(
sizeof(status))
1146 #if FW_ENABLE_TEXT_LOGGING
1147 if (this->m_LogText_OutputPort[0].isConnected()) {
1149 #if FW_OBJECT_NAMES == 1
1150 const char* _formatString =
1151 "(%s) %s: The ComLogger failed to create a validation file %s for %s with error %d.";
1153 const char* _formatString =
1154 "%s: The ComLogger failed to create a validation file %s for %s with error %d.";
1166 "FileValidationError "
1167 , validationFile.
toChar()
1175 this->m_LogText_OutputPort[0].invoke(
1196 if (this->m_timeCaller_OutputPort[0].isConnected()) {
1197 this->m_timeCaller_OutputPort[0].invoke( _logTime);
1210 #if FW_AMPCS_COMPATIBLE
1236 #if FW_ENABLE_TEXT_LOGGING
1237 if (this->m_LogText_OutputPort[0].isConnected()) {
1239 #if FW_OBJECT_NAMES == 1
1240 const char* _formatString =
1241 "(%s) %s: File %s closed successfully.";
1243 const char* _formatString =
1244 "%s: File %s closed successfully.";
1263 this->m_LogText_OutputPort[0].invoke(
1279 void ComLoggerComponentBase ::
1309 void ComLoggerComponentBase ::
1325 ComponentIpcSerializableBuffer msg;
1328 _status = msg.serialize(
1336 _status = msg.serialize(
portNum);
1343 _status = msg.serialize(
data);
1350 _status = msg.serialize(
context);
1385 ComponentIpcSerializableBuffer msg;
1388 _status = msg.serialize(
1396 _status = msg.serialize(
portNum);
1403 _status = msg.serialize(
key);
1426 void ComLoggerComponentBase ::
1452 ComponentIpcSerializableBuffer msg;
1471 MsgTypeEnum msgType =
static_cast<MsgTypeEnum
>(desMsg);
1473 if (msgType == COMLOGGER_COMPONENT_EXIT) {
1478 deserStatus = msg.deserialize(
portNum);
1491 deserStatus = msg.deserialize(
data);
1499 deserStatus = msg.deserialize(
context);
1506 this->comIn_handler(
1520 deserStatus = msg.deserialize(
key);
1537 case CMD_CLOSEFILE: {
1540 deserStatus = msg.deserialize(opCode);
1548 deserStatus = msg.deserialize(
cmdSeq);
1556 deserStatus = msg.deserialize(
args);
1567 #if FW_CMD_CHECK_RESIDUAL
1577 this->CloseFile_cmdHandler(opCode,
cmdSeq);