Ejemplo n.º 1
0
        public void Delete_Port(Schematix.FSM.My_Port p)
        {
            DialogResult res = MessageBox.Show("Are you sure want to delete port " + p.name + " ?", "Delete Port?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (res == DialogResult.Yes)
            {
                RemoveFigure(p);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Создание нового порта
        /// </summary>
        /// <param name="Direction"></param>
        public void CreateNewPort(Schematix.FSM.My_Port.PortDirection Direction)
        {
            if (Lock == true)
            {
                MessageBox.Show("You must create figure " + SelectedFigure.name + " before.", "Fatal Error :)", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            graph.UnselectAllFigures();

            Schematix.FSM.My_Port port = new Schematix.FSM.My_Port(this, Direction);
            SelectedFigureList.Add(port);
            SelectedFigure = port;
            graph.AddFigure(port);
            Lock = true;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Создание нового порта используя ToolBox
        /// </summary>
        /// <param name="Direction"></param>
        /// <param name="pt"></param>
        public void CreateNewPort_Dragged(Schematix.FSM.My_Port.PortDirection Direction, Point pt)
        {
            pt = form.PointToClient(pt);
            if (Lock == true)
            {
                MessageBox.Show("You must create figure " + SelectedFigure.name + " before.", "Fatal Error :)", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            graph.UnselectAllFigures();

            Schematix.FSM.My_Port port = new Schematix.FSM.My_Port("Port" + graph.Ports.Count.ToString(), "STD_LOGIC", pt, this);
            SelectedFigure = port;
            port.Direction = Direction;
            graph.AddFigure(port);
            Lock = false;
            //AddToHistory("New port Draged");
            bitmap.UpdateBitmap();
        }
Ejemplo n.º 4
0
        private void OK()
        {
            signal.name            = textBoxName.Text;
            signal.label_name.Text = textBoxName.Text;
            if (radioButtonUserDefined.Checked == false)
            {
                signal.Default_Value = textBoxValue.Text;
            }
            else
            {
                signal.Default_Value = "";
            }

            if (radioButtonStd_Logic.Checked == true)
            {
                signal.Type = "Std_Logic";
                SetBusRange();
            }
            if (radioButtonStd_uLogic.Checked == true)
            {
                signal.Type = "Std_uLogic";
                SetBusRange();
            }
            if (radioButtonBit.Checked == true)
            {
                signal.Type = "Bit";
                SetBusRange();
            }
            if (radioButtonInteger.Checked == true)
            {
                signal.Type = "Integer";
                SetIntegerRange();
            }
            if (radioButtonBoolean.Checked == true)
            {
                signal.Type = "Boolean";
            }
            if (radioButtonCharacter.Checked == true)
            {
                signal.Type = "Character";
            }
            if (radioButtonUserDefined.Checked == true)
            {
                string type = comboBoxType.Text;
                if (string.IsNullOrEmpty(type))
                {
                    type = GetDataFromCombobox(comboBoxType);
                }
                signal.Type = type;
            }

            if (signal is Schematix.FSM.My_Constant)
            {
                core.AddToHistory("Constant " + signal.name + " change properties");
                (signal as Schematix.FSM.My_Constant).Gen_Type = (Schematix.FSM.My_Constant.GenerationType)comboBoxGenType.SelectedItem;
            }
            if (signal is Schematix.FSM.My_Port)
            {
                Schematix.FSM.My_Port p = signal as Schematix.FSM.My_Port;
                if (radioButtonInput.Checked == true)
                {
                    p.Direction = Schematix.FSM.My_Port.PortDirection.In;
                }
                if (radioButtonOutput.Checked == true)
                {
                    p.Direction = Schematix.FSM.My_Port.PortDirection.Out;
                }
                if (radioButtonInout.Checked == true)
                {
                    p.Direction = Schematix.FSM.My_Port.PortDirection.InOut;
                }
                if (radioButtonBuffer.Checked == true)
                {
                    p.Direction = Schematix.FSM.My_Port.PortDirection.Buffer;
                }

                if (radioButtonCombinatioral.Checked == true)
                {
                    p.Port_Type = Schematix.FSM.My_Port.PortType.Combinatioral;
                }
                if (radioButtonRegistered.Checked == true)
                {
                    p.Port_Type = Schematix.FSM.My_Port.PortType.Registered;
                }
                if (radioButtonClocked.Checked == true)
                {
                    p.Port_Type = Schematix.FSM.My_Port.PortType.Clocked;
                }

                if (checkBoxClock.Checked == true)
                {
                    p.Port_Type = Schematix.FSM.My_Port.PortType.Clock;
                }
                if (checkBoxClockEnable.Checked == true)
                {
                    p.Port_Type = Schematix.FSM.My_Port.PortType.ClockEnable;
                }
            }
            if (signal is Schematix.FSM.My_Signal)
            {
                core.AddToHistory("Signal " + signal.name + " change properties");
            }
        }
Ejemplo n.º 5
0
        private void OK()
        {
            signal.name            = textBoxName.Text;
            signal.label_name.Text = textBoxName.Text;
            if (radioButtonUserDefined.Checked == false)
            {
                signal.Default_Value = textBoxValue.Text;
            }
            else
            {
                signal.Default_Value = "";
            }

            if (radioButtonInteger.Checked == true)
            {
                signal.Type = "Integer";
            }
            if (radioButtonLogic.Checked == true)
            {
                signal.Type = cbPortType.SelectedItem as string;
                if (checkBoxIsBus.Checked == true)
                {
                    signal.Type_inf.avaliable = true;
                    signal.Type_inf.range1    = LeftIndex.ToString();
                    signal.Type_inf.range2    = RightIndex.ToString();
                }
            }
            if (radioButtonUserDefined.Checked == true)
            {
                signal.Type = textBoxType.Text;
            }

            if (signal is Schematix.FSM.My_Constant)
            {
                core.AddToHistory("Constant " + signal.name + " change properties");
            }
            if (signal is Schematix.FSM.My_Port)
            {
                Schematix.FSM.My_Port p = signal as Schematix.FSM.My_Port;
                if (radioButtonInput.Checked == true)
                {
                    p.Direction = Schematix.FSM.My_Port.PortDirection.In;
                }
                if (radioButtonOutput.Checked == true)
                {
                    p.Direction = Schematix.FSM.My_Port.PortDirection.Out;
                }
                if (radioButtonInout.Checked == true)
                {
                    p.Direction = Schematix.FSM.My_Port.PortDirection.InOut;
                }

                if (radioButtonCombinatioral.Checked == true)
                {
                    p.Port_Type = Schematix.FSM.My_Port.PortType.Combinatioral;
                }
                if (radioButtonRegistered.Checked == true)
                {
                    p.Port_Type = Schematix.FSM.My_Port.PortType.Registered;
                }
                if (radioButtonClocked.Checked == true)
                {
                    p.Port_Type = Schematix.FSM.My_Port.PortType.Clocked;
                }

                if (checkBoxClock.Checked == true)
                {
                    p.Port_Type = Schematix.FSM.My_Port.PortType.Clock;
                }
                if (checkBoxClockEnable.Checked == true)
                {
                    p.Port_Type = Schematix.FSM.My_Port.PortType.ClockEnable;
                }
            }
            if (signal is Schematix.FSM.My_Signal)
            {
                core.AddToHistory("Signal " + signal.name + " change properties");
            }
        }