source: MML/trunk/mml/switchmode.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.1 KB
Line 
1function Mode = switchmode(varargin)
2%SWITCHMODE - Change the mode field for all families in the MML
3%  Mode = switchmode(Command)
4%
5%  KEYWORDS
6%  1. 'Online' - Switches to online
7%  2. 'Simulator' - Switches to simulator
8%  3. 'Model' - Switches to model
9%  4. 'Manual' - Switches manual mode
10%
11%  OUTPUTS
12%  1. Mode - Mode selected
13%
14%  See Also switch2sim, switch2online, switch2manual, switch2model
15
16%
17%  Written by Gregory J. Portmann
18
19Mode = '';
20
21if isempty(varargin)
22    ButtonName = questdlg('Matlab MiddleLayer Mode?','Middle Layer','Online', 'Simulator', 'Online');
23    switch ButtonName
24        case 'Online'
25            switch2online;
26            Mode = 'Online';
27        case 'Simulator'
28            switch2sim;
29            Mode = 'Simulator';
30    end
31else
32    if strcmpi(varargin{1},'online')
33        switch2online;
34        Mode = 'Online';
35    elseif strcmpi(varargin{1},'simulator') | strcmpi(varargin{1},'model')
36        switch2sim;
37        Mode = 'Simulator';
38    elseif strcmpi(varargin{1},'manual')
39        switch2manual;
40        Mode = 'Manual';
41    else
42        error('Mode type unknown.');
43    end
44end
Note: See TracBrowser for help on using the repository browser.