private void UpdateDisplay() { if (_ledType == LEDDisplyType.ComplexType) { for (int i = 0; i < _curLedInf.ScannerCount; i++) { _scanBoardTempInfo = (ScanBoardRegionInfo)_curLedInf[i].Clone(); _tempAddr = StaticFunction.GetSBAddr(_commPort, _scanBoardTempInfo.SenderIndex, _scanBoardTempInfo.PortIndex, _scanBoardTempInfo.ConnectIndex); if (!_curSettingDic.ContainsKey(_tempAddr)) { _curSettingDic.Add(_tempAddr, _commonInfo.SameCount); if (_setOneScanBoardInfoEvent != null) { _setOneScanBoardInfoEvent.Invoke(_tempAddr, _commonInfo.SameCount); } } _complexLayout.AddOneMonitorCardInf(_tempAddr, _curSettingDic[_tempAddr]); } } else { Point screenLocation = _curLedInf.GetScreenPosition(); for (int i = 0; i < _curLedInf.ScannerCount; i++) { if (_curLedInf[i] == null || _curLedInf[i].SenderIndex == 255) { continue; } _scanBoardTempInfo = (ScanBoardRegionInfo)_curLedInf[i].Clone(); _tempAddr = StaticFunction.GetSBAddr(_commPort, _scanBoardTempInfo.SenderIndex, _scanBoardTempInfo.PortIndex, _scanBoardTempInfo.ConnectIndex); _tempRect = new Rectangle(_scanBoardTempInfo.X - screenLocation.X, _scanBoardTempInfo.Y - screenLocation.Y, _scanBoardTempInfo.Width, _scanBoardTempInfo.Height); if (!_curSettingDic.ContainsKey(_tempAddr)) { _curSettingDic.Add(_tempAddr, _commonInfo.SameCount); if (_setOneScanBoardInfoEvent != null) { _setOneScanBoardInfoEvent.Invoke(_tempAddr, _commonInfo.SameCount); } } _tempCustomInfo = new SetCustomObjInfo(); _tempCustomInfo.ScanBordInfo = _scanBoardTempInfo; _tempCustomInfo.Count = _curSettingDic[_tempAddr]; _standarAndSimpleLayout.AddRectangularGrid(_tempRect, _tempAddr, _tempCustomInfo); } _standarAndSimpleLayout.InvalidateDrawArea(); } }
/// <summary> /// 恢复所有默认个数 /// </summary> /// <param name="count"></param> /// <returns></returns> public bool ResumeDefaultCount(byte count) { if (count > CountArray.Length) { return(false); } DataGridViewDisableComboBoxCell comBoxCell = null; bool isConnect = false; int nIndex = 0; if (count > 0) { isConnect = true; } else { isConnect = false; } for (int i = 0; i < dbfDataGridView_ComplexLayout.Rows.Count; i++) { comBoxCell = dbfDataGridView_ComplexLayout[(int)ColType.Count, i] as DataGridViewDisableComboBoxCell; _countList[i] = count; if (isConnect) { comBoxCell.Value = count.ToString(); } comBoxCell.Enabled = isConnect; dbfDataGridView_ComplexLayout[(int)ColType.IsConnect, i].Value = isConnect; if (SetComplexScreenInfEvent != null) { SetComplexScreenInfEvent.Invoke(_addrList[nIndex], _countList[nIndex]); } } dbfDataGridView_ComplexLayout.Refresh(); return(true); }