Merge branch 'master' into enhanced_device
This commit is contained in:
@@ -696,6 +696,14 @@ result_t NumberDataType::readSymbols(size_t offset, size_t length, const SymbolS
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (isnan(val)) {
|
||||
if (outputFormat & OF_JSON) {
|
||||
*output << "null";
|
||||
} else {
|
||||
*output << nullptr_VALUE;
|
||||
}
|
||||
return RESULT_OK;
|
||||
}
|
||||
if (val != 0.0) {
|
||||
if (m_divisor < 0) {
|
||||
val *= static_cast<float>(-m_divisor);
|
||||
|
||||
@@ -2506,7 +2506,7 @@ Message* MessageMap::find(const string& circuit, const string& name, const strin
|
||||
|
||||
void MessageMap::findAll(const string& circuit, const string& name, const string& levels,
|
||||
bool completeMatch, bool withRead, bool withWrite, bool withPassive, bool includeEmptyLevel, bool onlyAvailable,
|
||||
time_t since, time_t until, deque<Message*>* messages) const {
|
||||
time_t since, time_t until, bool changedSince, deque<Message*>* messages) const {
|
||||
string lcircuit = circuit;
|
||||
FileReader::tolower(&lcircuit);
|
||||
string lname = name;
|
||||
@@ -2553,7 +2553,7 @@ void MessageMap::findAll(const string& circuit, const string& name, const string
|
||||
if (message->getDstAddress() == SYN) {
|
||||
continue;
|
||||
}
|
||||
time_t lastchg = message->getLastChangeTime();
|
||||
time_t lastchg = changedSince ? message->getLastChangeTime() : message->getLastUpdateTime();
|
||||
if ((since != 0 && lastchg < since)
|
||||
|| (until != 0 && lastchg >= until)) {
|
||||
continue;
|
||||
@@ -2647,7 +2647,7 @@ void MessageMap::invalidateCache(Message* message) {
|
||||
string circuit = message->getCircuit();
|
||||
string name = message->getName();
|
||||
deque<Message*> messages;
|
||||
findAll(circuit, name, "*", true, true, true, true, true, true, 0, 0, &messages);
|
||||
findAll(circuit, name, "*", true, true, true, true, true, true, 0, 0, false, &messages);
|
||||
for (auto checkMessage : messages) {
|
||||
if (checkMessage != message) {
|
||||
checkMessage->m_lastUpdateTime = 0;
|
||||
|
||||
@@ -1403,11 +1403,12 @@ class MessageMap : public MappedFileReader {
|
||||
* address), or 0 to ignore.
|
||||
* @param until the end time to which to add updates (exclusive, also removes messages with unset destination
|
||||
* address), or 0 to ignore.
|
||||
* @changedSince true to use the last change time for the since/until range, false to use the last seen time.
|
||||
* @param messages the @a deque to which to add the found @a Message instances.
|
||||
*/
|
||||
void findAll(const string& circuit, const string& name, const string& levels,
|
||||
bool completeMatch, bool withRead, bool withWrite, bool withPassive, bool includeEmptyLevel, bool onlyAvailable,
|
||||
time_t since, time_t until, deque<Message*>* messages) const;
|
||||
time_t since, time_t until, bool changedSince, deque<Message*>* messages) const;
|
||||
|
||||
/**
|
||||
* Find the @a Message instance for the specified master data.
|
||||
|
||||
@@ -412,6 +412,7 @@ int main() {
|
||||
{"x,,exp", "-32.767", "10feffff04681103c2", "00", ""},
|
||||
{"x,,exp,1000", "-0.000090000", "10feffff04ec51b8bd", "00", ""},
|
||||
{"x,,exp,-100", "-9", "10feffff04ec51b8bd", "00", ""},
|
||||
{"x,,exp", "-", "10feffff040000c07f", "00", "W"},
|
||||
{"x,,exr", "-0.09", "10feffff04bdb851ec", "00", ""},
|
||||
{"x,,exr", "0.0", "10feffff0400000000", "00", ""},
|
||||
{"x,,exr", "-0.001", "10feffff04ba83126f", "00", ""},
|
||||
|
||||
@@ -367,7 +367,7 @@ int main() {
|
||||
continue;
|
||||
}
|
||||
deque<Message*> msgs;
|
||||
messages->findAll("", "", "*", false, true, true, true, true, false, 0, 0, &msgs);
|
||||
messages->findAll("", "", "*", false, true, true, true, true, false, 0, 0, false, &msgs);
|
||||
if (msgs.empty()) {
|
||||
message = nullptr;
|
||||
cout << "\"" << check[0] << "\": create error: message not found" << endl;
|
||||
|
||||
Reference in New Issue
Block a user