Skip to content

Commit

Permalink
Fix SCPI parsing for arguments containing ':'; allow lower case calib…
Browse files Browse the repository at this point in the history
…ration file names
  • Loading branch information
jankae committed Jun 24, 2024
1 parent 253e2d3 commit 2fbfb96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -292,7 +292,7 @@ Calibration::Calibration()
return SCPI::getResultName(SCPI::Result::False);
}
return SCPI::getResultName(SCPI::Result::True);
}));
}, false));
add(&kit);
}

Expand Down
3 changes: 2 additions & 1 deletion Software/PC_Application/LibreVNA-GUI/scpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2fbfb96

Please sign in to comment.