Newer
Older
classdef GUI < handle
properties
% vertical grid
Grid2 = [];
% horizontal grid
Grid1 = [];
%output grid
Grid0 = [];
main_fig = [];
frame = [];
fig = [];
scroll_v = [];
edit_tog = [];
save_pb = [];
pvs_pb = [];
close_pb = [];
save_ext_pb = [];
check_pb = [];
input_pb = [];
settings_pb = [];
function_name_control = [];
function_name_text = [];
function_inputs_text = [];
function_inputs_control = [];
edit = 1;
initialized = 0;
block_handle = [];
% height of header where buttons and text is
header_height = 100;
% window size
Colin Eles
committed
fig_height = 600;
fig_width = 800;
% space inbetween buttons in header
pb_offset = 5;
% width of push buttons in header
pb_width = 80;
% height of push buttons in header
pb_height = 40;
% width of text boxes
text_width = 250;
name_label = [];
input_label = [];
Colin Eles
committed
Data = [];
Colin Eles
committed
EMLGen = [];
TableBlk = [];
end
methods
%% GUI
% constructor
% inputs:
% h:double - handle to Tabular block in model
% outputs;
% obj:GUI - object that is created
function object = GUI(h,mode)
object.block_handle = h;
object.mode = mode;
function [] = setData(object,Data)
object.Data = Data;
object.Grid0 = Data.Grid0;
object.Grid1 = Data.Grid1;
object.Grid2 = Data.Grid2;
object.pvs_checked = Data.checked;
object.function_name_text = Data.function_name;
object.function_inputs_text = Data.function_inputs;
object.settings = Data.settings;
Colin Eles
committed
end
%% init
% initialize the gui
% inputs:
% obj:GUI - GUI object
% outputs;
% none
if object.mode == 1
name = get_param(object.block_handle,'Name');
elseif object.mode == 0
object.fig = figure('units','pixels',...
'position',[0 0 object.fig_width object.fig_height],...
'CloseRequestFcn',@(src,event)close_fig(object,src,event),...
'ResizeFcn',@(src,event)resize_fig(object,src,event));
object.edit_tog = uicontrol('style','toggle',...
'units','pix',...
'string','Edit',...
'HorizontalAlign','left',...
'Parent',object.fig,...
'Value',object.edit,...
'callback',@(src,event)edit_tog_call(object,src,event));
object.save_pb = uicontrol('style','push',...
'units','pix',...
'string','Save',...
'HorizontalAlign','left',...
'Parent',object.fig,...
'callback',@(src,event)save_call(object,src,event));
object.close_pb = uicontrol('style','push',...
'units','pix',...
'string','Close',...
'HorizontalAlign','left',...
'Parent',object.fig,...
'callback',@(src,event)close_fig(object,src,event));
object.save_ext_pb = uicontrol('style','push',...
'units','pix',...
'string','Save Ext',...
'HorizontalAlign','left',...
'Parent',object.fig,...
'callback',@(src,event)save_ext_call(object,src,event));
object.pvs_pb = uicontrol('style','push',...
'units','pix',...
'string','PVS',...
'HorizontalAlign','left',...
'Parent',object.fig,...
'callback',@(src,event)pvs_ext_call(object,src,event));
object.check_pb = uicontrol('style','push',...
'units','pix',...
'string','Check',...
'HorizontalAlign','left',...
'Parent',object.fig,...
'callback',@(src,event)check_call(object,src,event));
object.input_pb = uicontrol('style','push',...
'units','pix',...
'string','Ports',...
'HorizontalAlign','left',...
'Parent',object.fig,...
'callback',@(src,event)input_call(object,src,event));
object.settings_pb = uicontrol('style','push',...
'units','pix',...
'string','Settings',...
'HorizontalAlign','left',...
'Parent',object.fig,...
'callback',@(src,event)settings_call(object,src,event));
object.name_label = uicontrol('style','text',...
'string','Expression Name',...
'HorizontalAlign','right',...
'BackgroundColor',get(object.fig,'Color'));
object.function_name_control = uicontrol('style','edit',...
'HorizontalAlign','center',...
'FontWeight','bold',...
'FontSize',12,...
'Max',2.0,...
'BackgroundColor',[1 1 1]);
% input list label
object.input_label = uicontrol('style','text',...
'string','Inputs',...
'HorizontalAlign','right',...
'BackgroundColor',get(object.fig,'Color'));
object.function_inputs_control = uicontrol('style','edit',...
'HorizontalAlign','center',...
'FontWeight','bold',...
'Max',2.0,...
'FontSize',12,...
'BackgroundColor',[1 1 1]);
Loading
Loading full blame...