Esempio n. 1
0
        private void gleeViewCFG_MouseClick(object sender, MouseEventArgs e)
        {
            if ((gleeViewCFG.Graph != null) && (gleeViewCFG.SelectedObject != null))
            {
                if (gleeViewCFG.SelectedObject is Node)
                {
                    BddViewForm.CleanAllBdd();

                    BddViewForm.bddPathEdgeLabel.Text = "Path Edges for: " + (gleeViewCFG.SelectedObject as Node).Attr.Label;

                    BddViewForm.bddSummaryEdgeLabel.Text = "Summary Edges for: " + (gleeViewCFG.SelectedObject as Node).Attr.Label;

                    //   BddViewForm.bddTransferLabel.Text = "Transfer Function for: " + (gleeViewCFG.SelectedObject as Node).Attr.Label;

                    int id = int.Parse((gleeViewCFG.SelectedObject as Node).Id);

                    BddViewForm.bddPathEdgesControl.BddRoot           = MyBMC.GetCFGPathEdgeByHashCode(id);
                    BddViewForm.bddPathEdgesControl.BddManager        = MyBMC.GetBddManager;
                    BddViewForm.bddPathEdgesControl.BddVariableToName = MyBMC.BddToName;

                    BddViewForm.bddPathEdgesControl.DrawGraph();

                    BddViewForm.bddSummaryEdgesControl.BddRoot           = MyBMC.GetCFGSummaryEdgeByHashCode(id);
                    BddViewForm.bddSummaryEdgesControl.BddManager        = MyBMC.GetBddManager;
                    BddViewForm.bddSummaryEdgesControl.BddVariableToName = MyBMC.BddToName;

                    BddViewForm.bddSummaryEdgesControl.DrawGraph();


                    if (!BddViewForm.bddTransferComboBox.Items.Contains("Transfer"))
                    {
                        BddViewForm.bddTransferComboBox.Items.Add("Transfer");
                    }

                    BddViewForm.bddTransferComboBox.SelectedItem = "Transfer";
                    BddViewForm.bddTransferComboBox.Enabled      = false;


                    if (MyBMC.GetCFGTransferTrueByHashCode(id) != null)
                    {
                        BddViewForm.bddTransferTrueControl.BddRoot  = MyBMC.GetCFGTransferTrueByHashCode(id);
                        BddViewForm.bddTransferFalseControl.BddRoot = MyBMC.GetCFGTransferFalseByHashCode(id);

                        BddViewForm.bddTransferTrueControl.BddManager  = MyBMC.GetBddManager;
                        BddViewForm.bddTransferFalseControl.BddManager = MyBMC.GetBddManager;

                        BddViewForm.bddTransferTrueControl.BddVariableToName  = MyBMC.BddToName;
                        BddViewForm.bddTransferFalseControl.BddVariableToName = MyBMC.BddToName;

                        BddViewForm.bddTransferTrueControl.DrawGraph();
                        BddViewForm.bddTransferFalseControl.DrawGraph();

                        BddViewForm.bddTransferComboBox.Enabled = true;

                        BddViewForm.bddTransferComboBox.Items.Remove("Transfer");
                        BddViewForm.bddTransferComboBox.SelectedItem = "Transfer True";
                    }
                    else
                    {
                        BddViewForm.bddTransferControl.BddRoot           = MyBMC.GetCFGTransferByHashCode(id);
                        BddViewForm.bddTransferControl.BddManager        = MyBMC.GetBddManager;
                        BddViewForm.bddTransferControl.BddVariableToName = MyBMC.BddToName;
                        BddViewForm.bddTransferControl.DrawGraph();
                    }

                    BddViewForm.Show();
                    BddViewForm.WindowState = FormWindowState.Normal;
                }
            }
        }