private void StandarAndSimpleLayout_GridMouseDoubleClick(object sender, RectangularGridMouseEventArgs e)
        {
            if (e.GridInfo == null)
            {
                return;
            }
            _tempCustomInfo = (SetCustomObjInfo)e.GridInfo.CustomObj;
            if (_tempCustomInfo == null)
            {
                return;
            }
            _scanBoardTempInfo = (ScanBoardRegionInfo)_tempCustomInfo.ScanBordInfo.Clone();
            _tempCnt           = _tempCustomInfo.Count;

            _setInfoFrm = new Frm_SetInfo(_commonInfo.TypeStr, _tempCnt, _commonInfo.MaxCount);

            if (_setInfoFrm.ShowDialog() == DialogResult.OK)
            {
                _tempCustomInfo.Count = _setInfoFrm.Count;


                _tempAddr = StaticFunction.GetSBAddr(_commPort,
                                                     _scanBoardTempInfo.SenderIndex,
                                                     _scanBoardTempInfo.PortIndex,
                                                     _scanBoardTempInfo.ConnectIndex);

                _standarAndSimpleLayout.GridDic[_tempAddr].CustomObj = _tempCustomInfo;
                _curSettingDic[_tempAddr] = _setInfoFrm.Count;

                if (_setOneScanBoardInfoEvent != null)
                {
                    _setOneScanBoardInfoEvent.Invoke(_tempAddr, _setInfoFrm.Count);
                }
                _standarAndSimpleLayout.InvalidateDrawArea();
            }
        }
        private void StandarAndSimpleLayout_GridMouseDoubleClick(object sender, RectangularGridMouseEventArgs e)
        {
            if (e.GridInfo == null)
            {
                return;
            }
            _tempCustomInfo = (SetCustomObjInfo)e.GridInfo.CustomObj;
            if (_tempCustomInfo == null)
            {
                return;
            }
            _scanBoardTempInfo = (ScanBoardRegionInfo)_tempCustomInfo.ScanBordInfo.Clone();
            _tempCnt = _tempCustomInfo.Count;

            _setInfoFrm = new Frm_SetInfo(_commonInfo.TypeStr, _tempCnt, _commonInfo.MaxCount);

            if (_setInfoFrm.ShowDialog() == DialogResult.OK)
            {
                _tempCustomInfo.Count = _setInfoFrm.Count;

                _tempAddr = StaticFunction.GetSBAddr(_commPort,
                                                     _scanBoardTempInfo.SenderIndex,
                                                      _scanBoardTempInfo.PortIndex,
                                                      _scanBoardTempInfo.ConnectIndex);

                _standarAndSimpleLayout.GridDic[_tempAddr].CustomObj = _tempCustomInfo;
                _curSettingDic[_tempAddr] = _setInfoFrm.Count;

                if (_setOneScanBoardInfoEvent != null)
                {
                    _setOneScanBoardInfoEvent.Invoke(_tempAddr, _setInfoFrm.Count);
                }
                _standarAndSimpleLayout.InvalidateDrawArea();
            }
        }
        private void crystalButton_SetSelect_Click(object sender, EventArgs e)
        {
            if (_ledType == LEDDisplyType.ComplexType)
            {
                if (_complexLayout.SelectedItemRowsItems.Count <= 0)
                {
                    string info = Frm_FanPowerAdvanceSetting.GetLangControlText("PleaseSelectScanBoard", "��ѡ����Ҫ���õĽ��տ�!");
                    CustomMessageBox.ShowTopMostCustomMessageBox(this.ParentForm, info, "",
                                                          MessageBoxButtons.OK, MessageBoxIconType.Alert);
                    return;
                }
                if (_complexLayout.SelectedItemRowsItems.Count == 1)
                {
                    bool bGetRes = _complexLayout.GetCountByRowIndex(_complexLayout.SelectedItemRowsItems[0].Index,
                                                                     out _tempCnt);
                }
                else
                {
                    _tempCnt = _commonInfo.SameCount;
                }

                _setInfoFrm = new Frm_SetInfo(_commonInfo.TypeStr, _tempCnt, _commonInfo.MaxCount);

                if (_setInfoFrm.ShowDialog() == DialogResult.OK)
                {
                    _complexLayout.SetCountForSelectedItems(_setInfoFrm.Count);
                }
            }
            else
            {
                if (_standarAndSimpleLayout.SelectedGrid == null
                   || _standarAndSimpleLayout.SelectedGrid.Count <= 0)
                {
                    string info = Frm_FanPowerAdvanceSetting.GetLangControlText("PleaseSelectScanBoard", "��ѡ����Ҫ���õĽ��տ�!");
                    CustomMessageBox.ShowTopMostCustomMessageBox(this.ParentForm, info, "",
                                                          MessageBoxButtons.OK, MessageBoxIconType.Alert);
                    return;
                }
                if (_standarAndSimpleLayout.SelectedGrid.Count == 1)
                {
                    _tempCustomInfo = (SetCustomObjInfo)_standarAndSimpleLayout.SelectedGrid[0].CustomObj;
                    if (_tempCustomInfo == null)
                    {
                        return;
                    }
                    _tempCnt = _tempCustomInfo.Count;
                }
                else
                {
                    _tempCnt = _commonInfo.SameCount;
                }

                _setInfoFrm = new Frm_SetInfo(_commonInfo.TypeStr, _tempCnt, _commonInfo.MaxCount);

                if (_setInfoFrm.ShowDialog() == DialogResult.OK)
                {
                    for (int i = 0; i < _standarAndSimpleLayout.SelectedGrid.Count; i++)
                    {
                        _tempCustomInfo = (SetCustomObjInfo)_standarAndSimpleLayout.SelectedGrid[i].CustomObj;
                        if (_tempCustomInfo == null)
                        {
                            continue;
                        }
                        _scanBoardTempInfo = (ScanBoardRegionInfo)_tempCustomInfo.ScanBordInfo.Clone();
                        _tempCustomInfo.Count = _setInfoFrm.Count;
                        _standarAndSimpleLayout.SelectedGrid[i].CustomObj = _tempCustomInfo;

                        _tempAddr = StaticFunction.GetSBAddr(_commPort,
                                                              _scanBoardTempInfo.SenderIndex,
                                                            _scanBoardTempInfo.PortIndex,
                                                            _scanBoardTempInfo.ConnectIndex);

                        _curSettingDic[_tempAddr] = _setInfoFrm.Count;

                        if (_setOneScanBoardInfoEvent != null)
                        {
                            _setOneScanBoardInfoEvent.Invoke(_tempAddr, _setInfoFrm.Count);
                        }
                    }
                    _standarAndSimpleLayout.InvalidateDrawArea();
                }
            }
        }
        private void crystalButton_SetSelect_Click(object sender, EventArgs e)
        {
            if (_ledType == LEDDisplyType.ComplexType)
            {
                if (_complexLayout.SelectedItemRowsItems.Count <= 0)
                {
                    string info = Frm_FanPowerAdvanceSetting.GetLangControlText("PleaseSelectScanBoard", "请选中需要设置的接收卡!");
                    CustomMessageBox.ShowTopMostCustomMessageBox(this.ParentForm, info, "",
                                                                 MessageBoxButtons.OK, MessageBoxIconType.Alert);
                    return;
                }
                if (_complexLayout.SelectedItemRowsItems.Count == 1)
                {
                    bool bGetRes = _complexLayout.GetCountByRowIndex(_complexLayout.SelectedItemRowsItems[0].Index,
                                                                     out _tempCnt);
                }
                else
                {
                    _tempCnt = _commonInfo.SameCount;
                }

                _setInfoFrm = new Frm_SetInfo(_commonInfo.TypeStr, _tempCnt, _commonInfo.MaxCount);

                if (_setInfoFrm.ShowDialog() == DialogResult.OK)
                {
                    _complexLayout.SetCountForSelectedItems(_setInfoFrm.Count);
                }
            }
            else
            {
                if (_standarAndSimpleLayout.SelectedGrid == null ||
                    _standarAndSimpleLayout.SelectedGrid.Count <= 0)
                {
                    string info = Frm_FanPowerAdvanceSetting.GetLangControlText("PleaseSelectScanBoard", "请选中需要设置的接收卡!");
                    CustomMessageBox.ShowTopMostCustomMessageBox(this.ParentForm, info, "",
                                                                 MessageBoxButtons.OK, MessageBoxIconType.Alert);
                    return;
                }
                if (_standarAndSimpleLayout.SelectedGrid.Count == 1)
                {
                    _tempCustomInfo = (SetCustomObjInfo)_standarAndSimpleLayout.SelectedGrid[0].CustomObj;
                    if (_tempCustomInfo == null)
                    {
                        return;
                    }
                    _tempCnt = _tempCustomInfo.Count;
                }
                else
                {
                    _tempCnt = _commonInfo.SameCount;
                }

                _setInfoFrm = new Frm_SetInfo(_commonInfo.TypeStr, _tempCnt, _commonInfo.MaxCount);

                if (_setInfoFrm.ShowDialog() == DialogResult.OK)
                {
                    for (int i = 0; i < _standarAndSimpleLayout.SelectedGrid.Count; i++)
                    {
                        _tempCustomInfo = (SetCustomObjInfo)_standarAndSimpleLayout.SelectedGrid[i].CustomObj;
                        if (_tempCustomInfo == null)
                        {
                            continue;
                        }
                        _scanBoardTempInfo    = (ScanBoardRegionInfo)_tempCustomInfo.ScanBordInfo.Clone();
                        _tempCustomInfo.Count = _setInfoFrm.Count;
                        _standarAndSimpleLayout.SelectedGrid[i].CustomObj = _tempCustomInfo;

                        _tempAddr = StaticFunction.GetSBAddr(_commPort,
                                                             _scanBoardTempInfo.SenderIndex,
                                                             _scanBoardTempInfo.PortIndex,
                                                             _scanBoardTempInfo.ConnectIndex);

                        _curSettingDic[_tempAddr] = _setInfoFrm.Count;

                        if (_setOneScanBoardInfoEvent != null)
                        {
                            _setOneScanBoardInfoEvent.Invoke(_tempAddr, _setInfoFrm.Count);
                        }
                    }
                    _standarAndSimpleLayout.InvalidateDrawArea();
                }
            }
        }