Configtool: Steinhart-Hart temperature fields should allow floats.

This is, the parameter entry fields in the GUI, not in the
generated temperature table. Allowing floats is a tiny bit more
precise and also, more importantly, less confusing for the user.
--Traumflug

This is related to issue #176.
This commit is contained in:
jbernardis 2015-07-21 20:50:13 -04:00 committed by Markus Hitter
parent 4fdb2dac9e
commit feb57c3eb0
2 changed files with 8 additions and 8 deletions

View File

@ -410,7 +410,10 @@ class AddSensorDlg(wx.Dialog):
def onParam1Entry(self, evt):
if self.currentMode == MODE_THERMISTOR:
if self.currentMethod == METHOD_BETA:
self.param1Valid = self.onTextCtrlInteger(self.param1, True)
else:
self.param1Valid = self.onTextCtrlFloat(self.param1, True)
self.checkValuesForPreset()
else:
self.param1Valid = True
@ -432,10 +435,7 @@ class AddSensorDlg(wx.Dialog):
def onParam3Entry(self, evt):
if self.currentMode == MODE_THERMISTOR:
if self.currentMethod == METHOD_BETA:
self.param3Valid = self.onTextCtrlFloat(self.param3, True)
else:
self.param3Valid = self.onTextCtrlInteger(self.param3, True)
self.checkValuesForPreset()
else:
self.param3Valid = True
@ -463,7 +463,7 @@ class AddSensorDlg(wx.Dialog):
if self.currentMethod == METHOD_BETA:
self.param5Valid = True
else:
self.param5Valid = self.onTextCtrlInteger(self.param5, True)
self.param5Valid = self.onTextCtrlFloat(self.param5, True)
self.checkValuesForPreset()
else:
self.param5Valid = True

View File

@ -131,8 +131,8 @@ def SteinhartHartTable(ofp, params, names, idx, settings, finalTable):
params[6]))
ofp.output(" {")
thrm = SHThermistor(int(params[0]), int(params[1]), int(params[2]),
int(params[3]), int(params[4]), int(params[5]),
thrm = SHThermistor(int(params[0]), float(params[1]), int(params[2]),
float(params[3]), int(params[4]), float(params[5]),
int(params[6]))
for t in idx: