diff --git a/src/ebusd/main.cpp b/src/ebusd/main.cpp index 9ef74dca..ae5ce4ed 100644 --- a/src/ebusd/main.cpp +++ b/src/ebusd/main.cpp @@ -894,7 +894,7 @@ int main(int argc, char* argv[]) } if (result == RESULT_OK && opt.checkConfig > 1) { logNotice(lf_main, "Configuration dump:"); - s_messageMap->dump(cout); + s_messageMap->dump(cout, true); } delete s_messageMap; s_messageMap = NULL; diff --git a/src/lib/ebus/message.cpp b/src/lib/ebus/message.cpp index 103ddbfd..fbcc3945 100644 --- a/src/lib/ebus/message.cpp +++ b/src/lib/ebus/message.cpp @@ -641,7 +641,7 @@ bool Message::isLessPollWeight(const Message* other) return false; } -void Message::dump(ostream& output, vector* columns) +void Message::dump(ostream& output, vector* columns, bool withConditions) { bool first = true, all = columns==NULL; size_t end = all ? 9 : columns->size(); @@ -652,15 +652,15 @@ void Message::dump(ostream& output, vector* columns) output << FIELD_SEPARATOR; } size_t column = all ? i : (*columns)[i]; - dumpColumn(output, column); + dumpColumn(output, column, withConditions); } } -void Message::dumpColumn(ostream& output, size_t column) +void Message::dumpColumn(ostream& output, size_t column, bool withConditions) { switch (column) { case 0: // type - if (m_condition!=NULL) { + if (withConditions && m_condition!=NULL) { m_condition->dump(output); } if (m_isPassive) { @@ -914,10 +914,10 @@ result_t ChainedMessage::storeLastData(const PartType partType, SymbolString& da return result; } -void ChainedMessage::dumpColumn(ostream& output, size_t column) +void ChainedMessage::dumpColumn(ostream& output, size_t column, bool withConditions) { if (column!=7) { - Message::dumpColumn(output, column); + Message::dumpColumn(output, column, withConditions); return; } bool first = true; @@ -1614,7 +1614,7 @@ Message* MessageMap::getNextPoll() return ret; } -void MessageMap::dump(ostream& output) +void MessageMap::dump(ostream& output, bool withConditions) { bool first = true; for (map >::iterator it = m_messagesByName.begin(); it != m_messagesByName.end(); it++) { @@ -1629,7 +1629,7 @@ void MessageMap::dump(ostream& output) first = false; else output << endl; - message->dump(output); + message->dump(output, NULL, withConditions); } } else { Message* message = getFirstAvailable(it->second); @@ -1639,7 +1639,7 @@ void MessageMap::dump(ostream& output) first = false; else output << endl; - message->dump(output); + message->dump(output, NULL, withConditions); } } if (!first) diff --git a/src/lib/ebus/message.h b/src/lib/ebus/message.h index d1915483..6e48e833 100644 --- a/src/lib/ebus/message.h +++ b/src/lib/ebus/message.h @@ -413,8 +413,9 @@ public: * Write the message definition or parts of it to the @a ostream. * @param output the @a ostream to append the formatted value to. * @param columns the list of column indexes to write, or NULL for all. + * @param withConditions whether to include the optional conditions prefix. */ - void dump(ostream& output, vector* columns=NULL); + void dump(ostream& output, vector* columns=NULL, bool withConditions=false); protected: @@ -422,8 +423,9 @@ protected: * Write the specified column to the @a ostream. * @param output the @a ostream to append the formatted value to. * @param column the column indexes to write. + * @param withConditions whether to include the optional conditions prefix. */ - virtual void dumpColumn(ostream& output, size_t column); + virtual void dumpColumn(ostream& output, size_t column, bool withConditions); /** the optional circuit name. */ const string m_circuit; @@ -571,7 +573,7 @@ public: protected: // @copydoc - virtual void dumpColumn(ostream& output, size_t column); + virtual void dumpColumn(ostream& output, size_t column, bool withConditions); private: @@ -984,8 +986,9 @@ public: /** * Write the message definitions to the @a ostream. * @param output the @a ostream to append the formatted messages to. + * @param withConditions whether to include the optional conditions prefix. */ - void dump(ostream& output); + void dump(ostream& output, bool withConditions=false); private: