GUI in Linux

  • Follow


Hi,

I'm trying to build a GUI that continually stream data from a text file and update the axes plot.  The code for the plot button is as follows:

% --- Executes on button press in PLOT_button.
function PLOT_button_Callback(hObject, eventdata, handles)
% hObject    handle to PLOT_button (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

%Change the status2 box to 'Running'
if handles.State==1
    set(handles.RunStatus,'String','Running');
end;

%Run the graphing procedure if state is ON(1)

while handles.State==1
  
    Source1=importdata('ModelPath.txt');    
    copyfile(char(Source1),'Model.txt');    
    Model=double(importdata('Model.txt'))

    %plot_button the MODEL_axes 
    
    surf(handles.MODEL_axes,1:24,1:24,Model);
    title(handles.MODEL_axes,'FirebreakModel','fontsize',24);
    axis(handles.MODEL_axes,[1 24 1 24 0 4]);
    caxis(handles.MODEL_axes,[0 4]);
    caxis manual;
    shading faceted;
    view(handles.MODEL_axes,2);
   
    %Flush graphic event queue and force update of plot
    refreshdata(hObject);
    drawnow;
    handles=guidata(hObject);
    if handles.State==0
        break;
    end;
    
end;

As you can see, the code structure is simple.  When I press PLOT it will continually update and plot MODEL_axes until another button interrupt and changes handles.State.  I wrote this code in Window, which compiled and work perfectly (it updates).  However, when I run this in a Linux machine, the initial plot is show but it won't update. Is there something Linux specific that I missed?
This has been driving me nut :(

Thank you in advance.
0
Reply Quyen 11/3/2010 10:57:03 PM


0 Replies
191 Views

(page loaded in 0.314 seconds)

Similiar Articles:













7/16/2012 6:34:55 PM


Reply: