예제 #1
0
        private void VisualizeStep()
        {
            processor.process();
            form1.UpdateGraphFromThread(processor.UpdateGraph(path).GetVisualGraph());

            Thread.Sleep(500);
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //Open file
            openFileDialog1.ShowDialog();
            string fileName = openFileDialog1.FileName;

            textBox1.Text = fileName;

            Process    = new Processor(fileName, this);
            fileLoaded = true;

            //Read file per line
            for (int i = 0; i <= Process.totalEdge; i++)
            {
                if (i != 0)
                {
                    Process.fileContent += Process.fileLines[i] + "\n";
                }
            }

            //Read all nodes
            richTextBox1.Text = Process.fileContent;


            gViewer1.Graph = Process.process();


            int totalNode = Process.allNode.Count();

            for (int i = 0; i < totalNode; i++)
            {
                comboBox1.Items.Add(Process.nodeIn[i]);
                comboBox1.Items.Add(Process.nodeOut[i]);
            }

            List <string> allNodes = new List <string>();

            foreach (string S in comboBox1.Items)
            {
                if (!allNodes.Contains(S))
                {
                    allNodes.Add(S);
                }
            }
            comboBox1.Items.Clear();
            comboBox1.Items.AddRange(allNodes.ToArray());


            foreach (string S in comboBox2.Items)
            {
                if (!allNodes.Contains(S))
                {
                    allNodes.Add(S);
                }
            }
            comboBox2.Items.Clear();
            comboBox2.Items.AddRange(allNodes.ToArray());

            /*
             * threadStart = new ThreadStart(StartProcessing);
             * processingThread = new Thread(threadStart);
             *
             * processingThread.Name = "Solving Process";
             * processingThread.Start();
             */
        }