732,19 → 732,28 |
msg = self.mk.getDebugMsg() |
voltage = msg.getVoltage() |
if (voltage == 0): |
# Board is probably fed by USB |
minVoltage = 0 |
maxVoltage = 1 |
else: |
# Determine the n umber of cells |
if (voltage > 4.2*3): |
nbCells = 4 |
else: |
nbCells = 3 |
minVoltage = nbCells*3.5 |
maxVoltage = nbCells*3.9 |
# Set minimum and maximum voltages |
if self.param.minVoltage > 0: |
minVoltage = self.param.minVoltage |
else: |
minVoltage = nbCells*3.5 # auto |
if self.param.maxVoltage > 0: |
maxVoltage = self.param.maxVoltage |
else: |
maxVoltage = nbCells*3.9 |
|
self._sendEvent("Voltage: %2.1fV" % voltage) |
self._sendEvent("Min/Max Voltage: %2.1fV-%2.1fV" % (minVoltage, maxVoltage), parVoltage=(minVoltage, maxVoltage, voltage)) |
|
|
self._sendEvent("Starting motor(s) (speed=%d)... " % self.param.motorStartupSpeed, speed=self.param.motorStartupSpeed) |
self._setMotorSpeed(self.param.motorStartupSpeed, self.param.motorStartupSettlingTime) |
|
859,7 → 868,10 |
self.settings["serialport"] = Setting("Serial Port", "COM1") |
self.settings["hpf"] = Setting("HP Filter cutoff (Hz)", 50) |
self.settings["lpf"] = Setting("LP Filter cutoff (Hz)", 180) |
self.settings["minvoltage"] = Setting("Minimum Bettery Voltage (0=Automatic) (V) ", 0) |
self.settings["maxvoltage"] = Setting("Maximum Bettery Voltage (0=Automatic) (V) ", 0) |
|
|
self.readSettings() |
|
if len(sys.argv)>1: |
995,6 → 1007,8 |
measureParams.serialPort = self.settings["serialport"].value |
measureParams.motorStartupSpeed = self.settings["startupspeed"].value |
measureParams.motorStartupSettlingTime = self.settings["startupsettling"].value |
measureParams.minVoltage = self.settings["minvoltage"].value |
measureParams.maxVoltage = self.settings["maxvoltage"].value |
|
self.measureThread = MeasureThread(measureParams, dialog) |
self.measureThread.start() |