add creation time
This commit is contained in:
@@ -119,6 +119,7 @@ Message::Message(const string& circuit, const string& level, const string& name,
|
|||||||
setScanMessage();
|
setScanMessage();
|
||||||
m_pollPriority = 0;
|
m_pollPriority = 0;
|
||||||
}
|
}
|
||||||
|
time(&m_createTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
Message::Message(const string& circuit, const string& level, const string& name,
|
Message::Message(const string& circuit, const string& level, const string& name,
|
||||||
@@ -132,6 +133,7 @@ Message::Message(const string& circuit, const string& level, const string& name,
|
|||||||
m_pollPriority(0),
|
m_pollPriority(0),
|
||||||
m_usedByCondition(false), m_isScanMessage(true), m_condition(nullptr),
|
m_usedByCondition(false), m_isScanMessage(true), m_condition(nullptr),
|
||||||
m_lastUpdateTime(0), m_lastChangeTime(0), m_pollOrder(0), m_lastPollTime(0) {
|
m_lastUpdateTime(0), m_lastChangeTime(0), m_pollOrder(0), m_lastPollTime(0) {
|
||||||
|
time(&m_createTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -511,6 +511,12 @@ class Message : public AttributedItem {
|
|||||||
*/
|
*/
|
||||||
const SlaveSymbolString& getLastSlaveData() const { return m_lastSlaveData; }
|
const SlaveSymbolString& getLastSlaveData() const { return m_lastSlaveData; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the time when this message was created.
|
||||||
|
* @return the time when this message was created.
|
||||||
|
*/
|
||||||
|
time_t getCreateTime() const { return m_createTime; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the time when this message was last seen with reasonable data.
|
* Get the time when this message was last seen with reasonable data.
|
||||||
* @return the time when this message was last seen, or 0.
|
* @return the time when this message was last seen, or 0.
|
||||||
@@ -643,6 +649,9 @@ class Message : public AttributedItem {
|
|||||||
/** the last seen @a SlaveSymbolString. */
|
/** the last seen @a SlaveSymbolString. */
|
||||||
SlaveSymbolString m_lastSlaveData;
|
SlaveSymbolString m_lastSlaveData;
|
||||||
|
|
||||||
|
/** the system time when the message was created. */
|
||||||
|
time_t m_createTime;
|
||||||
|
|
||||||
/** the system time when the message was last updated, 0 for never. */
|
/** the system time when the message was last updated, 0 for never. */
|
||||||
time_t m_lastUpdateTime;
|
time_t m_lastUpdateTime;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user