forked from wozy13/DIAMOND
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flexbtns.m
213 lines (188 loc) · 6.41 KB
/
flexbtns.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
function flexbtns
%
% Function: flexbtns
%
% Usage: flexbtns
%
% Description:
% Initializes the Flexibility Analysis Window
% Handles and graphics elements.
% Returns a vector to those elements.
%
% Version SWD970902
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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=.08;
spacing=.01;
%====================================
% Set up the console frame
%=====================================
frmborder=0.01;
ypos=.05-frmborder;
frmpos=[left-frmborder ypos btnwd+2*frmborder .95+2*frmborder];
HANDLES.hflexb(1)=uicontrol(HANDLES.hfigdmnd, ...
'Style','Frame', ...
'Position',frmpos, ...
'BackgroundColor',[.5 .5 .5]);
%
% Set up plot axes
%
HANDLES.hflexb(2) = axes('position',[.1 .22 .7 .7],'dataaspectratio',[1 1 1]);
%
% Set up legend axes
%
HANDLES.hflexb(15) = axes('position',[.1 .1 .7 .10]);
%
% Loading DOF Textbox
%
btnnum=2;
ypos=top-(btnnum-1)*(btnht+spacing)+2*spacing;
btnpos=[left ypos-btnht btnwd btnht/2];
HANDLES.hflexb(4)=uicontrol(HANDLES.hfigdmnd, ...
'style','text', ...
'position',btnpos, ...
'string','Loaded DOF');
btnpos=[left ypos-btnht*3/2 btnwd btnht/2];
HANDLES.hflexb(5)=uicontrol(HANDLES.hfigdmnd, ...
'style','edit', ...
'position',btnpos, ...
'string','1',...
'callback',...
['iflex_t = str2num(get(HANDLES.hflexb(5),''string''));',...
'if iflex_t < 1,',...
' DAMAGEID.iflexdof = 1;',...
'elseif iflex_t > length(DAMAGEID.undammode{1}),',...
' DAMAGEID.iflexdof = length(DAMAGEID.undammode{1});',...
'else,',...
' DAMAGEID.iflexdof = iflex_t;',...
'end,',...
'set(HANDLES.hflexb(5),''string'',num2str(DAMAGEID.iflexdof)),']);
%
% Positive/Negative Loading
%
btnnum=3.0;
ypos=top-(btnnum-1)*(btnht+spacing)+2*spacing;
btnpos=[left ypos-btnht btnwd btnht/2];
HANDLES.hflexb(13) = uicontrol(HANDLES.hfigdmnd, ...
'style','text', ...
'position',btnpos, ...
'string','Loading Sign');
btnpos(2) = btnpos(2) - btnht/2;
HANDLES.hflexb(6) = uicontrol(HANDLES.hfigdmnd, ...
'style','popup', ...
'position',btnpos, ...
'Value',1,...
'string','Positive|Negative',...
'callback',...
['if get(HANDLES.hflexb(6),''value'') == 1,',...
' DAMAGEID.iflexsgn = 1;',...
'else,',...
' DAMAGEID.iflexsgn = -1;',...
'end,']);
%
% Flexibility Loading Type
%
btnnum=4;
ypos=top-(btnnum-1)*(btnht+spacing)+2*spacing;
btnpos=[left ypos-btnht btnwd btnht/2];
HANDLES.hflexb(7) = uicontrol(HANDLES.hfigdmnd, ...
'style','text', ...
'position',btnpos, ...
'string','Loading Type');
btnpos(2) = btnpos(2) - btnht/2;
HANDLES.hflexb(8) = uicontrol(HANDLES.hfigdmnd, ...
'style','popup', ...
'position',btnpos, ...
'Value',1,...
'string','Uniform|Multi-Point|Single Point',...
'callback',...
['switch get(HANDLES.hflexb(8),''value'');',...
'case 1, DAMAGEID.nflexload = ''Uniform'';',...
' set(HANDLES.hflexb(4:5),''visible'',''off''),',...
'case 2, DAMAGEID.nflexload = ''Multi Point'';',...
' set(HANDLES.hflexb(4:5),''visible'',''off''),',...
'case 3, DAMAGEID.nflexload = ''Single Point'';',...
' set(HANDLES.hflexb(4:5),''visible'',''on''),',...
' DAMAGEID.iflexdof = str2num(get(HANDLES.hflexb(5),''string''));',...
'end']);
%
% Plot Type
%
btnnum=5;
ypos=top-(btnnum-1)*(btnht+spacing)+2*spacing;
btnpos=[left ypos-btnht btnwd btnht/2];
HANDLES.hflexb(14) = uicontrol(HANDLES.hfigdmnd, ...
'style','text', ...
'position',btnpos, ...
'string','Plot Type');
btnpos(2) = btnpos(2) - btnht/2;
HANDLES.hflexb(9) = uicontrol(HANDLES.hfigdmnd, ...
'style','popup', ...
'position',btnpos, ...
'Value',1,...
'string','Flex Change|Undamaged Flex|Damaged Flex',...
'callback',...
['switch get(HANDLES.hflexb(9),''value'');',...
'case 1, DAMAGEID.iflextype = ''Flexibility Change'';',...
'case 2, DAMAGEID.iflextype = ''Undamaged Flexibility'';',...
'case 3, DAMAGEID.iflextype = ''Damaged Flexibility'';',...
'end,']);
%
% Plot Flexibility Shape
%
btnnum=7;
ypos=top-(btnnum-1)*(btnht+spacing)+2*spacing;
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hflexb(10)=uicontrol(HANDLES.hfigdmnd, ...
'style','pushbutton', ...
'position',btnpos, ...
'string','Plot Flex',...
'callback',...
['clear undammode dammode undamfreq damfreq,',...
'for j = 1:length(DAMAGEID.mode_anal),',...
' undammode(:,j) = DAMAGEID.undammode{DAMAGEID.mode_anal(j)}'';',...
' dammode(:,j) = DAMAGEID.dammode{DAMAGEID.mode_anal(j)}'';',...
' undamfreq(j) = DAMAGEID.undamFreq{DAMAGEID.mode_anal(j)}'';',...
' damfreq(j) = DAMAGEID.damFreq{DAMAGEID.mode_anal(j)}'';',...
'end,',...
'DAMAGEID.undamflex = undammode/diag(2*pi*undamfreq)^2 * undammode'';',...
'DAMAGEID.damflex = dammode/diag(2*pi*damfreq)^2 * dammode'';',...
'plotflex,']);
%
% Select the modes to use in the analysis
%
btnnum=9;
ypos=top-(btnnum-1)*(btnht+spacing);
btnpos=[left ypos-btnht btnwd btnht];
HANDLES.hflexb(12)=uicontrol(HANDLES.hfigdmnd, ...
'style','pushbutton', ...
'position',btnpos, ...
'string','Select Modes', ...
'Callback', ...
['set(HANDLES.hmdsel(1),''visible'',''on''), figure(HANDLES.hmdsel(1)),']);
set(HANDLES.hflexb,'visible','off')
return