Commit 5b597ee8 authored by Colin Eles's avatar Colin Eles
Browse files

latest version

git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/trunk/TableTool@5830 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
parent 62ecf443
Loading
Loading
Loading
Loading
+206 −197
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@ classdef GUI < handle
        Data = [];
        PVS = [];
        
        mode = [];
        
    end
    
    methods
@@ -56,8 +58,9 @@ classdef GUI < handle
        %   h:double - handle to Tabular block in model
        % outputs;
        %   obj:GUI - object that is created
        function obj = GUI(h)
        function obj = GUI(h,mode)
            obj.block_handle = h;
            obj.mode = mode;
        end
        
        function [] = setData(obj,Data)
@@ -79,7 +82,11 @@ classdef GUI < handle
        function [] = init(obj)
            
            % create the handles for the gui objects
            
            if obj.mode == 1
                name = get_param(obj.block_handle,'Name');
            elseif obj.mode == 0
                name = 'Table Tool';
            end
            % main figure
            obj.fig = figure('units','pixels',...
                'position',[0 0 obj.fig_width obj.fig_height],...
@@ -87,7 +94,7 @@ classdef GUI < handle
                'name','Table Tool',...
                'numbertitle','off',...
                'resize','on',...
                'Name',get_param(obj.block_handle,'Name'),...
                'Name',name,...
                'CloseRequestFcn',@(src,event)close_fig(obj,src,event),...
                'ResizeFcn',@(src,event)resize_fig(obj,src,event));
          
@@ -198,7 +205,6 @@ classdef GUI < handle
            end

            
            
            obj.set_command_pos;
            obj.reset_wh();
            obj.draw_allgrids(1);
@@ -357,6 +363,8 @@ classdef GUI < handle
        % outputs;
        %   none
        function [] = save_call(object,src,event)
            if object.mode == 1
                
                load_system('simulink')
                % generate the code
                code = [];
@@ -573,6 +581,7 @@ classdef GUI < handle
                object.function_name_text = get(object.function_name_control,'String');
                object.function_inputs_text = get(object.function_inputs_control,'String');
            end
        end
        
        %% delete_recursive
        % delete any lines that are unconnected and one end or both
+36 −22
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ orig_gcbh = gcbh;


Action = varargin{1};
Mode = varargin{2};

if 1 ~= nargin
    DAStudio.warning('improper function use')
@@ -12,7 +13,12 @@ end
switch Action,
    case 'Open',
        blockHandleTTTopMask = orig_gcbh;
        LocalOpenBlockFcn(blockHandleTTTopMask);
        switch Mode,
            case 'Simulink'
                 LocalOpenBlockFcn(blockHandleTTTopMask,1);
            case 'Matlab'
                 LocalOpenBlockFcn([],0);
        end
        
    case 'Close',
        blockHandleTTTopMask = orig_gcbh;
@@ -39,8 +45,9 @@ function LocalCopyBlockFcn(blockHandleTTTopMask)
    end
end

function LocalOpenBlockFcn(blockHandleTTTopMask)

function LocalOpenBlockFcn(blockHandleTTTopMask,mode)
    data = []
    if (mode == 1)
            modelHandle = bdroot(blockHandleTTTopMask);


@@ -57,6 +64,7 @@ function LocalOpenBlockFcn(blockHandleTTTopMask)


        data = get_param(blockHandleTTTopMask,'UserData');
    end
    
    if isempty(data)
        data = Data();
@@ -78,24 +86,30 @@ function LocalOpenBlockFcn(blockHandleTTTopMask)
        end
        
    end
    
    gui = GUI(blockHandleTTTopMask);   
    if mode == 1
        gui = GUI(blockHandleTTTopMask,1);   
    elseif mode == 0
        gui = GUI([],0);
    end

    gui.setData(data)
    gui.init();
        
        if(mode == 1)
            set_param(blockHandleTTTopMask,'UserData',data); 
            set_param(blockHandleTTTopMask, 'UserDataPersistent', 'on');

        end
    
end

function LocalCloseRequestBlockFcn(blockHandleTTTopMask)

    modelHandle = bdroot(blockHandleTTTopMask);


    data = get_param(blockHandleTTTopMask,'UserData')



if ~isempty(data)
    if data.open
        delete(data.fig)
+65 −21
Original line number Diff line number Diff line
Library {
  Name			  "TableLibrary"
  Version		  7.2
  Version		  7.5
  MdlSubVersion		  0
  SavedCharacterEncoding  "UTF-8"
  LibraryType		  "BlockLibrary"
@@ -8,15 +8,16 @@ Library {
  ScopeRefreshTime	  0.035000
  OverrideScopeRefreshTime on
  DisableAllScopes	  off
  MaxMDLFileLineLength	  120
  Created		  "Thu Apr  8 11:30:49 2010"
  Creator		  "elesc"
  UpdateHistory		  "UpdateHistoryNever"
  ModifiedByFormat	  "%<Auto>"
  LastModifiedBy	  "elesc"
  LastModifiedBy	  "colin"
  ModifiedDateFormat	  "%<Auto>"
  LastModifiedDate	  "Tue Jun 15 13:31:59 2010"
  RTWModifiedTimeStamp	  198509517
  ModelVersionFormat	  "1.%<AutoIncrement:4>"
  LastModifiedDate	  "Mon Jul  5 16:29:11 2010"
  RTWModifiedTimeStamp	  200248140
  ModelVersionFormat	  "1.%<AutoIncrement:5>"
  ConfigurationManager	  "None"
  SampleTimeColors	  off
  SampleTimeAnnotations	  off
@@ -44,15 +45,18 @@ Library {
  LinearizationMsg	  "none"
  Profile		  off
  ParamWorkspaceSource	  "MATLABWorkspace"
  RecordCoverage	  off
  CovSaveName		  "covdata"
  CovMetricSettings	  "dw"
  CovNameIncrementing	  off
  CovHtmlReporting	  on
  CovForceBlockReductionOff on
  covSaveCumulativeToWorkspaceVar on
  CovSaveSingleToWorkspaceVar on
  CovCumulativeReport	  off
  CovReportOnPause	  on
  CovModelRefEnable	  "Off"
  CovExternalEMLEnable	  off
  ExtModeBatchMode	  off
  ExtModeEnableFloating	  on
  ExtModeTrigType	  "manual"
@@ -81,13 +85,13 @@ Library {
    Dimension		    1
    Simulink.ConfigSet {
      $ObjectID		      1
      Version		      "1.5.1"
      Version		      "1.10.0"
      Array {
	Type			"Handle"
	Dimension		8
	Simulink.SolverCC {
	  $ObjectID		  2
	  Version		  "1.5.1"
	  Version		  "1.10.0"
	  StartTime		  "0.0"
	  StopTime		  "10.0"
	  AbsTol		  "auto"
@@ -107,6 +111,7 @@ Library {
	  SolverMode		  "Auto"
	  Solver		  "ode45"
	  SolverName		  "ode45"
	  SolverJacobianMethodControl "auto"
	  ShapePreserveControl	  "DisableAll"
	  ZeroCrossControl	  "UseLocalSettings"
	  ZeroCrossAlgorithm	  "Nonadaptive"
@@ -116,11 +121,10 @@ Library {
	  AutoInsertRateTranBlk	  off
	  SampleTimeConstraint	  "Unconstrained"
	  InsertRTBMode		  "Whenever possible"
	  SignalSizeVariationType "Allow only fixed size"
	}
	Simulink.DataIOCC {
	  $ObjectID		  3
	  Version		  "1.5.1"
	  Version		  "1.10.0"
	  Decimation		  "1"
	  ExternalInput		  "[t, u]"
	  FinalStateName	  "xFinal"
@@ -130,23 +134,28 @@ Library {
	  LoadExternalInput	  off
	  LoadInitialState	  off
	  SaveFinalState	  off
	  SaveCompleteFinalSimState off
	  SaveFormat		  "Array"
	  SaveOutput		  on
	  SaveState		  off
	  SignalLogging		  on
	  DSMLogging		  on
	  InspectSignalLogs	  off
	  SaveTime		  on
	  ReturnWorkspaceOutputs  off
	  StateSaveName		  "xout"
	  TimeSaveName		  "tout"
	  OutputSaveName	  "yout"
	  SignalLoggingName	  "logsout"
	  DSMLoggingName	  "dsmout"
	  OutputOption		  "RefineOutputTimes"
	  OutputTimes		  "[]"
	  ReturnWorkspaceOutputsName "out"
	  Refine		  "1"
	}
	Simulink.OptimizationCC {
	  $ObjectID		  4
	  Version		  "1.5.1"
	  Version		  "1.10.0"
	  Array {
	    Type		    "Cell"
	    Dimension		    7
@@ -163,14 +172,19 @@ Library {
	  BooleanDataType	  on
	  ConditionallyExecuteInputs on
	  InlineParams		  off
	  UseIntDivNetSlope	  off
	  InlineInvariantSignals  off
	  OptimizeBlockIOStorage  on
	  BufferReuse		  on
	  EnhancedBackFolding	  off
	  StrengthReduction	  off
	  EnforceIntegerDowncast  on
	  ExpressionFolding	  on
	  BooleansAsBitfields	  off
	  BitfieldContainerType	  "uint_T"
	  EnableMemcpy		  on
	  MemcpyThreshold	  64
	  PassReuseOutputArgsAs	  "Structure reference"
	  ExpressionDepthLimit	  2147483647
	  FoldNonRolledExpr	  on
	  LocalBlockOutputs	  on
@@ -187,13 +201,14 @@ Library {
	  EfficientMapNaN2IntZero on
	  OptimizeModelRefInitCode off
	  LifeSpan		  "inf"
	  MaxStackSize		  "Inherit from target"
	  BufferReusableBoundary  on
	  SimCompilerOptimization "Off"
	  AccelVerboseBuild	  off
	}
	Simulink.DebuggingCC {
	  $ObjectID		  5
	  Version		  "1.5.1"
	  Version		  "1.10.0"
	  RTPrefix		  "error"
	  ConsistencyChecking	  "none"
	  ArrayBoundsChecking	  "none"
@@ -233,6 +248,9 @@ Library {
	  ParameterUnderflowMsg	  "none"
	  ParameterPrecisionLossMsg "warning"
	  ParameterTunabilityLossMsg "warning"
	  FixptConstUnderflowMsg  "none"
	  FixptConstOverflowMsg	  "none"
	  FixptConstPrecisionLossMsg "none"
	  UnderSpecifiedDataTypeMsg "none"
	  UnnecessaryDatatypeConvMsg "none"
	  VectorMatrixConversionMsg "none"
@@ -257,13 +275,16 @@ Library {
	  ModelReferenceSymbolNameMessage "warning"
	  ModelReferenceExtraNoncontSigs "error"
	  StateNameClashWarn	  "warning"
	  SimStateInterfaceChecksumMismatchMsg "warning"
	  StrictBusMsg		  "Warning"
	  BusNameAdapt		  "WarnAndRepair"
	  NonBusSignalsTreatedAsBus "none"
	  LoggingUnavailableSignals "error"
	  BlockIODiagnostic	  "none"
	}
	Simulink.HardwareCC {
	  $ObjectID		  6
	  Version		  "1.5.1"
	  Version		  "1.10.0"
	  ProdBitPerChar	  8
	  ProdBitPerShort	  16
	  ProdBitPerInt		  32
@@ -290,26 +311,35 @@ Library {
	}
	Simulink.ModelReferenceCC {
	  $ObjectID		  7
	  Version		  "1.5.1"
	  Version		  "1.10.0"
	  UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
	  CheckModelReferenceTargetMessage "error"
	  EnableParallelModelReferenceBuilds off
	  ParallelModelReferenceMATLABWorkerInit "None"
	  ModelReferenceNumInstancesAllowed "Multi"
	  PropagateVarSize	  "Infer from blocks in model"
	  ModelReferencePassRootInputsByReference on
	  ModelReferenceMinAlgLoopOccurrences off
	  PropagateSignalLabelsOutOfModel off
	  SupportModelReferenceSimTargetCustomCode off
	}
	Simulink.SFSimCC {
	  $ObjectID		  8
	  Version		  "1.5.1"
	  Version		  "1.10.0"
	  SFSimEnableDebug	  on
	  SFSimOverflowDetection  on
	  SFSimEcho		  on
	  SimBlas		  on
	  SimCtrlC		  on
	  SimExtrinsic		  on
	  SimIntegrity		  on
	  SimUseLocalCustomCode	  off
	  SimBuildMode		  "sf_incremental_build"
	}
	Simulink.RTWCC {
	  $BackupClass		  "Simulink.RTWCC"
	  $ObjectID		  9
	  Version		  "1.5.1"
	  Version		  "1.10.0"
	  Array {
	    Type		    "Cell"
	    Dimension		    6
@@ -351,12 +381,14 @@ Library {
	  GenerateTraceReportEml  off
	  GenerateCodeInfo	  off
	  RTWCompilerOptimization "Off"
	  CheckMdlBeforeBuild	  "Off"
	  CustomRebuildMode	  "OnUpdate"
	  Array {
	    Type		    "Handle"
	    Dimension		    2
	    Simulink.CodeAppCC {
	      $ObjectID		      10
	      Version		      "1.5.1"
	      Version		      "1.10.0"
	      Array {
		Type			"Cell"
		Dimension		19
@@ -399,6 +431,7 @@ Library {
	      CustomSymbolStrType     "$N$R$M"
	      CustomSymbolStrField    "$N$M"
	      CustomSymbolStrFcn      "$R$N$M$F"
	      CustomSymbolStrFcnArg   "rt$I$N$M"
	      CustomSymbolStrBlkIO    "rtb_$N$M"
	      CustomSymbolStrTmpVar   "$N$M"
	      CustomSymbolStrMacro    "$R$N$M"
@@ -415,7 +448,7 @@ Library {
	    Simulink.GRTTargetCC {
	      $BackupClass	      "Simulink.TargetCC"
	      $ObjectID		      11
	      Version		      "1.5.1"
	      Version		      "1.10.0"
	      Array {
		Type			"Cell"
		Dimension		17
@@ -444,6 +477,7 @@ Library {
	      TargetFunctionLibrary   "ANSI_C"
	      UtilityFuncGeneration   "Auto"
	      ERTMultiwordTypeDef     "System defined"
	      ERTCodeCoverageTool     "None"
	      ERTMultiwordLength      256
	      MultiwordLength	      2048
	      GenerateFullHeader      on
@@ -451,8 +485,10 @@ Library {
	      GenerateTestInterfaces  off
	      IsPILTarget	      off
	      ModelReferenceCompliant on
	      ParMdlRefBuildCompliant on
	      CompOptLevelCompliant   on
	      IncludeMdlTerminateFcn  on
	      GeneratePreprocessorConditionals "Disable all"
	      CombineOutputUpdateFcns off
	      SuppressErrorStatus     off
	      ERTFirstTimeCompliant   off
@@ -467,6 +503,7 @@ Library {
	      PurelyIntegerCode	      off
	      SupportContinuousTime   on
	      SupportNonInlinedSFcns  on
	      SupportVariableSizeSignals off
	      EnableShiftOperators    on
	      ParenthesesLevel	      "Nominal"
	      PortableWordSizes	      off
@@ -498,7 +535,6 @@ Library {
    PropName		    "ConfigurationSets"
  }
  BlockDefaults {
    Orientation		    "right"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
@@ -508,6 +544,8 @@ Library {
    FontWeight		    "normal"
    FontAngle		    "normal"
    ShowName		    on
    BlockRotation	    0
    BlockMirror		    off
  }
  AnnotationDefaults {
    HorizontalAlignment	    "center"
@@ -535,6 +573,7 @@ Library {
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      VarSizeSig	      "Inherit"
      SampleTime	      "-1"
      OutMin		      "[]"
      OutMax		      "[]"
@@ -546,7 +585,7 @@ Library {
      SignalType	      "auto"
      SamplingMode	      "auto"
      LatchByDelayingOutsideSignal off
      LatchByCopyingInsideSignal off
      LatchInputForFeedbackSignals off
      Interpolate	      on
    }
    Block {
@@ -556,6 +595,7 @@ Library {
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      VarSizeSig	      "Inherit"
      SampleTime	      "-1"
      OutMin		      "[]"
      OutMax		      "[]"
@@ -592,7 +632,7 @@ Library {
  }
  System {
    Name		    "TableLibrary"
    Location		    [210, 199, 790, 459]
    Location		    [210, 221, 790, 481]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
@@ -606,13 +646,15 @@ Library {
    ShowPageBoundaries	    off
    ZoomFactor		    "100"
    ReportName		    "simulink-default.rpt"
    SIDHighWatermark	    3
    Block {
      BlockType		      SubSystem
      Name		      "Tabular Expression"
      SID		      1
      Ports		      [1, 1]
      Position		      [75, 74, 170, 116]
      CopyFcn		      "TTdiag Copy"
      OpenFcn		      "TTdiag Open"
      OpenFcn		      "TTdiag Open Simulink"
      MinAlgLoopOccurrences   off
      PropExecContextOutsideSubsystem off
      RTWSystemCode	      "Auto"
@@ -638,6 +680,7 @@ Library {
	Block {
	  BlockType		  Inport
	  Name			  "In1"
	  SID			  2
	  Position		  [110, 103, 140, 117]
	  IconDisplay		  "Port number"
	  OutDataType		  "fixdt(1, 16)"
@@ -646,6 +689,7 @@ Library {
	Block {
	  BlockType		  Outport
	  Name			  "Out1"
	  SID			  3
	  Position		  [360, 103, 390, 117]
	  IconDisplay		  "Port number"
	  OutDataType		  "fixdt(1, 16)"