diff --git a/sw/logalizer/dialog.fig b/sw/logalizer/dialog.fig index 1b03374a96..87e94a6ae3 100644 Binary files a/sw/logalizer/dialog.fig and b/sw/logalizer/dialog.fig differ diff --git a/sw/logalizer/dialog.m b/sw/logalizer/dialog.m index 0ab0adf7a1..d7ed026521 100644 --- a/sw/logalizer/dialog.m +++ b/sw/logalizer/dialog.m @@ -31,7 +31,7 @@ function varargout = dialog(varargin) % Edit the above text to modify the response to help dialog -% Last Modified by GUIDE v2.5 10-Nov-2005 18:47:16 +% Last Modified by GUIDE v2.5 18-Sep-2006 11:05:50 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; @@ -52,6 +52,72 @@ else end % End initialization code - DO NOT EDIT +function [m,n]=set2Plot(handles,section,field) + +axes(handles.axes1); + +global labelsSections; +global sectionsIndex; +global labelsFields; +global fieldsIndex; +N=max(size(labelsSections)); +n=1; while n<=N && ~strcmpi(labelsSections(n),section), n=n+1; end; +if strcmpi(labelsSections(n),section), + set(handles.ListSections,'Value',n); + ListSections_Callback(0, 0, handles); + M=max(size(labelsFields)); + m=1; while m<=M && ~strcmpi(labelsFields(m),field), m=m+1; end; + if strcmpi(labelsFields(m),field), + return; + end; +end; +m=0; +n=0; +return; + +function [x,y]=setXY2plot(m,n,k) +%fetch xy data for section n, field m +global X0; +global logData; +global x; +global y; +x=[]; y=[]; +len=max(size(logData)); +last_time=0; +for j=1:len, + if logData(j).type==n && logData(j).plane_id==k, + if logData(j).time>last_time, + x=[x;logData(j).time]; + y=[y;logData(j).fields(m)]; + last_time=x(max(size(x))); + end; + end; +end; + +x=x-X0; % shift timer to start at the boot time + +function h=plotlog(x,y) +%plot data for section n, field m, plane_id k + +% minimum number of points in the plot (resolution) +%if actual number of points if greater we dont need to change anything, but +%if it is less, interpolate using nearest neighbor as closest model of +%signals incoming to ground station. Previous value is used in the ap +%until a new value is obtained +Nres=1000; + +if ~isempty(x) && ~isempty(y), + MIN=min(x); + MAX=max(x); + X=MIN:(MAX-MIN)/Nres:MAX; + if max(size(X))<=max(size(x)) %plot as it is + h=plot(x,y); + else + h=plot(x,y,'x'); + %plot(X,interp1(x,y,X,'nearest')); %interpolate using nearest neighbor + end; +end; + % --- Executes just before dialog is made visible. function dialog_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. @@ -74,7 +140,8 @@ set(handles.ListSections,'Enable','off'); set(handles.ListFields,'Enable','off'); set(handles.ListDevices,'Enable','off'); - +global X0; +X0=0; % UIWAIT makes dialog wait for user response (see UIRESUME) % uiwait(handles.figure1); @@ -185,6 +252,21 @@ if res~=0, %find name of the data file dataFileName=char(node.getFirstChild.getAttributes.item(0).getValue); + %find ground altitude + global ground_alt; + j=0; + found=0 + while ~found && j<=node.getFirstChild.getChildNodes.item(1).getChildNodes.item(1).getChildNodes.item(1).getAttributes.getLength, + if ~strcmpi(node.getFirstChild.getChildNodes.item(1).getChildNodes.item(1).getChildNodes.item(1).getAttributes.item(j).getName,'GROUND_ALT'), + j=j+1; + found=1; + end; + end; + if j<=node.getFirstChild.getChildNodes.item(1).getChildNodes.item(1).getChildNodes.item(1).getAttributes.getLength, + ground_alt=str2num(char(node.getFirstChild.getChildNodes.item(1).getChildNodes.item(1).getChildNodes.item(1).getAttributes.item(j).getValue)); + else ground_alt=0; + end; + %---read protocol--------------------------------- set(handles.text1,'String','Reading protocol specification'); @@ -287,8 +369,9 @@ if res~=0, fld=sscanf(tline,'%g'); %extract a vector of fields found=0; j=1; count=max(size(labelsSections)); %find index of the message label in the protocol - while jxl(2), t2=xl(2)-0.01*xscale; else t2=x(n2); end; + line([t1 t2],[yl(1)+0.1*yscale yl(1)+0.1*yscale],'LineWidth',0.5,'Color',C); + if x(n1)>=xl(1), patch([1,0,1]*xscale*0.01+x(n1),[-1 0 1]*yscale*0.01+yl(1)+0.1*yscale,C); end; + if x(n2)<=xl(2), patch(-1*[1,0,1]*xscale*0.01+x(n2),[-1 0 1]*yscale*0.01+yl(1)+0.1*yscale,C); end; + if t2-t1>0.15*xscale, text(t1+0.5*(t2-t1),yl(1)+0.1*yscale,txt,... + 'EdgeColor',C,'BackgroundColor',get(handles.axes1,'Color'),'HorizontalAlignment','Center'); end; + hold off; + n1=n2; +end; +legend_handle=legend; +if ~isempty(legend_handle), legend(legend_handle); end; %refresh legend + + + +% --- Executes during object creation, after setting all properties. +function vel_button_CreateFcn(hObject, eventdata, handles) +% hObject handle to vel_button (see GCBO) +% eventdata reserved - to be defined in a future version of MATLAB +% handles empty - handles not created until after all CreateFcns called + + + +