From 7631db0eb4ae811aa5ba3df61841eeab4295552a Mon Sep 17 00:00:00 2001 From: Spyros Stathopoulos Date: Wed, 13 Jan 2021 11:35:03 +0000 Subject: [PATCH] Fix V display update when Vread is not supplied in the callback Function `updateHistory` can be called with or without a supplied Vread. If Vread was not supplied that defaulted to `g.Vread` (global read-out voltage). However the default parameter assignment is taken at the moment the function is instantiated. So it was impossible to implicitly propagate the update Vread value to `updateHistory`. That now defaults to None and the value is read the moment the function is called. This is a backport from the pypify branch --- Globals/GlobalFunctions.py | 4 +++- source/version.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Globals/GlobalFunctions.py b/Globals/GlobalFunctions.py index 35820df..cf776c5 100644 --- a/Globals/GlobalFunctions.py +++ b/Globals/GlobalFunctions.py @@ -29,7 +29,9 @@ # Update history function -def updateHistory(w,b,m,a,pw,tag,Vread=g.Vread): +def updateHistory(w,b,m,a,pw,tag,Vread=None): + if Vread is None: + Vread = g.Vread readTag='R'+str(g.readOption) if g.sessionMode==1: g.Mnow=m/2 diff --git a/source/version.txt b/source/version.txt index cd2ea68..31884d7 100644 --- a/source/version.txt +++ b/source/version.txt @@ -1,2 +1,2 @@ DO NOT MODIFY! -1.5.1 +1.5.2