-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcheck_port_eval.m
117 lines (114 loc) · 4.76 KB
/
check_port_eval.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
%CHECK AND ACTIVATE (DEACTIVATE) CHECKBOXES TO DRAW A PORTRAIT
% NPDSToolbox version 1.0.0
% handles handle to Check boxes (see GCBO)
%-----Help: selecting checkboxes to draw 2D & 3D portraits-----
% There are generally five checkboxes for drawing portrait.
% Four checkboxes according to the dimensions of dynamic models
% One checkboxes according to drawing 3D portrait
% If pop-up refers to the 'Hudgkin-Huxley' model:
% The checkboxes refer to the v, m, n and h dimensions,
% You can also select two active checkboxes to draw 2D portrait.
% By clicking on the 3D checkbox, you can choose three checkboxes to draw a 3D portrait.
% If pop-up refers to the 'Rose-Hindmarsh' model:
% Three checkboxes refer to the x, y and z dimensions,
% and the extra checkbox becomes inactive and invisible.
% You can also select two active checkboxes to draw 2D portrait.
% By clicking on the 3D checkbox, you can choose three checkboxes
% to draw a 3D portrait.
% If pop-up refers to the 'Thalamic' model:
% Three checkboxes refer to the v, h andr dimensions,
% and the extra checkbox becomes inactive and invisible.
% You can also select two active checkboxes to draw 2D portrait.
% By clicking on the 3D checkbox, you can choose three checkboxes
% to draw a 3D portrait.
% If pop-up refers to the 'FitzHugh-Nagumo' model:
% Two checkboxes refer to the V and W dimensions,
% and the extra checkbox (including 3D checkbox) becomes inactive and invisible
%---------------------------------------------------------------
% runable variable returns two values 0 or 1 to the output,
% which 1 means "valid for drawing portrait" and 0 means "invalid for drawing portrait".
% For information about the parameters of the models
%, refer to the parameters guide (PARAMETER_GUIDE.md)
function runable=check_port_eval(handles)
runable=false;
if get(handles.Check_3D,'value')
legal_check=3;
else
legal_check=2;
end
contents = get(handles.Popup_Neuron,'String');
val = contents{get(handles.Popup_Neuron,'Value')};
if strcmp(val,'Hudgkin-Huxley')
Checks=[get(handles.Check_port1,'value'),get(handles.Check_port2,'value'),get(handles.Check_port3,'value'),get(handles.Check_port4,'value')];
if sum(Checks)<legal_check
set(handles.Check_port1,'Enable','on');
set(handles.Check_port2,'Enable','on');
set(handles.Check_port3,'Enable','on');
set(handles.Check_port4,'Enable','on');
else
runable=true;
if ~get(handles.Check_port1,'value')
set(handles.Check_port1,'Enable','off');
end
if ~get(handles.Check_port2,'value')
set(handles.Check_port2,'Enable','off');
end
if ~get(handles.Check_port3,'value')
set(handles.Check_port3,'Enable','off');
end
if ~get(handles.Check_port4,'value')
set(handles.Check_port4,'Enable','off');
end
end
if sum(Checks)==3
set(handles.Check_3D,'Enable','inactive');
else
set(handles.Check_3D,'Enable','on');
end
elseif strcmp(val,'Rose-Hindmarsh')
Checks=[get(handles.Check_port1,'value'),get(handles.Check_port2,'value'),get(handles.Check_port3,'value')];
if sum(Checks)<legal_check
set(handles.Check_port1,'Enable','on');
set(handles.Check_port2,'Enable','on');
set(handles.Check_port3,'Enable','on');
else
runable=true;
if ~get(handles.Check_port1,'value')
set(handles.Check_port1,'Enable','off');
end
if ~get(handles.Check_port2,'value')
set(handles.Check_port2,'Enable','off');
end
if ~get(handles.Check_port3,'value')
set(handles.Check_port3,'Enable','off');
end
end
if sum(Checks)==3
set(handles.Check_3D,'Enable','inactive');
else
set(handles.Check_3D,'Enable','on');
end
elseif strcmp(val,'Thalamic')
Checks=[get(handles.Check_port1,'value'),get(handles.Check_port2,'value'),get(handles.Check_port3,'value')];
if sum(Checks)<legal_check
set(handles.Check_port1,'Enable','on');
set(handles.Check_port2,'Enable','on');
set(handles.Check_port3,'Enable','on');
else
runable=true;
if ~get(handles.Check_port1,'value')
set(handles.Check_port1,'Enable','off');
end
if ~get(handles.Check_port2,'value')
set(handles.Check_port2,'Enable','off');
end
if ~get(handles.Check_port3,'value')
set(handles.Check_port3,'Enable','off');
end
end
if sum(Checks)==3
set(handles.Check_3D,'Enable','inactive');
else
set(handles.Check_3D,'Enable','on');
end
end