classdef CodeForum < matlab.apps.AppBase
properties (Access = public)
UIFigure matlab.ui.Figure
NumberOfStage matlab.ui.control.NumericEditField
NumberofStageLabel matlab.ui.control.Label
TabGroup matlab.ui.container.TabGroup
Etage1Tab matlab.ui.container.Tab
ResiduB3 matlab.ui.control.TextArea
Residualbeta_3ps3Label matlab.ui.control.Label
ResiduB2 matlab.ui.control.TextArea
Residualbeta_2ps2TextAreaLabel matlab.ui.control.Label
LengthAfter matlab.ui.control.NumericEditField
LengthmEditField_2Label matlab.ui.control.Label
LengthBefore matlab.ui.control.NumericEditField
LengthmEditFieldLabel matlab.ui.control.Label
PassiveFiberAfterButton matlab.ui.control.StateButton
PassiveFiberBeforeButton matlab.ui.control.StateButton
OpticDropDown matlab.ui.control.DropDown
OpticDropDownLabel matlab.ui.control.Label
end
properties (Access = public)
c= 299792458 ;
h = 6.626e-34;
kb=1.38064852e-23;
end
properties (Access = private)
tabs = cell(1,100);
end
methods (Access = private)
function NumberOfStageValueChanged(app, event)
value = app.NumberOfStage.Value;
app.TabGroup.Parent=[];
app.Etage1Tab = uitab(app.TabGroup);
app.TabGroup = uitabgroup(app.UIFigure);
app.TabGroup.Position = [132 180 314 262];
app.Etage1Tab = uitab(app.TabGroup);
app.Etage1Tab.Title = 'Etage1';
app.OpticDropDownLabel = uilabel(app.Etage1Tab);
app.OpticDropDownLabel.HorizontalAlignment = 'right';
app.OpticDropDownLabel.Position = [6 165 34 22];
app.OpticDropDownLabel.Text = 'Optic';
app.OpticDropDown = uidropdown(app.Etage1Tab);
app.OpticDropDown.Items = {'FBG', 'Ampli Fiber', 'Passive Fiber'};
app.OpticDropDown.Position = [54 165 116 22];
app.OpticDropDown.Value = 'FBG';
app.PassiveFiberBeforeButton = uibutton(app.Etage1Tab, 'state');
app.PassiveFiberBeforeButton.Text = 'Passive Fiber Before';
app.PassiveFiberBeforeButton.Position = [1 207 127 22];
app.PassiveFiberAfterButton = uibutton(app.Etage1Tab, 'state');
app.PassiveFiberAfterButton.Text = 'Passive Fiber After';
app.PassiveFiberAfterButton.Position = [1 12 116 22];
app.LengthmEditFieldLabel = uilabel(app.Etage1Tab);
app.LengthmEditFieldLabel.HorizontalAlignment = 'right';
app.LengthmEditFieldLabel.Position = [149 207 62 22];
app.LengthmEditFieldLabel.Text = 'Length [m]';
app.LengthBefore = uieditfield(app.Etage1Tab, 'numeric');
app.LengthBefore.Position = [214 207 35 22];
app.LengthmEditField_2Label = uilabel(app.Etage1Tab);
app.LengthmEditField_2Label.HorizontalAlignment = 'right';
app.LengthmEditField_2Label.Position = [149 12 62 22];
app.LengthmEditField_2Label.Text = 'Length [m]';
app.LengthAfter = uieditfield(app.Etage1Tab, 'numeric');
app.LengthAfter.Position = [214 12 35 22];
app.Residualbeta_2ps2TextAreaLabel = uilabel(app.Etage1Tab);
app.Residualbeta_2ps2TextAreaLabel.Interpreter = 'latex';
app.Residualbeta_2ps2TextAreaLabel.HorizontalAlignment = 'right';
app.Residualbeta_2ps2TextAreaLabel.Position = [54 138 96 22];
app.Residualbeta_2ps2TextAreaLabel.Text = 'Residual $ \beta_2 [ps^2]$';
app.ResiduB2 = uitextarea(app.Etage1Tab);
app.ResiduB2.Position = [159 137 41 24];
app.ResiduB2.Value = {'0'};
app.Residualbeta_3ps3Label = uilabel(app.Etage1Tab);
app.Residualbeta_3ps3Label.Interpreter = 'latex';
app.Residualbeta_3ps3Label.HorizontalAlignment = 'right';
app.Residualbeta_3ps3Label.Position = [39 113 111 22];
app.Residualbeta_3ps3Label.Text = 'Residual $ \beta_3 [ps^3]$';
app.ResiduB3 = uitextarea(app.Etage1Tab);
app.ResiduB3.Position = [159 113 41 20];
app.ResiduB3.Value = {'0'};
app.Etage1Tab.Title = 'Etage1';
app.TabGroup
for i = 2: value
app.tabs{i} = uitab(app.TabGroup,'Title',['Etage' num2str(i)]);
app.OpticDropDownLabel = uilabel(app.tabs{i});
app.OpticDropDownLabel.HorizontalAlignment = 'right';
app.OpticDropDownLabel.Position = [6 165 34 22];
app.OpticDropDownLabel.Text = 'Optic';
app.OpticDropDown = uidropdown(app.tabs{i});
app.OpticDropDown.Items = {'FBG', 'Ampli Fiber', 'Passive Fiber'};
app.OpticDropDown.ValueChangedFcn = createCallbackFcn(app, @OpticDropDownValueChanged, true);
app.OpticDropDown.Position = [54 165 116 22];
app.OpticDropDown.Value = 'FBG';
app.PassiveFiberBeforeButton = uibutton(app.tabs{i}, 'state');
app.PassiveFiberBeforeButton.Text = 'Passive Fiber Before';
app.PassiveFiberBeforeButton.Position = [1 207 127 22];
app.PassiveFiberAfterButton = uibutton(app.tabs{i}, 'state');
app.PassiveFiberAfterButton.Text = 'Passive Fiber After';
app.PassiveFiberAfterButton.Position = [1 12 116 22];
app.LengthmEditFieldLabel = uilabel(app.tabs{i});
app.LengthmEditFieldLabel.HorizontalAlignment = 'right';
app.LengthmEditFieldLabel.Position = [149 207 62 22];
app.LengthmEditFieldLabel.Text = 'Length [m]';
app.LengthBefore = uieditfield(app.tabs{i}, 'numeric');
app.LengthBefore.Position = [214 207 35 22];
app.LengthmEditField_2Label = uilabel(app.tabs{i});
app.LengthmEditField_2Label.HorizontalAlignment = 'right';
app.LengthmEditField_2Label.Position = [149 12 62 22];
app.LengthmEditField_2Label.Text = 'Length [m]';
app.LengthAfter = uieditfield(app.tabs{i}, 'numeric');
app.LengthAfter.Position = [214 12 35 22];
app.Residualbeta_2ps2TextAreaLabel = uilabel(app.tabs{i});
app.Residualbeta_2ps2TextAreaLabel.Interpreter = 'latex';
app.Residualbeta_2ps2TextAreaLabel.HorizontalAlignment = 'right';
app.Residualbeta_2ps2TextAreaLabel.Position = [54 138 96 22];
app.Residualbeta_2ps2TextAreaLabel.Text = 'Residual $ \beta_2 [ps^2]$';
app.ResiduB2 = uitextarea(app.tabs{i});
app.ResiduB2.Position = [159 137 41 24];
app.ResiduB2.Value = {'0'};
app.Residualbeta_3ps3Label = uilabel(app.tabs{i});
app.Residualbeta_3ps3Label.Interpreter = 'latex';
app.Residualbeta_3ps3Label.HorizontalAlignment = 'right';
app.Residualbeta_3ps3Label.Position = [39 113 111 22];
app.Residualbeta_3ps3Label.Text = 'Residual $ \beta_3 [ps^3]$';
app.ResiduB3 = uitextarea(app.tabs{i});
app.ResiduB3.Position = [159 113 41 20];
app.ResiduB3.Value = {'0'};
i
end
end
function OpticDropDownValueChanged(app, event)
value = app.OpticDropDown.Value;
if isequal(value , 'FBG')
app.ResiduB2.Visible = 'on'
app.Residualbeta_2ps2TextAreaLabel.Visible = 'on'
app.ResiduB3.Visible = 'on'
app.Residualbeta_3ps3Label.Visible = 'on'
elseif isequal(value , 'Ampli Fiber')
app.ResiduB2.Visible = 'off'
app.Residualbeta_2ps2TextAreaLabel.Visible = 'off'
app.ResiduB3.Visible = 'off'
app.Residualbeta_3ps3Label.Visible = 'off'
elseif isequal(value , 'Passive Fiber')
app.ResiduB2.Visible = 'off'
app.Residualbeta_2ps2TextAreaLabel.Visible = 'off'
app.ResiduB3.Visible = 'off'
app.Residualbeta_3ps3Label.Visible = 'off'
end
end
end
methods (Access = private)
function createComponents(app)
app.UIFigure = uifigure('Visible', 'off');
app.UIFigure.Position = [100 100 640 480];
app.UIFigure.Name = 'MATLAB App';
app.TabGroup = uitabgroup(app.UIFigure);
app.TabGroup.Position = [132 180 314 262];
app.Etage1Tab = uitab(app.TabGroup);
app.Etage1Tab.Title = 'Etage1';
app.OpticDropDownLabel = uilabel(app.Etage1Tab);
app.OpticDropDownLabel.HorizontalAlignment = 'right';
app.OpticDropDownLabel.Position = [6 165 34 22];
app.OpticDropDownLabel.Text = 'Optic';
app.OpticDropDown = uidropdown(app.Etage1Tab);
app.OpticDropDown.Items = {'FBG', 'Ampli Fiber', 'Passive Fiber'};
app.OpticDropDown.ValueChangedFcn = createCallbackFcn(app, @OpticDropDownValueChanged, true);
app.OpticDropDown.Position = [54 165 116 22];
app.OpticDropDown.Value = 'FBG';
app.PassiveFiberBeforeButton = uibutton(app.Etage1Tab, 'state');
app.PassiveFiberBeforeButton.Text = 'Passive Fiber Before';
app.PassiveFiberBeforeButton.Position = [1 207 127 22];
app.PassiveFiberAfterButton = uibutton(app.Etage1Tab, 'state');
app.PassiveFiberAfterButton.Text = 'Passive Fiber After';
app.PassiveFiberAfterButton.Position = [1 12 116 22];
app.LengthmEditFieldLabel = uilabel(app.Etage1Tab);
app.LengthmEditFieldLabel.HorizontalAlignment = 'right';
app.LengthmEditFieldLabel.Position = [149 207 62 22];
app.LengthmEditFieldLabel.Text = 'Length [m]';
app.LengthBefore = uieditfield(app.Etage1Tab, 'numeric');
app.LengthBefore.Position = [214 207 35 22];
app.LengthmEditField_2Label = uilabel(app.Etage1Tab);
app.LengthmEditField_2Label.HorizontalAlignment = 'right';
app.LengthmEditField_2Label.Position = [149 12 62 22];
app.LengthmEditField_2Label.Text = 'Length [m]';
app.LengthAfter = uieditfield(app.Etage1Tab, 'numeric');
app.LengthAfter.Position = [214 12 35 22];
app.Residualbeta_2ps2TextAreaLabel = uilabel(app.Etage1Tab);
app.Residualbeta_2ps2TextAreaLabel.Interpreter = 'latex';
app.Residualbeta_2ps2TextAreaLabel.HorizontalAlignment = 'right';
app.Residualbeta_2ps2TextAreaLabel.Position = [54 138 96 22];
app.Residualbeta_2ps2TextAreaLabel.Text = 'Residual $ \beta_2 [ps^2]$';
app.ResiduB2 = uitextarea(app.Etage1Tab);
app.ResiduB2.Position = [159 137 41 24];
app.ResiduB2.Value = {'0'};
app.Residualbeta_3ps3Label = uilabel(app.Etage1Tab);
app.Residualbeta_3ps3Label.Interpreter = 'latex';
app.Residualbeta_3ps3Label.HorizontalAlignment = 'right';
app.Residualbeta_3ps3Label.Position = [39 113 111 22];
app.Residualbeta_3ps3Label.Text = 'Residual $ \beta_3 [ps^3]$';
app.ResiduB3 = uitextarea(app.Etage1Tab);
app.ResiduB3.Position = [159 113 41 20];
app.ResiduB3.Value = {'0'};
app.NumberofStageLabel = uilabel(app.UIFigure);
app.NumberofStageLabel.FontColor = [0.149 0.149 0.149];
app.NumberofStageLabel.Position = [171 115 96 22];
app.NumberofStageLabel.Text = 'Number of Stage';
app.NumberOfStage = uieditfield(app.UIFigure, 'numeric');
app.NumberOfStage.ValueChangedFcn = createCallbackFcn(app, @NumberOfStageValueChanged, true);
app.NumberOfStage.HorizontalAlignment = 'center';
app.NumberOfStage.FontColor = [0.149 0.149 0.149];
app.NumberOfStage.Position = [318 115 40 22];
app.NumberOfStage.Value = 1;
app.UIFigure.Visible = 'on';
end
end
methods (Access = public)
function app = CodeForum
createComponents(app)
registerApp(app, app.UIFigure)
if nargout == 0
clear app
end
end
function delete(app)
delete(app.UIFigure)
end
end
end