-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathanmodbtns.m
315 lines (276 loc) · 9.22 KB
/
anmodbtns.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
function anmodbtns
%
% Function: anmodbtns
%
% Usage: anmodbtns
%
% Description:
% Initializes the Analyze Mode Window
%
%
% Version SWD970911
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This matlab source code was originally %
% developed as part of "DIAMOND" at %
% Los Alamos National Laboratory. It may %
% be copied, modified, and distributed in %
% any form, provided: %
% a) This notice accompanies the files and %
% appears near the top of all source %
% code files. %
% b) No payment or commercial services are %
% received in exchange for the code. %
% %
% Original copyright is reserved by the %
% Regents of the University of California, %
% in addition to Scott W. Doebling, Phillip %
% J. Cornwell, Erik G. Straser, and Charles %
% R. Farrar. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global HANDLES
%====================================
% General buttons parameters
%====================================
top=.95;
left=.84;
btnwd=.15;
btnht=.06;
spacing=.01;
%====================================
% Set up the console frame
%=====================================
frmborder=0.01;
ypos=.05-frmborder;
frmpos=[left-frmborder ypos btnwd+2*frmborder .95+2*frmborder];
HANDLES.hanalmodb(1)=uicontrol(HANDLES.hfigdmnd, ...
'Style','Frame', ...
'Position',frmpos, ...
'BackgroundColor',[.5 .5 .5]);
%
% Set up plot axes
%
HANDLES.hanalmodb(2) = axes('position',[.1 .2 .7 .7],'parent',HANDLES.hfigdmnd);
%
% AUTOMAC Button
%
btnnum=0.5;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hanalmodb(3)=uicontrol(HANDLES.hfigdmnd, ...
'style','pushbutton', ...
'position',btnpos, ...
'string','AUTOMAC',...
'callback',...
['showall(HANDLES.hanalmodb(2));',...
'automacplot(HANDLES.hanalmodb(2),MODES.modalvector);']);
%
% Print Freq Table Button
%
btnnum=1.5;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hanalmodb(12)=uicontrol(HANDLES.hfigdmnd, ...
'style','pushbutton', ...
'position',btnpos, ...
'string','Print Freq / Damp',...
'callback','prntfreq');
% Frame on mode selection controls
HANDLES.hanalmodb(18) = uicontrol(HANDLES.hfigdmnd, ...
'style','frame',...
'pos',[left-spacing ypos-btnht*4.8 btnwd+2*spacing btnht*3.5],...
'BackgroundColor','w');
btnnum=2.5;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht*0.5];
HANDLES.hanalmodb(19) = uicontrol(HANDLES.hfigdmnd, ...
'style','text',...
'pos',btnpos,...
'backgroundcolor','w',...
'fontweight','bold',...
'string','Current Mode');
%
% Active mode popup
%
btnnum=3;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht*0.5];
HANDLES.hanalmodb(13) = uicontrol(HANDLES.hfigdmnd, ...
'style','popup',...
'pos',btnpos,...
'string','temp',...
'callback',...
['imode = get(HANDLES.hanalmodb(13),''value'');',...
'set(HANDLES.hanalmodb(4),''string'',num2str(imode))']);
%
% Define Text box for Mode Number
%
btnnum=4.1;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left+0.5*btnwd ypos-btnht btnwd*0.5 btnht];
HANDLES.hanalmodb(4) = uicontrol(HANDLES.hfigdmnd, ...
'style','edit',...
'pos',btnpos,...
'callback', ...
['imode_t = str2num(get(HANDLES.hanalmodb(4),''string''));',...
'if isempty(imode_t), disp(''Invalid Mode Number''),',...
' set(HANDLES.hanalmodb(4),''string'',num2str(imode)),',...
'elseif imode_t > MODES.nmodes, disp(''Invalid Mode Number''),',...
' set(HANDLES.hanalmodb(4),''string'',num2str(imode)),',...
'elseif imode_t <= 0, disp(''Invalid Mode Number''),',...
' set(HANDLES.hanalmodb(4),''string'',num2str(imode)),',...
'else,',...
' imode = imode_t;',...
'end,',...
'set(HANDLES.hanalmodb(4),''string'',num2str(imode)),',...
'set(HANDLES.hanalmodb(13),''value'',imode),',...
]);
btnpos=[left ypos-btnht btnwd*0.5 btnht];
HANDLES.hanalmodb(5)=uicontrol(HANDLES.hfigdmnd, ...
'style','text',...
'pos',btnpos,...
'string','Mode #');
%
% Define Previous and Next Mode Buttons
%
btnnum=4.6;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd*0.5 btnht*0.5];
HANDLES.hanalmodb(6) = uicontrol(HANDLES.hfigdmnd, ...
'style','push',...
'pos',btnpos,...
'string','prev', ...
'callback',...
['imode_t=imode-1;', ...
'if imode_t < 1, ',...
' disp(''Invalid Mode Number''),',...
' else,',...
' imode = imode_t;',...
'end,',...
'set(HANDLES.hanalmodb(4),''string'',num2str(imode)),',...
'set(HANDLES.hanalmodb(13),''value'',imode),',...
]);
btnpos=[left+0.5*btnwd ypos-btnht btnwd*0.5 btnht*0.5];
HANDLES.hanalmodb(7) = uicontrol(HANDLES.hfigdmnd, ...
'style','push',...
'pos',btnpos,...
'string','next', ...
'callback', ...
['imode_t=imode+1;', ...
'if imode_t > MODES.nmodes, ',...
' disp(''Invalid Mode Number''),',...
' else,',...
' imode = imode_t;',...
'end,',...
'set(HANDLES.hanalmodb(4),''string'',num2str(imode)),',...
'set(HANDLES.hanalmodb(13),''value'',imode),',...
]);
% Frame on mode normalization controls
HANDLES.hanalmodb(20) = uicontrol(HANDLES.hfigdmnd, ...
'style','frame',...
'pos',[left-spacing top-(btnht+spacing)*9.6 btnwd+2*spacing btnht*5.0],...
'BackgroundColor','w');
btnnum=6.5;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hanalmodb(21) = uicontrol(HANDLES.hfigdmnd, ...
'style','text',...
'pos',btnpos,...
'backgroundcolor','w',...
'fontweight','bold',...
'string','Mode Normalization');
%
% Mass Normalization Button
%
btnnum=7.5;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hanalmodb(10)=uicontrol(HANDLES.hfigdmnd, ...
'style','pushbutton', ...
'position',btnpos, ...
'string','Normalize',...
'callback',[...
'disp(''Normalizing Real Modes...''),',...
'normmodes,',...
'disp(''Done Normalizing Real Modes''),']);
%
% Menu of Mass Normalization Methods
%
btnnum=8.5;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hanalmodb(11)=uicontrol(HANDLES.hfigdmnd, ...
'style','popup', ...
'position',btnpos, ...
'string','Drive Point|Unit Mass',...
'value',1,...
'callback',...
['switch get(HANDLES.hanalmodb(11),''value''),',...
'case 1, MODES.imnmeth = ''Drive Point'';',...
' set(HANDLES.hanalmodb([9 25]),''visible'',''on''),',...
'case 2, MODES.imnmeth = ''Unit Mass'';',...
' set(HANDLES.hanalmodb([9 25]),''visible'',''off''),',...
'end,']);
%
% Driving point pair
%
btnnum=9.0;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht*0.5];
HANDLES.hanalmodb(25)=uicontrol(HANDLES.hfigdmnd, ...
'style','text', ...
'position',btnpos, ...
'string','Drive Pt Pair');
btnnum=9.5;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht*0.5];
HANDLES.hanalmodb(9)=uicontrol(HANDLES.hfigdmnd, ...
'style','edit', ...
'position',btnpos, ...
'string','[1 1]', ...
'callback','MODES.dppair=str2num(get(HANDLES.hanalmodb(9),''string''));');
%
% MPC Button
%
btnnum=11;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hanalmodb(8)=uicontrol(HANDLES.hfigdmnd, ...
'style','pushbutton', ...
'position',btnpos, ...
'string','Plot MPC (Polar)',...
'callback',['mpcplot(HANDLES.hanalmodb(2),MODES.residue{imode}.'',MODES.Freq{imode});']);
%
% List Magnitudes and phases
%
btnnum=12;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hanalmodb(14)=uicontrol(HANDLES.hfigdmnd, ...
'style','pushbutton', ...
'position',btnpos, ...
'string','Print Mag / Phs',...
'callback',...
['disp([''Magnitudes and Phases for Mode #'',num2str(imode),'' ('',num2str(MODES.Freq{imode}),'' Hz)'']),',...
'disp(magphstx(MODES.respDOF,MODES.residue{imode},MODES.Freq{imode}));']);
%
%
% Delete Mode Button
%
btnnum=13;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hanalmodb(17) = uicontrol(HANDLES.hfigdmnd, ...
'style','push', ...
'string','Delete Current Mode', ...
'position',btnpos, ...
'callback',['deletemode(imode),',...
'if MODES.nmodes == 0, hideallbtns, set(HANDLES.hmmenu{6}(1),''enable'',''off''), set(HANDLES.hviewm(1),''visible'',''off''),',...
'else,',...
'if imode > 1, imode = imode -1; else imode = 1; end,',...
'set(HANDLES.hanalmodb(13),''string'',buildfreqpopup),',...
'set(HANDLES.hanalmodb(4),''string'',num2str(imode)),',...
'set(HANDLES.hanalmodb(13),''value'',imode),',...
'end,']);
set(HANDLES.hanalmodb,'visible','off')
return