Ejemplo n.º 1
0
        public FrmShutter(ShutterNode node)
        {
            InitializeComponent();

            this.Text = node.Title + "-" + this.Text;

            this.ckbShutterUpDown.Checked         = this.tlpShutterUpDown.Enabled = node.ShutterUpDown.Enable;
            this.ckbShutterStop.Checked           = this.tlpShutterStop.Enabled = node.ShutterStop.Enable;
            this.ckbPositionShutter.Checked       = this.tlpPositionShutter.Enabled = node.AbsolutePositionOfShutter.Enable;
            this.ckbPositionBlinds.Checked        = this.tlpPositionBlinds.Enabled = node.AbsolutePositionOfBlinds.Enable;
            this.ckbStateUpperPosition.Checked    = this.tlpStateUpperPosition.Enabled = node.StateUpperPosition.Enable;
            this.ckbStateLowerPosition.Checked    = this.tlpStateLowerPosition.Enabled = node.StateLowerPosition.Enable;
            this.ckbStatusPositionShutter.Checked = this.tlpStatusPositionShutter.Enabled = node.StatusActualPositionOfShutter.Enable;
            this.ckbStatusPositionBlinds.Checked  = this.tlpStatusPositionBlinds.Enabled = node.StatusActualPositionOfBlinds.Enable;

            this.gaShutterUpDown         = new Dictionary <string, KNXSelectedAddress>(node.ShutterUpDown.MapSelectedAddress);
            this.gaShutterStop           = new Dictionary <string, KNXSelectedAddress>(node.ShutterStop.MapSelectedAddress);
            this.gaPositionShutter       = new Dictionary <string, KNXSelectedAddress>(node.AbsolutePositionOfShutter.MapSelectedAddress);
            this.gaPositionBlinds        = new Dictionary <string, KNXSelectedAddress>(node.AbsolutePositionOfBlinds.MapSelectedAddress);
            this.gaStateUpperPosition    = new Dictionary <string, KNXSelectedAddress>(node.StateUpperPosition.MapSelectedAddress);
            this.gaStateLowerPosition    = new Dictionary <string, KNXSelectedAddress>(node.StateLowerPosition.MapSelectedAddress);
            this.gaStatusPositionShutter = new Dictionary <string, KNXSelectedAddress>(node.StatusActualPositionOfShutter.MapSelectedAddress);
            this.gaStatusPositionBlinds  = new Dictionary <string, KNXSelectedAddress>(node.StatusActualPositionOfBlinds.MapSelectedAddress);

            this.txbxShutterUpDown.Text         = KNXSelectedAddress.GetGroupAddressName(this.gaShutterUpDown);
            this.txbxShutterStop.Text           = KNXSelectedAddress.GetGroupAddressName(this.gaShutterStop);
            this.txbxPositionShutter.Text       = KNXSelectedAddress.GetGroupAddressName(this.gaPositionShutter);
            this.txbxPositionBlinds.Text        = KNXSelectedAddress.GetGroupAddressName(this.gaPositionBlinds);
            this.txbxStateUpperPosition.Text    = KNXSelectedAddress.GetGroupAddressName(this.gaStateUpperPosition);
            this.txbxStateLowerPosition.Text    = KNXSelectedAddress.GetGroupAddressName(this.gaStateLowerPosition);
            this.txbxStatusPositionShutter.Text = KNXSelectedAddress.GetGroupAddressName(this.gaStatusPositionShutter);
            this.txbxStatusPositionBlinds.Text  = KNXSelectedAddress.GetGroupAddressName(this.gaStatusPositionBlinds);

            this.node = node;
        }
Ejemplo n.º 2
0
        public FrmDimmer(DimmerNode node)
        {
            InitializeComponent();

            this.Text = this.Text + "-" + node.Title;

            this.ckbSwitch.Checked        = this.tlpSwitch.Enabled = node.Switch.Enable;
            this.ckbDimRelatively.Checked = this.tlpDimRelatively.Enabled = node.DimRelatively.Enable;
            this.ckbDimAbsolutely.Checked = this.tlpDimAbsolutely.Enabled = node.DimAbsolutely.Enable;
            this.ckbStateOnOff.Checked    = this.tlpStateOnOff.Enabled = node.StateOnOff.Enable;
            this.ckbStateDimValue.Checked = this.tlpStateDimValue.Enabled = node.StateDimValue.Enable;

            this.gaSwitch        = new Dictionary <string, KNXSelectedAddress>(node.Switch.MapSelectedAddress);
            this.gaDimRelatively = new Dictionary <string, KNXSelectedAddress>(node.DimRelatively.MapSelectedAddress);
            this.gaDimAbsoultely = new Dictionary <string, KNXSelectedAddress>(node.DimAbsolutely.MapSelectedAddress);
            this.gaStateOnOff    = new Dictionary <string, KNXSelectedAddress>(node.StateOnOff.MapSelectedAddress);
            this.gaStateDimValue = new Dictionary <string, KNXSelectedAddress>(node.StateDimValue.MapSelectedAddress);

            this.txbxSwitch.Text        = KNXSelectedAddress.GetGroupAddressName(this.gaSwitch);
            this.txbxDimRelatively.Text = KNXSelectedAddress.GetGroupAddressName(this.gaDimRelatively);
            this.txbxDimAbsolutely.Text = KNXSelectedAddress.GetGroupAddressName(this.gaDimAbsoultely);
            this.txbxStateOnOff.Text    = KNXSelectedAddress.GetGroupAddressName(this.gaStateOnOff);
            this.txbxStateDimValue.Text = KNXSelectedAddress.GetGroupAddressName(this.gaStateDimValue);

            this.node = node;
        }
Ejemplo n.º 3
0
        private void btnStatusPositionBlinds_Click(object sender, EventArgs e)
        {
            try
            {
                var frm = new FrmGroupAddressPick();
                frm.Text            = node.Title + " - " + this.ckbStatusPositionBlinds.Text;
                frm.MultiSelect     = false;
                frm.PickType        = FrmGroupAddressPick.AddressType.Read;
                frm.SelectedAddress = this.gaStatusPositionBlinds;
                var result = frm.ShowDialog();

                if (result == DialogResult.OK)
                {
                    this.gaStatusPositionBlinds = frm.SelectedAddress;

                    this.txbxStatusPositionBlinds.Text = KNXSelectedAddress.GetGroupAddressName(this.gaStatusPositionBlinds);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 4
0
        private void btnPositionShutter_Click(object sender, EventArgs e)
        {
            try
            {
                var frm = new FrmGroupAddressPick();
                frm.Text            = node.Title + " - " + this.ckbPositionShutter.Text;
                frm.MultiSelect     = true;
                frm.PickType        = FrmGroupAddressPick.AddressType.Write;
                frm.SelectedAddress = this.gaPositionShutter;
                var result = frm.ShowDialog();

                if (result == DialogResult.OK)
                {
                    this.gaPositionShutter = frm.SelectedAddress;

                    this.txbxPositionShutter.Text = KNXSelectedAddress.GetGroupAddressName(this.gaPositionShutter);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }