Code covered by the BSD License  

Highlights from
Task Scheduler beta

image thumbnail

Task Scheduler beta

by

 

This GUI application makes possible to schedule a set of tasks using classical scheduling protocol.

DrawOptions(varargin)
function varargout = DrawOptions(varargin)
% DRAWOPTIONS M-file for DrawOptions.fig
%      DRAWOPTIONS, by itself, creates a new DRAWOPTIONS or raises the existing
%      singleton*.
%
%      H = DRAWOPTIONS returns the handle to a new DRAWOPTIONS or the handle to
%      the existing singleton*.
%
%      DRAWOPTIONS('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in DRAWOPTIONS.M with the given input arguments.
%
%      DRAWOPTIONS('Property','Value',...) creates a new DRAWOPTIONS or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before DrawOptions_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to DrawOptions_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help DrawOptions

% Last Modified by GUIDE v2.5 20-Oct-2012 20:40:01

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @DrawOptions_OpeningFcn, ...
                   'gui_OutputFcn',  @DrawOptions_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
    if nargin && ischar(varargin{1})
        gui_State.gui_Callback = str2func(varargin{1});
    end

    if nargout
        [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
    else
        gui_mainfcn(gui_State, varargin{:});
    end
    
% End initialization code - DO NOT EDIT
end

% --- Executes just before DrawOptions is made visible.
function DrawOptions_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to DrawOptions (see VARARGIN)

% Choose default command line output for DrawOptions
handles.output = hObject;

handles.hMainObject = varargin{1};
handles.handlesMain = varargin{2};
%Position = get(hObject,'Position')
%Units = get(hObject,'Units')
Units = get(handles.uipanel1,'Units');
Position = get(handles.uipanel1,'Position');
i_turnback = 0;
i_turnbackNum = 0;
%handles.uipanel1
handles.color = handles.handlesMain.Options.color;
color = handles.color;
save 'colorTemp.mat' color;
handles.handle_color = zeros(handles.handlesMain.Tasks_Param.Nb_Tasks,1)
for i=1:1:handles.handlesMain.Tasks_Param.Nb_Tasks
    i
    handles.handlesMain.Options.color(:,:)
width = 12;
heigth = 2;
x = Position(1) + width*(i-i_turnback-1);%width*(i-i_turnback-1);
if x + width>=Position(1)+Position(3)
x=0;
i_turnback = i;
i_turnbackNum = i_turnbackNum+1;
end
y = Position(2) + Position(4) - heigth*(2+i_turnbackNum);
handles.handle_color(i) = uicontrol('Style', 'pushbutton',...
                           'String', ['Tasks ' num2str(i)],...
                           'Units', Units, ...
                           'Position', [x y width heigth],...
                           'Callback', {@Create_Colors,handles,i},...
                           'background',handles.handlesMain.Options.color(i,:),...
                           'foreground',[1 1 1]);  
       
end       
      
% Update handles structure
guidata(hObject, handles);
end
% UIWAIT makes DrawOptions wait for user response (see UIRESUME)
% uiwait(handles.figure1);
function C = Create_Colors(hObject,eventdata,handles,i)
    load 'colorTemp.mat' color
    handles.color = color;
    handles.color(:,:)
        %options = 0;  icon = 0;
        C = uisetcolor(['Tasks ' num2str(i)]);
        disp('A QUE COUCOU');
        handles.color(i,:) = C;
        %set(handles.handle_color(i),'background',handles.handlesMain.Options.color(i,:));
        set(hObject,'background', handles.color(i,:));
    handles.color(:,:)
    color = handles.color;
    save 'colorTemp.mat' color;
  guidata(hObject, handles);  
end

% --- Outputs from this function are returned to the command line.
function varargout = DrawOptions_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Get default command line output from handles structure
varargout{1} = hObject;%handles.output;
end

% --- Executes during object creation, after setting all properties.
function figure1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to figure1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

end


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

Contact us