basic function is done
This commit is contained in:
parent
1aa750d619
commit
8cfb47880a
39
IsegGUI.py
39
IsegGUI.py
|
@ -187,26 +187,51 @@ class MyWindow(QMainWindow):
|
||||||
value = float(self.txtV[mod][ch].text())
|
value = float(self.txtV[mod][ch].text())
|
||||||
print("mod : " + str(mod) + ", ch : " + str(ch) + " | " + str(value))
|
print("mod : " + str(mod) + ", ch : " + str(ch) + " | " + str(value))
|
||||||
mpod.SetHV( mod*100 + ch, value)
|
mpod.SetHV( mod*100 + ch, value)
|
||||||
|
newValue = mpod.GetHV(mod*100+ch)
|
||||||
|
self.txtV[mod][ch].setText("{:.1f}".format(newValue))
|
||||||
|
|
||||||
def SetI(self, mod, ch):
|
def SetI(self, mod, ch):
|
||||||
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)
|
||||||
|
self.txtI[mod][ch].setText("{:.1f}".format(newValue))
|
||||||
|
|
||||||
def SetOnOff(self, mod, ch):
|
def SetOnOff(self, mod, ch):
|
||||||
state = self.chkON[mod][ch].checkState()
|
state = self.chkON[mod][ch].checkState()
|
||||||
print("mod : " + str(mod) + ", ch : " + str(ch) + " | " + str(state))
|
if state == Qt.CheckState.Checked:
|
||||||
if state == Qt.Checked :
|
if onOffList[sum(nChPerMod[:mod]) + ch] == 3 :
|
||||||
mpod.SwitchOnHV( mod*100 + ch, True)
|
mpod.SwitchOnHV(mod*100 + ch, 2)
|
||||||
|
mpod.SwitchOnHV( mod*100 + ch, 1)
|
||||||
|
onOffList[sum(nChPerMod[:mod]) + ch] = 1
|
||||||
else:
|
else:
|
||||||
mpod.SwitchOnHV( mod*100 + ch, False)
|
mpod.SwitchOnHV( mod*100 + ch, 0)
|
||||||
|
onOffList[sum(nChPerMod[:mod]) + ch] = 0
|
||||||
|
|
||||||
|
value = mpod.IsHVOn(mod*100 + ch)
|
||||||
|
# print("mod : " + str(mod) + ", ch : " + str(ch) + " | " + str(state) + " | " + str(onOffList[sum(nChPerMod[:mod]) + ch]) + " | " + str(value))
|
||||||
|
if value == 0 :
|
||||||
|
self.chkON[mod][ch].setChecked(False)
|
||||||
|
self.chkON[mod][ch].setStyleSheet("")
|
||||||
|
if value == 1 :
|
||||||
|
self.chkON[mod][ch].setChecked(True)
|
||||||
|
self.chkON[mod][ch].setStyleSheet("")
|
||||||
|
if value == 3 :
|
||||||
|
self.chkON[mod][ch].setChecked(False)
|
||||||
|
self.chkON[mod][ch].setStyleSheet("background-color: red;")
|
||||||
|
|
||||||
def on_timeout(self):
|
|
||||||
print("Timer timed out!")
|
|
||||||
|
|
||||||
def updateTimer(self):
|
def updateTimer(self):
|
||||||
self.time += 1
|
self.time += 1
|
||||||
print(f'Time: {self.time}')
|
# print(f'Time: {self.time}')
|
||||||
|
outVList = mpod.GetAllOutputHV()
|
||||||
|
outIList = mpod.GetAllLC()
|
||||||
|
# print(outVList)
|
||||||
|
for k in range(0, nMod):
|
||||||
|
for i, a in enumerate(modChList[k]) :
|
||||||
|
self.txtVOut[k][i].setText("{:.2f}".format(outVList[sum(nChPerMod[:k]) + i]))
|
||||||
|
self.txtIOut[k][i].setText("{:.2f}".format(outIList[sum(nChPerMod[:k]) + i]))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
|
|
|
@ -88,7 +88,7 @@ class Mpod:
|
||||||
|
|
||||||
def IsHVOn(self, ch):
|
def IsHVOn(self, ch):
|
||||||
if (self.isConnected == False ) : return 0
|
if (self.isConnected == False ) : return 0
|
||||||
return self.SendCmd(0, "outputSwitch.u"+str(ch))
|
return extract_number_between_parentheses(self.SendCmd(0, "outputSwitch.u"+str(ch)))
|
||||||
|
|
||||||
def GetHVRiseRate(self, ch):
|
def GetHVRiseRate(self, ch):
|
||||||
if (self.isConnected == False ) : return 0
|
if (self.isConnected == False ) : return 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user