private void SetCount(List <ILEDDisplayInfo> oneLedInfos, string sn, byte bcount, out SerializableDictionary <string, byte> mcInfo) { mcInfo = new SerializableDictionary <string, byte>(); ScanBoardRegionInfo sbRegionInfo = null; string sbAddr = ""; if (oneLedInfos == null || oneLedInfos.Count == 0) { return; } foreach (ILEDDisplayInfo led in oneLedInfos) { if (led == null || led.ScannerCount <= 0) { continue; } for (int n = 0; n < led.ScannerCount; n++) { sbRegionInfo = led[n]; if (sbRegionInfo == null || sbRegionInfo.SenderIndex == 255) { continue; } sbAddr = GetSBAddr(sn, sbRegionInfo.SenderIndex, sbRegionInfo.PortIndex, sbRegionInfo.ConnectIndex); mcInfo.Add(sbAddr, bcount); } } }
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(); } }
private void SetAutoReader(string sn, string comName, ILEDDisplayInfo scrInfo, List <SenderRedundancyInfo> reduInfoList) { if (string.IsNullOrEmpty(comName) || string.IsNullOrEmpty(sn) || scrInfo == null) { return; } ScannerPropertyReader scan = new ScannerPropertyReader(_serverProxy, comName); ScanBoardRegionInfo scanBoard = null; scrInfo.GetFirstScanBoardInList(out scanBoard); if (scanBoard != null) { ScanBoardPosition pos = new ScanBoardPosition(); pos.SenderIndex = scanBoard.SenderIndex; pos.PortIndex = scanBoard.PortIndex; pos.ScanBdIndex = scanBoard.ConnectIndex; ScanBoardPosition posSlave = new ScanBoardPosition(); if (reduInfoList != null) { for (int j = 0; j < reduInfoList.Count; j++) { if (reduInfoList[j].MasterSenderIndex == scanBoard.SenderIndex && reduInfoList[j].MasterPortIndex == scanBoard.PortIndex) { posSlave.SenderIndex = reduInfoList[j].SlaveSenderIndex; posSlave.PortIndex = reduInfoList[j].SlavePortIndex; posSlave.ScanBdIndex = scanBoard.ConnectIndex; } } } lock (_lockObj) { _sn_ScannerInfos.Add(new SN_ScannerPropertyReader() { SN = sn, ScannerProperty = scan, ScanPosition = pos, ScanRedundancyPosition = posSlave }); } } if (_sn_ScannerInfos != null && _sn_ScannerInfos.Count == 1) { if (_sn_BrightSensors == null) { _sn_BrightSensors = new Dictionary <string, List <PeripheralsLocation> >(); } _autoTimer.Change(_interval, _interval); } }
private void RemoveCountInfoForOther() { if (_oneLedInfos != null && _oneLedInfos.Count > 0) { List <string> addrTempList = new List <string>(); string addr = ""; ScanBoardRegionInfo scanBoardTempInfo = null; foreach (ILEDDisplayInfo led in _oneLedInfos) { if (led == null) { continue; } for (int j = 0; j < led.ScannerCount; j++) { if (led[j] == null || led[j].SenderIndex == 255) { continue; } scanBoardTempInfo = (ScanBoardRegionInfo)led[j].Clone(); addr = StaticFunction.GetSBAddr(_commPort, scanBoardTempInfo.SenderIndex, scanBoardTempInfo.PortIndex, scanBoardTempInfo.ConnectIndex); addrTempList.Add(addr); } } List <string> otherScanBoardAddrList = new List <string>(); foreach (string key in _curConfigDic.Keys) { if (!addrTempList.Contains(key)) { otherScanBoardAddrList.Add(key); } } for (int i = 0; i < otherScanBoardAddrList.Count; i++) { _curConfigDic.Remove(otherScanBoardAddrList[i]); } } }
private void crystalButton_Resume_Click(object sender, EventArgs e) { string info = Frm_FanPowerAdvanceSetting.GetLangControlText("WhetherSetDefaultValue", "确认需要将当前显示屏的监控信息设置为默认值?"); if (CustomMessageBox.ShowTopMostCustomMessageBox(this.ParentForm, info, "", MessageBoxButtons.YesNo, MessageBoxIconType.Question) == DialogResult.No) { return; } if (_ledType == LEDDisplyType.ComplexType) { _complexLayout.ResumeDefaultCount(_commonInfo.SameCount); } else { for (int i = 0; i < _curLedInf.ScannerCount; i++) { _scanBoardTempInfo = (ScanBoardRegionInfo)_curLedInf[i].Clone(); _tempAddr = StaticFunction.GetSBAddr(_commPort, _scanBoardTempInfo.SenderIndex, _scanBoardTempInfo.PortIndex, _scanBoardTempInfo.ConnectIndex); _tempCustomInfo = new SetCustomObjInfo(); _tempCustomInfo.Count = _commonInfo.SameCount; _tempCustomInfo.ScanBordInfo = _scanBoardTempInfo; _standarAndSimpleLayout.GridDic[_tempAddr].CustomObj = _tempCustomInfo; _curSettingDic[_tempAddr] = _commonInfo.SameCount; if (_setOneScanBoardInfoEvent != null) { _setOneScanBoardInfoEvent.Invoke(_tempAddr, _commonInfo.SameCount); } } _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 GetScanBoardInPosition(ILEDDisplayInfo displayInfo, ScanBoardRegionInfo info, ref int cols, ref int rows, ref bool isComplex) { isComplex = false; if (displayInfo is SimpleLEDDisplayInfo) { SimpleLEDDisplayInfo simpleLED = (SimpleLEDDisplayInfo)displayInfo; for (int m = 0; m < simpleLED.ScanBdCols; m++) { for (int n = 0; n < simpleLED.ScanBdRows; n++) { ScanBoardRegionInfo data = simpleLED[m, n]; if (data.CompareTo(info) == 0) { cols = m; rows = n; return; } } } } else if (displayInfo is StandardLEDDisplayInfo) { StandardLEDDisplayInfo StandardLED = (StandardLEDDisplayInfo)displayInfo; for (int m = 0; m < StandardLED.ScanBoardCols; m++) { for (int n = 0; n < StandardLED.ScanBoardRows; n++) { ScanBoardRegionInfo data = StandardLED[m, n]; if (data.CompareTo(info) == 0) { cols = m; rows = n; return; } } } } else { isComplex = true; } }
/// <summary> /// ����һ�����տ��е���ʾ�ַ����ͱ�����ɫ /// </summary> /// <param name="index"></param> /// <param name="backClr"></param> /// <param name="displayStr"></param> /// <param name="ScanBordInfo"></param> private void UpdateOneScanBoardInfo(int index, Color backClr, string displayStr, ScanBoardRegionInfo ScanBordInfo) { dbfDataGridView_ComplexScreenInfo[0, index].Style.BackColor = backClr; dbfDataGridView_ComplexScreenInfo[0, index].Style.SelectionBackColor = backClr; dbfDataGridView_ComplexScreenInfo.Rows[index].SetValues(new object[] { displayStr, (ScanBordInfo.SenderIndex + 1), (ScanBordInfo.PortIndex+ 1), (ScanBordInfo.ConnectIndex+ 1), ScanBordInfo.X, ScanBordInfo.Y, ScanBordInfo.Width, ScanBordInfo.Height }); }
private void OnCmdShowSendDisplayInfoDlg() { if (_globalParams != null) { _globalParams.IsSendCurrentDisplayConfig = true; _globalParams.CurrentDisplayInfoList = new List<ILEDDisplayInfo>(); #region 屏体信息 List<ILEDDisplayInfo> ledInfoList = new List<ILEDDisplayInfo>(); for (int i = 0; i < MyScreen.ElementCollection.Count; i++) { if (MyScreen.ElementCollection[i].ConnectedIndex == -1) { continue; } ComplexLEDDisplayInfo info = new ComplexLEDDisplayInfo(); List<RectElement> receiveList = new List<RectElement>(); receiveList = FindRect((RectLayer)MyScreen.ElementCollection[i]); for (int j = 0; j < receiveList.Count; j++) { ScanBoardRegionInfo receiveInfo = new ScanBoardRegionInfo(); receiveInfo.Height = (ushort)receiveList[j].Height; receiveInfo.Width = (ushort)receiveList[j].Width; receiveInfo.ConnectIndex = (ushort)receiveList[j].ConnectedIndex; int portIndex = receiveList[j].ParentElement.ConnectedIndex; receiveInfo.PortIndex = (byte)portIndex; int senderIndex = receiveList[j].ParentElement.ParentElement.ConnectedIndex; receiveInfo.SenderIndex = (byte)senderIndex; receiveInfo.X = (ushort)receiveList[j].X; receiveInfo.Y = (ushort)receiveList[j].Y; RectLayer parent = new RectLayer(); parent = (RectLayer)receiveList[j].ParentElement; while (parent.ParentElement != null) { receiveInfo.X += (ushort)parent.X; receiveInfo.Y += (ushort)parent.Y; parent = (RectLayer)parent.ParentElement; } receiveInfo.XInPort = (ushort)receiveList[j].X; receiveInfo.YInPort = (ushort)receiveList[j].Y; info.ScanBoardRegionInfoList.Add(receiveInfo); } ledInfoList.Add(info); } #endregion _globalParams.CurrentDisplayInfoList = GetLedDisplayInfoList(); Messenger.Default.Send<string>("", MsgToken.MSG_SHOWEQUIPMENTMANAGER); } }
/// <summary> /// 获取每个显示屏的接收卡位置 /// </summary> /// <returns></returns> private List<ILEDDisplayInfo> GetLedDisplayInfoList() { List<ILEDDisplayInfo> ledDisplayInfoList = new List<ILEDDisplayInfo>(); int currentSenderIndex; int senderCount = Function.FindSenderCount(MyScreen.SenderConnectInfoList, out currentSenderIndex); //获取每个屏里接收卡相对于发送卡的位置坐标 for (int screenIndex = 0; screenIndex < MyScreen.ElementCollection.Count; screenIndex++) { if (MyScreen.ElementCollection[screenIndex].EleType == ElementType.newLayer) { continue; } ComplexLEDDisplayInfo ledDisplayInfo = new ComplexLEDDisplayInfo(); RectLayer screen = (RectLayer)((RectLayer)MyScreen.ElementCollection[screenIndex]).ElementCollection[0]; ObservableCollection<SenderConnectInfo> senderConnectInfoList = screen.SenderConnectInfoList; for (int senderIndex = 0; senderIndex < senderConnectInfoList.Count; senderIndex++) { SenderConnectInfo senderConnectInfo = senderConnectInfoList[senderIndex]; Rect senderLoadSize = senderConnectInfo.LoadSize; Point mapLocation = new Point(); for (int portIndex = 0; portIndex < senderConnectInfo.PortConnectInfoList.Count; portIndex++) { int connectIndexGlobal = 0; for (int sIndex = 0; sIndex < screenIndex; sIndex++) { ObservableCollection<IRectElement> cList = ((RectLayer)((RectLayer)MyScreen.ElementCollection[sIndex]).ElementCollection[0]).SenderConnectInfoList[senderIndex].PortConnectInfoList[portIndex].ConnectLineElementList; if (cList != null && cList.Count != 0) { connectIndexGlobal += cList.Count; } } ObservableCollection<IRectElement> scanBdCollection = senderConnectInfo.PortConnectInfoList[portIndex].ConnectLineElementList; if (scanBdCollection == null || scanBdCollection.Count == 0) { continue; } //connectIndex的值不是连续的,所以排个序才能知道先后 List<IRectElement> scanBdList = new List<IRectElement>(); for (int scanIndex = 0; scanIndex < scanBdCollection.Count; scanIndex++) { scanBdList.Add(scanBdCollection[scanIndex]); } scanBdList.Sort(delegate(IRectElement first, IRectElement second) { return first.ConnectedIndex.CompareTo(second.ConnectedIndex); }); //if (senderCount > 1) //{ mapLocation = senderConnectInfo.PortConnectInfoList[portIndex].MapLocation; //} for (int scanBdIndex = 0; scanBdIndex < scanBdList.Count; scanBdIndex++) { IRectElement scanBdElement = scanBdList[scanBdIndex]; ScanBoardRegionInfo scanBdInfo = new ScanBoardRegionInfo(); scanBdInfo.SenderIndex = (byte)scanBdElement.SenderIndex; scanBdInfo.PortIndex = (byte)(scanBdElement.PortIndex); scanBdInfo.ConnectIndex = (ushort)(scanBdIndex + connectIndexGlobal); scanBdInfo.Width = (ushort)scanBdElement.Width; scanBdInfo.Height = (ushort)scanBdElement.Height; scanBdInfo.X = (ushort)(scanBdElement.X - senderLoadSize.Left + mapLocation.X); scanBdInfo.Y = (ushort)(scanBdElement.Y - senderLoadSize.Top + mapLocation.Y); ledDisplayInfo.ScanBoardRegionInfoList.Add(scanBdInfo); } } } if (ledDisplayInfo.ScanBoardRegionInfoList.Count != 0) { ledDisplayInfoList.Add(ledDisplayInfo); } } return ledDisplayInfoList; }
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(); } }
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_Resume_Click(object sender, EventArgs e) { string info = Frm_FanPowerAdvanceSetting.GetLangControlText("WhetherSetDefaultValue", "ȷ����Ҫ����ǰ��ʾ���ļ����Ϣ����ΪĬ��ֵ?"); if (CustomMessageBox.ShowTopMostCustomMessageBox(this.ParentForm, info, "", MessageBoxButtons.YesNo, MessageBoxIconType.Question) == DialogResult.No) { return; } if (_ledType == LEDDisplyType.ComplexType) { _complexLayout.ResumeDefaultCount(_commonInfo.SameCount); } else { for (int i = 0; i < _curLedInf.ScannerCount; i++) { _scanBoardTempInfo = (ScanBoardRegionInfo)_curLedInf[i].Clone(); _tempAddr = StaticFunction.GetSBAddr(_commPort, _scanBoardTempInfo.SenderIndex, _scanBoardTempInfo.PortIndex, _scanBoardTempInfo.ConnectIndex); _tempCustomInfo = new SetCustomObjInfo(); _tempCustomInfo.Count = _commonInfo.SameCount; _tempCustomInfo.ScanBordInfo = _scanBoardTempInfo; _standarAndSimpleLayout.GridDic[_tempAddr].CustomObj = _tempCustomInfo; _curSettingDic[_tempAddr] = _commonInfo.SameCount; if (_setOneScanBoardInfoEvent != null) { _setOneScanBoardInfoEvent.Invoke(_tempAddr, _commonInfo.SameCount); } } _standarAndSimpleLayout.InvalidateDrawArea(); } }
private ScannerMonitorData GetScannerMonitorDataFromScannerMDict(Dictionary<string, ScannerMonitorData> monitorDict, ScanBoardRegionInfo regionInfo) { string scannerFlag = GetScannerNameFlag(regionInfo); if (monitorDict != null && monitorDict.ContainsKey(scannerFlag)) { return monitorDict[scannerFlag]; } else { return null; } }
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 string GetScannerNameFlag(ScanBoardRegionInfo regionInfo) { return regionInfo.SenderIndex + "-" + regionInfo.PortIndex + "-" + regionInfo.ConnectIndex; }