classdef CodeViewExternal < fxptui.ExternalViewer
    %EXTERNALVIEWER Class to interface with MLFB Coder View
    
    %   Copyright 2013-2019 The MathWorks, Inc.
    
    methods(Static)
        function updateGlobalEnabledState(enabled)
            coder.internal.mlfb.gui.CodeViewUpdater.updateGlobalEnabledState(enabled);
        end
        function runRenamed(oldRunName, newRunName)
            coder.internal.mlfb.gui.CodeViewUpdater.runRenamed(oldRunName, newRunName);
        end
        function proposedTypeAnnotated(result)
            coder.internal.mlfb.gui.CodeViewUpdater.proposedTypeAnnotated(result);
        end
        function runsDeleted(varargin)
            coder.internal.mlfb.gui.CodeViewUpdater.runsDeleted(varargin);
        end
        function typesApplied(applySuccess)
            coder.internal.mlfb.gui.CodeViewUpdater.typesApplied(applySuccess);
        end
        function typesProposed(SUDObject)
            coder.internal.mlfb.gui.CodeViewUpdater.typesProposed(SUDObject);
        end
        function overrideConvertedMATLABFunctionBlocks(modelName, blkData)
            coder.internal.MLFcnBlock.FPTSupport.overrideConvertedMATLABFunctionBlocks(modelName,blkData);
        end
        function overrideConvertedMATLABFunctionBlocksUsingFixedPoint(modelName)
            override = coder.internal.MLFcnBlock.VariantOverrideEnum.OverrideUsingFixedPoint;
            coder.internal.MLFcnBlock.FPTSupport.overrideConvertedMATLABFunctionBlocks(modelName,override);
        end
        function markSimCompleted
            coder.internal.mlfb.gui.CodeViewUpdater.markSimCompleted();
        end
        
        function restoreModelSettings
            % Restore the model settings. DTO settings were changed for the
            % proposal workflow in MLFB.
            if coder.internal.mlfb.gui.fxptToolIsCodeViewEnabled
                fpt = fxptui.FixedPointTool.getExistingInstance;
                fpt.restoreSystemSettings;
            end
        end
    end
    
end

