Skip to content

Commit 7a2bb56

Browse files
authored
Update stepped wind input interface
1 parent 2f484ff commit 7a2bb56

3 files changed

Lines changed: 235 additions & 68 deletions

File tree

subfunctions/Certification.m

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ function Certification_OpeningFcn(hObject, eventdata, handles, varargin)
3636
handles.Control = varargin{6};
3737
handles.CertificationSettings = varargin{7};
3838

39-
% Adjust simulation time if a stepped wind is requested
39+
% Disable simulation time and wind speed if a stepped wind is requested
4040
if handles.CertificationSettings.Wind.Type == 2
41-
amountOfSteps = ceil(handles.CertificationSettings.Run.WindSpeed(1) - handles.CertificationSettings.Wind.Step) + 1;
42-
handles.CertificationSettings.Run.Time = amountOfSteps*handles.CertificationSettings.Wind.StepDuration;
4341
set(handles.Runtime_textbox, 'Enable', 'off');
42+
set(handles.WindSpeed_textbox, 'Enable', 'off');
4443
else
4544
set(handles.Runtime_textbox, 'Enable', 'on');
45+
set(handles.WindSpeed_textbox, 'Enable', 'on');
4646
end
4747

4848
% Update input fields
@@ -177,6 +177,17 @@ function WindSettings_Callback(hObject, eventdata, handles)
177177
set(buttons(i), 'Enable', 'on');
178178
end
179179

180+
% Disable simulation time and wind speed if a stepped wind is requested
181+
if handles.CertificationSettings.Wind.Type == 2
182+
set(handles.Runtime_textbox, 'Enable', 'off');
183+
set(handles.WindSpeed_textbox, 'Enable', 'off');
184+
set(handles.Runtime_textbox, 'String', handles.CertificationSettings.Run.Time);
185+
set(handles.WindSpeed_textbox, 'String', handles.CertificationSettings.Run.WindSpeed(1));
186+
else
187+
set(handles.Runtime_textbox, 'Enable', 'on');
188+
set(handles.WindSpeed_textbox, 'Enable', 'on');
189+
end
190+
180191
% Disable start button
181192
if isempty(handles.OutputFile)
182193
set(handles.Start, 'Enable', 'off')
@@ -218,16 +229,6 @@ function WindSettings_Callback(hObject, eventdata, handles)
218229
set(hObject, 'TooltipString', 'Extreme coherent gust (ECD)')
219230
end
220231

221-
% Adjust simulation time if a stepped wind is requested
222-
if handles.CertificationSettings.Wind.Type == 2
223-
amountOfSteps = ceil(handles.CertificationSettings.Run.WindSpeed(1) - handles.CertificationSettings.Wind.Step) + 1;
224-
handles.CertificationSettings.Run.Time = amountOfSteps*handles.CertificationSettings.Wind.StepDuration;
225-
set(handles.Runtime_textbox, 'Enable', 'off');
226-
set(handles.Runtime_textbox, 'String', handles.CertificationSettings.Run.Time);
227-
else
228-
set(handles.Runtime_textbox, 'Enable', 'on');
229-
end
230-
231232
% Update handles structure
232233
guidata(hObject, handles);
233234

@@ -249,6 +250,15 @@ function OperationSettings_Callback(hObject, eventdata, handles)
249250
set(buttons(i), 'Enable', 'on');
250251
end
251252

253+
% Disable simulation time and wind speed if a stepped wind is requested
254+
if handles.CertificationSettings.Wind.Type == 2
255+
set(handles.Runtime_textbox, 'Enable', 'off');
256+
set(handles.WindSpeed_textbox, 'Enable', 'off');
257+
else
258+
set(handles.Runtime_textbox, 'Enable', 'on');
259+
set(handles.WindSpeed_textbox, 'Enable', 'on');
260+
end
261+
252262
% Disable start button
253263
if isempty(handles.OutputFile)
254264
set(handles.Start, 'Enable', 'off')
@@ -340,6 +350,7 @@ function NSeeds_textbox_Callback(hObject, eventdata, handles)
340350
handles.CertificationSettings.Run.Seeds = ceil(str2double(get(hObject,'String')));
341351
guidata(hObject, handles);
342352
UpdateOutputName(handles);
353+
343354
function NSeeds_textbox_CreateFcn(hObject, eventdata, handles)
344355
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
345356
set(hObject,'BackgroundColor','white');
@@ -355,6 +366,7 @@ function Runtime_textbox_Callback(hObject, eventdata, handles)
355366
handles.CertificationSettings.Run.Time = str2double(get(hObject,'String'));
356367
handles.CertificationSettings.Wind.T = handles.CertificationSettings.Run.Time;
357368
guidata(hObject, handles);
369+
358370
function Runtime_textbox_CreateFcn(hObject, eventdata, handles)
359371
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
360372
set(hObject,'BackgroundColor','white');
@@ -619,6 +631,15 @@ function Start_Callback(hObject, eventdata, handles)
619631
set(buttons(i), 'Enable', 'on');
620632
end
621633

634+
% Disable simulation time and wind speed if a stepped wind is requested
635+
if handles.CertificationSettings.Wind.Type == 2
636+
set(handles.Runtime_textbox, 'Enable', 'off');
637+
set(handles.WindSpeed_textbox, 'Enable', 'off');
638+
else
639+
set(handles.Runtime_textbox, 'Enable', 'on');
640+
set(handles.WindSpeed_textbox, 'Enable', 'on');
641+
end
642+
622643
% Turn on warnings
623644
warning('on','all')
624645
disp('')

subfunctions/Wind.fig

-7.33 KB
Binary file not shown.

0 commit comments

Comments
 (0)