Fix SCPI parsing for arguments containing ':'; allow lower case calibration file names

This commit is contained in:
Jan Käberich 2024-06-24 09:04:17 +02:00
parent 253e2d3517
commit 2fbfb96dda
2 changed files with 4 additions and 3 deletions

View file

@ -281,7 +281,7 @@ Calibration::Calibration()
return SCPI::getResultName(SCPI::Result::Error);
}
return SCPI::getResultName(SCPI::Result::Empty);
}, nullptr));
}, nullptr, false));
add(new SCPICommand("LOAD", nullptr, [=](QStringList params) -> QString {
if(params.size() != 1) {
// no filename given or no calibration active
@ -292,7 +292,7 @@ Calibration::Calibration()
return SCPI::getResultName(SCPI::Result::False);
}
return SCPI::getResultName(SCPI::Result::True);
}));
}, false));
add(&kit);
}

View file

@ -442,7 +442,8 @@ QString SCPINode::parse(QString cmd, SCPINode* &lastNode)
if(cmd.isEmpty()) {
return "";
}
auto splitPos = cmd.indexOf(':');
auto cmdName = cmd.split(" ").front();
auto splitPos = cmdName.indexOf(':');
if(splitPos > 0) {
// have not reached a leaf, find next subnode
auto subnode = cmd.left(splitPos);