gestione soglia, gestione timer, fix lingua

This commit is contained in:
Marco Locatelli
2021-05-25 15:20:27 +02:00
parent 24929a5700
commit cf744852d5
11 changed files with 165 additions and 80 deletions
+57
View File
@@ -544,3 +544,60 @@
17/05/2021 09:51:36 FTSampler caught error: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
17/05/2021 11:12:38 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
21/05/2021 14:59:25 FTSampler caught error: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
24/05/2021 16:26:29 FTSampler caught error: local variable 'numReqPowerOff' referenced before assignment
24/05/2021 16:26:42 FTSampler caught error: local variable 'numReqPowerOff' referenced before assignment
24/05/2021 16:39:31 FTSampler caught error: local variable 'numReqPowerOff' referenced before assignment
25/05/2021 13:20:29 FTSampler caught error: could not convert string to float:
25/05/2021 13:20:42 FTSampler caught error: could not convert string to float:
25/05/2021 13:53:58 FTSampler caught error: could not convert string to float:
25/05/2021 13:54:09 FTSampler caught error: could not convert string to float:
25/05/2021 13:54:29 FTSampler caught error: could not convert string to float:
25/05/2021 13:54:46 FTSampler caught error: could not convert string to float:
25/05/2021 14:00:26 FTSampler caught error: could not convert string to float:
25/05/2021 14:21:47 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:21:53 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:21:58 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:22:04 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:22:09 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:22:15 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:22:20 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:22:26 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:22:31 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:22:35 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:22:40 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:22:46 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:22:51 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:22:57 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:23:02 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
25/05/2021 14:23:08 FTSampler caught error: float() argument must be a string or a number, not 'datetime.timedelta'
25/05/2021 14:23:13 FTSampler caught error: float() argument must be a string or a number, not 'datetime.timedelta'
25/05/2021 14:23:19 FTSampler caught error: float() argument must be a string or a number, not 'datetime.timedelta'
25/05/2021 14:23:24 FTSampler caught error: float() argument must be a string or a number, not 'datetime.timedelta'
25/05/2021 14:23:29 FTSampler caught error: float() argument must be a string or a number, not 'datetime.timedelta'
25/05/2021 14:23:35 FTSampler caught error: float() argument must be a string or a number, not 'datetime.timedelta'
25/05/2021 14:23:40 FTSampler caught error: float() argument must be a string or a number, not 'datetime.timedelta'
25/05/2021 14:23:46 FTSampler caught error: float() argument must be a string or a number, not 'datetime.timedelta'
25/05/2021 14:23:51 FTSampler caught error: float() argument must be a string or a number, not 'datetime.timedelta'
25/05/2021 14:28:02 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:28:08 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:28:09 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:28:15 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:28:20 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:28:26 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:28:26 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:28:31 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:28:37 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:28:42 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:28:49 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:28:54 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:29:00 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:29:05 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:29:11 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:29:17 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:29:22 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:29:28 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:29:33 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:29:39 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:29:45 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:29:51 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
25/05/2021 14:29:57 FTSampler caught error: 'datetime.timedelta' object has no attribute 'strftime'
Binary file not shown.
+15 -15
View File
@@ -1,5 +1,6 @@
#!/usr/bin/python
import os
import math
import time
import datetime
@@ -14,8 +15,6 @@ redSrv0 = redis.Redis(
port=REDIS_PORT,
db=0)
numReqPowerOff = 0
#funzione per leggere e decodificare da redis
def getRedisVal(redisKey):
if redSrv0.get(redisKey) is None:
@@ -56,27 +55,26 @@ def getRmsVal(redisKey, numVal):
LOG_path = "/home/pi/Flythis/"
#intervallo in millisecondi fra un campionamento e il successivo
startingSampleFreq = 100
redSampleFreq = 'SETTINGS:LOG:FREQ'
redSrv0.set(redSampleFreq,startingSampleFreq)
redSrv0.set(redSampleFreq,100)
#definizioni variabili
redRmsList ='RTDATA:RMSLIST'
redSamPer='SETTINGS:LOG:EXETIME'
#se non c'è un valore nei campi di redis, popolo il db
redSrv0.set('SETTINGS:DECIMALS:COUNT',3)
redSrv0.set('SETTINGS:DECIMALS:COUNT',2)
redSrv0.set('SETTINGS:LOG:STATUS',0)
redSrv0.set('SETTINGS:POWER:CH', 10)
redSrv0.set('SETTINGS:POWER:UPTIME', 180)
if redSrv0.get('RTDATA:VALUE:UMEASURE') is None:
redSrv0.set('RTDATA:VALUE:UMEASURE', "-")
if redSrv0.get('SETTINGS:LOG:EXETIME') is None:
redSrv0.set('SETTINGS:LOG:EXETIME', 1)
if redSrv0.get('RTDATA:VALUE') is None:
redSrv0.set('RTDATA:VALUE', 1)
if redSrv0.get('SETTINGS:POWER:CH') is None:
redSrv0.set('SETTINGS:POWER:CH', 10)
if redSrv0.get('SETTINGS:POWER:THRESH') is None:
redSrv0.set('SETTINGS:POWER:THRESH', 1)
redSrv0.set('SETTINGS:POWER:THRESH', 0)
if redSrv0.get('SETTINGS:POWER:OFF') is None:
redSrv0.set('SETTINGS:POWER:OFF', 0)
if redSrv0.get('SETTINGS:SMOOTHING:FUNCTION') is None:
@@ -178,16 +176,17 @@ def scaleVal(inValue, chIndex):
def checkPowerOff():
powerChannel = getRedisVal('SETTINGS:POWER:CH')
if(int(powerChannel) < 10):
#controllo che non ci sia già una richiesta di spegnimento
if(getRedisVal('SETTINGS:POWER:OFF')=="0"):
limitVal = float(getRedisVal('SETTINGS:POWER:THRESH'))
actVal = float(getRedisVal('RTDATA:CH:' + str(powerChannel)))
if(actVal > limitVal):
# resetto contatore
numReqPowerOff = 0
else:
numReqPowerOff += 1
if(numReqPowerOff > 10):
# chiedo spognimento
#controllo che il valore letto sia inferiore al valore impostato di soglia
if(actVal < limitVal):
#controllo che il sistema sia acceso da 180 secondi prima di spegnere
UptimePower = getRedisVal('SETTINGS:POWER:UPTIME')
sysUptime = os.popen("awk '{print $1}' /proc/uptime").readline()
if float(sysUptime) > float(UptimePower):
# chiedo spegnimento
redSrv0.set('SETTINGS:POWER:OFF',1)
def calculateValue():
@@ -224,6 +223,7 @@ try:
endExec = datetime.datetime.now()
# calcolo il delta time dovuto alle esecuzioni
delta = endExec - now
redSrv0.set('SETTINGS:EXE:TIME',str(delta))
oldSPeriod=float(getRedisVal(redSamPer))
newSPeriod=0.5*oldSPeriod+0.5*(float(delta.microseconds/1000))
redSrv0.set(redSamPer,newSPeriod)
+17
View File
@@ -154,6 +154,7 @@ def api_channels_current():
'MinIn' : getRedisVal('SETTINGS:IN:MIN:'+str(numCh)),
'UniMisura' : getRedisVal('SETTINGS:UNIT:MEASURE:'+str(numCh)),
'CurrentWorkFolder' : getRedisVal('SETTINGS:FOLDER:CURRENT'),
'MinUptime' : getRedisVal('SETTINGS:POWER:UPTIME'),
'ShowDiv01' : showDiv1,
'ShowDiv02' : showDiv2,
'ShowDiv03' : showDiv3,
@@ -297,6 +298,7 @@ def setupInMin():
indCh = getRedisVal('SETTINGS:SELECTED_CH')
currChVal = redSrv0.get('RTDATA:CH:'+ str(indCh))
redSrv0.set('SETTINGS:IN:MIN:'+ str(indCh), currChVal)
redSrv0.save()
return redirect("/settings")
@flaskApp.route("/api/v1/setup/saveInMax", methods=['PUT'])
@@ -305,43 +307,53 @@ def setupInMax():
indCh = getRedisVal('SETTINGS:SELECTED_CH')
currChVal = redSrv0.get('RTDATA:CH:'+ str(indCh))
redSrv0.set('SETTINGS:IN:MAX:'+ str(indCh), currChVal)
redSrv0.save()
return redirect("/settings")
@flaskApp.route("/api/v1/setup/selectChannelA/<numChA>", methods=['PUT'])
def selectChannelA(numChA):
redSrv0.set('SETTINGS:CHANNEL:A', numChA)
redSrv0.save()
return "OK"
@flaskApp.route("/api/v1/setup/selectChannelB/<numChB>", methods=['PUT'])
def selectChannelB(numChB):
redSrv0.set('SETTINGS:CHANNEL:B', numChB)
redSrv0.save()
return "OK"
@flaskApp.route("/api/v1/setup/selectChannel/<numCh>", methods=['PUT'])
def setChannel(numCh):
redSrv0.set('SETTINGS:SELECTED_CH', numCh)
redSrv0.save()
return redirect("/settings")
@flaskApp.route("/api/v1/setup/selectPowerChannel/<numPowerCh>", methods=['PUT'])
def setPowerChannel(numPowerCh):
redSrv0.set('SETTINGS:POWER:CH', numPowerCh)
redSrv0.save()
return "OK"
@flaskApp.route("/api/v1/setup/calcMeasureUnit", methods=['POST'])
def VUnitMeasure():
CMeasureUnit = request.form['CalcUMeasure']
redSrv0.set('RTDATA:VALUE:UMEASURE', CMeasureUnit)
redSrv0.save()
return redirect("/settings")
@flaskApp.route("/api/v1/setup/selectProcessing/<processingType>", methods=['PUT'])
def setProcessing(processingType):
redSrv0.set('SETTINGS:SMOOTHING:FUNCTION', processingType)
redSrv0.save()
return "OK"
@flaskApp.route("/api/v1/threshold", methods=['POST'])
def setPowerThreshold():
powerThreshold = request.form['ChanThresh']
redSrv0.set('SETTINGS:POWER:THRESH', powerThreshold)
minUptime = request.form['MinUptime']
redSrv0.set('SETTINGS:POWER:UPTIME', minUptime)
redSrv0.save()
# rimando in settings
return redirect("/settings")
@@ -349,6 +361,7 @@ def setPowerThreshold():
def setSmoothFact():
smoothingFactor = request.form['SmoothFact']
redSrv0.set('SETTINGS:SMOOTHING:FACTOR', smoothingFactor)
redSrv0.save()
# rimando in settings
return redirect("/settings")
@@ -359,6 +372,7 @@ def setWriteFrequency():
redSrv0.set('SETTINGS:WRITE:FREQ', newWriteFrequency)
newLogFrequency = request.form['LogFreq']
redSrv0.set('SETTINGS:LOG:FREQ', newLogFrequency)
redSrv0.save()
# rimando in settings
return redirect("/settings")
@@ -367,6 +381,7 @@ def setDecimalsCount():
#funzione set decimali, scrive su SETTINGS:DECIMALS:COUNT
newDecimalsCount = request.form['DecimalsCount']
redSrv0.set('SETTINGS:DECIMALS:COUNT', newDecimalsCount)
redSrv0.save()
# rimando in settings
return redirect("/settings")
@@ -396,6 +411,7 @@ def setScale():
redSrv0.set('SETTINGS:OUT:MAX:'+ str(indexCh), scaleMax)
uniMisura = request.form['UniMisura']
redSrv0.set('SETTINGS:UNIT:MEASURE:'+ str(indexCh), uniMisura)
redSrv0.save()
# rimando in settings
return redirect("/settings")
@@ -413,6 +429,7 @@ def resetSetup():
redSrv0.set('SETTINGS:OUT:MIN:'+str(numCh),0)
redSrv0.set('SETTINGS:UNIT:MEASURE:'+str(numCh),"-")
# rimando in settings
redSrv0.save()
return redirect("/settings")
@flaskApp.route("/api/v1/setup/poweroff", methods=['PUT'])
+2 -2
View File
@@ -28,9 +28,9 @@
<div class="card-body">
Steamware 2021
<br>
Analog/Digital logger software
Software di lettura e scrittura per canali analogici e digitali
<br>
V 1.0.0
V 1.0.1
</div>
</div>
</main>
+3 -3
View File
@@ -41,19 +41,19 @@
<br>
<div class="row">
<div class="col-12">
<a href="settings" class="btn btn-block btn-primary text-uppercase">Setup</a>
<a href="settings" class="btn btn-block btn-primary text-uppercase">Impostazioni</a>
</div>
</div>
<br>
<div class="row">
<div class="col-12">
<a href="about" class="btn btn-block btn-primary text-uppercase">About</a>
<a href="about" class="btn btn-block btn-primary text-uppercase">Info</a>
</div>
</div>
<div class="row">
<div class="col-4"></div>
<button type="button" class="btn btn-danger col-4 my-4" onclick="powerOff()">
<img src="../static/img/power.svg" height="36" width="36"> <br> POWER OFF </button>
<img src="../static/img/power.svg" height="36" width="36"> <br> SHUT DOWN </button>
</div>
<div class="col-4"></div>
</div>
+2 -2
View File
@@ -33,10 +33,10 @@
<a class="nav-link" href="logger">Logger</a>
</li>
<li class="nav-item">
<a class="nav-link" href="settings">Setup</a>
<a class="nav-link" href="settings">Impostazioni</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about">About</a>
<a class="nav-link" href="about">Info</a>
</li>
</ul>
</div>
+6 -6
View File
@@ -309,7 +309,7 @@
<div class="col-6 pr-0">
<div class="card text-center">
<div class="card-header">
<strong>Channel A: <span id="SelChannelA"></span></strong>
<strong>Canale A: <span id="SelChannelA"></span></strong>
</div>
<div class="card-body">
<div id="divChA"></div>
@@ -325,7 +325,7 @@
<div class="col-6 pl-0">
<div class="card text-center">
<div class="card-header">
<strong>Channel B: <span id="SelChannelB"></span></strong>
<strong>Canale B: <span id="SelChannelB"></span></strong>
</div>
<div class="card-body">
<div id="divChB"></div>
@@ -355,11 +355,11 @@
<div class="row">
<div class="col-6">
<button id="btnStart" type="button" class="btn btn-success btn-block" style="font-size: 110%" onclick="startLog()">
<img src="../static/img/play-fill.svg" height="24" width="24">&nbsp; Start Log</button>
<img src="../static/img/play-fill.svg" height="24" width="24">&nbsp; Inizia Scrittura</button>
</div>
<div class="col-6">
<button id="btnStop" type="button" class="btn btn-danger btn-block" style="font-size: 110%" onclick="stopLog()">
<img src="../static/img/stop-fill.svg" height="24" width="24">&nbsp; Stop Log</button>
<img src="../static/img/stop-fill.svg" height="24" width="24">&nbsp; Ferma Scrittura</button>
</div>
</div>
</div>
@@ -386,11 +386,11 @@
</div>
<div class="col-4">
<button type="button" style="font-size: 90%" class="btn btn-primary btn-block" onclick="exportData()">
<img src="../static/img/download.svg" height="24" width="24"> &nbsp; Esporta</button>
<img src="../static/img/download.svg" height="24" width="24"> &nbsp; Salva su USB</button>
</div>
<div class="col-4">
<button type="button" style="font-size: 90%" class="btn btn-warning btn-block" onclick="deleteData()">
<img src="../static/img/folder-x.svg" height="24" width="24"> &nbsp; Cancella</button>
<img src="../static/img/folder-x.svg" height="24" width="24"> &nbsp; Elimina dati</button>
</div>
</div>
</div>
+55 -52
View File
@@ -36,6 +36,7 @@
$("#ChanThresh").val(result.ChanThresh);
$("#SmoothFact").val(result.SmoothFact);
$("#CalcUMeasure").val(result.CalcUMeasure);
$("#MinUptime").val(result.MinUptime);
// inizio nascondendo div2 e div3
$("#Div2").hide();
$("#Div3").hide();
@@ -252,7 +253,7 @@
<strong>Impostazioni scalatura</strong>
</div>
<div class="col-3 text-right">
<label for="sel1"> Channel</label>
<label for="sel1"> Canale</label>
</div>
<div class="col-4 text-right">
<div class="form-group">
@@ -296,9 +297,9 @@
<div class="col-2"></div>
<div class="col-8">
<div class="row">
<div class="col-5 px-0"><button type="button" class="btn btn-secondary" onclick="saveMin()">Save Min</button></div>
<div class="col-5 px-0"><button type="button" class="btn btn-secondary" onclick="saveMin()">Salva Min</button></div>
<div class="col-2"></div>
<div class="col-5 px-0"><button type="button" class="btn btn-info" onclick="saveMax()">Save Max</button></div>
<div class="col-5 px-0"><button type="button" class="btn btn-info" onclick="saveMax()">Salva Max</button></div>
</div>
</div>
<div class="col-2"></div>
@@ -340,7 +341,7 @@
<div class="row text-center">
<div class="col-2"></div>
<div class="col-8">
<input type="submit" value="SET IN/OUT SCALE" class="btn btn-success btn-block mt-2"></input>
<input type="submit" value="IMPOSTA SCALATURA" class="btn btn-success btn-block mt-2"></input>
</div>
<div class="col-2"></div>
</div>
@@ -349,7 +350,7 @@
</div>
<div class="card my-2 col-12">
<div class="row card-header">
<strong>Unità di misura della risultante [Valore B / (Valore A - Valore B)]</strong>
<strong>Unità di misura del risultato di [Valore B / (Valore A - Valore B)]</strong>
</div>
<div class="card-body">
<form class="col-12" method="POST" action="/api/v1/setup/calcMeasureUnit">
@@ -361,48 +362,6 @@
</form>
</div>
</div>
<div class="card my-2 col-12">
<div class="row card-header">
<strong>Impostazioni canale e soglia per spegnimento</strong>
</div>
<div class="card-body">
<div class="row">
<div class="col-12">
<i>Impostazione canale analogico a soglia per gestione autospegnimento.</i>
</div>
<br>
<div class="col-12">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Selezione canale</span>
</div>
<select class="form-control" id="SelPowerChannel" onchange="setPowerChannel(this)">
<option value="10">Nessuno</option>
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
</select>
</div>
</div>
<form class="col-12" method="POST" action="/api/v1/threshold">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Soglia spegnimento: &nbsp;</span>
</div>
<input type="number" step="0.1" min="0" max="3.3" class="form-control" id="ChanThresh" name="ChanThresh"></input>
<div class="input-group-append">
<input type="submit" value="SET" class="btn btn-success "></input>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="card my-2 col-12">
<div class="row card-header">
<strong>Tipo processing</strong>
@@ -444,7 +403,7 @@
<form class="col-12" method="POST" action="/api/v1/decimals">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Decimals Count: &nbsp;</span>
<span class="input-group-text">Numero di cifre decimali: &nbsp;</span>
</div>
<input type="number" class="form-control" id="DecimalsCount" name="DecimalsCount"></input>
<div class="input-group-append">
@@ -454,6 +413,50 @@
</form>
</div>
</div>
<div class="card my-2 col-12">
<div class="row card-header">
<strong>Impostazione canale da monitorare per soglia spegnimento</strong>
</div>
<div class="card-body">
<div class="row">
<div class="col-12">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Selezione canale</span>
</div>
<select class="form-control" id="SelPowerChannel" onchange="setPowerChannel(this)">
<option value="10">Nessuno</option>
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
</select>
</div>
</div>
<form class="col-12" method="POST" action="/api/v1/threshold">
<div class="input-group">
<span class="input-group-text">Soglia spegnimento: &nbsp;</span>
<input type="number" step="0.1" min="0" max="3.3" class="form-control" id="ChanThresh" name="ChanThresh"></input>
</div>
<div class="input-group">
<span class="input-group-text">Tempo minimo prima dello spegnimento (s): &nbsp;</span>
<input type="number" min="180" class="form-control" id="MinUptime" name="MinUptime"></input>
</div>
<div class="row">
<div class="col-2"></div>
<div class="col-8">
<input type="submit" value="SET" class="btn btn-success btn-block mt-2"></input>
</div>
<div class="col-2"></div>
</div>
</form>
</div>
</div>
</div>
<div class="card my-2 col-12">
<div class="row card-header">
<i class="fas fa-table mr-1"></i>
@@ -462,11 +465,11 @@
<div class="card-body row">
<form class="col-12" method="POST" action="/api/v1/frequency">
<div class="input-group row my-2 px-0">
<span class="col-6 input-group-text">Sample Period (ms): &nbsp;</span>
<span class="col-6 input-group-text">Periodo di campionamento (ms): &nbsp;</span>
<input type="number" class="col-6 form-control" id="LogFreq" name="LogFreq"></input>
</div>
<div class="input-group row my-2 px-0">
<span class="col-6 input-group-text">Log Period (ms): &nbsp;</span>
<span class="col-6 input-group-text">Periodo di scrittura su file (ms): &nbsp;</span>
<input type="number" class="col-6 form-control" id="WriteFreq" name="WriteFreq"></input>
<br>
</div>
@@ -483,14 +486,14 @@
<div class="card my-2 col-12">
<div class="row card-header">
<i class="fas fa-table mr-1"></i>
<strong>Reset default settings</strong>
<strong>Ripristina impostazioni predefinite</strong>
</div>
<div class="card-body">
<form method="POST" action="/api/v1/setup/resetSettings">
<div class="row text-center">
<div class="col-2"></div>
<div class="col-8">
<input type="submit" value="RESET SETTINGS" class="btn btn-danger btn-block mt-2"></input>
<input type="submit" value="RESET IMPOSTAZIONI" class="btn btn-danger btn-block mt-2"></input>
</div>
<div class="col-2"></div>
</div>
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/python
import os
raspbUptime = os.popen("awk '{print $1}' /proc/uptime").readline()
print(raspbUptime)
if float(raspbUptime) > 2000:
print("yo")
BIN
View File
Binary file not shown.