From 10310ef335c87d43de6650039bf194fe5cb35764 Mon Sep 17 00:00:00 2001 From: nanovna <54525305+nanovna@users.noreply.github.com> Date: Fri, 24 Jan 2020 07:27:25 +0000 Subject: [PATCH] fix automatic sweep nValues logic --- libxavna/xavna_cpp.C | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libxavna/xavna_cpp.C b/libxavna/xavna_cpp.C index dc3778c..e24950a 100644 --- a/libxavna/xavna_cpp.C +++ b/libxavna/xavna_cpp.C @@ -35,8 +35,9 @@ namespace xaxaxa { } _dev = xavna_open(dev.c_str()); if(!_dev) throw runtime_error(strerror(errno)); - - if(isAutoSweep() != _lastDeviceIsAutosweep) { + + bool a = isAutoSweep(); + if(a != _lastDeviceIsAutosweep) { if(isAutoSweep()) { nValues = 2; nWait = -1; @@ -45,6 +46,7 @@ namespace xaxaxa { nWait = 20; } } + _lastDeviceIsAutosweep = a; } bool VNADevice::isTR() { if(!_dev) return true;