Added PVs for error reset and status problem reporting and fixed a bug

in msgPrintControl
This commit is contained in:
2025-03-10 14:28:24 +01:00
parent ca7bede4b7
commit bed245b010
8 changed files with 90 additions and 16 deletions

View File

@@ -69,13 +69,16 @@ bool msgPrintControl::shouldBePrinted(msgPrintControlKey &key, bool wantToPrint,
*/
if (map_.find(key) != map_.end()) {
if (map_[key] != 0) {
char formattedKey[100] = {0};
key.format(formattedKey, sizeof(formattedKey));
asynPrint(pasynUser, ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nError "
"associated with key \"%s\" has been resolved.\n",
key.controller_.c_str(), key.axisNo_,
key.functionName_, key.line_, formattedKey);
if (pasynUser != nullptr) {
char formattedKey[100] = {0};
key.format(formattedKey, sizeof(formattedKey));
asynPrint(
pasynUser, ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nError "
"associated with key \"%s\" has been resolved.\n",
key.controller_.c_str(), key.axisNo_, key.functionName_,
key.line_, formattedKey);
}
map_[key] = 0;
}
}
@@ -91,9 +94,20 @@ bool msgPrintControl::shouldBePrinted(char *portName, int axisNo,
return shouldBePrinted(key, wantToPrint, pasynUser);
}
void msgPrintControl::resetCount(msgPrintControlKey &key) {
void msgPrintControl::resetCount(msgPrintControlKey &key, asynUser *pasynUser) {
if (map_.find(key) != map_.end()) {
map_[key] = 0;
if (map_[key] != 0) {
if (pasynUser != nullptr) {
char formattedKey[100] = {0};
key.format(formattedKey, sizeof(formattedKey));
asynPrint(pasynUser, ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nError "
"associated with key \"%s\" has been resolved.\n",
key.controller_.c_str(), key.axisNo_,
key.functionName_, key.line_, formattedKey);
}
map_[key] = 0;
}
}
}