Beispiel #1
0
        public void L02TestLiteral_Connectivity()
        {
            //Create two literal nodes & Connect them
            string commands = @"
                ClearSelection
                CreateCodeBlockNode|d:335.0|d:169.0|s:100
                CreateIdentifierNode|d:534.0|d:184.0
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None";

            GraphController controller = new GraphController(null, null);
            bool result = controller.RunCommands(commands);
            Assert.AreEqual(true, result);
            Assert.AreEqual(2, controller.GetVisualNodes().Count);//output slot

            IVisualNode node = controller.GetVisualNode(0x10000001);
            IVisualNode node2 = controller.GetVisualNode(0x10000002);

            Assert.NotNull(new object[] { node, node2 });// check if node create
            Assert.AreEqual(NodeType.Literal, node.VisualType);// check if literal node

            Assert.AreEqual(null, node.GetInputSlots());//output slot
            Assert.AreEqual(3, controller.GetSlots().Count);//output slot
            // get slots

            uint outputSlotId = node.GetOutputSlot(0);
            ISlot outputSlot = controller.GetSlot(outputSlotId);

            uint connectingSlotId = node2.GetInputSlot(0);
            ISlot connectingSlot = controller.GetSlot(connectingSlotId);

            uint[] connecting = connectingSlot.ConnectingSlots;
            Assert.AreEqual(connectingSlotId, outputSlot.ConnectingSlots[0]);
        }
    public SingleLineDrawingMouseHandler(GraphController grac)
    {
      this._grac = grac;

      if(_grac.View!=null)
        _grac.View.SetPanelCursor(Cursors.Arrow);
    }
    public ReadXYCoordinatesMouseHandler(GraphController grac)
    {
      _grac = grac;

      if(_grac.View!=null)
        _grac.View.SetPanelCursor(Cursors.Cross);
    }
Beispiel #4
0
        public void L01TestLiteral()
        {
            // Create two literal nodes

            string commands = @"
                ClearSelection
                CreateCodeBlockNode|d:315.0|d:179.0|s:100
                ClearSelection
                CreateCodeBlockNode|d:329.0|d:280.0|s:100";

            GraphController controller = new GraphController(null, null);
            bool result = controller.RunCommands(commands);
            Assert.AreEqual(true, result);
            Assert.AreEqual(2, controller.GetVisualNodes().Count);//output slot

            //check each Node
            IVisualNode node = controller.GetVisualNode(0x10000001);
            IVisualNode node2 = controller.GetVisualNode(0x10000002);
            Assert.NotNull(new object []{node,node2});// check if node create
            Assert.AreEqual(NodeType.Literal,node.VisualType);// check if literal node
            Assert.AreEqual(NodeType.Literal, node2.VisualType);// check if literal node
            Assert.AreEqual(2, controller.GetSlots().Count);//output slot
            Assert.AreEqual(null, node.GetInputSlots());//output slot
            Assert.AreEqual(null, node2.GetInputSlots());//output slot
        }
Beispiel #5
0
 public void DrawWithoutColorOverriding(GraphController<int, int> g, int sel1, int sel2, int formatter, Graphics gdi, Control[] ctrls, Panel p, int edgesize, int xcenter, int ycenter, int xk, int yk, Image normal, Image iterator, Image selected)
 {
     InitializeCore(g, formatter, p, ctrls, edgesize, xcenter, ycenter, xk, yk);
     //RenderVertices(g, 0, sel1, sel2, edgesize, ctrls, normal, iterator, selected);
     RenderLinks(g, gdi, ctrls);
     if (UpdateState != null) UpdateState(g);
 }
    public ZoomAxesMouseHandler(GraphController grac)
      : base(grac)
    {
      NextMouseHandlerType = this.GetType();

      if(_grac.View!=null)
        _grac.View.SetPanelCursor(Cursors.Arrow);
    }
 /// <summary>
 /// The constructor used to initiate the Victor Turner
 /// </summary>
 /// <param name="players">The players in the game</param>
 /// <param name="world">The world the game takes place in</param>
 public VictorTurner(GameInitializer gameInitializer)
 {
     this.gameInitializer = gameInitializer;
     this.players = gameInitializer.theWorld.players;
     this.world = gameInitializer.theWorld;
     this.humanControl = new WorldController(players[0],world);
     this.graphControl = GraphController.Instance;
 }
    public AbstractRectangularToolMouseHandler(GraphController grac)
     
    {
      _grac = grac;

      if(_grac.View!=null)
        _grac.View.SetPanelCursor(Cursors.Arrow);
    }
Beispiel #9
0
		public override void Run(GraphController ctrl)
		{
			ctrl.EnsureValidityOfCurrentLayerNumber();
			var currentLayerNumber = ctrl.CurrentLayerNumber;
			if (currentLayerNumber.Count != 0)
			{
				ctrl.Doc.PasteFromClipboardAsNewLayerBeforeLayerNumber(ctrl.CurrentLayerNumber);
			}
			else
			{
				Current.Gui.ErrorMessageBox("'Can't paste before the root layer. Please select another layer.", "Operation not possible");
			}
		}
Beispiel #10
0
        public void L00TestLiteral_SingleNode()
        {
            // Create Single literal node

            string commands = @"
                ClearSelection
                CreateCodeBlockNode|d:386.0|d:270.0|s:100";

            GraphController controller = new GraphController(null, null);
            bool result = controller.RunCommands(commands);
            Assert.AreEqual(true, result);

            IVisualNode node = controller.GetVisualNode(0x10000001);
            Assert.NotNull(node);// check if node create
            Assert.AreEqual(NodeType.Literal, node.VisualType);// check if literal node
            Assert.AreEqual(1, controller.GetSlots().Count);//output slot
        }
        public void TestHandleSaveGraphAndLoadGraph()
        {
            try
            {
                GraphController graphController1 = new GraphController(null);
                IVisualNode     node1            = new CodeBlockNode(graphController1, "Double Click and Type");
                IVisualNode     node2            = new DriverNode(graphController1, Configurations.DriverInitialTextValue);
                IVisualNode     node3            = new FunctionNode(graphController1, "", "-", "double,double");
                IVisualNode     node4            = new IdentifierNode(graphController1, "c");

                string filePath = Path.GetTempPath() + "test.bin";
                graphController1.DoSaveGraph(filePath);
                GraphController graphController2 = new GraphController(null, filePath);

                Assert.AreEqual(4, graphController2.GetVisualNodes().Count);
            }
            finally
            {
                File.Delete(Path.GetTempPath() + "test.bin");
            }
        }
Beispiel #12
0
        public void TestOwners()
        {
            IGraphController controller = new GraphController(null);

            controller.DoCreateFunctionNode(1, 1, "", "Function", "int,int");

            List <IVisualNode> nodes = ((GraphController)controller).GetVisualNodes();
            VisualNode         node  = (VisualNode)nodes[0];
            uint  slotId             = node.GetInputSlot(0);
            ISlot slot   = ((GraphController)controller).GetSlot(slotId);
            bool  result = false;

            uint[] owners = slot.Owners;

            if (owners.Count() != 0)
            {
                result = true;
            }

            Assert.AreEqual(true, result);
        }
Beispiel #13
0
        public virtual void OnControllerStartTouchInteractableObject(ObjectInteractEventArgs e)
        {
            if (GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>().Mode == 1)
            {
                //  1) Select Node
            }

            if (GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>().Mode == 2)
            {
                //  2) Highlight Node

                touchedObject.GetComponent <ColorSpheres>().Pressed();
            }

            if (GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>().Mode == 3)
            {
                //  3) Start Node
            }

            if (GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>().Mode == 4)
            {
                //  4) End Node
            }

            if (GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>().Mode == 5)
            {
                //need to call the hide function
                touchedObject.GetComponent <Renderer>().sharedMaterial = touchedObject.GetComponent <ColorSpheres>().hidden;
                touchedObject.GetComponent <ColorSpheres>().hide       = true;
                //Need to update graph to hide the nodes
                GraphController Script = GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>();
                Script.UpdateGraph();
                touchedObject.SetActive(false);
            }

            if (ControllerStartTouchInteractableObject != null)
            {
                ControllerStartTouchInteractableObject(this, e);
            }
        }
Beispiel #14
0
        public override void Run(GraphController ctrl)
        {
            var miniProjectBuilder = new Altaxo.Graph.Procedures.MiniProjectBuilder();
            var newDocument        = miniProjectBuilder.GetMiniProject(ctrl.Doc, false);

            var items = new HashSet <IProjectItem>();

            foreach (var coll in newDocument.ProjectItemCollections)
            {
                foreach (var item in coll.ProjectItems)
                {
                    items.Add(item);
                }
            }

            Altaxo.Serialization.Clipboard.ClipboardSerialization.PutObjectToClipboard(
                new string[] {
                Main.Commands.ProjectItemCommands.ClipboardFormat_ListOfProjectItems,
                ClipboardFormat_MiniProjectItems
            },
                new Main.Commands.ProjectItemCommands.ProjectItemClipboardList(items, baseFolder: string.Empty));
        }
        private void LoadGraphItem_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog
            {
                DefaultExt = ".txt",
            };
            bool?result = dlg.ShowDialog();

            if (result == true)
            {
                string             fileName = dlg.FileName;
                List <List <int> > adjList  = GraphController.LoadGraph(fileName);

                ChooseViewer viewer = new ChooseViewer();
                int          index  = viewer.ReturnViewerIndex();
                CommonOperations2(index, adjList);
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("Nie można otworzyć pliku, nieznany błąd", "Błąd", System.Windows.Forms.MessageBoxButtons.OK);
            }
        }
        public void TestDeleteNodeCrash()
        {
            // 1. Create operator node "+".
            // 2. Create operator node "+".
            // 3. Connect output of second "+" node to the input of first "+"
            // 4. Select the second "+" node.
            // 5. Hit DELETE key, crashes.
            //
            string commands = @"
                CreateFunctionNode|d:1086.0|d:357.0|s:|s:+|s:double,double
                CreateFunctionNode|d:529.0|d:292.0|s:|s:+|s:double,double
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
                ClearSelection
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None
                DeleteComponents";

            GraphController controller = new GraphController(null);
            bool            result     = controller.RunCommands(commands);

            Assert.AreEqual(true, result);
        }
Beispiel #17
0
        public void TestSerializeDeserialize()
        {
            IGraphController graphController = new GraphController(null);
            IStorage         storage         = new BinaryStorage();

            IVisualNode node1 = new RenderNode(graphController, 1);
            IVisualNode node2 = new RenderNode(graphController, 1);

            node1.Serialize(storage);
            storage.Seek(0, SeekOrigin.Begin);
            node2.Deserialize(storage);

            Assert.AreEqual(NodeType.Render, node2.VisualType);
            Assert.AreEqual(node1.NodeId, node2.NodeId);
            Assert.AreEqual(true, ((RenderNode)node2).Dirty);
            Assert.AreEqual(((RenderNode)node1).Text, ((RenderNode)node2).Text);
            Assert.AreEqual(((RenderNode)node1).Caption, ((RenderNode)node2).Caption);
            Assert.AreEqual(node1.X, node2.X);
            Assert.AreEqual(node1.Y, node2.Y);
            //Assert.AreEqual(1, node2.GetInputSlots().Length);
            //Assert.AreEqual(0, node2.GetOutputSlots().Length);
        }
Beispiel #18
0
        public override void Run(GraphController ctrl)
        {
            System.IO.Stream myStream;
            var saveFileDialog1 = new Microsoft.Win32.SaveFileDialog
            {
                Filter           = "Altaxo graph files (*.axogrp)|*.axogrp|All files (*.*)|*.*",
                FilterIndex      = 1,
                RestoreDirectory = true
            };

            if (true == saveFileDialog1.ShowDialog((System.Windows.Window)Current.Workbench.ViewObject))
            {
                if ((myStream = saveFileDialog1.OpenFile()) != null)
                {
                    var info = new Altaxo.Serialization.Xml.XmlStreamSerializationInfo();
                    info.BeginWriting(myStream);
                    info.AddValue("Graph", ctrl.Doc);
                    info.EndWriting();
                    myStream.Close();
                }
            }
        }
Beispiel #19
0
    void Start()
    {
        graphController = GetComponent <GraphController>();
        Nodehandler     = GetComponent <NodeSettingsHandler>();

        persistentData = GameObject.Find("PersistentData").GetComponent <PersistantData>();
        if (persistentData.HasDatafile)
        {
            GameObject.Find("DataFileText").GetComponent <Text>().text        = persistentData.DatasetFilename;
            GameObject.Find("AttributeCountText").GetComponent <Text>().text  = persistentData.DatasetNames.Count.ToString();
            GameObject.Find("DataRecordCountText").GetComponent <Text>().text = persistentData.RecordValues.Count.ToString();
        }
        if (persistentData.HasAssociations)
        {
            GameObject.Find("AssociationFileText").GetComponent <Text>().text           = persistentData.AssociationsFilename;
            GameObject.Find("AssociationAttributeCountText").GetComponent <Text>().text = persistentData.AssociationNames.Count.ToString();
            GameObject.Find("AssociationsCountText").GetComponent <Text>().text         = persistentData.Associations.Count.ToString();
        }
        Nodehandler.Persistantdata = persistentData;
        Nodehandler.InitializeDataSettings();
        Debug.Log("NodeHandler activated");
    }
Beispiel #20
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            String         newCSVPath = "";
            OpenFileDialog fd         = new OpenFileDialog();

            fd.Filter = "CSV files(*.csv)| *.csv";
            if (fd.ShowDialog() == true)
            {
                newCSVPath = fd.FileName;
                FilesParser newAnomaly = new FilesParser(newCSVPath, XMLPath);
                newAnomaly.parseXML();
                newAnomaly.matchXMLToCSV();
                newAnomaly.parseCSV();
                newAnomaly.CreateAnomalyCsv();

                TimeConroller.setTimeControllerValues(newAnomaly.getCSV());
                FlightInfo.setFlightValues(newAnomaly.getXML_CSVMap());
                WheelController.setMapValues(newAnomaly.getXML_CSVMap());
                GraphController.updateAnomalyMap(newAnomaly.XMLlist, newAnomaly.getXML_CSVMap());
                DllAlgorithmHandler.setValues(newAnomaly.getXML_CSVMap(), newAnomaly.XMLlist);
            }
        }
Beispiel #21
0
        private static void InputGUI()
        {
            Event current = Event.current;

            if (target)
            {
                switch (current.type)
                {
                case EventType.DragUpdated:
                case EventType.DragPerform:
                    if (current.button == 0)
                    {
                        if (DragAndDrop.objectReferences.Length > 0)
                        {
                            if (DragAndDrop.objectReferences[0] is GraphAsset)
                            {
                                if (current.type == EventType.DragPerform)
                                {
                                    DragAndDrop.AcceptDrag();
                                    GraphController controller = UndoManager.AddComponent <GraphController>(target);
                                    controller.graph = (GraphAsset)DragAndDrop.objectReferences[0];
                                    EditorGUIUtility.PingObject(controller);
                                    Selection.activeGameObject = target;
                                    set_dirty = true;
                                    current.Use();
                                    if (Application.isPlaying)
                                    {
                                        controller.OnControllerEnable();
                                    }
                                }
                                DragAndDrop.PrepareStartDrag();
                            }
                        }
                    }
                    break;
                }
            }
        }
        public void TestCreateDrivernode()
        {
            // create driver node edit values and assign it to identifier
            string commands = @"
                    CreateDriverNode|d:10456.5|d:10320.5
                    MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None
                    MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None
                    BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption
                    MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None
                    MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:-1|e:System.Windows.Input.ModifierKeys,None
                    EndNodeEdit|u:0x10000001|s:A2|b:True
                    MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                    MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                    BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
                    MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                    MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                    EndNodeEdit|u:0x10000001|s:10|b:True";

            GraphController controller = new GraphController(null);
            bool            result     = controller.RunCommands(commands);

            Assert.AreEqual(true, result);
        }
Beispiel #23
0
        public void TestDLLLoading01()
        {
            // 1. Load a dll library.
            //
            GraphController controller = new GraphController(null);

            string testPath     = Path.GetFullPath("..\\..\\..\\..\\Studio\\DesignScriptStudio.Tests\\UnitTests\\testfiles\\");
            string fileName     = "experimental.dll";
            string assemblyPath = testPath + fileName;
            string assemblyName = System.IO.Path.GetFileNameWithoutExtension(assemblyPath);

            bool result = CoreComponent.Instance.ImportAssembly(assemblyPath, null, false);

            Assert.AreEqual(true, result);

            // there should not be any errors for the importing
            ProtoCore.BuildStatus buildStatus = GraphToDSCompiler.GraphUtilities.BuildStatus;
            Assert.AreEqual(0, buildStatus.ErrorCount);
            Assert.AreEqual(0, buildStatus.WarningCount);

            // imported dll path should be stored properly in the StudioSettings
            Assert.AreEqual(true, CoreComponent.Instance.StudioSettings.LoadedAssemblies.Contains(assemblyPath));
        }
        public void Defect_IDE_1738()
        {
            // Create CBN with value: a=1..10;
            // Create another CBN with value: a[1]=0;
            // DSS should throw an error message for second CBN saying "'a' is already defined"

            string commands = @"
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                CreateCodeBlockNode|d:15487.0|d:15328.0|s:
                BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                EndNodeEdit|u:0x10000001|s:a=1..10;|b:True
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                CreateCodeBlockNode|d:15509.0|d:15477.66666667|s:
                BeginNodeEdit|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                EndNodeEdit|u:0x10000002|s:a[1] = 0;|b:True
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None";

            GraphController controller = new GraphController(null);
            bool            result     = controller.RunCommands(commands);

            Assert.AreEqual(true, result);

            IVisualNode node01 = controller.GetVisualNode(0x10000002);// Code Block Node


            Assert.AreEqual("'a' is already defined.\n", node01.ErrorMessage);
            //Assert.IsNull(node01.PreviewValue);
        }
Beispiel #25
0
        public void TestConnectingSlots()
        {
            string commands = @"
                CreateFunctionNode|d:350.0|d:346.0|s:Math.dll|s:Math.Cos|s:double
                CreateFunctionNode|d:636.0|d:275.0|s:ProtoGeometry.dll|s:Point.ByCoordinates|s:double,double,double
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
                BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:499.0|d:372.0
                EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:638.0|d:290.0
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None";

            GraphController controller = new GraphController(null);
            bool            result     = controller.RunCommands(commands);

            Assert.AreEqual(true, result);

            List <IVisualNode> nodes = ((GraphController)controller).GetVisualNodes();
            VisualNode         node  = (VisualNode)nodes[0];
            uint  slotId             = node.GetOutputSlot(0);
            ISlot slot = ((GraphController)controller).GetSlot(slotId);

            result = false;
            if (slot.ConnectingSlots != null)
            {
                result = true;
            }
            Assert.AreEqual(true, result);

            node   = (VisualNode)nodes[1];
            slotId = node.GetOutputSlot(0);
            slot   = ((GraphController)controller).GetSlot(slotId);
            result = false;
            if (slot.ConnectingSlots == null)
            {
                result = true;
            }
            Assert.AreEqual(true, result);
        }
Beispiel #26
0
        public void TestUndoRedoForNodeCreation()
        {
            string commands = @"
                CreateFunctionNode|d:525.0|d:275.0|s:Math.dll|s:Math.Sin|s:double";

            GraphController graphController = new GraphController(null);
            bool            result00        = graphController.RunCommands(commands);

            Assert.AreEqual(true, result00);
            Assert.AreEqual(1, graphController.GetVisualNodes().Count);

            commands = @"UndoOperation";
            bool result01 = graphController.RunCommands(commands);

            Assert.AreEqual(true, result01);
            Assert.AreEqual(0, graphController.GetVisualNodes().Count);

            commands = @"RedoOperation";
            bool result02 = graphController.RunCommands(commands);

            Assert.AreEqual(true, result02);
            Assert.AreEqual(1, graphController.GetVisualNodes().Count);
            Assert.AreEqual(0x10000001, graphController.GetVisualNodes().ElementAt(0).NodeId);
        }
        public void getData()
        {
            for (int iteratation = 0; iteratation < 3; iteratation++)
            {
                //var data = new DataRequest();
                //data.beginTime = AlarmHelper.DateTimeTopkTime(DateTime.Today);
                //data.timeAxisLength = 172800;
                string         json    = " {\"beginTime\": 562201600, \"timeAxisLength\": 172800, \"tags\":[{\"table\": \"norm\", \"column\": \"diSF1_Weight\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"diSF2_Weight\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"diSF3_Weight\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"diSF4_Weight\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"diSF5_Weight\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"diSF6_Weight\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"diSF7_Weight\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"diSF8_Weight\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_TempSF1\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_TempSF2\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_TempSF3\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_TempSF4\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_TempSF5\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_TempSF6\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_TempSF7\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_TempSF8\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_SF1\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_SF2\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_SF3\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_SF4\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_SF5\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_SF6\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_SF7\", \"period\": 60}, {\"table\": \"norm\", \"column\": \"ipH_SF8\", \"period\": 60}]}";
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://users2.diosna.cz/graph?name=Graphs&plc=Bread%20fermentation");
                request.ContentType = "application/json; charset=utf-8"; //set the content type to JSON
                request.Method      = "POST";                            //make an HTTP POST
                using (var streamWriter = request.GetRequestStream())
                {
                    byte[] jsonBytes = Encoding.ASCII.GetBytes(json);
                    streamWriter.Write(jsonBytes, 0, jsonBytes.Length);
                    streamWriter.Flush();
                    streamWriter.Close();
                }
                var data = new JavaScriptSerializer().Deserialize <DataRequest>(json);
                for (int i = 0; i < data.tags.Count; i++)
                {
                    data.tags[i].vals = null;
                }
                var test = new GraphController();

                Assert.AreNotEqual(data, test.getData());
                var data2 = new JavaScriptSerializer().Deserialize <DataRequest>(json);
                for (int j = 0; j < data.tags.Count; j++)
                {
                    data2.tags[j].vals = new double[data.timeAxisLength];
                    data2.tags[j].vals = Extension.Populate(data2.tags[j].vals, double.MaxValue);
                }

                Assert.AreNotEqual(data2, test.getData());
            }
        }
Beispiel #28
0
        public void L04TestLiteral_Delete_Createnew_click()
        {
            // Create Single literal node

            // @TODO(Monika): Please re-record this test case, due to the changes in
            // mouse-down/begin-drag/end-drag/mouse-up sequence, these recorded commands are no longer valid.
            string commands = @"
                ClearSelection
                CreateCodeBlockNode|d:365.0|d:296.0|s:100
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
                DeleteComponents
                ClearSelection
                BeginDrag|d:419.0|d:320.0";

            GraphController controller = new GraphController(null, null);
            bool            result     = controller.RunCommands(commands);

            Assert.AreEqual(true, result);

            /*IVisualNode node = controller.GetVisualNode(0x10000001);
             * Assert.NotNull(node);// check if node create
             * Assert.AreEqual(NodeType.Literal, node.VisualType);// check if literal node
             * Assert.AreEqual(1, controller.GetSlots().Count);//output slot. */
        }
Beispiel #29
0
        private void DockingMainForm_Load(object sender, EventArgs e)
        {
            //LoggerConfiguration.LoggerTreeForm loggerFrm = new LoggerConfiguration.LoggerTreeForm();
            //loggerFrm.Leave += new EventHandler(loggerFrm_Leave);
            //loggerFrm.LostFocus += new EventHandler(loggerFrm_LostFocus);
            //loggerFrm.MdiChildActivate += new EventHandler(loggerFrm_MdiChildActivate);
            //loggerFrm.Shown += new EventHandler(loggerFrm_Shown);
            //loggerFrm.VisibleChanged += new EventHandler(loggerFrm_VisibleChanged);
            //loggerFrm.Enter += new EventHandler(loggerFrm_Enter);
            //loggerFrm.ShowHint = DockState.DockLeft;
            //loggerFrm.Show(dockPanel1);

            var createDatabaseController = kernel[typeof(CreateDatabaseController)] as CreateDatabaseController;

            ViewController controller = (ViewController)kernel[typeof(ViewController)];

            controller.SetDockingForm(this);
            controller.Run();

            GraphController graphController = kernel[typeof(GraphController)] as GraphController;

            graphController.DockingForm = this;
            graphController.Run();
        }
        public void TestGetSlotIndex()
        {
            IGraphController controller = new GraphController(null);

            controller.DoCreateFunctionNode(1, 1, "", "Function", "int,int");

            List <IVisualNode> nodes = ((GraphController)controller).GetVisualNodes();

            VisualNode node   = ((VisualNode)nodes[0]);
            uint       slotId = node.GetInputSlot(0);
            int        result = node.GetSlotIndex(slotId);

            Assert.AreEqual(0, result);

            slotId = node.GetOutputSlot(0);
            result = node.GetSlotIndex(slotId);
            Assert.AreEqual(0, result);

            //try to get index of a non-existent slot
            Assert.Throws <InvalidOperationException>(() =>
            {
                result = node.GetSlotIndex(0x12345678);
            });
        }
Beispiel #31
0
		public override void Run(GraphController ctrl)
		{
			Altaxo.Graph.Procedures.MasterCurveCreation.ShowMasterCurveCreationDialog(ctrl.Doc);
		}
 void Start()
 {
     graphControl = GetComponent <GraphController>();
     gameCtrlUI   = GetComponent <GameCtrlUI>();
     //gameCtrlHelper gameCtrlHelper = GetComponent<gameCtrlHelper>();
 }
 public RectangleDrawingMouseHandler(GraphController grac)
   : base(grac)
 {
   
 }
Beispiel #34
0
		public override void Run(GraphController ctrl)
		{
			ctrl.Doc.ShowPrintOptionsDialog();
		}
 public EllipseDrawingMouseHandler(GraphController grac)
   : base(grac)
 {
   
 }
Beispiel #36
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);
			}
		}
Beispiel #37
0
		public override void Run(GraphController ctrl)
		{
			HostLayer l;
			ctrl.Doc.RootLayer.IsValidIndex(ctrl.CurrentLayerNumber, out l);

			if (l is XYPlotLayer)
			{
				((XYPlotLayer)l).OnUserRescaledAxes();
			}
		}
Beispiel #38
0
		public override void Run(GraphController ctrl)
		{
			FitPolynomialDialogController dlg = new FitPolynomialDialogController(2, double.NegativeInfinity, double.PositiveInfinity, false);
			if (Current.Gui.ShowDialog(dlg, "Polynomial fit", false))
			{
				Altaxo.Graph.Procedures.PolynomialFitting.Fit(ctrl, dlg.Order, dlg.FitCurveXmin, dlg.FitCurveXmax, dlg.ShowFormulaOnGraph);
			}

			/*
			if(DialogFactory.ShowPolynomialFitDialog(Current.MainWindow,dlg))
			{
				Altaxo.Graph.Procedures.PolynomialFitting.Fit(ctrl,dlg.Order,dlg.FitCurveXmin,dlg.FitCurveXmax,dlg.ShowFormulaOnGraph);
			}
			*/
		}
Beispiel #39
0
		/// <summary>
		/// Override this function for adding own worksheet commands. You will get
		/// the worksheet controller in the parameter.
		/// </summary>
		/// <param name="ctrl">The worksheet controller this command is applied to.</param>
		public abstract void Run(GraphController ctrl);
Beispiel #40
0
		public override void Run(GraphController ctrl)
		{
			ctrl.Doc.ShowPrintDialogAndPrint();
		}
Beispiel #41
0
        public void T001_Defect_IDE_1635()
        {
            // 1. Load a dll library.
            //
            GraphController controller = new GraphController(null);

            string testPath     = Path.GetFullPath("..\\..\\..\\..\\Studio\\DesignScriptStudio.Tests\\UnitTests\\testfiles\\");
            string fileName     = "MinimalFFITest.dll";
            string assemblyPath = testPath + fileName;
            string assemblyName = System.IO.Path.GetFileNameWithoutExtension(assemblyPath);

            bool result = CoreComponent.Instance.ImportAssembly(assemblyPath, null, false);

            Assert.AreEqual(true, result);

            // there should not be any errors for the importing
            ProtoCore.BuildStatus buildStatus = GraphToDSCompiler.GraphUtilities.BuildStatus;
            Assert.AreEqual(0, buildStatus.ErrorCount);
            Assert.AreEqual(0, buildStatus.WarningCount);

            // imported dll path should be stored properly in the StudioSettings
            Assert.AreEqual(true, CoreComponent.Instance.StudioSettings.LoadedAssemblies.Contains(assemblyPath));

            string commands = @"
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateCodeBlockNode|d:15330.0|d:15127.0|s:
BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000001|s:1..5|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None|d:15340.0|d:15233.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None|d:15340.0|d:15234.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateCodeBlockNode|d:15340.0|d:15235.0|s:
BeginNodeEdit|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
EndNodeEdit|u:0x10000002|s:0..4|b:True
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
CreateFunctionNode|d:15506.0|d:15150.0|s:User defined|s:+|s:double,double
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15359.0|d:15130.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15454.0|d:15149.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15368.0|d:15236.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:1|e:System.Windows.Input.ModifierKeys,None|d:15452.0|d:15169.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:1|e:System.Windows.Input.ModifierKeys,None
CreateFunctionNode|d:15642.0|d:15318.0|s:MinimalFFITest.dll|s:Minimal.staticFunction|s:double
MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15548.0|d:15162.0
EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000004|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15576.0|d:15326.0
MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000004|e:DesignScriptStudio.Graph.Core.NodePart,InputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
";


            bool result00 = controller.RunCommands(commands);

            Assert.AreEqual(true, result00);

            VisualNode node;

            node = (VisualNode)controller.GetVisualNode(0x10000004);
            Assert.AreEqual(false, node.Error);
        }
Beispiel #42
0
 void Awake()
 {
     controller = GameObject.Find("GraphController").GetComponent <GraphController>();
     resultText = GameObject.Find("ResultText").GetComponent <TextMesh>();
 }
Beispiel #43
0
 public RegularPolygonDrawingMouseHandler(GraphController grac)
     : base(grac)
 {
 }
Beispiel #44
0
 public static void CopyPageToClipboard(GraphController ctrl)
 {
     CopyPageCommand.Run(ctrl);
 }
Beispiel #45
0
 void UpdateStat(GraphController<int, int> t)// updates bottom pannel information
 {
     int iteratorpointer = -1;
     try
     {
         label10.Text = test.LastVertex.ToString();
         if (test.IsValid()) panel3.BackColor = Color.LightGreen; else panel3.BackColor = Color.Red;
         try { iteratorpointer = test.Current(); }
         catch (Exception e) { iteratorpointer = -2; panel3.BackColor = Color.Red; }                   
         label6.Text = "Info: Vertices: " + t.VertexCount + "   Edges: " + t.EdgeCount + "  Type: ";
         if (!test.IslistBased()) label6.Text += "MatrixBased"; else label6.Text += "ListBased";
         label6.Text+=" K: " + test.Getk;                    
         if (t.EdgeExists(sel1, sel2)) panel2.BackgroundImage = GetImageFromPath("layout\\edgeexist.png"); else panel2.BackgroundImage = GetImageFromPath("layout\\edgenotexist.png");
         textBox4.Text = test.GetEdgeWeight(sel1, sel2).ToString();
     }
     catch (Exception eeee) { textBox4.Text = "N/a"; return; }
 }
Beispiel #46
0
 public static void Refresh(GraphController ctrl)
 {
     ctrl.RefreshGraph();
 }
Beispiel #47
0
		public override void Run(GraphController ctrl)
		{
			HostLayer l;
			ctrl.Doc.RootLayer.IsValidIndex(ctrl.CurrentLayerNumber, out l);

			if (l is XYPlotLayer)
				((XYPlotLayer)l).CreateNewLayerLegend();
		}
Beispiel #48
0
		public override void Run(GraphController ctrl)
		{
			SaveAsMiniProjectBase.Run(ctrl.Doc);
		}
Beispiel #49
0
 protected virtual void Start()
 {
     graphControl  = FindObjectOfType <GraphController>();
     gameCtrlUI    = FindObjectOfType <GameCtrlUI>();
     NodeTextInput = Resources.FindObjectsOfTypeAll <InputField>().FirstOrDefault(p => p.name == "Input_Text");
 }
Beispiel #50
0
        public void L04TestLiteral_Delete_Createnew_click()
        {
            // Create Single literal node

            // @TODO(Monika): Please re-record this test case, due to the changes in
            // mouse-down/begin-drag/end-drag/mouse-up sequence, these recorded commands are no longer valid.
            string commands = @"
                ClearSelection
                CreateCodeBlockNode|d:365.0|d:296.0|s:100
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Caption|i:0|e:System.Windows.Input.ModifierKeys,None
                DeleteComponents
                ClearSelection
                BeginDrag|d:419.0|d:320.0";

            GraphController controller = new GraphController(null, null);
            bool result = controller.RunCommands(commands);
            Assert.AreEqual(true, result);

            /*IVisualNode node = controller.GetVisualNode(0x10000001);
            Assert.NotNull(node);// check if node create
            Assert.AreEqual(NodeType.Literal, node.VisualType);// check if literal node
            Assert.AreEqual(1, controller.GetSlots().Count);//output slot. */
        }
Beispiel #51
0
 public GraphRenameValidator(GraphDocument graphdoc, GraphController ctrl)
     : base("The graph's name must not be empty! Please enter a valid name.")
 {
     _doc        = graphdoc;
     _controller = ctrl;
 }
Beispiel #52
0
		public override void Run(GraphController ctrl)
		{
			ctrl.EnsureValidityOfCurrentLayerNumber();
			var xylayer = ctrl.Doc.RootLayer.ElementAt(ctrl.CurrentLayerNumber) as XYPlotLayer;
			if (null != xylayer)
				xylayer.PlotItems.Add(new XYFunctionPlotItem(new XYFunctionPlotData(new PolynomialFunction(new double[] { 0, 0, 1 })), new G2DPlotStyleCollection(LineScatterPlotStyleKind.Line, xylayer.GetPropertyContext())));
		}
Beispiel #53
0
		public override void Run(GraphController ctrl)
		{
			ctrl.EnsureValidityOfCurrentLayerNumber();
			var t1 = ctrl.ActiveLayer as XYPlotLayer;
			if (null != t1)
			{
				XYPlotLayerController.ShowDialog(t1);
				return;
			}
			var t2 = ctrl.ActiveLayer;
			if (null != t2)
			{
				HostLayerController.ShowDialog(t2);
				return;
			}
		}
Beispiel #54
0
		public override void Run(GraphController ctrl)
		{
			GraphDocument newDoc = new GraphDocument(ctrl.Doc);
			string newnamebase = Altaxo.Main.ProjectFolder.CreateFullName(ctrl.Doc.Name, "GRAPH");
			newDoc.Name = Current.Project.GraphDocumentCollection.FindNewName(newnamebase);
			Current.Project.GraphDocumentCollection.Add(newDoc);
			Current.ProjectService.CreateNewGraph(newDoc);
		}
Beispiel #55
0
 protected virtual void Start()
 {
     graphControl = FindObjectOfType <GraphController>();
 }
Beispiel #56
0
		public override void Run(GraphController ctrl)
		{
			var layer = ctrl.ActiveLayer as XYPlotLayer;
			if (null == layer || ctrl.CurrentPlotNumber < 0 || !(layer.PlotItems[ctrl.CurrentPlotNumber] is DensityImagePlotItem))
			{
				Current.Gui.ErrorMessageBox("Current plot item should be a density image plot!");
				return;
			}

			var plotItem = (DensityImagePlotItem)layer.PlotItems[ctrl.CurrentPlotNumber];
			var legend = new Gdi.Shapes.DensityImageLegend(plotItem, layer, 0.5 * layer.Size, new PointD2D(layer.Size.X / 3, layer.Size.Y / 2), ctrl.Doc.GetPropertyHierarchy());
			layer.GraphObjects.Add(legend);
		}
Beispiel #57
0
		protected void EhWorkbenchContentChanged(object o, System.EventArgs e)
		{
			if (!object.ReferenceEquals(Controller, myCurrentGraphController))
			{
				if (null != myCurrentGraphController)
				{
					lock (this)
					{
						this.myCurrentGraphController.CurrentGraphToolChanged -= new EventHandler(this.EhGraphToolChanged);
						this.myCurrentGraphController = null;
					}
				}
				if (Controller != null)
				{
					lock (this)
					{
						this.myCurrentGraphController = this.Controller;
						this.myCurrentGraphController.CurrentGraphToolChanged += new EventHandler(this.EhGraphToolChanged);
					}
				}
				OnPropertyChanged("IsChecked");
			}
		}
Beispiel #58
0
		public override void Run(GraphController ctrl)
		{
			string result = Altaxo.Graph.Procedures.NonlinearFitting.Fit(ctrl);
			if (null != result)
				Current.Gui.ErrorMessageBox(result);
		}
 public EllipseDrawingMouseHandler(GraphController grac)
     : base(grac)
 {
 }
Beispiel #60
0
		public override void Run(GraphController ctrl)
		{
			ctrl.Doc.ShowCopyPageOptionsDialog();
		}