Sync from remote server: 2025-10-12 18:56:41
This commit is contained in:
46
RSN/LastElab_bisSS.m
Executable file
46
RSN/LastElab_bisSS.m
Executable file
@@ -0,0 +1,46 @@
|
||||
function DatiElabShockSensor = LastElab_bisSS(conn,NodoShockSensor,rSS,datainiSS,...
|
||||
tempoiniSS,IDcentralina,DTcatena,FileName)
|
||||
|
||||
text = 'LastElab_bisSS function started';
|
||||
fileID = fopen(FileName,'a');
|
||||
fmt = '%s \r';
|
||||
fprintf(fileID,fmt,text);
|
||||
|
||||
NShockSensor = cell2mat(NodoShockSensor(:,2));
|
||||
NodeType = 'Shock Sensor';
|
||||
ii = 1; % contatore
|
||||
col = 3; % contatore colonne
|
||||
while ii <= rSS
|
||||
ini_col = col-2;
|
||||
nN = num2str(NShockSensor(ii,1));
|
||||
% Scarico di dati di spostamenti - giorno X
|
||||
comando = ['select EventDate, EventTime, X from ElabDataView where EventDate = ''' ...
|
||||
datainiSS ''' and EventTime >= ''' tempoiniSS ''' and UnitName = ''' IDcentralina ...
|
||||
''' and ToolNameID = ''' DTcatena ''' and NodeType = ''' NodeType ''' and NodeNum = ''' nN ''' '];
|
||||
curs = exec(conn,comando);
|
||||
curs = fetch(curs);
|
||||
DATnodoSSd = curs.Data;
|
||||
% Scarico di dati di spostamenti - giorni successivi a X
|
||||
comando = ['select EventDate, EventTime, X from ElabDataView where EventDate >= ''' ...
|
||||
datainiSS ''' and UnitName = ''' IDcentralina ''' and ToolNameID = ''' DTcatena ...
|
||||
''' and NodeType = ''' NodeType ''' and NodeNum = ''' nN ''' '];
|
||||
curs = exec(conn,comando);
|
||||
curs = fetch(curs);
|
||||
DATnodoSS = curs.Data;
|
||||
[~,c1] = size(DATnodoSS);
|
||||
[~,c2] = size(DATnodoSSd);
|
||||
if c1 == c2
|
||||
DATnodoSS = [DATnodoSSd; DATnodoSS];
|
||||
elseif c1 < c2 % solo giorno di riferimento
|
||||
DATnodoSS = DATnodoSSd;
|
||||
end
|
||||
DatiElabShockSensor(:,ini_col:col) = DATnodoSS(:,:);
|
||||
col = col+3;
|
||||
ii = ii+1;
|
||||
end
|
||||
|
||||
text = 'LastElab_bisSS function worked correctly';
|
||||
fprintf(fileID,fmt,text);
|
||||
fclose(fileID);
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user