Ejemplo n.º 1
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                FunctionEvaluationScript s = null != o ? (FunctionEvaluationScript)o : new FunctionEvaluationScript();

                // deserialize the base class
                info.GetBaseValueEmbedded(s, typeof(AbstractScript), parent);

                return(s);
            }
Ejemplo n.º 2
0
    public override void Run(Altaxo.Graph.GUI.GraphController ctrl)
    {
      FunctionEvaluationScript script = null; // 

      if(script==null)
        script = new FunctionEvaluationScript();

      object[] args = new object[]{script,new ScriptExecutionHandler(this.EhScriptExecution)};
      if(Current.Gui.ShowDialog(args, "Function script"))
      {
        ctrl.EnsureValidityOfCurrentLayerNumber();

        script = (FunctionEvaluationScript)args[0];
        XYFunctionPlotItem functItem = new XYFunctionPlotItem(new XYFunctionPlotData(script),new G2DPlotStyleCollection(LineScatterPlotStyleKind.Line));
        ctrl.Doc.Layers[ctrl.CurrentLayerNumber].PlotItems.Add(functItem);
      }
    }
 /// <summary>
 /// Creates a column script as a copy from another script.
 /// </summary>
 /// <param name="b">The script to copy from.</param>
 /// <param name="forModification">If true, the new script text can be modified.</param>
 public FunctionEvaluationScript(FunctionEvaluationScript b, bool forModification)
   : base(b,forModification)
 {
 }
 /// <summary>
 /// Creates a column script as a copy from another script.
 /// </summary>
 /// <param name="b">The script to copy from.</param>
 public FunctionEvaluationScript(FunctionEvaluationScript b)
   : base(b,false)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Creates a column script as a copy from another script.
 /// </summary>
 /// <param name="b">The script to copy from.</param>
 /// <param name="forModification">If true, the new script text can be modified.</param>
 public FunctionEvaluationScript(FunctionEvaluationScript b, bool forModification)
     : base(b, forModification)
 {
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Creates a column script as a copy from another script.
 /// </summary>
 /// <param name="b">The script to copy from.</param>
 public FunctionEvaluationScript(FunctionEvaluationScript b)
     : base(b, false)
 {
 }
Ejemplo n.º 7
0
		public override void Run(GraphController ctrl)
		{
			HostLayer activeLayer;
			ctrl.Doc.RootLayer.IsValidIndex(ctrl.CurrentLayerNumber, out activeLayer);

			if (!(activeLayer is XYPlotLayer))
				return;

			FunctionEvaluationScript script = null; //

			if (script == null)
				script = new FunctionEvaluationScript();

			object[] args = new object[] { script, new ScriptExecutionHandler(this.EhScriptExecution) };
			if (Current.Gui.ShowDialog(args, "Function script"))
			{
				ctrl.EnsureValidityOfCurrentLayerNumber();

				script = (FunctionEvaluationScript)args[0];
				XYFunctionPlotItem functItem = new XYFunctionPlotItem(new XYFunctionPlotData(script), new G2DPlotStyleCollection(LineScatterPlotStyleKind.Line, activeLayer.GetPropertyContext()));
				((XYPlotLayer)activeLayer).PlotItems.Add(functItem);
			}
		}