Professional Documents
Culture Documents
Lab 10 Nutu
Lab 10 Nutu
Laborator Nr: 10
Interfata grafica utilizator
Program:
classdef App10 < matlab.apps.AppBase
% Component initialization
methods (Access = private)
% Create Image
app.Image = uiimage(app.UIFigure);
app.Image.Tag = 'logo1';
app.Image.Position = [21 336 100 100];
app.Image.ImageSource = 'logo-fimm.png';
% Create Image2
app.Image2 = uiimage(app.UIFigure);
app.Image2.Tag = 'logo2';
app.Image2.Position = [816 336 100 100];
app.Image2.ImageSource = 'logo-upb.png';
% Create IesireButton
app.IesireButton = uibutton(app.UIFigure, 'push');
app.IesireButton.ButtonPushedFcn = createCallbackFcn(app, @IesireButtonPushed,
true);
app.IesireButton.Tag = 'exit';
app.IesireButton.Position = [778 23 100 38];
app.IesireButton.Text = 'Iesire';
% Create Label
app.Label = uilabel(app.UIFigure);
app.Label.HorizontalAlignment = 'right';
app.Label.Position = [29 283 29 22];
app.Label.Text = 'ϕ1 = ';
% Create EditField
app.EditField = uieditfield(app.UIFigure, 'numeric');
app.EditField.Tag = 'fiDisc';
app.EditField.Position = [66 283 35 22];
% Create Label_2
app.Label_2 = uilabel(app.UIFigure);
app.Label_2.HorizontalAlignment = 'right';
app.Label_2.Position = [26 249 32 22];
app.Label_2.Text = 'ϕ2 = ';
% Create EditField_2
app.EditField_2 = uieditfield(app.UIFigure, 'numeric');
app.EditField_2.Tag = 'inFiGauri';
app.EditField_2.Position = [66 249 35 22];
% Create Label_3
app.Label_3 = uilabel(app.UIFigure);
app.Label_3.HorizontalAlignment = 'right';
app.Label_3.Position = [26 212 32 22];
app.Label_3.Text = 'ϕ3 = ';
% Create EditField_3
app.EditField_3 = uieditfield(app.UIFigure, 'numeric');
app.EditField_3.Tag = 'inFiGaura';
app.EditField_3.Position = [66 215 35 22];
% Create Label_4
app.Label_4 = uilabel(app.UIFigure);
app.Label_4.HorizontalAlignment = 'right';
app.Label_4.Position = [26 182 32 22];
app.Label_4.Text = 'ϕ4 = ';
% Create EditField_4
app.EditField_4 = uieditfield(app.UIFigure, 'numeric');
app.EditField_4.Tag = 'inFiFusMic';
app.EditField_4.Position = [66 181 35 22];
% Create Label_5
app.Label_5 = uilabel(app.UIFigure);
app.Label_5.HorizontalAlignment = 'right';
app.Label_5.Position = [26 152 32 22];
app.Label_5.Text = 'ϕ5 = ';
% Create EditField_5
app.EditField_5 = uieditfield(app.UIFigure, 'numeric');
app.EditField_5.Tag = 'inFiFusMare';
app.EditField_5.Position = [66 147 35 22];
% Create Label_6
app.Label_6 = uilabel(app.UIFigure);
app.Label_6.HorizontalAlignment = 'right';
app.Label_6.Position = [26 116 32 22];
app.Label_6.Text = 'ϕ6 = ';
% Create EditField_6
app.EditField_6 = uieditfield(app.UIFigure, 'numeric');
app.EditField_6.Tag = 'inFiCapDisc';
app.EditField_6.Position = [66 113 35 22];
% Create mmLabel
app.mmLabel = uilabel(app.UIFigure);
app.mmLabel.Position = [109 283 25 22];
app.mmLabel.Text = 'mm';
% Create mmLabel_2
app.mmLabel_2 = uilabel(app.UIFigure);
app.mmLabel_2.Position = [109 249 25 22];
app.mmLabel_2.Text = 'mm';
% Create mmLabel_3
app.mmLabel_3 = uilabel(app.UIFigure);
app.mmLabel_3.Position = [109 215 25 22];
app.mmLabel_3.Text = 'mm';
% Create mmLabel_4
app.mmLabel_4 = uilabel(app.UIFigure);
app.mmLabel_4.Position = [109 182 25 22];
app.mmLabel_4.Text = 'mm';
% Create mmLabel_5
app.mmLabel_5 = uilabel(app.UIFigure);
app.mmLabel_5.Position = [109 149 25 22];
app.mmLabel_5.Text = 'mm';
% Create mmLabel_6
app.mmLabel_6 = uilabel(app.UIFigure);
app.mmLabel_6.Position = [109 116 25 22];
app.mmLabel_6.Text = 'mm';
% Create mmLabel_7
app.mmLabel_7 = uilabel(app.UIFigure);
app.mmLabel_7.Position = [273 283 25 22];
app.mmLabel_7.Text = 'mm';
% Create mmLabel_8
app.mmLabel_8 = uilabel(app.UIFigure);
app.mmLabel_8.Position = [273 249 25 22];
app.mmLabel_8.Text = 'mm';
% Create mmLabel_9
app.mmLabel_9 = uilabel(app.UIFigure);
app.mmLabel_9.Position = [273 215 25 22];
app.mmLabel_9.Text = 'mm';
% Create L1EditFieldLabel
app.L1EditFieldLabel = uilabel(app.UIFigure);
app.L1EditFieldLabel.HorizontalAlignment = 'right';
app.L1EditFieldLabel.Position = [190 283 32 22];
app.L1EditFieldLabel.Text = 'L1 = ';
% Create L1EditField
app.L1EditField = uieditfield(app.UIFigure, 'numeric');
app.L1EditField.Tag = 'inLFus';
app.L1EditField.Position = [230 283 35 22];
% Create L2EditFieldLabel
app.L2EditFieldLabel = uilabel(app.UIFigure);
app.L2EditFieldLabel.HorizontalAlignment = 'right';
app.L2EditFieldLabel.Position = [190 249 32 22];
app.L2EditFieldLabel.Text = 'L2 = ';
% Create L2EditField
app.L2EditField = uieditfield(app.UIFigure, 'numeric');
app.L2EditField.Tag = 'inLFusIesit';
app.L2EditField.Position = [230 249 35 22];
% Create L3EditFieldLabel
app.L3EditFieldLabel = uilabel(app.UIFigure);
app.L3EditFieldLabel.HorizontalAlignment = 'right';
app.L3EditFieldLabel.Position = [190 212 32 22];
app.L3EditFieldLabel.Text = 'L3 = ';
% Create L3EditField
app.L3EditField = uieditfield(app.UIFigure, 'numeric');
app.L3EditField.Tag = 'inLDisc';
app.L3EditField.Position = [230 215 35 22];
% Create kgm3Label
app.kgm3Label = uilabel(app.UIFigure);
app.kgm3Label.Position = [274 147 43 22];
app.kgm3Label.Text = 'kg/m^3';
% Create kgm3Label_2
app.kgm3Label_2 = uilabel(app.UIFigure);
app.kgm3Label_2.Position = [273 110 43 22];
app.kgm3Label_2.Text = 'kg/m^3';
% Create Label_7
app.Label_7 = uilabel(app.UIFigure);
app.Label_7.HorizontalAlignment = 'right';
app.Label_7.Position = [190 147 32 22];
app.Label_7.Text = 'ρ1 = ';
% Create EditField_7
app.EditField_7 = uieditfield(app.UIFigure, 'numeric');
app.EditField_7.Tag = 'inRoDisc';
app.EditField_7.Position = [230 147 35 22];
% Create Label_8
app.Label_8 = uilabel(app.UIFigure);
app.Label_8.HorizontalAlignment = 'right';
app.Label_8.Position = [190 110 32 22];
app.Label_8.Text = 'ρ2 = ';
% Create EditField_8
app.EditField_8 = uieditfield(app.UIFigure, 'numeric');
app.EditField_8.Tag = 'inRoBucsa';
app.EditField_8.Position = [230 110 35 22];
% Create Image3
app.Image3 = uiimage(app.UIFigure);
app.Image3.ScaleMethod = 'fill';
app.Image3.Position = [339 120 247 206];
app.Image3.ImageSource = 'pozaAnsamblu.PNG';
% Create RezultatePanel
app.RezultatePanel = uipanel(app.UIFigure);
app.RezultatePanel.Title = 'Rezultate';
app.RezultatePanel.Position = [618 163 260 167];
% Create AnsambluLabel
app.AnsambluLabel = uilabel(app.RezultatePanel);
app.AnsambluLabel.Tag = 'numeRezultat';
app.AnsambluLabel.Position = [19 115 57 27];
app.AnsambluLabel.Text = 'Ansamblu';
% Create VolumLabel
app.VolumLabel = uilabel(app.RezultatePanel);
app.VolumLabel.Position = [31 86 52 22];
app.VolumLabel.Text = 'Volum = ';
% Create MasaLabel
app.MasaLabel = uilabel(app.RezultatePanel);
app.MasaLabel.Position = [31 54 48 22];
app.MasaLabel.Text = 'Masa = ';
% Create MomentLabel
app.MomentLabel = uilabel(app.RezultatePanel);
app.MomentLabel.Position = [31 19 63 22];
app.MomentLabel.Text = 'Moment = ';
% Create m3Label
app.m3Label = uilabel(app.RezultatePanel);
app.m3Label.Position = [198 86 27 22];
app.m3Label.Text = 'm^3';
% Create kgLabel
app.kgLabel = uilabel(app.RezultatePanel);
app.kgLabel.Position = [198 54 25 22];
app.kgLabel.Text = 'kg';
% Create NmLabel
app.NmLabel = uilabel(app.RezultatePanel);
app.NmLabel.Position = [198 19 29 22];
app.NmLabel.Text = 'N*m';
% Create EditField_9
app.EditField_9 = uieditfield(app.RezultatePanel, 'numeric');
app.EditField_9.Tag = 'outVolum';
app.EditField_9.Editable = 'off';
app.EditField_9.Position = [93 86 100 22];
% Create EditField_10
app.EditField_10 = uieditfield(app.RezultatePanel, 'numeric');
app.EditField_10.Tag = 'outMasa';
app.EditField_10.Editable = 'off';
app.EditField_10.Position = [93 49 100 22];
% Create EditField_11
app.EditField_11 = uieditfield(app.RezultatePanel, 'numeric');
app.EditField_11.Tag = 'outMoment';
app.EditField_11.Editable = 'off';
app.EditField_11.Position = [93 19 100 22];
% Create CalculeazavolumulmasasimomentuldeinertieButton
app.CalculeazavolumulmasasimomentuldeinertieButton = uibutton(app.UIFigure,
'push');
app.CalculeazavolumulmasasimomentuldeinertieButton.ButtonPushedFcn =
createCallbackFcn(app, @CalculeazavolumulmasasimomentuldeinertieButtonPushed,
true);
app.CalculeazavolumulmasasimomentuldeinertieButton.Tag = 'compute';
app.CalculeazavolumulmasasimomentuldeinertieButton.Position = [27.5 23 279 38];
app.CalculeazavolumulmasasimomentuldeinertieButton.Text = 'Calculeaza volumul,
masa si momentul de inertie';
% Create ResetButton
app.ResetButton = uibutton(app.UIFigure, 'push');
app.ResetButton.ButtonPushedFcn = createCallbackFcn(app, @ResetButtonPushed,
true);
app.ResetButton.Tag = 'reset';
app.ResetButton.Position = [413 23 100 38];
app.ResetButton.Text = 'Reset';
% Create CorpDropDownLabel
app.CorpDropDownLabel = uilabel(app.UIFigure);
app.CorpDropDownLabel.HorizontalAlignment = 'right';
app.CorpDropDownLabel.Position = [695 131 31 22];
app.CorpDropDownLabel.Text = 'Corp';
% Create CorpDropDown
app.CorpDropDown = uidropdown(app.UIFigure);
app.CorpDropDown.Items = {'Ansamblu', 'Arbore', 'Disc'};
app.CorpDropDown.ValueChangedFcn = createCallbackFcn(app,
@CorpDropDownValueChanged, true);
app.CorpDropDown.Tag = 'selectareCorp';
app.CorpDropDown.Position = [741 131 100 22];
app.CorpDropDown.Value = 'Ansamblu';
% Create gauriEditFieldLabel
app.gauriEditFieldLabel = uilabel(app.UIFigure);
app.gauriEditFieldLabel.HorizontalAlignment = 'right';
app.gauriEditFieldLabel.Position = [167 78 55 22];
app.gauriEditFieldLabel.Text = '# gauri = ';
% Create gauriEditField
app.gauriEditField = uieditfield(app.UIFigure, 'numeric');
app.gauriEditField.Tag = 'inNrGauri';
app.gauriEditField.Position = [230 78 35 22];
% Create mmLabel_12
app.mmLabel_12 = uilabel(app.UIFigure);
app.mmLabel_12.Position = [273 181 25 22];
app.mmLabel_12.Text = 'mm';
% Create L4EditFieldLabel
app.L4EditFieldLabel = uilabel(app.UIFigure);
app.L4EditFieldLabel.HorizontalAlignment = 'right';
app.L4EditFieldLabel.Position = [190 181 32 22];
app.L4EditFieldLabel.Text = 'L4 = ';
% Create L4EditField
app.L4EditField = uieditfield(app.UIFigure, 'numeric');
app.L4EditField.Tag = 'inLFusMic';
app.L4EditField.Position = [230 181 35 22];
% Create NutuLabel
app.NutulLabel = uilabel(app.UIFigure);
app.NutulLabel.Position = [133 414 131 22];
app.NutuLabel.Text = 'Nutu ';
% Create CalculatorvolummasasimomentalunuianasambluarborediscLabel
app.CalculatorvolummasasimomentalunuianasambluarborediscLabel =
uilabel(app.UIFigure);
app.CalculatorvolummasasimomentalunuianasambluarborediscLabel.HorizontalAlignmen
t = 'center';
app.CalculatorvolummasasimomentalunuianasambluarborediscLabel.FontSize = 19;
app.CalculatorvolummasasimomentalunuianasambluarborediscLabel.Position = [178.5
352 569 46];
app.CalculatorvolummasasimomentalunuianasambluarborediscLabel.Text =
'Calculator volum, masa si moment al unui anasamblu arbore-disc';
% Construct app
function app = App10
if nargout == 0
clear app
end
end
Poze:
Corp: Ansamblu
Corp: Arbore
Corp: Disc
Buton: Reset