Пример #1
0
        private void AddGraph(Graph graph)
        {
            _graphs.Add(graph);

            GraphControls graphControls = new GraphControls(this, graph);

            _graphControls.Add(graph, graphControls);
            graphControls.Attach();

            foreach (DataSeriesView v in graph.Views)
            {
                graphControls.AddViewLabel(v);
            }

            graph.OnAddPoint      += new Graph.AddPointDelegate(graph_OnAddPoint);
            graph.OnSeriesChanged += new Graph.SeriesChangedDelegate(graph_OnSeriesChanged);

            graph.OnAddView     += new Graph.AddViewDelegate(graph_OnAddView);
            graph.OnRemoveView  += new Graph.RemoveViewDelegate(graph_OnRemoveView);
            graph.OnViewChanged += new Graph.ViewChangeDelegate(graph_OnViewChanged);

            graph.OnResolutionChanged += new Graph.ResolutionChangedDelegate(graph_OnGraphChange);
            graph.OnShowTimeLabels    += new Graph.ShowTimeLabelsDelegate(graph_OnGraphChange);

            CalculateSizeAndPositions();
        }
Пример #2
0
        public override void OnNodeEnter(GraphControls graphControls)
        {
            base.OnNodeEnter(graphControls);

            if (string.IsNullOrEmpty(m_blackboardElementId))
            {
                Debug.LogError("BlackboardSetter: Blackboard element is not set!");
                return;
            }
            BlackboardElement element = graphControls.BlackboardProperties.GetElementById(m_blackboardElementId);

            m_setterValue.Evaluate(element);
            graphControls.TraverseEdge(0, this);
        }
Пример #3
0
        public void RemoveGraphHelper(Graph graph)
        {
            GraphControls controls = _graphControls[graph];

            controls.Detach();

            graph.OnAddPoint -= graph_OnAddPoint;

            graph.OnAddView    -= graph_OnAddView;
            graph.OnRemoveView -= graph_OnRemoveView;

            graph.OnResolutionChanged -= graph_OnGraphChange;
            graph.OnShowTimeLabels    -= graph_OnGraphChange;

            _graphControls.Remove(graph);
        }
Пример #4
0
        public override void OnNodeEnter(GraphControls graphControls)
        {
            base.OnNodeEnter(graphControls);
            if (string.IsNullOrEmpty(m_blackboardElementId))
            {
                Debug.LogError("BlackboardConditional: Blackboard element is not set!");
                return;
            }
            BlackboardElement element = graphControls.BlackboardProperties.GetElementById(m_blackboardElementId);

            for (int i = 0; i < m_conditionals.Count; i++)
            {
                if (m_conditionals[i].Evaluate(element))
                {
                    graphControls.TraverseEdge(i, this);
                    return;
                }
            }
        }
 public override void OnNodeExit(GraphControls graphControls)
 {
     Debug.Log("EntryNode Exit");
 }
 public override void OnNodeUpdate(GraphControls graphControls)
 {
     Debug.Log("EntryNode Update");
 }
 public override void OnNodeEnter(GraphControls graphControls)
 {
     Debug.Log("EntryNode Enter");
     graphControls.TraverseEdge(0, this);
 }
        private void PublishResponseNonDataNodes(XElement publishElt)
        {
            // Now do the other elements
            XElement currentElt = (XElement)publishElt.FirstNode;

            while (currentElt != null)
            {
                try
                {
                    switch (currentElt.Name.ToString())
                    {
                    case Common.FieldNode:
                        PublishResponseField(currentElt);
                        break;

                    case Common.Requests.MethodInvocation:
                        PublishResponseMethodInvocation(currentElt);
                        break;

                    case Common.Data.Node:
                        PublishResponseNode(currentElt);
                        break;

                    case Common.MessagesNode:
                        XElement messageElt = (XElement)currentElt.FirstNode;

                        while (messageElt != null)
                        {
                            PublishMessage(messageElt);
                            messageElt = (XElement)messageElt.NextNode;
                        }

                        break;

                    case Common.UIMessage.Node:
                        AppHost.PublishUIMessage(currentElt);
                        break;

                    case Common.ModelObject:
                        // Publishes dirty state
                        bool   dirty = Common.boolValue(currentElt.Attribute(Common.Dirty).Value);
                        string mo    = currentElt.Attribute(Common.IDAttrib).Value;

                        _container.PublishDirtyChange(mo, dirty);

                        break;

                    case Common.Graph:
                        string id = currentElt.Attribute(Common.IDAttrib).Value;

                        if (GraphControls.ContainsKey(id))
                        {
                            GraphControls[id].PublishGraph(currentElt);
                        }

                        break;

                    case Common.Requests.ContextMenu:
                        if (ContextMenuPublisher == null)
                        {
                            ApplicationEx.Instance.DisplayMessageBox("No publisher for context menu", "Error");
                        }
                        else
                        {
                            ContextMenuPublisher.PublishContextMenu(currentElt);
                        }

                        break;

                    case Common.CustomContent:
                        //id = currentElt.Attribute(Common.IDAttrib).Value;

                        //if (CustomContentControls.ContainsKey(id))
                        //    CustomContentControls[id].publishCustomContent(currentElt);

                        break;
                    }
                }
                catch (Exception e)
                {
                    Logging.LogException(e);
                }

                currentElt = (XElement)currentElt.NextNode;
            }
        }
Пример #9
0
 public override void OnNodeExit(GraphControls graphControls)
 {
     Debug.Log("Exited sample node.");
 }
Пример #10
0
 public override void OnNodeUpdate(GraphControls graphControls)
 {
     graphControls.TraverseEdge(0, this);
 }
Пример #11
0
 public override void OnNodeEnter(GraphControls graphControls)
 {
     Debug.Log($"Entered sample node. SampleString is {SampleString} and SampleInt is {SampleInt}");
 }