/ Published in: MatLab
Expand |
Embed | Plain Text
% 10.10 Project % Spring 2011 % Jackie Simpson and Ben Frank %========================================================================== % GUI Creation || %========================================================================== function mygui % This method creates a figure as the GUI to facilitate user interaction % with the simulation. global ReactorHeater ReactionHeatingPeriod AmountSolvent_S2 %necessary global variables throughout all functions %========================================================================== % Purely Aesthetic Stuff || %========================================================================== % Initialization tasks 'NumberTitle', 'off', 'Visible', 'on', 'Position', [520, 280, 583, 423]); % Now construct the components %prompt to push a button 'String','Would you like to run a simulation or automatic optimization?',... 'BackgroundColor', 'black', 'FontWeight', 'bold', 'FontSize',... 14.0, 'ForegroundColor', 'white', 'Position',[32, 378, 529, 25]); %bordering frames to make it easier on the eyes to distinguish functions %instructions for each option 'String','Input the optimization parameters and simulate the process.',... 'Position',[47, 329, 237, 31]); 'String','...Or let the program automatically find the optimal values.',... 'Position',[334, 242, 192, 48]); % %simulation Panel % simPanel = uipanel('Parent',fh,'Title','Simulation',... % 'HighlightColor', 'Red', 'Units', 'normalized','Position',[520, 136, 640, 567]); % three text labels for input fields 'Position', [50, 400, 175, 30]); 'Position', [50, 300, 175, 30]); 'Position', [50, 200, 175, 30]); align([label1, label2, label3], 'Left', 'Fixed', 5); %three corresponding input fields global field1 field2 field3 'BackgroundColor', [0.8, 0.8, 0.8], 'Position',[325, 400, 50, 30]); 'BackgroundColor', [0.8, 0.8, 0.8], 'Position',[325, 300, 50, 30]); 'BackgroundColor', [0.8, 0.8, 0.8], 'Position',[325, 200, 50, 30]); %alignment issues align([field1, field2, field3], 'Left', 'Fixed', 5); align([label1, field1], 'Fixed', 10, 'Top'); align([label2, field2], 'Fixed', 10, 'Top'); align([label3, field3], 'Fixed', 10, 'Top'); %simulation button 'BackgroundColor', 'red', 'ForegroundColor', 'white','Position',[100, 40, 116, 40]); %optimization button 'BackgroundColor', 'blue', 'ForegroundColor', 'white','Position',[380, 40, 116, 40]); %========================================================================== % Event Handlers || %========================================================================== % Initialization tasks %when one of the buttons is pressed, program control shifts to either %simCaller or Optimizer end %end of main gui flow function
You need to login to post a comment.
