From 2fbfb96ddaf5ac8855daf59f318a6d81d8152b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Mon, 24 Jun 2024 09:04:17 +0200 Subject: [PATCH] Fix SCPI parsing for arguments containing ':'; allow lower case calibration file names --- .../PC_Application/LibreVNA-GUI/Calibration/calibration.cpp | 4 ++-- Software/PC_Application/LibreVNA-GUI/scpi.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Software/PC_Application/LibreVNA-GUI/Calibration/calibration.cpp b/Software/PC_Application/LibreVNA-GUI/Calibration/calibration.cpp index 3c27bb02..8d2de879 100644 --- a/Software/PC_Application/LibreVNA-GUI/Calibration/calibration.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Calibration/calibration.cpp @@ -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); } diff --git a/Software/PC_Application/LibreVNA-GUI/scpi.cpp b/Software/PC_Application/LibreVNA-GUI/scpi.cpp index b7ad43b1..9f6a0e6e 100644 --- a/Software/PC_Application/LibreVNA-GUI/scpi.cpp +++ b/Software/PC_Application/LibreVNA-GUI/scpi.cpp @@ -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);