Unità di misura del valore calcolato
This commit is contained in:
@@ -543,3 +543,4 @@
|
||||
14/05/2021 15:15:22 FTSampler caught error: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
|
||||
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'
|
||||
|
||||
@@ -65,7 +65,8 @@ 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:LOG:STATUS',0)
|
||||
|
||||
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:
|
||||
@@ -80,7 +81,6 @@ if redSrv0.get('SETTINGS:SMOOTHING:FUNCTION') is None:
|
||||
redSrv0.set('SETTINGS:SMOOTHING:FUNCTION', 0)
|
||||
if redSrv0.get('SETTINGS:SMOOTHING:FACTOR') is None:
|
||||
redSrv0.set('SETTINGS:SMOOTHING:FACTOR', 10)
|
||||
|
||||
if redSrv0.get('SETTINGS:PASSWORD:CURRENT') is None:
|
||||
redSrv0.set('SETTINGS:PASSWORD:CURRENT',"-")
|
||||
if redSrv0.get('SETTINGS:FOLDER:CURRENT') is None:
|
||||
@@ -189,8 +189,8 @@ def calculateValue():
|
||||
v1 = getRedisVal('RTDATA:OUT:' + ch1)
|
||||
v2 = getRedisVal('RTDATA:OUT:' + ch2)
|
||||
den = (float(v1)-float(v2))
|
||||
if(den < 0.00001):
|
||||
den = 0.00001
|
||||
if(den < 0.001):
|
||||
den = 0.001
|
||||
newValue = float(v2)/float(den)
|
||||
redSrv0.set('RTDATA:VALUE',round(newValue,3))
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ def api_channels_all():
|
||||
'Outmin': OUTMIN,
|
||||
'Outmax': OUTMAX,
|
||||
'UniMeasure' : UNIMISURA,
|
||||
'CalcUMeasure' : getRedisVal('RTDATA:VALUE:UMEASURE'),
|
||||
'ChA' : getRedisVal('SETTINGS:CHANNEL:A'),
|
||||
'ChB' : getRedisVal('SETTINGS:CHANNEL:B'),
|
||||
'ChScaleMax' : getRedisVal('SETTINGS:IN:MAX:'+str(numCh)),
|
||||
@@ -138,6 +139,7 @@ def api_channels_current():
|
||||
#funzione api_channels_all: legge direttamente da redis, ritorna jsonify
|
||||
result = {
|
||||
'numCh' : numCh,
|
||||
'CalcUMeasure' : getRedisVal('RTDATA:VALUE:UMEASURE'),
|
||||
'SmoothFact' : getRedisVal('SETTINGS:SMOOTHING:FACTOR'),
|
||||
'ChanThresh' : getRedisVal('SETTINGS:POWER:THRESH'),
|
||||
'timeSrv' : getRedisVal('RTDATA:TIME:SRV'),
|
||||
@@ -325,6 +327,12 @@ def setPowerChannel(numPowerCh):
|
||||
redSrv0.set('SETTINGS:POWER:CH', numPowerCh)
|
||||
return "OK"
|
||||
|
||||
@flaskApp.route("/api/v1/setup/calcMeasureUnit", methods=['POST'])
|
||||
def VUnitMeasure():
|
||||
CMeasureUnit = request.form['CalcUMeasure']
|
||||
redSrv0.set('RTDATA:VALUE:UMEASURE', CMeasureUnit)
|
||||
return redirect("/settings")
|
||||
|
||||
@flaskApp.route("/api/v1/setup/selectProcessing/<processingType>", methods=['PUT'])
|
||||
def setProcessing(processingType):
|
||||
redSrv0.set('SETTINGS:SMOOTHING:FUNCTION', processingType)
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
//scarico unità di misura dei canali mostrati
|
||||
$("#UniMisuA").html(result.UniMeasure[result.ChA]);
|
||||
$("#UniMisuB").html(result.UniMeasure[result.ChB]);
|
||||
|
||||
$("#CalcUMeasure").html(result.CalcUMeasure);
|
||||
}});
|
||||
|
||||
// A ogni giro di data refresh fix di tabella cartelle e tabella file
|
||||
@@ -339,14 +339,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card text-center">
|
||||
<div class="card-header">
|
||||
<strong>Calcolo risultante</strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
[Valore B / (Valore A - Valore B)] = <span class="h6" id="ResultValue"></span>
|
||||
</div>
|
||||
<div class="card text-center">
|
||||
<div class="card-header">
|
||||
<strong>Calcolo risultante [Valore B / (Valore A - Valore B)]</strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<span class="h3" id="ResultValue"></span>
|
||||
<span class="h3" id="CalcUMeasure"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-xl-6">
|
||||
<div class="card my-2">
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
$("#UniMisura").val(result.UniMisura);
|
||||
$("#ChanThresh").val(result.ChanThresh);
|
||||
$("#SmoothFact").val(result.SmoothFact);
|
||||
$("#CalcUMeasure").val(result.CalcUMeasure);
|
||||
// inizio nascondendo div2 e div3
|
||||
$("#Div2").hide();
|
||||
$("#Div3").hide();
|
||||
@@ -346,6 +347,20 @@
|
||||
</form>
|
||||
</div>
|
||||
</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>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="col-12" method="POST" action="/api/v1/setup/calcMeasureUnit">
|
||||
<div class="row input-group my-2">
|
||||
<span class="input-group-text col-4">Unità di misura: </span>
|
||||
<input type="text" class=" form-control col-5" id="CalcUMeasure" name="CalcUMeasure"></input>
|
||||
<input type="submit" value="SET" class="btn btn-success col-3"></input>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card my-2 col-12">
|
||||
<div class="row card-header">
|
||||
<strong>Impostazioni canale e soglia per spegnimento</strong>
|
||||
|
||||
Reference in New Issue
Block a user