Beispiel #1
0
        private void SaveAndClearNodes()
        {
            if (currentTab != -1)
            {
                if (currentTab > tabs.Count - 1)
                {
                    tabs.Add(new FSMInstance()
                    {
                        matrix        = mt.Matrix,
                        nodes         = nodes,
                        dataVersion   = dataVersion,
                        graphElements = CopyChildrenToList(graphCanvas),
                        states        = CopyChildrenToList(stateList),
                        events        = CopyChildrenToList(eventList),
                        variables     = CopyChildrenToList(variableList)
                    });
                }
                else
                {
                    FSMInstance fsmInstance = tabs[currentTab];
                    fsmInstance.matrix = mt.Matrix;
                }
            }

            graphCanvas.Children.Clear();
            stateList.Children.Clear();
            eventList.Children.Clear();
            variableList.Children.Clear();
            nodes = new List <Node>();
        }
Beispiel #2
0
        public void LoadSavedNodes(int tab)
        {
            currentTab = tab;
            FSMInstance curInstance = tabs[currentTab];

            mt.Matrix = curInstance.matrix;

            nodes = curInstance.nodes;
            CopyListToChildren(stateList, curInstance.states);
            CopyListToChildren(eventList, curInstance.events);
            CopyListToChildren(variableList, curInstance.variables);
            CopyListToChildren(graphCanvas, curInstance.graphElements);
            dataVersion = curInstance.dataVersion;
        }
Beispiel #3
0
        private void SaveAndClearNodes()
        {
            if (currentTab != -1)
            {
                FSMInstance fsmInstance = tabs[currentTab];
                fsmInstance.matrix = mt.Matrix;
            }

            graphCanvas.Children.Clear();
            stateList.Children.Clear();
            eventList.Children.Clear();
            variableList.Children.Clear();
            nodes = new List <Node>();
        }