From 28a782d615dc1a48e261e00f9e3ec19d77979416 Mon Sep 17 00:00:00 2001 From: Marco Locatelli Date: Mon, 12 Apr 2021 14:49:19 +0200 Subject: [PATCH] fix finali + datarefresh corretto --- sampler/FTSampler.py | 2 +- server/FTServer.py | 4 +- server/templates/about.html | 14 ++++++- server/templates/home.html | 14 ++++++- server/templates/layout.html | 2 +- server/templates/logger.html | 43 +++++++++---------- server/templates/settings.html | 76 ++++++++++++++++++---------------- 7 files changed, 91 insertions(+), 64 deletions(-) diff --git a/sampler/FTSampler.py b/sampler/FTSampler.py index 195364c..597a4ad 100644 --- a/sampler/FTSampler.py +++ b/sampler/FTSampler.py @@ -2,8 +2,8 @@ import time import datetime -import ADS1256 import RPi.GPIO as GPIO +import ADS1256 import redis #configurazione per lavorare su server redis locale diff --git a/server/FTServer.py b/server/FTServer.py index 703e059..fa59ef4 100644 --- a/server/FTServer.py +++ b/server/FTServer.py @@ -158,7 +158,7 @@ def api_get_folders(): idx=0 # for item in sorted(data): for item in folderList: - current = {"Cartelle": item} + current = {"Elenco Cartelle": item} lista.append(current) idx=idx+1 return jsonify(folderTable = lista) @@ -179,7 +179,7 @@ def api_get_files(): t_obj = time.strptime(time.ctime(os.path.getctime(workingDirectory+"/"+item))) # Transforming the time object to a timestamp T_stamp = time.strftime("%Y-%m-%d %H:%M:%S", t_obj) - current = {"Nome file": item, "Size (bytes)": os.path.getsize(workingDirectory+"/"+item), "Data modifica":T_stamp} + current = {"Nome": item, "Size (bytes)": os.path.getsize(workingDirectory+"/"+item), "Data creazione":T_stamp} lista.append(current) idx=idx+1 return jsonify(fileTable = lista) diff --git a/server/templates/about.html b/server/templates/about.html index e93423b..53e9327 100644 --- a/server/templates/about.html +++ b/server/templates/about.html @@ -3,7 +3,19 @@ {% block content %}
diff --git a/server/templates/home.html b/server/templates/home.html index c8ec7c9..56c1f73 100644 --- a/server/templates/home.html +++ b/server/templates/home.html @@ -3,7 +3,19 @@ {% block content %}
diff --git a/server/templates/layout.html b/server/templates/layout.html index 9488401..c4b392a 100644 --- a/server/templates/layout.html +++ b/server/templates/layout.html @@ -53,7 +53,7 @@
-
© Steamware srl 2021 +
© Steamware 2021
diff --git a/server/templates/logger.html b/server/templates/logger.html index 7735518..61bfe63 100644 --- a/server/templates/logger.html +++ b/server/templates/logger.html @@ -19,13 +19,11 @@ $.ajax({url: "/api/v1/channels/all", success: function(result){ // compilo i dati scaricati $("#SelChannelA").html(result.ChA); - // $("#ChannelA").html(result.Channels[result.ChA]); $("#OutputA").html(result.Outs[result.ChA]); setGaugeA(result.Outs[result.ChA],result.Outmin[result.ChA],result.Outmax[result.ChA]); $("#SelChannelB").html(result.ChB); - $("#ChannelB").html(result.Channels[result.ChB]); $("#OutputB").html(result.Outs[result.ChB]); setGaugeB(result.Outs[result.ChB],result.Outmin[result.ChB],result.Outmax[result.ChB]); @@ -36,6 +34,7 @@ $("#ServerTime").html(result.timeSrv); $("#LastSessionName").html(result.LastSessionName); $("#CurrentFolder").html(result.CurrentWorkFolder); + // Se ho una current folder assegnata, la mostro e mostro contenuto. Altrimenti mostro elenco cartelle. if(result.CurrentWorkFolder == "") { $("#Div7").hide(); @@ -52,7 +51,21 @@ $("#Div10").show(); $("#Div11").show(); } + // Se LOG:STATUS è 0, mostro solo Start Log. se è 1, mostro solo Stop Log + if(result.Status == "0") + { + $("#btnStart").show(); + $("#btnStop").hide(); + } + else if(result.Status == "1") + { + $("#btnStart").hide(); + $("#btnStop").show(); + } }}); + // A ogni giro di data refresh fix di tabella cartelle e tabella file + fixFolderTable(); + fixFileTable(); timeout = setTimeout(dataRefresh, intTime); }; @@ -102,11 +115,7 @@ ,url: "/api/v1/log/start" ,data: "" }) - $("#btnStart").hide(); - $("#btnStop").show(); // fix table - fixFileTable(); - fixFolderTable(); dataRefresh(); }; @@ -117,11 +126,7 @@ ,url: "/api/v1/log/stop" ,data: "" }) - $("#btnStart").show(); - $("#btnStop").hide(); // fix table - fixFileTable(); - fixFolderTable(); dataRefresh(); }; @@ -132,8 +137,6 @@ ,data: "" }) // fix table - fixFileTable(); - fixFolderTable(); dataRefresh(); }; @@ -145,8 +148,6 @@ ,data: "" }) // fix table - fixFileTable(); - fixFolderTable(); dataRefresh(); }; @@ -159,13 +160,9 @@ ,url: "/api/v1/data/delete" ,data: "" }) - fixFolderTable(); - fixFileTable(); dataRefresh(); } else{ - fixFolderTable(); - fixFileTable(); dataRefresh(); } }; @@ -303,15 +300,15 @@
-
Cartella attuale:  
/
-
Sessione attuale:  
/
+
Cartella attuale:  
+
Sessione attuale:  

- Cartella:   - + Seleziona o Crea Cartella:   +
@@ -319,7 +316,7 @@
- +
diff --git a/server/templates/settings.html b/server/templates/settings.html index 2b22445..3a86b2c 100644 --- a/server/templates/settings.html +++ b/server/templates/settings.html @@ -225,36 +225,36 @@
-
+
-
MIN
-
Attuale
-
MAX
+
MIN
+
Attuale
+
MAX
+
+
+
+
+
+
+
+
+
+
+
IN
-
-
000
-
000
-
000
-
-
-
-
-
-
-
-
-
-
-
+
+
000
+
000
+
000
@@ -264,11 +264,11 @@
OUT
-
+
-
{{ Out0 }}
-
+
{{ Out0 }}
+
@@ -279,9 +279,7 @@
-
- -
+
@@ -295,15 +293,21 @@
-
- Periodo di campionamento (ms):   - +
+ Sample Period (ms):   +
-
- Periodo di scrittura (ms):   - +
+ Write Period (ms):   +
- +
+
+
+
+ +
+
@@ -311,13 +315,15 @@
- Reset impostazioni predefinite + Reset default settings
-
+
- +
+ +