fix threahold Current display bug

This commit is contained in:
Ryan Tang 2024-11-05 09:31:53 -05:00
parent 1eb082213b
commit 00a5fc4de8

View File

@ -271,8 +271,11 @@ class MyWindow(QMainWindow):
# print(str(modID) + "," + str(chID)) # print(str(modID) + "," + str(chID))
self.txtName[modID][chID].setText(row[0]) self.txtName[modID][chID].setText(row[0])
self.txtName[modID][chID].setStyleSheet("")
self.txtV[modID][chID].setText(row[2]) self.txtV[modID][chID].setText(row[2])
self.txtV[modID][chID].setStyleSheet("")
self.txtI[modID][chID].setText(row[3]) self.txtI[modID][chID].setText(row[3])
self.txtI[modID][chID].setStyleSheet("")
# print("Setting " + row[1] ) # print("Setting " + row[1] )
mpod.SetHV(int(ch[1:]), float(row[2])) mpod.SetHV(int(ch[1:]), float(row[2]))
@ -307,8 +310,8 @@ class MyWindow(QMainWindow):
value = float(self.txtI[mod][ch].text()) value = float(self.txtI[mod][ch].text())
print("mod : " + str(mod) + ", ch : " + str(ch) + " | " + str(value)) print("mod : " + str(mod) + ", ch : " + str(ch) + " | " + str(value))
mpod.SetCurrent( mod*100 + ch, value/1000.) mpod.SetCurrent( mod*100 + ch, value/1000.)
newValue = mpod.GetCurrent(mod*100+ch) newValue = mpod.GetCurrent(mod*100+ch) * 1000.
self.txtI[mod][ch].setText("{:.1f}".format(newValue)) self.txtI[mod][ch].setText("{:.2f}".format(newValue))
def SwitchOnAllCh(self): def SwitchOnAllCh(self):
for k in range(0, nMod): for k in range(0, nMod):