Value panel containing int values
Inheritance: ValuePanel
Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NodeForm"/> class.
        /// </summary>
        /// <param name="node">The node.</param>
        public NodeForm( Node node )
        {
            m_node = node;
            InitializeComponent();

            // load all possible configuration parameters
            for (byte i = 0; i <= 10; i++)
            {
                MainForm.Manager.RequestConfigParam(node.HomeID, node.ID, i);
            }

            if (node.Manufacturer != "")
            {
                this.Text = "Node " + node.ID.ToString() + ": " + node.Manufacturer + " " + node.Product;
            }
            else
            {
                this.Text = "Node " + node.ID.ToString() + ": " + node.Label;
            }

            foreach (ZWValueID valueID in node.Values)
            {
                Control control = null;
                switch (valueID.GetType())
                {
                    case ZWValueID.ValueType.Bool:
                    {
                        control = new ValuePanelBool(valueID);
                        break;
                    }
                    case ZWValueID.ValueType.Button:
                    {
                        control = new ValuePanelButton(valueID);
                        break;
                    }
                    case ZWValueID.ValueType.Byte:
                    {
                        control = new ValuePanelByte(valueID);
                        break;
                    }
                    case ZWValueID.ValueType.Decimal:
                    {
                        control = new ValuePanelDecimal(valueID);
                        break;
                    }
                    case ZWValueID.ValueType.Int:
                    {
                        control = new ValuePanelInt(valueID);
                        break;
                    }
                    case ZWValueID.ValueType.List:
                    {
                        control = new ValuePanelList(valueID);
                        break;
                    }
                    case ZWValueID.ValueType.Short:
                    {
                        control = new ValuePanelShort(valueID);
                        break;
                    }
                    case ZWValueID.ValueType.String:
                    {
                        control = new ValuePanelString(valueID);
                        break;
                    }
                }

                if (control != null)
                {
                    NodeLayoutPanel.Controls.Add(control);
                }
            }
        }
Ejemplo n.º 2
0
        public NodeForm(Node node)
        {
            m_node = node;
            InitializeComponent();

            // load all possible configuration parameters
            for (byte i = 0; i <= 10; i++)
            {
                MainForm.Manager.RequestConfigParam(node.HomeID, node.ID, i);
            }

            if (node.Manufacturer != "")
            {
                this.Text = "Node " + node.ID.ToString() + ": " + node.Manufacturer + " " + node.Product;
            }
            else
            {
                this.Text = "Node " + node.ID.ToString() + ": " + node.Label;
            }

            foreach (ZWValueID valueID in node.Values)
            {
                Control control = null;
                switch (valueID.GetType())
                {
                case ZWValueID.ValueType.Bool:
                {
                    control = new ValuePanelBool(valueID);
                    break;
                }

                case ZWValueID.ValueType.Button:
                {
                    control = new ValuePanelButton(valueID);
                    break;
                }

                case ZWValueID.ValueType.Byte:
                {
                    control = new ValuePanelByte(valueID);
                    break;
                }

                case ZWValueID.ValueType.Decimal:
                {
                    control = new ValuePanelDecimal(valueID);
                    break;
                }

                case ZWValueID.ValueType.Int:
                {
                    control = new ValuePanelInt(valueID);
                    break;
                }

                case ZWValueID.ValueType.List:
                {
                    control = new ValuePanelList(valueID);
                    break;
                }

                case ZWValueID.ValueType.Short:
                {
                    control = new ValuePanelShort(valueID);
                    break;
                }

                case ZWValueID.ValueType.String:
                {
                    control = new ValuePanelString(valueID);
                    break;
                }
                }

                if (control != null)
                {
                    NodeLayoutPanel.Controls.Add(control);
                }
            }
        }
Ejemplo n.º 3
0
        public ChangeNodeValuesForm(Node node)
        {
            m_node = node;
            InitializeComponent();

            if (node.Manufacturer != "")
            {
                this.Text = "Node " + node.ID.ToString() + ": " + node.Manufacturer + " " + node.Product;
            }
            else
            {
                this.Text = "Node " + node.ID.ToString() + ": " + node.Label;
            }

            foreach (ZWValueID valueID in node.Values)
            {
                Control control = null;
                switch (valueID.GetType())
                {
                    case ZWValueID.ValueType.Bool:
                        {
                            control = new ValuePanelBool(valueID);
                            break;
                        }
                    case ZWValueID.ValueType.Button:
                        {
                            control = new ValuePanelButton(valueID);
                            break;
                        }
                    case ZWValueID.ValueType.Byte:
                        {
                            control = new ValuePanelByte(valueID);
                            break;
                        }
                    case ZWValueID.ValueType.Decimal:
                        {
                            control = new ValuePanelDecimal(valueID);
                            break;
                        }
                    case ZWValueID.ValueType.Int:
                        {
                            control = new ValuePanelInt(valueID);
                            break;
                        }
                    case ZWValueID.ValueType.List:
                        {
                            control = new ValuePanelList(valueID);
                            break;
                        }
                    case ZWValueID.ValueType.Short:
                        {
                            control = new ValuePanelShort(valueID);
                            break;
                        }
                    case ZWValueID.ValueType.String:
                        {
                            control = new ValuePanelString(valueID);
                            break;
                        }
                }

                if (control != null)
                {
                    NodeLayoutPanel.Controls.Add(control);
                }
            }
        }