%hScanLTEWaveformGUI launches a Graphical User Interface (GUI)
%   hScanLTEWaveformGUI creates GUI for LTE scanner by dividing main figure
%   container in to two sub-containers: (i) Controller, contains all the
%   widgets corresponding to input settings. (ii) Viewer, contains all
%   widgets corresponding to the decoded information.

%   Copyright 2019 The MathWorks, Inc.

function hScanLTEWaveformGUI

% Top level figure for GUI
figureHandle = figure('Visible','off',...
    'HandleVisibility','on',...
    'NumberTitle','off',...
    'IntegerHandle','off',...
    'Resize','off',...
    'MenuBar','none',...
    'Name','Scan LTE Waveform',...
    'Tag','ScanLTEWaveformFigure');

% Create the main container for the controller and the viewer
mainContainer = uigridcontainer('v0','Parent',figureHandle,...
    'GridSize',[1 2],'HorizontalWeight',[2 5],...
    'Tag','ScanLTEWaveformMainContainer');

% Add controller panel to the main container
controllerPanel = uicontainer('Parent',mainContainer,...
    'Tag','ScanLTEWaveformCtrlPanel',...
    'Units','pixels');

% Add viewer container to the main container
viewerPanel = uicontainer('Parent',mainContainer,...
    'Tag','ScanLTEWaveformViewerPanel',...
    'Units','pixels');

% Instantiate the viewer
viewer = hScanLTEWaveformViewer('ParentHandle',viewerPanel);

% Instantiate the controller
controller = hScanLTEWaveformController...
    ('ParentHandle',controllerPanel,...
    'Viewer',viewer);
render(controller);

% Set the GUI dimensions
figureHandle.Position(3) = 1200;
figureHandle.Position(4) = 700;
movegui(figureHandle,'center');
figureHandle.Visible = 'on';

end