private LedBasicInfo DataConverter(ScreenInfo sInfo) { if (sInfo == null) return null; LedBasicInfo lInfo = new LedBasicInfo(); lInfo.Width = sInfo.LedWidth; lInfo.Height = sInfo.LedHeight; lInfo.Sn = sInfo.LedSN; lInfo.PointCount = sInfo.PointCount; lInfo.LedIndexOfCom = sInfo.LedIndexOfCom; lInfo.Commport = sInfo.Commport; lInfo.IsSupportPointDetect = sInfo.IsSupportPointDetect; lInfo.PartInfos = new List<PartInfo>(); lInfo.PartInfos.Add(new PartInfo() { Type = DeviceType.SendCard, Amount = sInfo.SenderCardCount }); lInfo.PartInfos.Add(new PartInfo() { Type = DeviceType.ReceiverCard, Amount = sInfo.ScannerCardCount }); lInfo.PartInfos.Add(new PartInfo() { Type = DeviceType.MonitoringCard, Amount = sInfo.MonitorCardCount }); return lInfo; }
public List<ScreenInfo> GetAllScreenInfo() { _fLogService.Info("Mars Start Read Screen..."); if (_serverProxy == null || !_serverProxy.IsRegisted) { _fLogService.Error("Server is null..."); SendStatusMsg("NoScreenInfo"); _reReadScreenTimer.Change(10000, 10000); return null; } List<ScreenInfo> scrInfoList = new List<ScreenInfo>(); if (_allComBaseInfo == null || _allComBaseInfo.AllInfoDict == null) { _fLogService.Error("Get Screen null or Get Screen List null..."); _reReadScreenTimer.Change(10000, 10000); return null; } else if (_allComBaseInfo.AllInfoDict.Count == 0) { _fLogService.Error("Get Screen Count 0"); SendStatusMsg("NoScreenInfo"); _reReadScreenTimer.Change(10000, 10000); return scrInfoList; } foreach (string comName in _allComBaseInfo.AllInfoDict.Keys) { OneCOMHWBaseInfo baseInfo = _allComBaseInfo.AllInfoDict[comName]; int count = baseInfo.LEDDisplayInfoList.Count; _fLogService.Debug("得到的屏列表数据的个数:" + count); for (int i = 0; i < count; i++) { ScreenInfo scrInfo = new ScreenInfo(); scrInfo.LedSN = GetScreenUdid(baseInfo.FirstSenderSN, i); scrInfo.LedIndexOfCom = i; scrInfo.Commport = comName; ILEDDisplayInfo displayInfo = baseInfo.LEDDisplayInfoList[i]; System.Drawing.Size scrSize = displayInfo.GetScreenSize(); scrInfo.LedWidth = scrSize.Width; scrInfo.LedHeight = scrSize.Height; scrInfo.LedInfo = displayInfo; scrInfo.DeconcentratorCount = 0; scrInfo.FunctionCardCount = 0; if (_screenPointDetectIdentify.ContainsKey(scrInfo.LedSN)) { scrInfo.IsSupportPointDetect = _screenPointDetectIdentify[scrInfo.LedSN]; } List<ScreenSenderAddrInfo> senderAddrList = null; List<ScreenPortAddrInfo> senderPortAddrList = null; List<ScanBoardRegionInfo> regionInfoList; displayInfo.GetScreenPortAddrInfo(out senderPortAddrList); if (senderPortAddrList != null) { foreach (var portAddr in senderPortAddrList) { regionInfoList = displayInfo.GetScannerOfSpecifyPort(portAddr.SenderIndex, portAddr.PortIndex); if (regionInfoList != null) { foreach (var scanInfo in regionInfoList) { if (scanInfo.ConnectIndex == 255) { continue; } scrInfo.PointCount += scanInfo.Width * scanInfo.Height; } } } if (displayInfo.VirtualMode == VirtualModeType.Led4Mode1 || displayInfo.VirtualMode == VirtualModeType.Led4Mode2) { scrInfo.PointCount *= 4; } else scrInfo.PointCount *= 3; } displayInfo.GetScreenSenderAddrInfo(out senderAddrList); if (senderAddrList != null) { scrInfo.SenderCardCount = senderAddrList.Count; int totalLoadCount = 0; for (int scanIndex = 0; scanIndex < senderAddrList.Count; scanIndex++) { ScreenSenderAddrInfo addrInfo = senderAddrList[scanIndex]; totalLoadCount += addrInfo.LoadScannerCount; } scrInfo.ScannerCardCount = totalLoadCount; scrInfo.MonitorCardCount = totalLoadCount; //TODO:第二阶段加入监控卡的个数:if (IsHWScreenConfigExist(scrInfo.LedSN) && _hwConfigs[scrInfo.LedSN].IsUpdateMCStatus) //{ // scrInfo.MonitorCardCount = totalLoadCount; //} //else //{ // scrInfo.MonitorCardCount = 0; //} } scrInfoList.Add(scrInfo); } } if (scrInfoList.Count == 0) { SendStatusMsg("NoScreenInfo"); _reReadScreenTimer.Change(10000, 10000); } return scrInfoList; }