Skip to content

Commit

Permalink
Improving messaging logging when messages are wonkily connected for #817
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Piggott committed Nov 1, 2024
1 parent 98a1851 commit 9dc7866
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/architecture/messaging/messaging.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,21 @@ class Recorder : public SysModel{
void IntegratedInit(){};
//! -- Read and record the message
void UpdateState(uint64_t CurrentSimNanos){
if (CurrentSimNanos >= this->nextUpdateTime) {
bool msgGood = this->readMessage.isLinked() && this->readMessage.isWritten();
if (CurrentSimNanos >= this->nextUpdateTime && msgGood) {
this->msgRecordTimes.push_back(CurrentSimNanos);
this->msgWrittenTimes.push_back(this->readMessage.timeWritten());
this->msgRecord.push_back(this->readMessage());
this->nextUpdateTime += this->timeInterval;
}
else
{
this->msgRecordTimes.push_back(CurrentSimNanos);
this->msgWrittenTimes.push_back(0);
messageType blnkMsg {};
this->msgRecord.push_back(blnkMsg);
this->nextUpdateTime += this->timeInterval;
}
};
//! Reset method
void Reset(uint64_t CurrentSimNanos){
Expand Down

0 comments on commit 9dc7866

Please sign in to comment.