0001 function [txt, color]=state_txt(txt)
0002
0003
0004 tf = isstrprop(txt, 'cntrl');
0005 [C,I] = max(tf);
0006 if I==1
0007 n=length(txt);
0008 else
0009 n=I-1;
0010 end
0011 txt=txt(1:n);
0012
0013 if strcmp('Local board is up and running.', txt)
0014 color='green';
0015 elseif strcmp('Linac system up and running.', txt)
0016 color='green';
0017 elseif strcmp('Local board is up and running. be careful: there is at least 1 soft address', txt)
0018 color='green';
0019 elseif strcmp('Local board is no more declenching. all events are equal to 0', txt)
0020 color='yellow';
0021 elseif strcmp('Local board is no more declenching. try to execute Update', txt)
0022 color='magenta';
0023 else
0024 color='red';
0025 end
0026
0027