56 lines
1.6 KiB
Matlab
Executable File
56 lines
1.6 KiB
Matlab
Executable File
%% Funzione che mette a zero gli spostamenti di alcuni nodi specifici
|
|
function [dsX,dsY,dsZ] = azzeramenti_TLHR(IDcentralina,DTcatena,dsX,dsY,dsZ,NodoTiltLinkHR,FileName)
|
|
|
|
fileID = fopen(FileName,'a');
|
|
fmt = '%s \r';
|
|
text = 'azzeramenti_TLHR function started';
|
|
fprintf(fileID,fmt,text);
|
|
|
|
NomeFile = strcat(IDcentralina,'-',DTcatena,'-','Azzeramenti.txt');
|
|
if isfile(NomeFile) == 1
|
|
Dati = importdata(NomeFile);
|
|
i = 1;
|
|
while Dati(i,1) ~= 99999
|
|
i = i+1;
|
|
end
|
|
i = i+1; % aggiusto contatore nella prima colonna per le ampolle
|
|
fileID = fopen(FileName,'a');
|
|
fmt = '%s \r';
|
|
END = 0;
|
|
while END == 0
|
|
if Dati(i,1) == 9999999999
|
|
END = 1;
|
|
else
|
|
nodo = Dati(i);
|
|
dsX(nodo,:) = 0;
|
|
dsY(nodo,:) = 0;
|
|
dsZ(nodo,:) = 0;
|
|
num = cell2mat(NodoTiltLinkHR(nodo,2));
|
|
text = ['---Node Tilt Link HR V number ' num2str(num) ' has not been elaborated due to forced reset---'];
|
|
fprintf(fileID,fmt,text);
|
|
i = i+1;
|
|
end
|
|
end
|
|
else
|
|
fclose(fileID);
|
|
Parametro1 = 99999;
|
|
Parametro2 = 9999999999;
|
|
outdat = fopen(NomeFile,'wt+');
|
|
fopen(NomeFile,'wt');
|
|
fmt = '%d \r';
|
|
fileA = fopen(NomeFile,'a');
|
|
fprintf(fileA,fmt,Parametro1);
|
|
fprintf(fileA,fmt,Parametro2);
|
|
fclose(fileA);
|
|
|
|
fileID = fopen(FileName,'a');
|
|
fmt = '%s \r';
|
|
text = 'azzeramenti_TLHR function created the reference file correctly';
|
|
fprintf(fileID,fmt,text);
|
|
end
|
|
|
|
text = 'azzeramenti_TLHR function worked correctly';
|
|
fprintf(fileID,fmt,text);
|
|
fclose(fileID);
|
|
|
|
end |