-
Notifications
You must be signed in to change notification settings - Fork 27
/
displaybut.m
183 lines (175 loc) · 6.02 KB
/
displaybut.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
function displaybut(action)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% displaybut.m
%
% Puts the desired plot on the display window
%
% Parameters:
% action - a string that is the plot that you want displayed
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global HANDLES PARAMS
% figure out how many subplots needed:
savalue = get(HANDLES.display.ltsa,'Value');
tsvalue = get(HANDLES.display.timeseries,'Value');
spvalue = get(HANDLES.display.spectra,'Value');
sgvalue = get(HANDLES.display.specgram,'Value');
MultiChValue = get(HANDLES.mc.on, 'Value');
m = savalue + tsvalue + spvalue + sgvalue ; % total number of subplots
if strcmp(action,'timeseries')
if MultiChValue
set(HANDLES.display.spectra, 'Value', 0)
set(HANDLES.tfradios,'Visible','off')
set(HANDLES.display.specgram, 'Value', 0)
control('ampoff')
set(HANDLES.sgequal,'Visible','off')
set(HANDLES.fax.linear, 'Visible', 'off')
set(HANDLES.fax.log, 'Visible', 'off')
end
if tsvalue % timeseries button on
set(HANDLES.timeseriescontrol,'Visible','on')
if PARAMS.nch > 1
set(HANDLES.mc.on, 'Visible', 'on')
% set(HANDLES.mc.off,'Visible', 'on')
if MultiChValue
set(HANDLES.mc.lock,'Visible','on')
end
end
elseif ~tsvalue % ts button off
if ~sgvalue && ~spvalue
set(HANDLES.mc.on, 'Visible', 'off')
% set(HANDLES.mc.off,'Visible', 'off')
set(HANDLES.mc.lock,'Visible','off')
end
if ~sgvalue % specgram button off
set(HANDLES.sndcontrol,'Visible','off') % turn off sound control
set(HANDLES.delimit.but,'Visible','off') % turn off delimit switch
if ~spvalue % spectra button off
set(HANDLES.allcontrol,'Visible','off') % turn off all XWAV control
set(HANDLES.displaycontrol,'Visible','on') %turn on top row buttons
end
end
end
if MultiChValue
set(HANDLES.ch.txt, 'Visible', 'off')
set(HANDLES.ch.pop, 'Visible', 'off')
end
plot_triton
elseif strcmp(action,'spectra')
if MultiChValue
set(HANDLES.ch.txt, 'Visible', 'off')
set(HANDLES.ch.pop, 'Visible', 'off')
set(HANDLES.display.timeseries, 'Value', 0)
set(HANDLES.display.specgram, 'Value', 0)
control('ampoff')
set(HANDLES.sgequal,'Visible','off')
end
if spvalue
set(HANDLES.spectracontrol,'Visible','on')
if PARAMS.nch > 1
set(HANDLES.mc.on, 'Visible', 'on')
% set(HANDLES,'Visible', 'on')
end
elseif ~spvalue
% set(HANDLES.tfradios,'Visible','off')
set(HANDLES.fax.log, 'Visible', 'off')
set(HANDLES.fax.linear, 'Visible', 'off')
if ~tsvalue && ~sgvalue
set(HANDLES.mc.on, 'Visible', 'off')
% set(HANDLES.mc.off,'Visible', 'off')
end
if ~sgvalue
control('ampoff')
control('freqoff')
set(HANDLES.tfradios,'Visible','off')
if ~tsvalue
set(HANDLES.allcontrol,'Visible','off')
set(HANDLES.displaycontrol,'Visible','on')
end
end
end
if MultiChValue
set(HANDLES.ch.txt, 'Visible', 'off')
set(HANDLES.ch.pop, 'Visible', 'off')
end
plot_triton
elseif strcmp(action,'specgram')
if MultiChValue
set(HANDLES.display.spectra, 'Value', 0)
set(HANDLES.tfradios,'Visible','on')
set(HANDLES.display.timeseries, 'Value', 0)
end
if sgvalue
set(HANDLES.specgramcontrol,'Visible','on')
if PARAMS.nch > 1
set(HANDLES.mc.on, 'Visible', 'on')
% set(HANDLES.mc.off,'Visible', 'on')
end
elseif ~sgvalue
control('ampoff')
set(HANDLES.sgequal,'Visible','off')
if ~tsvalue && ~spvalue
set(HANDLES.mc.on, 'Visible', 'off')
% set(HANDLES.mc.off,'Visible', 'off')
end
if ~tsvalue
set(HANDLES.sndcontrol,'Visible','off')
set(HANDLES.delimit.but,'Visible','off') % turn off delimit switch
end
if ~spvalue
control('freqoff')
set(HANDLES.tfradios,'Visible','off')
if ~tsvalue
set(HANDLES.allcontrol,'Visible','off')
set(HANDLES.displaycontrol,'Visible','on')
end
end
end
if MultiChValue
set(HANDLES.fax.linear, 'Visible', 'off')
set(HANDLES.fax.log, 'Visible', 'off')
set(HANDLES.ch.txt, 'Visible', 'off')
set(HANDLES.ch.pop, 'Visible', 'off')
end
if ~spvalue
set(HANDLES.fax.log, 'Visible', 'off')
set(HANDLES.fax.linear, 'Visible', 'off')
end
plot_triton
elseif strcmp(action,'ltsa')
if savalue
set(HANDLES.ltsa.allcontrol,'Visible','on')
elseif ~savalue
set(HANDLES.ltsa.allcontrol,'Visible','off')
end
plot_triton
if get(HANDLES.mc.lock, 'Value')
fig_hand = get(HANDLES.plot1,'Parent');
all_hands = findobj(fig_hand, 'type', 'axes', 'tag', '');
if savalue
% set the value of the ltsa handle to 0 so that it's not linked
% with the zoom in
all_hands (PARAMS.ch + savalue) = 0;
end
linkaxes(all_hands,'x');
end
end
if m == 0
set(HANDLES.allcontrol,'Visible','off')
set(HANDLES.ltsa.allcontrol,'Visible','off')
% gotta keep the display control on to reactivate the plots without
% re-opening the files
if ~isempty(PARAMS.infile)
if ~isempty(PARAMS.ltsa.infile)
set(HANDLES.displaycontrol,'Visible','on')
set(HANDLES.display.ltsa,'Visible','on')
else
set(HANDLES.displaycontrol,'Visible','on')
end
else
if ~isempty(PARAMS.ltsa.infile)
set(HANDLES.display.ltsa,'Visible','on')
end
end
end