xxsimRemoveCurveFromPlot

PURPOSE ^

xxsimRemoveCurveFromPlot - Remove a curve from a plot

SYNOPSIS ^

function retval = xxsimRemoveCurveFromPlot(window,plot,curve)

DESCRIPTION ^

 xxsimRemoveCurveFromPlot - Remove a curve from a plot

 Syntax: 
   retval = xxsimRemoveCurveFromPlot(window,plot,curve)

 Inputs:
   window     =  ID or name from the plot window where the curve is removed from.
   plot       =  ID or name from the plot where the curve is removed from.
   curve      =  ID or yPath of the curve that will be removed.

 Outputs: 
   retval = returns true on removing the curve from the plot without errors, false otherwise.
 
 Example:
   retval = xxsimRemoveCurveFromPlot(1,2,3)
   
     - Remove curve 3 from plot 2 in window 1.
     - 3 could have been the y-path name of the curve to be removed.
     - 2 could have been the name of the plot of which data will be removed.
     - 1 could have been the name of the window of which data will be removed.
     - retval now contains true if the curve was removed without errors, false otherwise.
     - Note: The simulator should be open before calling this function.  

 See also: xxsimAddCurveToPlot, xxsimOpenSimulator, xxsimAddPlotToWindow, xxsimGetCurvesFromPlot

 Author: Controllab Products B.V.
 email: info@controllab.nl
 Website: http://www.controllab.nl
 November 2015

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function retval = xxsimRemoveCurveFromPlot(window,plot,curve)
0002 % xxsimRemoveCurveFromPlot - Remove a curve from a plot
0003 %
0004 % Syntax:
0005 %   retval = xxsimRemoveCurveFromPlot(window,plot,curve)
0006 %
0007 % Inputs:
0008 %   window     =  ID or name from the plot window where the curve is removed from.
0009 %   plot       =  ID or name from the plot where the curve is removed from.
0010 %   curve      =  ID or yPath of the curve that will be removed.
0011 %
0012 % Outputs:
0013 %   retval = returns true on removing the curve from the plot without errors, false otherwise.
0014 %
0015 % Example:
0016 %   retval = xxsimRemoveCurveFromPlot(1,2,3)
0017 %
0018 %     - Remove curve 3 from plot 2 in window 1.
0019 %     - 3 could have been the y-path name of the curve to be removed.
0020 %     - 2 could have been the name of the plot of which data will be removed.
0021 %     - 1 could have been the name of the window of which data will be removed.
0022 %     - retval now contains true if the curve was removed without errors, false otherwise.
0023 %     - Note: The simulator should be open before calling this function.
0024 %
0025 % See also: xxsimAddCurveToPlot, xxsimOpenSimulator, xxsimAddPlotToWindow, xxsimGetCurvesFromPlot
0026 %
0027 % Author: Controllab Products B.V.
0028 % email: info@controllab.nl
0029 % Website: http://www.controllab.nl
0030 % November 2015
0031 
0032 %------------- BEGIN CODE --------------
0033 
0034   % Check the obtained amount of input arguments.
0035   if(nargin>3)
0036     error('Too many input arguments were specified.');
0037   elseif(nargin<3)
0038     error('Too little input arguments were specified.');
0039   end;
0040 
0041   % Check if the window_ID is a number, and the plot_name a string
0042   if(~isnumeric(window) && ~ischar(window))
0043     error('Please specify a number as ID or a name as string for the window');
0044   elseif(~isnumeric(plot) && ~ischar(plot))
0045     error('Please specify a number as ID or a name as string for the plot');
0046   elseif(~isnumeric(curve) && ~ischar(curve))
0047     error('Please specify a number as ID or a name for the variable');
0048   end;
0049   
0050   windowID = xxsimGetPlotWindowIDFromName(window);
0051   plotID = xxsimGetPlotIDFromName(windowID,plot);
0052   curveID = xxsimGetCurveIDFromName(windowID,plotID,curve);
0053   if(curveID == -1)
0054     warning('The curve does not exist in the given plot, nothing will be deleted.');
0055   else
0056     % And make the actual call to 20-sim
0057     retval = xrlinvoke('xxsim.plot.removeCurveFromPlot', struct('windowID',int32(windowID),'plotID',int32(plotID),'curveID',int32(curveID)));
0058   end;
0059     
0060 end
0061 %------------- END OF CODE --------------

Generated on Sun 10-Dec-2017 19:24:51