Sync from remote server: 2025-10-12 18:56:41

This commit is contained in:
2025-10-12 18:56:59 +02:00
commit 7e8ee264aa
553 changed files with 161447 additions and 0 deletions

42
Tilt/threshold.m Executable file
View File

@@ -0,0 +1,42 @@
function threshold(yesHD,ARRAYdateHD,Xlocal_HD,Ylocal_HD,X_HD,Y_HD,HShift_local_HD,...
HShift_HD,NodoTiltLinkHD,unitID,IDcentralina,DTcatena,conn,FileName)
fileID = fopen(FileName,'a');
fmt = '%s \r';
text = 'threshold function started';
fprintf(fileID,fmt,text);
fclose(fileID);
% Scarico la data di riferimento
comando = ['select graph_prod_date from tools where unit_ID like ''' unitID ''' and name like ''' DTcatena ''' '];
data_ini = fetch(conn,comando);
stringa = cell2mat(data_ini);
[lS] = length(stringa);
dataRif = stringa(1,1:10);
timeRif = stringa(1,12:lS);
if lS == 4 % Codice null - non c'è data di riferimento
Riferimento = 0;
else
Riferimento = 1;
end
comando = ['select soglie from tools where unit_id like ''' ...
unitID ''' and name like ''' DTcatena ''' '];
Soglie = fetch(conn,comando);
value = jsondecode(char(Soglie));
if isempty(value) == 0
%% Tilt Link HD
if yesHD == 1
threshold_TiltLinkHD(value,ARRAYdateHD,HShift_local_HD,HShift_HD,...
Xlocal_HD,Ylocal_HD,X_HD,Y_HD,Riferimento,dataRif,timeRif,...
NodoTiltLinkHD,IDcentralina,DTcatena,conn,FileName);
end
end
fileID = fopen(FileName,'a');
fmt = '%s \r';
text = 'threshold function closed';
fprintf(fileID,fmt,text);
fclose(fileID);