add filename to loaded scan config info
This commit is contained in:
+5
-2
@@ -574,7 +574,8 @@ static result_t readConfigFiles(const string path, const string extension, DataF
|
|||||||
return RESULT_OK;
|
return RESULT_OK;
|
||||||
};
|
};
|
||||||
|
|
||||||
result_t loadConfigFiles(MessageMap* messages, bool recursive, bool verbose) {
|
result_t loadConfigFiles(MessageMap* messages, bool recursive, bool verbose)
|
||||||
|
{
|
||||||
logInfo(lf_main, "loading configuration files from %s", opt.configPath);
|
logInfo(lf_main, "loading configuration files from %s", opt.configPath);
|
||||||
string path = string(opt.configPath);
|
string path = string(opt.configPath);
|
||||||
messages->clear();
|
messages->clear();
|
||||||
@@ -600,7 +601,8 @@ result_t loadConfigFiles(MessageMap* messages, bool recursive, bool verbose) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result_t loadScanConfigFile(MessageMap* messages, unsigned char address, SymbolString& data) {
|
result_t loadScanConfigFile(MessageMap* messages, unsigned char address, SymbolString& data, string& relativeFile)
|
||||||
|
{
|
||||||
PartType partType;
|
PartType partType;
|
||||||
if (isMaster(address)) {
|
if (isMaster(address)) {
|
||||||
address = (unsigned char)(data[0]+5); // slave address of sending master
|
address = (unsigned char)(data[0]+5); // slave address of sending master
|
||||||
@@ -764,6 +766,7 @@ result_t loadScanConfigFile(MessageMap* messages, unsigned char address, SymbolS
|
|||||||
logError(lf_main, "error resolving conditions: %s, %s", getResultCode(result), messages->getLastError().c_str());
|
logError(lf_main, "error resolving conditions: %s, %s", getResultCode(result), messages->getLastError().c_str());
|
||||||
|
|
||||||
logNotice(lf_main, "found messages: %d (%d conditional on %d conditions, %d poll, %d update)", messages->size(), messages->sizeConditional(), messages->sizeConditions(), messages->sizePoll(), messages->sizePassive());
|
logNotice(lf_main, "found messages: %d (%d conditional on %d conditions, %d poll, %d update)", messages->size(), messages->sizeConditional(), messages->sizeConditions(), messages->sizePoll(), messages->sizePassive());
|
||||||
|
relativeFile = best.substr(strlen(opt.configPath)+1);
|
||||||
return RESULT_OK;
|
return RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -75,8 +75,9 @@ result_t loadConfigFiles(MessageMap* messages, bool recursive=true, bool verbose
|
|||||||
* @param messages the @a MessageMap to load the messages into.
|
* @param messages the @a MessageMap to load the messages into.
|
||||||
* @param address the address of the scan participant (either master for broadcast master data or slave for read slave data).
|
* @param address the address of the scan participant (either master for broadcast master data or slave for read slave data).
|
||||||
* @param data the scan @a SymbolString for which to load the configuration file.
|
* @param data the scan @a SymbolString for which to load the configuration file.
|
||||||
|
* @param relativeFile the string in which the name of the configuration file is stored on success.
|
||||||
* @return the result code.
|
* @return the result code.
|
||||||
*/
|
*/
|
||||||
result_t loadScanConfigFile(MessageMap* messages, unsigned char address, SymbolString& data);
|
result_t loadScanConfigFile(MessageMap* messages, unsigned char address, SymbolString& data, string& relativeFile);
|
||||||
|
|
||||||
#endif // MAIN_H_
|
#endif // MAIN_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user