From 2e4828ab9e1652feebd64cfe4698cb7ba04ef28b Mon Sep 17 00:00:00 2001 From: Marco Locatelli Date: Tue, 6 Apr 2021 11:42:52 +0200 Subject: [PATCH] gauges readonly, fix elenco --- sampler/FTSampler.py | 12 ++++-------- server/FTServer.py | 3 +-- server/templates/about.html | 4 ++-- server/templates/logger.html | 5 +++-- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/sampler/FTSampler.py b/sampler/FTSampler.py index 690b2c1..35d0743 100644 --- a/sampler/FTSampler.py +++ b/sampler/FTSampler.py @@ -18,13 +18,11 @@ redSrv0 = redis.Redis( def getRedisVal(redisKey): return redSrv0.get(redisKey).decode('utf-8') -#assegno director: log per file di debug e data per file output +#assegno director log per file di debug LOG_path = "/home/pi/Flythis/logger/log/" -DATA_path = "/home/pi/data/" - -startingSampleFreq = 250 #intervallo in millisecondi fra un campionamento e il successivo +startingSampleFreq = 250 redSampleFreq = 'SETTINGS:LOG:FREQ' redSrv0.set(redSampleFreq,startingSampleFreq) @@ -86,17 +84,15 @@ try: outVal = chOutMin + ((inValue-chInMin) * (deltaOut / deltaIn)) return outVal -#ciclo principale, salva time attuale e se LOG:STATUS è 1 fa il ciclo principale +#ciclo principale while(1): now = datetime.datetime.now() redSrv0.set(redisTime,str(now)) - #print(logStatus) - # solo se su redis LOG è 1 eseguo il ciclo principale CHvalue = CH.ADS1256_GetAll() redisSave(CHvalue) # riporto ultima esecuzione ad adesso endExec = datetime.datetime.now() - # calcolo il delta dovuto alle esecuzioni + # calcolo il delta time dovuto alle esecuzioni delta = endExec - now waitTime = int(redSrv0.get(redSampleFreq)) / 1000 - delta.microseconds/1000000 if(waitTime < 0.1): diff --git a/server/FTServer.py b/server/FTServer.py index 85bfe02..20a0fc0 100644 --- a/server/FTServer.py +++ b/server/FTServer.py @@ -71,10 +71,10 @@ def about(): return render_template('about.html', **channelsData) # definisco una NUOVA route a cui rispondere su chiamta in metodo GET x restituire dati aggiornati +# funzione api_channels_all: legge direttamente da redis, ritorna jsonify @flaskApp.route("/api/v1/channels/all", methods=['GET']) def api_channels_all(): numCh = getRedisVal('SETTINGS:SELECTED_CH') - #funzione api_channels_all: legge direttamente da redis, ritorna jsonify CH = [0,0,0,0,0,0,0,0] OUT = [0,0,0,0,0,0,0,0] @@ -128,7 +128,6 @@ def api_channels_current(): # restituisce in formato json i dati letti da redis return jsonify(result) - # elenco file nella directory @flaskApp.route("/api/v1/files/list", methods=['GET']) def api_get_files(): diff --git a/server/templates/about.html b/server/templates/about.html index e0168f8..9ccbcef 100644 --- a/server/templates/about.html +++ b/server/templates/about.html @@ -19,11 +19,11 @@

Analog and Digital reader and logger software

-

Version 0.2.1

+

Version 1.0.1

Last Patched:
- 02/04/2021

+ 06/04/2021

diff --git a/server/templates/logger.html b/server/templates/logger.html index 9d11497..ab4941f 100644 --- a/server/templates/logger.html +++ b/server/templates/logger.html @@ -44,7 +44,6 @@ $("#LastSessionName").html(result.LastSessionName); }}); - timeout = setTimeout(dataRefresh, intTime); }; @@ -200,7 +199,7 @@ -
+
@@ -208,6 +207,8 @@
+
+
Logger period: ms