Merge remote-tracking branch 'origin/develop'
This commit is contained in:
@@ -388,3 +388,159 @@
|
||||
29/04/2021 17:04:46 FTSampler caught error: can only concatenate str (not "int") to str
|
||||
30/04/2021 09:58:45 FTSampler caught error: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
|
||||
30/04/2021 09:58:51 FTSampler caught error: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
|
||||
14/05/2021 12:58:54 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 12:58:59 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 12:59:05 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 12:59:10 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 12:59:16 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 12:59:21 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 12:59:27 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 12:59:32 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 12:59:38 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 12:59:43 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 12:59:49 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 12:59:54 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:00:00 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:00:05 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:00:11 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:00:16 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:00:22 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:00:27 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:00:33 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:00:38 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:00:44 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:00:49 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:00:55 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:00 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:06 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:11 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:17 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:22 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:28 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:33 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:39 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:44 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:50 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:53 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:01:55 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:02:01 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:02:06 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:02:12 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:02:17 FTSampler caught error: unsupported operand type(s) for -: 'str' and 'str'
|
||||
14/05/2021 13:02:23 FTSampler caught error: invalid literal for int() with base 10: '46.414'
|
||||
14/05/2021 13:02:24 FTSampler caught error: invalid literal for int() with base 10: '46.412'
|
||||
14/05/2021 13:02:28 FTSampler caught error: invalid literal for int() with base 10: '46.412'
|
||||
14/05/2021 13:02:34 FTSampler caught error: invalid literal for int() with base 10: '46.404'
|
||||
14/05/2021 13:02:39 FTSampler caught error: invalid literal for int() with base 10: '46.412'
|
||||
14/05/2021 13:02:45 FTSampler caught error: unsupported operand type(s) for /: 'str' and 'float'
|
||||
14/05/2021 13:02:47 FTSampler caught error: unsupported operand type(s) for /: 'str' and 'float'
|
||||
14/05/2021 13:02:48 FTSampler caught error: unsupported operand type(s) for /: 'str' and 'float'
|
||||
14/05/2021 13:02:52 FTSampler caught error: unsupported operand type(s) for /: 'str' and 'float'
|
||||
14/05/2021 13:02:58 FTSampler caught error: unsupported operand type(s) for /: 'str' and 'float'
|
||||
14/05/2021 13:03:03 FTSampler caught error: unsupported operand type(s) for /: 'str' and 'float'
|
||||
14/05/2021 13:03:09 FTSampler caught error: unsupported operand type(s) for /: 'str' and 'float'
|
||||
14/05/2021 13:03:14 FTSampler caught error: unsupported operand type(s) for /: 'str' and 'float'
|
||||
14/05/2021 13:06:06 FTSampler end. Ctrl+C from user
|
||||
14/05/2021 13:06:23 FTSampler end. Ctrl+C from user
|
||||
14/05/2021 14:49:20 FTSampler caught error: Invalid input of type: 'datetime'. Convert to a bytes, string, int or float first.
|
||||
14/05/2021 14:49:21 FTSampler caught error: Invalid input of type: 'datetime'. Convert to a bytes, string, int or float first.
|
||||
14/05/2021 14:49:26 FTSampler caught error: Invalid input of type: 'datetime'. Convert to a bytes, string, int or float first.
|
||||
14/05/2021 14:49:31 FTSampler caught error: Invalid input of type: 'datetime'. Convert to a bytes, string, int or float first.
|
||||
14/05/2021 14:49:37 FTSampler caught error: Invalid input of type: 'datetime'. Convert to a bytes, string, int or float first.
|
||||
14/05/2021 14:49:43 FTSampler caught error: Invalid input of type: 'datetime'. Convert to a bytes, string, int or float first.
|
||||
14/05/2021 14:49:48 FTSampler caught error: Invalid input of type: 'datetime'. Convert to a bytes, string, int or float first.
|
||||
14/05/2021 14:49:54 FTSampler caught error: Invalid input of type: 'datetime'. Convert to a bytes, string, int or float first.
|
||||
14/05/2021 14:49:59 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
|
||||
14/05/2021 14:50:05 FTSampler caught error: Invalid input of type: 'timedelta'. Convert to a bytes, string, int or float first.
|
||||
14/05/2021 14:50:50 FTSampler caught error: unsupported operand type(s) for +: 'float' and 'str'
|
||||
14/05/2021 14:50:55 FTSampler caught error: unsupported operand type(s) for +: 'float' and 'str'
|
||||
14/05/2021 14:51:01 FTSampler caught error: unsupported operand type(s) for +: 'float' and 'str'
|
||||
14/05/2021 14:51:06 FTSampler caught error: unsupported operand type(s) for +: 'float' and 'str'
|
||||
14/05/2021 14:51:12 FTSampler caught error: unsupported operand type(s) for +: 'float' and 'str'
|
||||
14/05/2021 14:51:18 FTSampler caught error: unsupported operand type(s) for +: 'float' and 'str'
|
||||
14/05/2021 14:54:28 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:54:34 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:54:39 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:54:44 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:54:50 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:54:56 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:01 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:07 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:12 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:18 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:20 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:25 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:31 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:36 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:42 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:47 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:53 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:55:58 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:56:04 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:56:09 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:56:15 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:56:20 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:56:22 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:56:25 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:56:28 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:56:34 FTSampler caught error: could not convert string to float: '69.686 ms'
|
||||
14/05/2021 14:58:30 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:58:36 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:58:41 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:58:47 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:58:52 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:58:58 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:59:03 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:59:09 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:59:14 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:59:20 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:59:25 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:59:31 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:59:36 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:59:42 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:59:48 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:59:53 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 14:59:58 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:04 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:10 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:15 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:18 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:20 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:26 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:31 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:37 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:42 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:48 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:54 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:00:59 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:01:05 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:01:10 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:01:15 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:01:21 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:01:27 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:01:32 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:01:38 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:01:43 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:01:48 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:01:54 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:01:59 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:02:05 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:02:10 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:02:16 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:02:21 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:02:27 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:02:33 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:02:38 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:02:43 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:02:49 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:02:54 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:03:00 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:03:06 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:03:11 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:03:17 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:03:32 FTSampler caught error: float() argument must be a string or a number, not 'NoneType'
|
||||
14/05/2021 15:04:59 FTSampler end. Ctrl+C from user
|
||||
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'
|
||||
|
||||
+12
-7
@@ -49,6 +49,7 @@ if redSrv0.get('SETTINGS:FOLDER:CURRENT') is None:
|
||||
|
||||
#funzione salva time+data e otto valori letti su file SE LOG è 1
|
||||
def fileSave():
|
||||
resultValue = getRedisVal('RTDATA:VALUE')
|
||||
currentFolder = getRedisVal('SETTINGS:FOLDER:CURRENT')
|
||||
workingDirectory = (DATA_path+currentFolder)
|
||||
#dò un nome al nuovo file
|
||||
@@ -61,13 +62,17 @@ def fileSave():
|
||||
except FileNotFoundError:
|
||||
outFile = open(workingDirectory+"/"+dataFileName, "w+")
|
||||
# dichiaro una stringa in cui accumulo i valori
|
||||
csvRow = str(lastLog) +","
|
||||
for chIndex in range(0,2,+1):
|
||||
channelOut = getRedisVal('RTDATA:OUT:'+str(chIndex))
|
||||
csvRow += channelOut+","
|
||||
# tolgo ultimo ","
|
||||
l = len(csvRow)
|
||||
csvRow = csvRow[:l-1]
|
||||
csvRow = str(lastLog) +","
|
||||
# scrivo le letture del canale A
|
||||
chA = getRedisVal('SETTINGS:CHANNEL:A')
|
||||
chAOut = getRedisVal('RTDATA:OUT:'+str(chA))
|
||||
csvRow += chAOut+","
|
||||
# scrivo le letture del canale B
|
||||
chB = getRedisVal('SETTINGS:CHANNEL:B')
|
||||
chBOut = getRedisVal('RTDATA:OUT:'+str(chB))
|
||||
csvRow += chBOut+","
|
||||
#aggiungo il valore risultante calcolato V1/(V2-V1)
|
||||
csvRow += resultValue
|
||||
# scrivo in blocco la riga dei valori
|
||||
outFile.write(csvRow +"\r\n")
|
||||
outFile.close()
|
||||
|
||||
+26
-7
@@ -54,18 +54,23 @@ def getRmsVal(redisKey, numVal):
|
||||
LOG_path = "/home/pi/Flythis/"
|
||||
|
||||
#intervallo in millisecondi fra un campionamento e il successivo
|
||||
startingSampleFreq = 250
|
||||
startingSampleFreq = 100
|
||||
redSampleFreq = 'SETTINGS:LOG:FREQ'
|
||||
redSrv0.set(redSampleFreq,startingSampleFreq)
|
||||
|
||||
#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: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:
|
||||
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:
|
||||
@@ -76,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:
|
||||
@@ -179,6 +183,17 @@ def checkPowerOff():
|
||||
# chiedo spognimento
|
||||
redSrv0.set('SETTINGS:POWER:OFF',1)
|
||||
|
||||
def calculateValue():
|
||||
ch1 = getRedisVal('SETTINGS:CHANNEL:A')
|
||||
ch2 = getRedisVal('SETTINGS:CHANNEL:B')
|
||||
v1 = getRedisVal('RTDATA:OUT:' + ch1)
|
||||
v2 = getRedisVal('RTDATA:OUT:' + ch2)
|
||||
den = (float(v1)-float(v2))
|
||||
if(den < 0.001):
|
||||
den = 0.001
|
||||
newValue = float(v2)/float(den)
|
||||
redSrv0.set('RTDATA:VALUE',round(newValue,3))
|
||||
|
||||
# init oggetto lettura da
|
||||
try:
|
||||
CH = ADS1256.ADS1256()
|
||||
@@ -196,16 +211,20 @@ try:
|
||||
redisSave(CHvalue)
|
||||
# controllo soglia spegnimento
|
||||
checkPowerOff()
|
||||
#calcolo il valore [V2/(V1-V2)]
|
||||
calculateValue()
|
||||
# riporto ultima esecuzione ad adesso
|
||||
endExec = datetime.datetime.now()
|
||||
# calcolo il delta time dovuto alle esecuzioni
|
||||
delta = endExec - now
|
||||
oldSPeriod=float(getRedisVal(redSamPer))
|
||||
newSPeriod=0.5*oldSPeriod+0.5*(float(delta.microseconds/1000))
|
||||
redSrv0.set(redSamPer,newSPeriod)
|
||||
waitTime = int(getRedisVal(redSampleFreq)) / 1000 - delta.microseconds/1000000
|
||||
if(waitTime < 0.1):
|
||||
waitTime = 0.1
|
||||
if(waitTime < 0.01):
|
||||
waitTime = 0.01
|
||||
# attesa
|
||||
time.sleep(waitTime)
|
||||
#print('read done: ' + str(getRedisVal(redSampleFreq)) + ' | ' + str(waitTime))
|
||||
|
||||
#eccezione da ctrl+c in terminale e chiusura
|
||||
except KeyboardInterrupt:
|
||||
|
||||
+11
-2
@@ -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)),
|
||||
@@ -111,7 +112,8 @@ def api_channels_all():
|
||||
'CurrentWorkFolder' : getRedisVal('SETTINGS:FOLDER:CURRENT'),
|
||||
'RealDateStatus' : getRedisVal('SETTINGS:TIME:REAL'),
|
||||
'SelPowerChannel' : getRedisVal('SETTINGS:POWER:CH'),
|
||||
'SelProcessing' : getRedisVal('SETTINGS:SMOOTHING:FUNCTION')
|
||||
'SelProcessing' : getRedisVal('SETTINGS:SMOOTHING:FUNCTION'),
|
||||
'ResultValue' : getRedisVal('RTDATA:VALUE')
|
||||
}
|
||||
# restituisce in formato json i dati letti da redis
|
||||
return jsonify(channelsData)
|
||||
@@ -137,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'),
|
||||
@@ -324,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)
|
||||
@@ -393,7 +402,7 @@ def setScale():
|
||||
@flaskApp.route("/api/v1/setup/resetSettings", methods=['POST'])
|
||||
def resetSetup():
|
||||
#resetto i campi di redis alla situazione di partenza
|
||||
redSrv0.set('SETTINGS:LOG:FREQ',250)
|
||||
redSrv0.set('SETTINGS:LOG:FREQ',100)
|
||||
redSrv0.set('SETTINGS:WRITE:FREQ',1000)
|
||||
redSrv0.set('SETTINGS:LOG:STATUS',0)
|
||||
redSrv0.set('SETTINGS:SELECTED_CH',0)
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
$("#ServerTime").html(result.timeSrv);
|
||||
$("#LastSessionName").html(result.LastSessionName);
|
||||
$("#CurrentFolder").html(result.CurrentWorkFolder);
|
||||
$("#ResultValue").html(result.ResultValue);
|
||||
|
||||
if(result.GateOpen == "0")
|
||||
{
|
||||
@@ -90,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
|
||||
@@ -338,6 +339,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</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