classdef AppHelper
%APPHELPER Encapsulates the app's functionality.
%   The app delegates its work to simulink.compiler.app.AppHelper. As a
%   result, when you open the app (MLAPP file) in App Designer, there is
%   minimal code. You can look at the callbacks in the MLAPP file and the
%   functions that are called on the AppHelper, then inspect these
%   functions in simulink.compiler.app.AppHelper.
%   simulink.compiler.app.AppHelper enables you to better organize the
%   code, instead of having it all in the MLAPP file.

%   Copyright 2021-2022 The MathWorks, Inc.

    properties (Access = private)
        App
    end
    
    properties (Constant)

        MinAxesHeight = 100
        MinAxesHeightSplitView = 65
        MaxAxesRowsBeforeScroll = 4
        MaxAxesRowsBeforeScrollSplitView = 2
        SingleAxesHideTime = 0.1;
        AddedDelayForPaneTransition = 1.5
        SimControlsButtonSize = 32

        % Order is important in the below arrays
        TopPanes = [ ...
            "ModelHTML", ...
            "PrmsGL" ...
        ]
        BottomPanes = [ ...
            "SigsGL", ...
            "AxesGL" ...
        ]
        PaneGroups = [ ...
            "ModelHTMLAndPrmsGLShuttersGL", ...
            "ResultsGL" ...
        ]
        TopScrollButtons = [ ...
            "ScrollTopLeftUIC", ...
            "ScrollTopRightUIC" ...
        ]
        MiddleScrollButtons = [ ...
            "ScrollUpUIC", ...
            "ScrollDownUIC" ...
        ]
        BottomScrollButtons = [ ...
            "ScrollBottomLeftUIC", ...
            "ScrollBottomRightUIC" ...
        ]
        NonSimUIControls = [ ...
            "PlotRefreshRateHzSlider", ...
            simulink.compiler.app.AppHelper.TopScrollButtons, ...
            simulink.compiler.app.AppHelper.MiddleScrollButtons, ...
            simulink.compiler.app.AppHelper.BottomScrollButtons ...
        ]

        % Elements on the MultiPaneSimApp that should be disabled when the simulation is not Inactive
        SimulationInactiveControls = [
            "SaveMenu"                  ,...
            "SaveSession"               ,...
            "SaveParametersAndInputs"   ,...
            "LoadMenu"                  ,...
            "LoadSession"               ,...
            "LoadParametersAndInputs"   ,...
            "ResetParametersAndInputs"  ,...
            "ConfigureForDeploymentMenu"
        ]

        HorizontalDirections = ["left", "right"]
        VerticalDirections =   ["up"  , "down" ]
        ScrollControlPositions = ["left", "middle", "right"]
        LayoutRows =             ["top", "middle", "bottom"]
        
    end

    methods
        function obj = AppHelper(app)
            obj.App = app;
        end
    end
end

% LocalWords:  app's
