classdef GliDash < matlab.apps.AppBase

    % Properties that correspond to app components
    properties (Access = public)
        UIFigure           matlab.ui.Figure
        Gauge_3            matlab.ui.control.Gauge
        Gauge_3Label       matlab.ui.control.Label
        Gauge_2            matlab.ui.control.Gauge
        Gauge_2Label       matlab.ui.control.Label
        Gauge              matlab.ui.control.Gauge
        GaugeLabel         matlab.ui.control.Label
        DateTimeLabel      matlab.ui.control.Label
        TextArea           matlab.ui.control.TextArea
        MissionButton      matlab.ui.control.Button
        ScienceButton      matlab.ui.control.Button
        DiagnosticsButton  matlab.ui.control.Button
        ProfilesButton     matlab.ui.control.Button
    end

    
    properties (Access = private)
        UpdateTimer      timer % timer to update
    end
    
    methods (Access = private)
        
        
        function UpdateCurrentTime(app)
            app.DateTimeLabel.Text = {'Current time', [char(datetime('now','TimeZone','PST')) ' PST'],[char(datetime('now','TimeZone','UTC')) ' UTC']};
        end
        
    end
    

    % Callbacks that handle component events
    methods (Access = private)

        % Code that executes after component creation
        function startupFcn(app)
            UpdateCurrentTime(app)
        end
    end

    % Component initialization
    methods (Access = private)

        % Create UIFigure and components
        function createComponents(app)

            % Create UIFigure and hide until all components are created
            app.UIFigure = uifigure('Visible', 'off');
            app.UIFigure.Position = [100 100 903 900];
            app.UIFigure.Name = 'MATLAB App';

            % Create ProfilesButton
            app.ProfilesButton = uibutton(app.UIFigure, 'push');
            app.ProfilesButton.Position = [10 643 210 63];
            app.ProfilesButton.Text = 'Profiles';

            % Create DiagnosticsButton
            app.DiagnosticsButton = uibutton(app.UIFigure, 'push');
            app.DiagnosticsButton.Position = [229 643 210 63];
            app.DiagnosticsButton.Text = 'Diagnostics';

            % Create ScienceButton
            app.ScienceButton = uibutton(app.UIFigure, 'push');
            app.ScienceButton.Position = [449 643 227 63];
            app.ScienceButton.Text = 'Science';

            % Create MissionButton
            app.MissionButton = uibutton(app.UIFigure, 'push');
            app.MissionButton.Position = [685 643 210 63];
            app.MissionButton.Text = 'Mission';

            % Create TextArea
            app.TextArea = uitextarea(app.UIFigure);
            app.TextArea.FontSize = 48;
            app.TextArea.Position = [229 800 446 65];
            app.TextArea.Value = {'Welcome to Glidash'};

            % Create DateTimeLabel
            app.DateTimeLabel = uilabel(app.UIFigure);
            app.DateTimeLabel.Position = [11 705 275 74];

            % Create GaugeLabel
            app.GaugeLabel = uilabel(app.UIFigure);
            app.GaugeLabel.HorizontalAlignment = 'center';
            app.GaugeLabel.Position = [42 1 41 22];
            app.GaugeLabel.Text = 'Gauge';

            % Create Gauge
            app.Gauge = uigauge(app.UIFigure, 'circular');
            app.Gauge.Position = [2 38 120 120];

            % Create Gauge_2Label
            app.Gauge_2Label = uilabel(app.UIFigure);
            app.Gauge_2Label.HorizontalAlignment = 'center';
            app.Gauge_2Label.Position = [182 54 41 22];
            app.Gauge_2Label.Text = 'Gauge';

            % Create Gauge_2
            app.Gauge_2 = uigauge(app.UIFigure, 'circular');
            app.Gauge_2.Position = [142 91 120 120];

            % Create Gauge_3Label
            app.Gauge_3Label = uilabel(app.UIFigure);
            app.Gauge_3Label.HorizontalAlignment = 'center';
            app.Gauge_3Label.Position = [326 1 41 22];
            app.Gauge_3Label.Text = 'Gauge';

            % Create Gauge_3
            app.Gauge_3 = uigauge(app.UIFigure, 'circular');
            app.Gauge_3.Position = [286 38 120 120];

            % Show the figure after all components are created
            app.UIFigure.Visible = 'on';
        end
    end

    % App creation and deletion
    methods (Access = public)

        % Construct app
        function app = GliDash

            % Create UIFigure and components
            createComponents(app)

            % Register the app with App Designer
            registerApp(app, app.UIFigure)

            % Execute the startup function
            runStartupFcn(app, @startupFcn)

            if nargout == 0
                clear app
            end
        end

        % Code that executes before app deletion
        function delete(app)

            % Delete UIFigure when app is deleted
            delete(app.UIFigure)
        end
    end
end