Exemplo n.º 1
0
        public FrmBusToRS232ForMHRCU(string strname, MHRCU rs232, int devicetype, int maxcount, int type)
        {
            InitializeComponent();
            this.Type        = type;
            this.MyActiveObj = rs232;
            this.MaxCount    = maxcount;
            string strDevName = strname.Split('\\')[0].ToString();

            strRemark            = strname.Split('\\')[1].ToString();
            SubNetID             = Convert.ToByte(strDevName.Split('-')[0]);
            DevID                = Convert.ToByte(strDevName.Split('-')[1]);
            this.MyintDeviceType = devicetype;

            cbType.Items.Clear();
            cbType.DropDownStyle = ComboBoxStyle.DropDownList;
            cbType.Items.Add(CsConst.mstrINIDefault.IniReadValue("TargetType", "00000", ""));
            cbType.Items.Add(CsConst.myPublicControlType[4].ControlTypeName);
            cbState.Items.Clear();
            cbState.DropDownStyle = ComboBoxStyle.DropDownList;
            cbState.Items.Add(CsConst.Status[0]);
            cbState.Items.Add(CsConst.Status[1]);
            cbType.SelectedIndexChanged  += cbType_SelectedIndexChanged;
            txtNO.TextChanged            += txtNO_TextChanged;
            cbState.SelectedIndexChanged += cbState_SelectedIndexChanged;
            txtRemark.TextChanged        += txtRemark_TextChanged;
            dgvUV.Controls.Add(cbType);
            dgvUV.Controls.Add(txtRemark);
            dgvUV.Controls.Add(txtNO);
            dgvUV.Controls.Add(cbState);
            allVisible(false);
        }
Exemplo n.º 2
0
 public RelayExclusion(int devicetype, object obj, string strName)
 {
     InitializeComponent();
     this.DeviceType  = devicetype;
     this.MyActiveObj = obj;
     this.strNameHead = strName;
     this.bytSubID    = Convert.ToByte(strName.Split('\\')[0].ToString().Split('-')[0]);
     this.bytDevID    = Convert.ToByte(strName.Split('\\')[0].ToString().Split('-')[1]);
     #region
     oMHRCU = null;
     oRelay = null;
     if (MyActiveObj is MHRCU)
     {
         if (CsConst.myRcuMixModules != null)
         {
             foreach (MHRCU oTmp in CsConst.myRcuMixModules)
             {
                 if (oTmp.DIndex == (MyActiveObj as MHRCU).DIndex)
                 {
                     oMHRCU = oTmp;
                     break;
                 }
             }
         }
     }
     else if (MyActiveObj is Relay)
     {
         if (CsConst.myRelays != null)
         {
             foreach (Relay oTmp in CsConst.myRelays)
             {
                 if (oTmp.DIndex == (MyActiveObj as Relay).DIndex)
                 {
                     oRelay = oTmp;
                     break;
                 }
             }
         }
     }
     #endregion
     if (CsConst.iLanguageId == 1)
     {
         cl1.HeaderText = CsConst.mstrINIDefault.IniReadValue("RelayExclusion", "00000", "");
         cl2.HeaderText = CsConst.mstrINIDefault.IniReadValue("RelayExclusion", "00001", "");
         cl3.HeaderText = CsConst.mstrINIDefault.IniReadValue("RelayExclusion", "00002", "");
         cl4.HeaderText = CsConst.mstrINIDefault.IniReadValue("RelayExclusion", "00003", "");
         cl5.HeaderText = CsConst.mstrINIDefault.IniReadValue("RelayExclusion", "00004", "");
         lbHint.Text    = CsConst.mstrINIDefault.IniReadValue("RelayExclusion", "00005", "");
     }
     if (RelayDeviceTypeList.RelayThreeChnBaseWithACFunction.Contains(DeviceType))
     {
         lbHint.Visible     = false;
         chbBoxList.Visible = false;
     }
     loadInfoMation();
 }
Exemplo n.º 3
0
        public FrmACSetupForRCU(string strname, MHRCU mhrcu, int devicetype)
        {
            InitializeComponent();
            this.strName    = strname;
            this.oMHRCU     = mhrcu;
            this.DeviceType = devicetype;
            this.Text       = strName;
            string strDevName = strName.Split('\\')[0].ToString();

            SubNetID = Convert.ToByte(strDevName.Split('-')[0]);
            DeviceID = Convert.ToByte(strDevName.Split('-')[1]);
        }
Exemplo n.º 4
0
        public FrmBoundRate(byte subnetid, byte deviceid, Object rs232, bool is485)
        {
            this.SubNetID = subnetid;
            this.DeviceID = deviceid;

            if (rs232 is MHRCU)
            {
                sTmpMhrcu = (MHRCU)rs232;
            }
            else if (rs232 is RS232)
            {
                sTmpRs232 = (RS232)rs232;
            }

            this.is485Port = is485;
            InitializeComponent();
        }
Exemplo n.º 5
0
        public FrmACModeSetup(MHRCU myMHRCU, string strName, int intDeviceType)
        {
            InitializeComponent();
            this.myDevName = strName;
            string strDevName = strName.Split('\\')[0].ToString();

            this.MyintDeviceType = intDeviceType;
            this.oMHRCU          = myMHRCU;
            lbRemarkValue.Text   = strName.Split('\\')[1].ToString();
            lbSubValue.Text      = strDevName.Split('-')[0];
            lbDevValue.Text      = strDevName.Split('-')[1];
            SubNetID             = Convert.ToByte(strDevName.Split('-')[0]);
            DevID             = Convert.ToByte(strDevName.Split('-')[1]);
            cb1               = new ComboBox();
            cb1.DropDownStyle = ComboBoxStyle.DropDownList;
            cb1.Items.Clear();
            cb1.Items.Add(CsConst.mstrINIDefault.IniReadValue("Public", "99655", ""));
            cb1.Items.Add(CsConst.mstrINIDefault.IniReadValue("Public", "99656", ""));
            cb1.SelectedIndexChanged += cb1_SelectedIndexChanged;
            cb2 = new ComboBox();
            cb2.DropDownStyle = ComboBoxStyle.DropDownList;
            cb2.Items.Clear();
            cb2.Items.Add(CsConst.mstrINIDefault.IniReadValue("Public", "99655", ""));
            cb2.Items.Add(CsConst.mstrINIDefault.IniReadValue("Public", "99656", ""));
            cb2.SelectedIndexChanged += cb2_SelectedIndexChanged;
            cb3 = new ComboBox();
            cb3.DropDownStyle = ComboBoxStyle.DropDownList;
            cb3.Items.Clear();
            cb3.Items.Add(CsConst.mstrINIDefault.IniReadValue("Public", "99655", ""));
            cb3.Items.Add(CsConst.mstrINIDefault.IniReadValue("Public", "99656", ""));
            cb3.SelectedIndexChanged += cb3_SelectedIndexChanged;
            time1              = new TimeText(".");
            time1.TextChanged += time1_TextChanged;
            time2              = new TimeText(".");
            time2.TextChanged += time2_TextChanged;
            time3              = new TimeText(".");
            time3.TextChanged += time3_TextChanged;
            dgvMode.Controls.Add(cb1);
            dgvMode.Controls.Add(cb2);
            dgvMode.Controls.Add(cb3);
            dgvMode.Controls.Add(time1);
            dgvMode.Controls.Add(time2);
            dgvMode.Controls.Add(time3);
            setVisible(false);
        }
Exemplo n.º 6
0
        public FrmRS232BUSForMHRCU(string strname, MHRCU mhrcu, int devicetype, int maxcount, int type)
        {
            InitializeComponent();
            this.Type     = type;
            this.oMHRCU   = mhrcu;
            this.MaxCount = maxcount;
            string strDevName = strname.Split('\\')[0].ToString();

            strRemark            = strname.Split('\\')[1].ToString();
            SubNetID             = Convert.ToByte(strDevName.Split('-')[0]);
            DevID                = Convert.ToByte(strDevName.Split('-')[1]);
            this.MyintDeviceType = devicetype;
            #region
            cbEndChar.Items.Clear();
            cbEndChar.DropDownStyle = ComboBoxStyle.DropDownList;
            cbEndChar.Items.Add("NONE");
            cbEndChar.Items.Add("<CR>");
            cbEndChar.Items.Add("<CR+LF>");
            cbEnable.Items.Clear();
            cbEnable.DropDownStyle = ComboBoxStyle.DropDownList;
            cbEnable.Items.Add(CsConst.WholeTextsList[1775].sDisplayName);
            cbEnable.Items.Add(CsConst.mstrINIDefault.IniReadValue("public", "00042", ""));
            cb232ControlMode.Items.Clear();
            cb232ControlMode.DropDownStyle = ComboBoxStyle.DropDownList;
            cb232ControlMode.Items.Add(CsConst.mstrINIDefault.IniReadValue("Public", "99838", ""));
            cb232ControlMode.Items.Add(CsConst.mstrINIDefault.IniReadValue("Public", "99839", ""));
            cbEnable.SelectedIndexChanged         += cbEnable_SelectedIndexChanged;
            cb232ControlMode.SelectedIndexChanged += cb232ControlMode_SelectedIndexChanged;
            txt232Command.TextChanged             += txt232Command_TextChanged;
            txt232Remark.TextChanged       += txt232Remark_TextChanged;
            cbEndChar.SelectedIndexChanged += cbEndChar_SelectedIndexChanged;
            dgvCommand.Controls.Add(cb232ControlMode);
            dgvCommand.Controls.Add(cbEnable);
            dgvCommand.Controls.Add(txt232Command);
            dgvCommand.Controls.Add(txt232Remark);
            dgvCommand.Controls.Add(cbEndChar);
            #endregion
            setAllControlVisible(false);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 更新到结构体 需要则上传到设备
        /// </summary>
        void SaveButtonParametersToBuf()
        {
            if (MyActiveObject is IPModule)
            {
                #region
                IPModule TmpIpModule = (IPModule)MyActiveObject;
                if (TmpIpModule == null)
                {
                    return;
                }
                if (TmpIpModule.MyRemoteControllers == null)
                {
                    return;
                }
                if (cboController.SelectedIndex == -1)
                {
                    return;
                }
                Byte RemoteControllerID = (Byte)cboController.SelectedIndex;
                Byte PageID             = (Byte)cboPages.SelectedIndex;

                Byte[] DimEnable     = GetDataFromDataGridToPublicBuf(4);
                Byte[] SaveDimEnable = GetDataFromDataGridToPublicBuf(5);

                for (Byte bytI = 0; bytI < 8; bytI++)
                {
                    TmpIpModule.MyRemoteControllers[RemoteControllerID * IPmoduleDeviceTypeList.HowManyButtonsEachPage + bytI + PageID * 8].IsDimmer   = DimEnable[bytI];
                    TmpIpModule.MyRemoteControllers[RemoteControllerID * IPmoduleDeviceTypeList.HowManyButtonsEachPage + bytI + PageID * 8].SaveDimmer = SaveDimEnable[bytI];
                }

                if (CsConst.MyEditMode == 1)
                {
                    TmpIpModule.SaveButtonDimFlagToDeviceFrmBuf(RemoteControllerID, SubNetID, DeviceID, mywdDevicerType);
                }
                #endregion
            }
            else if (MyActiveObject is Panel)
            {
                #region
                Panel TmpPanel = (Panel)MyActiveObject;
                if (TmpPanel == null)
                {
                    return;
                }
                if (TmpPanel.PanelKey == null)
                {
                    return;
                }

                Byte PageID = 0;
                if (cboPages.Visible)
                {
                    PageID = Convert.ToByte(cboPages.SelectedIndex);
                }
                int wdMaxValue = int.Parse(CsConst.mstrINIDefault.IniReadValue("DeviceType" + mywdDevicerType.ToString(), "MaxValue", "0"));

                Byte[] ArayButtonLedBuf  = new Byte[TmpPanel.PanelKey.Count];
                Byte[] ArayButtonDim     = new Byte[TmpPanel.PanelKey.Count];
                Byte[] ArayButtonSaveDim = new Byte[TmpPanel.PanelKey.Count];
                Byte[] ArayButtonMutux   = new Byte[TmpPanel.PanelKey.Count];
                Byte[] ArayButtonLink    = new Byte[TmpPanel.PanelKey.Count];

                if (clLed.Visible == true)
                {
                    ArayButtonLedBuf = GetDataFromDataGridToPublicBuf(3);
                    for (int i = 0; i < ArayButtonLedBuf.Length; i++)
                    {
                        if (ArayButtonLedBuf[i] == 0)
                        {
                            ArayButtonLedBuf[i] = 1;
                        }
                        else
                        {
                            ArayButtonLedBuf[i] = 0;
                        }
                    }
                }

                if (ClDim.Visible == true)
                {
                    ArayButtonDim = GetDataFromDataGridToPublicBuf(4);
                }

                if (ClDimValue.Visible == true)
                {
                    ArayButtonSaveDim = GetDataFromDataGridToPublicBuf(5);
                }

                if (clMutux.Visible == true)
                {
                    ArayButtonMutux = GetDataFromDataGridToPublicBuf(6);
                }

                if (clLink.Visible == true)
                {
                    ArayButtonLink = GetDataFromDataGridToPublicBuf(7);
                }

                for (Byte bytI = 0; bytI < dgvListA.RowCount; bytI++)
                {
                    TmpPanel.PanelKey[bytI + wdMaxValue * PageID].IsDimmer   = ArayButtonDim[bytI];
                    TmpPanel.PanelKey[bytI + wdMaxValue * PageID].SaveDimmer = ArayButtonSaveDim[bytI];
                    TmpPanel.PanelKey[bytI + wdMaxValue * PageID].IsLEDON    = ArayButtonLedBuf[bytI];
                    TmpPanel.PanelKey[bytI + wdMaxValue * PageID].bytMutex   = ArayButtonMutux[bytI];
                    TmpPanel.PanelKey[bytI + wdMaxValue * PageID].byteLink   = ArayButtonLink[bytI];
                }

                if (CsConst.MyEditMode == 1)
                {
                    if (clLed.Visible == true)
                    {
                        TmpPanel.SaveButtonLEDEnableToDeviceFrmBuf(SubNetID, DeviceID, mywdDevicerType);
                    }
                    if (ClDim.Visible == true)
                    {
                        TmpPanel.SaveButtonDimFlagToDeviceFrmBuf(SubNetID, DeviceID, mywdDevicerType);
                    }
                    if (clMutux.Visible == true)
                    {
                        TmpPanel.SaveButtonMutuxToDeviceFrmBuf(SubNetID, DeviceID, mywdDevicerType);
                    }
                    if (clLink.Visible == true)
                    {
                        TmpPanel.SaveButtonLinkageToDeviceFrmBuf(SubNetID, DeviceID, mywdDevicerType);
                    }
                }
                #endregion
            }
            else if (MyActiveObject is MS04)
            {
                #region
                MS04 TmpPanel = (MS04)MyActiveObject;
                if (TmpPanel == null)
                {
                    return;
                }
                if (TmpPanel.MSKeys == null)
                {
                    return;
                }

                Byte[] ArayButtonDim     = new Byte[TmpPanel.MSKeys.Count];
                Byte[] ArayButtonSaveDim = new Byte[TmpPanel.MSKeys.Count];

                if (DryDim.Visible == true)
                {
                    ArayButtonDim = GetDataFromDataGridToPublicBuf(8);
                }

                if (ClDimValue.Visible == true)
                {
                    ArayButtonSaveDim = GetDataFromDataGridToPublicBuf(5);
                }

                for (Byte bytI = 0; bytI < TmpPanel.MSKeys.Count; bytI++)
                {
                    TmpPanel.MSKeys[bytI].IsDimmer   = ArayButtonDim[bytI];
                    TmpPanel.MSKeys[bytI].SaveDimmer = ArayButtonSaveDim[bytI];
                }

                if (CsConst.MyEditMode == 1)
                {
                    if (ClDimValue.Visible == true)
                    {
                        TmpPanel.SaveButtonDimFlagToDeviceFrmBuf(SubNetID, DeviceID, mywdDevicerType);
                    }
                    if (DryDim.Visible == true)
                    {
                        TmpPanel.SaveButtonDimDirectionsToDeviceFrmBuf(SubNetID, DeviceID, mywdDevicerType);
                    }
                }
                #endregion
            }
            else if (MyActiveObject is MHRCU)
            {
                #region
                MHRCU TmpPanel = (MHRCU)MyActiveObject;
                if (TmpPanel == null)
                {
                    return;
                }
                if (TmpPanel.MSKeys == null)
                {
                    return;
                }

                Byte[] ArayButtonDim     = new Byte[TmpPanel.MSKeys.Count];
                Byte[] ArayButtonSaveDim = new Byte[TmpPanel.MSKeys.Count];

                if (DryDim.Visible == true)
                {
                    ArayButtonDim = GetDataFromDataGridToPublicBuf(8);
                }

                if (ClDimValue.Visible == true)
                {
                    ArayButtonSaveDim = GetDataFromDataGridToPublicBuf(5);
                }

                for (Byte bytI = 0; bytI < TmpPanel.MSKeys.Count; bytI++)
                {
                    TmpPanel.MSKeys[bytI].IsDimmer   = ArayButtonDim[bytI];
                    TmpPanel.MSKeys[bytI].SaveDimmer = ArayButtonSaveDim[bytI];
                }

                if (CsConst.MyEditMode == 1)
                {
                    if (ClDimValue.Visible == true)
                    {
                        TmpPanel.SaveButtonDimFlagToDeviceFrmBuf(SubNetID, DeviceID, mywdDevicerType);
                    }
                    if (DryDim.Visible == true)
                    {
                        TmpPanel.SaveButtonDimDirectionsToDeviceFrmBuf(SubNetID, DeviceID, mywdDevicerType);
                    }
                }
                #endregion
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 刷新当前
        /// </summary>
        void RefreshButtonParametersToDataGrid()
        {
            if (MyActiveObject is IPModule)
            {
                #region
                IPModule TmpIpModule = (IPModule)MyActiveObject;
                if (TmpIpModule == null)
                {
                    return;
                }
                if (TmpIpModule.MyRemoteControllers == null)
                {
                    return;
                }
                if (cboController.SelectedIndex == -1)
                {
                    return;
                }
                Byte RemoteControllerID = (Byte)cboController.SelectedIndex;
                Byte PageID             = (Byte)cboPages.SelectedIndex;

                Byte[] ArayButtonDimAndSaveDim = TmpIpModule.ReadButtonDimFlagFrmDeviceToBuf(RemoteControllerID, SubNetID, DeviceID);

                for (Byte bytI = 0; bytI < IPmoduleDeviceTypeList.HowManyButtonsEachPage; bytI++)
                {
                    TmpIpModule.MyRemoteControllers[RemoteControllerID * IPmoduleDeviceTypeList.HowManyButtonsEachPage + bytI].IsDimmer   = (Byte)(ArayButtonDimAndSaveDim[bytI] >> 4);
                    TmpIpModule.MyRemoteControllers[RemoteControllerID * IPmoduleDeviceTypeList.HowManyButtonsEachPage + bytI].SaveDimmer = (Byte)(ArayButtonDimAndSaveDim[bytI] & 0x01);
                }
                cboPages_SelectedIndexChanged(cboPages, null);
                #endregion
            }
            else if (MyActiveObject is Panel)
            {
                #region
                Panel TmpPanel = (Panel)MyActiveObject;
                if (TmpPanel == null)
                {
                    return;
                }
                if (TmpPanel.PanelKey == null)
                {
                    return;
                }

                Byte[] ArayButtonLedBuf        = new Byte[TmpPanel.PanelKey.Count];
                Byte[] ArayButtonDimAndSaveDim = new Byte[TmpPanel.PanelKey.Count];
                Byte[] ArayButtonMutux         = new Byte[TmpPanel.PanelKey.Count];
                Byte[] ArayButtonLink          = new Byte[TmpPanel.PanelKey.Count];
                if (clLed.Visible == true)
                {
                    ArayButtonLedBuf = TmpPanel.ReadButtonLEDFrmDeviceToBuf(SubNetID, DeviceID);
                }

                if (clMutux.Visible == true)
                {
                    ArayButtonMutux = TmpPanel.ReadButtonMutuxFrmDeviceToBuf(SubNetID, DeviceID);
                }

                if (clLink.Visible == true)
                {
                    ArayButtonLink = TmpPanel.ReadButtonLinkableFrmDeviceToBuf(SubNetID, DeviceID);
                }

                if (ClDim.Visible == true)
                {
                    ArayButtonDimAndSaveDim = TmpPanel.ReadButtonDimFlagFrmDeviceToBuf(SubNetID, DeviceID);
                    for (Byte bytI = 0; bytI < TmpPanel.PanelKey.Count; bytI++)
                    {
                        TmpPanel.PanelKey[bytI].IsDimmer   = (Byte)(ArayButtonDimAndSaveDim[bytI] >> 4);
                        TmpPanel.PanelKey[bytI].SaveDimmer = (Byte)(ArayButtonDimAndSaveDim[bytI] & 0x01);
                        TmpPanel.PanelKey[bytI].IsLEDON    = ArayButtonLedBuf[bytI];
                        TmpPanel.PanelKey[bytI].bytMutex   = ArayButtonMutux[bytI];
                        TmpPanel.PanelKey[bytI].byteLink   = ArayButtonLink[bytI];
                    }
                }

                DisplayButtonParametersToGridTable();
                #endregion
            }
            else if (MyActiveObject is MS04)
            {
                #region
                MS04 TmpPanel = (MS04)MyActiveObject;
                if (TmpPanel == null)
                {
                    return;
                }
                if (TmpPanel.MSKeys == null)
                {
                    return;
                }

                Byte[] ArayButtonDimAndSaveDim = new Byte[TmpPanel.MSKeys.Count];
                Byte[] ArayButtonDimDirection  = new Byte[TmpPanel.MSKeys.Count];

                if (DryDim.Visible == true)
                {
                    ArayButtonDimDirection = TmpPanel.ReadButtonDimDirectionFrmDeviceToBuf(SubNetID, DeviceID);
                }

                if (ClDimValue.Visible == true)
                {
                    ArayButtonDimAndSaveDim = TmpPanel.ReadButtonDimFlagFrmDeviceToBuf(SubNetID, DeviceID);

                    for (Byte bytI = 0; bytI < TmpPanel.MSKeys.Count; bytI++)
                    {
                        TmpPanel.MSKeys[bytI].IsDimmer   = ArayButtonDimDirection[bytI];
                        TmpPanel.MSKeys[bytI].SaveDimmer = ArayButtonDimAndSaveDim[bytI];
                    }
                }

                DisplayButtonParametersToGridTable();
                #endregion
            }
            else if (MyActiveObject is MHRCU)
            {
                #region
                MHRCU TmpPanel = (MHRCU)MyActiveObject;
                if (TmpPanel == null)
                {
                    return;
                }
                if (TmpPanel.MSKeys == null)
                {
                    return;
                }

                Byte[] ArayButtonDimAndSaveDim = new Byte[TmpPanel.MSKeys.Count];
                Byte[] ArayButtonDimDirection  = new Byte[TmpPanel.MSKeys.Count];

                if (DryDim.Visible == true)
                {
                    ArayButtonDimDirection = TmpPanel.ReadButtonDimDirectionFrmDeviceToBuf(SubNetID, DeviceID);
                }

                if (ClDimValue.Visible == true)
                {
                    ArayButtonDimAndSaveDim = TmpPanel.ReadButtonDimFlagFrmDeviceToBuf(SubNetID, DeviceID);

                    for (Byte bytI = 0; bytI < TmpPanel.MSKeys.Count; bytI++)
                    {
                        TmpPanel.MSKeys[bytI].IsDimmer   = ArayButtonDimDirection[bytI];
                        TmpPanel.MSKeys[bytI].SaveDimmer = ArayButtonDimAndSaveDim[bytI];
                    }
                }

                DisplayButtonParametersToGridTable();
                #endregion
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 不同类型显示到界面
        /// </summary>
        void DisplayButtonParametersToGridTable()
        {
            if (MyActiveObject is IPModule)
            {
                #region
                IPModule TmpIpModule = (IPModule)MyActiveObject;
                if (TmpIpModule == null)
                {
                    return;
                }
                if (cboController.SelectedIndex == -1)
                {
                    return;
                }
                if (cboPages.SelectedIndex == -1)
                {
                    return;
                }
                dgvListA.Rows.Clear();
                Byte ControllerID = Convert.ToByte(cboController.SelectedIndex);
                Byte PageID       = Convert.ToByte(cboPages.SelectedIndex);

                for (int i = 0; i < 8; i++)
                {
                    HDLButton obutton = TmpIpModule.MyRemoteControllers[ControllerID * 64 + PageID * 8 + i];
                    if (obutton == null)
                    {
                        obutton = new HDLButton();
                    }
                    String   ButtonModeTmp = ButtonMode.ConvertorKeyModeToPublicModeGroup(obutton.Mode);
                    Object[] obj           = new object[] { (i + 1).ToString(), obutton.Remark, ButtonModeTmp, (obutton.IsLEDON == 1), (obutton.IsDimmer == 1),
                                                            (obutton.SaveDimmer == 1), clMutux.Items[obutton.bytMutex], clLink.Items[obutton.byteLink] };
                    dgvListA.Rows.Add(obj);
                }
                #endregion
            }
            else if (MyActiveObject is DLP) //
            {
                Panel TmpPanel = (Panel)MyActiveObject;
                if (TmpPanel == null)
                {
                    return;
                }

                dgvListA.Rows.Clear();
                Byte PageID     = Convert.ToByte(cboPages.SelectedIndex);
                int  wdMaxValue = int.Parse(CsConst.mstrINIDefault.IniReadValue("DeviceType" + mywdDevicerType.ToString(), "MaxValue", "0"));
                for (int i = 0; i < 8; i++)
                {
                    HDLButton obutton = TmpPanel.PanelKey[PageID * 8 + i];
                    if (obutton == null)
                    {
                        obutton = new HDLButton();
                    }
                    String   ButtonModeTmp = ButtonMode.ConvertorKeyModeToPublicModeGroup(obutton.Mode);
                    Object[] obj           = new object[] { (i + 1).ToString(), obutton.Remark, ButtonModeTmp, (obutton.IsLEDON == 0), (obutton.IsDimmer == 1),
                                                            (obutton.SaveDimmer == 1), clMutux.Items[obutton.bytMutex], clLink.Items[obutton.byteLink] };
                    dgvListA.Rows.Add(obj);
                }
            }
            else if (MyActiveObject is Panel)
            {
                #region
                Panel TmpPanel = (Panel)MyActiveObject;
                if (TmpPanel == null)
                {
                    return;
                }

                dgvListA.Rows.Clear();

                for (int i = 0; i < TmpPanel.PanelKey.Count; i++)
                {
                    HDLButton obutton = TmpPanel.PanelKey[i];
                    if (obutton == null)
                    {
                        obutton = new HDLButton();
                    }
                    String ButtonModeTmp = ButtonMode.ConvertorKeyModeToPublicModeGroup(obutton.Mode);
                    if (obutton.bytMutex >= clMutux.Items.Count)
                    {
                        obutton.bytMutex = (Byte)(clMutux.Items.Count - 1);
                    }
                    Object[] obj = new object[] { (i + 1).ToString(), obutton.Remark, ButtonModeTmp, (obutton.IsLEDON == 0), (obutton.IsDimmer == 1),
                                                  (obutton.SaveDimmer == 1), clMutux.Items[obutton.bytMutex], clLink.Items[obutton.byteLink] };
                    dgvListA.Rows.Add(obj);
                }
                #endregion
            }
            else if (MyActiveObject is MS04)
            {
                #region
                MS04 TmpPanel = (MS04)MyActiveObject;
                if (TmpPanel == null)
                {
                    return;
                }

                dgvListA.Rows.Clear();

                for (int i = 0; i < TmpPanel.MSKeys.Count; i++)
                {
                    HDLButton obutton = TmpPanel.MSKeys[i];
                    if (obutton == null)
                    {
                        obutton = new HDLButton();
                    }
                    String   ButtonModeTmp = DryMode.ConvertorKeyModeToPublicModeGroup(obutton.Mode);
                    Object[] obj           = new object[] { (i + 1).ToString(), obutton.Remark, ButtonModeTmp, (obutton.IsLEDON == 0), (obutton.IsDimmer == 1),
                                                            (obutton.SaveDimmer == 1), clMutux.Items[obutton.bytMutex], clLink.Items[obutton.byteLink], DryDim.Items[obutton.IsDimmer] };
                    dgvListA.Rows.Add(obj);
                }
                #endregion
            }
            else if (MyActiveObject is MHRCU)
            {
                #region
                MHRCU TmpPanel = (MHRCU)MyActiveObject;
                if (TmpPanel == null)
                {
                    return;
                }

                dgvListA.Rows.Clear();

                for (int i = 0; i < TmpPanel.MSKeys.Count; i++)
                {
                    HDLButton obutton = TmpPanel.MSKeys[i];
                    if (obutton == null)
                    {
                        obutton = new HDLButton();
                    }
                    String   ButtonModeTmp = DryMode.ConvertorKeyModeToPublicModeGroup(obutton.Mode);
                    Object[] obj           = new object[] { (i + 1).ToString(), obutton.Remark, ButtonModeTmp, (obutton.IsLEDON == 0), (obutton.IsDimmer == 1),
                                                            (obutton.SaveDimmer == 1), clMutux.Items[obutton.bytMutex], clLink.Items[obutton.byteLink], DryDim.Items[obutton.IsDimmer] };
                    dgvListA.Rows.Add(obj);
                }
                #endregion
            }
        }