@@ -368,8 +368,8 @@ function TableSize_slider_CreateFcn(hObject, eventdata, handles)
368368
369369%% --- Executes on button press in checkboxes.
370370function PlotLPF_checkbox_Callback(hObject , eventdata , handles )
371- [AllControllersDisabled , AllControllersEnabled ] = CheckStateCheckboxes(handles );
372- if AllControllersDisabled
371+ [AllDisabled , ~ ] = CheckStateCheckboxes(handles );
372+ if AllDisabled
373373 EnableDisableButtons(handles , ' off' )
374374 else
375375 EnableDisableButtons(handles , ' on' )
@@ -378,8 +378,8 @@ function PlotLPF_checkbox_Callback(hObject, eventdata, handles)
378378 BodePlot(handles , false , false )
379379
380380function PlotPI_checkbox_Callback(hObject , eventdata , handles )
381- [AllControllersDisabled , AllControllersEnabled ] = CheckStateCheckboxes(handles );
382- if AllControllersDisabled
381+ [AllDisabled , ~ ] = CheckStateCheckboxes(handles );
382+ if AllDisabled
383383 EnableDisableButtons(handles , ' off' )
384384 else
385385 EnableDisableButtons(handles , ' on' )
@@ -389,8 +389,8 @@ function PlotPI_checkbox_Callback(hObject, eventdata, handles)
389389
390390
391391function PlotNotch_checkbox_Callback(hObject , eventdata , handles )
392- [AllControllersDisabled , AllControllersEnabled ] = CheckStateCheckboxes(handles );
393- if AllControllersDisabled
392+ [AllDisabled , ~ ] = CheckStateCheckboxes(handles );
393+ if AllDisabled
394394 EnableDisableButtons(handles , ' off' )
395395 else
396396 EnableDisableButtons(handles , ' on' )
@@ -399,8 +399,8 @@ function PlotNotch_checkbox_Callback(hObject, eventdata, handles)
399399 BodePlot(handles , false , false )
400400
401401function PlotNom_checkbox_Callback(hObject , eventdata , handles )
402- [AllControllersDisabled , AllControllersEnabled ] = CheckStateCheckboxes(handles );
403- if AllControllersDisabled
402+ [AllDisabled , ~ ] = CheckStateCheckboxes(handles );
403+ if AllDisabled
404404 EnableDisableButtons(handles , ' off' )
405405 else
406406 EnableDisableButtons(handles , ' on' )
@@ -409,6 +409,13 @@ function PlotNom_checkbox_Callback(hObject, eventdata, handles)
409409 BodePlot(handles , false , false )
410410
411411function PlotLoopGain_checkbox_Callback(hObject , eventdata , handles )
412+ [AllDisabled , ~ ] = CheckStateCheckboxes(handles );
413+ if AllDisabled
414+ EnableDisableButtons(handles , ' off' )
415+ else
416+ EnableDisableButtons(handles , ' on' )
417+ end
418+
412419 BodePlot(handles , false , false )
413420
414421%% --- Executes on button presses
@@ -427,9 +434,6 @@ function BodePlot(handles, undock, exportData)
427434 % Evaluate state of buttons checked
428435 [AllDisabled , ~ ] = CheckStateCheckboxes(handles );
429436
430- % Enable export data button
431- set(handles .ExportPlotData_pushbutton , ' Enable' , ' on' )
432-
433437 % Create transfer function of filters in series according to selection GUI
434438 Plant = tf(1 ,1 )*ones(1 ,length(handles .SelectedListboxContents ));
435439 for i = 1 : length(handles .SelectedListboxContents )
@@ -629,14 +633,16 @@ function EnableDisableCheckBoxes(handles, state)
629633
630634function EnableDisableButtons(handles , state )
631635 set(handles .UndockBode_pushbutton , ' Enable' , state )
636+ set(handles .ExportPlotData_pushbutton , ' Enable' , state )
632637
633638function [AllDisabled , AllControllersEnabled ] = CheckStateCheckboxes(handles )
634639 checkBox(1 ) = get(handles .PlotLPF_checkbox , ' Value' );
635640 checkBox(2 ) = get(handles .PlotPI_checkbox , ' Value' );
636641 checkBox(3 ) = get(handles .PlotNotch_checkbox , ' Value' );
637642 checkBox(4 ) = get(handles .PlotNom_checkbox , ' Value' );
643+ checkBox(5 ) = get(handles .PlotLoopGain_checkbox , ' Value' );
638644
639- AllDisabled = all(checkBox(1 : 4 ) == 0 );
645+ AllDisabled = all(checkBox(1 : 5 ) == 0 );
640646 AllControllersEnabled = all(checkBox(1 : 3 ) == 1 );
641647
642648function Controller = calculateController(handles , LoopGainCheckbox )
@@ -887,7 +893,6 @@ function Window_slider_CreateFcn(hObject, eventdata, handles)
887893 set(hObject ,' BackgroundColor' ,[.9 .9 .9 ]);
888894end
889895
890-
891896% --- Executes on button press in ExportPlotData_pushbutton.
892897function ExportPlotData_pushbutton_Callback(hObject , eventdata , handles )
893898 BodePlot(handles , false , true )
0 commit comments