Sync from remote server: 2025-10-12 18:56:41
This commit is contained in:
44
ATD/datainiziale.m
Executable file
44
ATD/datainiziale.m
Executable file
@@ -0,0 +1,44 @@
|
||||
% Funzione che scarica la data iniziale per quell'installazione
|
||||
function [date,time,date_AC,time_AC,Nodo_AC,unitID] = datainiziale(DTcatena,...
|
||||
unitID,conn,FileName)
|
||||
|
||||
text = 'datainiziale function started';
|
||||
fileID = fopen(FileName,'a');
|
||||
fmt = '%s \r';
|
||||
fprintf(fileID,fmt,text);
|
||||
|
||||
unitID = num2str(cell2mat(unitID));
|
||||
comando = ['select 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);
|
||||
date = stringa(1,1:10);
|
||||
time = stringa(1,12:lS);
|
||||
|
||||
text = ['Starting date for the download of data: ' date ' ' time '. datainiziale function closed.'];
|
||||
fprintf(fileID,fmt,text);
|
||||
|
||||
% Scarico la data iniziale per i nodi dell'arco rovescio
|
||||
comando = ['select prod_date_node, node_num_prod from tools where unit_ID like ''' unitID ''' and name like ''' DTcatena ''' '];
|
||||
dati = fetch(conn,comando);
|
||||
stringa = cell2mat(dati(1,1));
|
||||
[lS] = length(stringa);
|
||||
if strcmp(stringa,'null')
|
||||
date_AC = [];
|
||||
time_AC = [];
|
||||
Nodo_AC = [];
|
||||
elseif strcmp(stringa,'No Data')
|
||||
date_AC = [];
|
||||
time_AC = [];
|
||||
Nodo_AC = [];
|
||||
else
|
||||
date_AC = stringa(1,1:10);
|
||||
time_AC = stringa(1,12:lS);
|
||||
Nodo_AC = cell2mat(dati(1,2));
|
||||
text = ['Starting date for the download of invert data related to Cir Array: ' date_AC ' ' time_AC '.'];
|
||||
fprintf(fileID,fmt,text);
|
||||
end
|
||||
|
||||
fclose(fileID);
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user