54 lines
1.6 KiB
Matlab
Executable File
54 lines
1.6 KiB
Matlab
Executable File
%% Funzione che mette a zero gli spostamenti di alcuni nodi specifici
|
|
function [dX_TLH,dY_TLH,dZ_TLH] = azzeramenti_TLH(IDcentralina,DTcatena,dX_TLH,...
|
|
dY_TLH,dZ_TLH,NodoTiltLinkH,FileName)
|
|
|
|
fileID = fopen(FileName,'a');
|
|
fmt = '%s \r';
|
|
text = 'azzeramenti_TLH function started';
|
|
fprintf(fileID,fmt,text);
|
|
|
|
NomeFile = strcat(IDcentralina,'-',DTcatena,'-','Azzeramenti.txt');
|
|
if isfile(NomeFile) == 1
|
|
Dati = importdata(NomeFile);
|
|
if Dati(1,1) == 99999
|
|
else
|
|
[r,~] = size(Dati);
|
|
fileID = fopen(FileName,'a');
|
|
fmt = '%s \r';
|
|
for i = 1:r
|
|
if Dati(i,1) == 99999
|
|
break
|
|
else
|
|
nodo = Dati(i);
|
|
dX_TLH(nodo,:) = 0;
|
|
dY_TLH(nodo,:) = 0;
|
|
dZ_TLH(nodo,:) = 0;
|
|
num = cell2mat(NodoTiltLinkH(nodo,2));
|
|
text = ['---Node Tilt Link H number ' num2str(num) ' has not been elaborated due to forced reset.---'];
|
|
fprintf(fileID,fmt,text);
|
|
end
|
|
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_TLH function created the reference file correctly';
|
|
fprintf(fileID,fmt,text);
|
|
end
|
|
|
|
text = 'azzeramenti_TLH function worked correctly';
|
|
fprintf(fileID,fmt,text);
|
|
fclose(fileID);
|
|
|
|
end |