mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-06-03 10:39:33 +00:00
Changed battry percentage to voltage
This commit is contained in:
@@ -112,7 +112,7 @@ def check_bat_v(item):
|
||||
def check_bat_p(item):
|
||||
if not item:
|
||||
return None
|
||||
if float(item) > 30: # todo config
|
||||
if float(item) > 10: # todo config
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
@@ -15,7 +15,7 @@ def selfcheck_selected():
|
||||
copter.refresh()
|
||||
data = {
|
||||
'anim_id': copter.anim_id,
|
||||
'batt_voltage': ((float(copter.batt_voltage) - 3.2) / (4.2 - 3.2)) * 100,
|
||||
'batt_voltage': copter.batt_voltage,
|
||||
'cell_voltage': copter.cell_voltage,
|
||||
'selfcheck': copter.selfcheck,
|
||||
'time': round(float(copter.time) - time(), 3),
|
||||
@@ -33,7 +33,7 @@ def selfcheck_all():
|
||||
copter.refresh()
|
||||
data.append({
|
||||
'anim_id': copter.anim_id,
|
||||
'batt_voltage': ((float(copter.batt_voltage) - 3.2) / (4.2 - 3.2)) * 100,
|
||||
'batt_voltage': copter.batt_voltage,
|
||||
'cell_voltage': copter.cell_voltage,
|
||||
'selfcheck': copter.selfcheck,
|
||||
'ip': copter.ip,
|
||||
|
||||
@@ -52,7 +52,7 @@ var table = new Tabulator("#copters-table", {
|
||||
{
|
||||
title: "Batt voltage", field: "batt_voltage", formatter: function (cell) {
|
||||
let voltage = cell.getValue();
|
||||
if (parseFloat(voltage) > 30) {
|
||||
if (parseFloat(voltage) > 10) {
|
||||
cell.getElement().style.background = green;
|
||||
} else if (voltage) {
|
||||
cell.getElement().style.background = red;
|
||||
|
||||
Reference in New Issue
Block a user