public void NotifyPhysicalDisplayInfoUpdated(LEDDisplayInfoCollection infoCollection)
 {
     if (PhysicalDisplayInfoUpdated != null)
     {
         //Action<LEDDisplayInfoCollection> action = new Action<LEDDisplayInfoCollection>((info) =>
         //{
         PhysicalDisplayInfoUpdated(infoCollection);
         //});
         //action.BeginInvoke(infoCollection, null, null);
     }
 }
 void Instance_PhysicalDisplayInfoUpdated(LEDDisplayInfoCollection infoCollection)
 {
     _fLogService.Info("开始收到物理屏变更信息...");
     SetPhysicalDisplayInfoUpdated(infoCollection);
     _fLogService.Info("完成收到物理屏变更信息...");
 }
        private void SetPhysicalDisplayInfoUpdated(LEDDisplayInfoCollection infoCollection)
        {
            _allCommPortLedDisplayDic = new SerializableDictionary<string, List<ILEDDisplayInfo>>();

            foreach (KeyValuePair<string, List<SimpleLEDDisplayInfo>> keyValue
                in infoCollection.LedSimples)
            {
                foreach (SimpleLEDDisplayInfo simple in keyValue.Value)
                {
                    if (!_allCommPortLedDisplayDic.ContainsKey(keyValue.Key))
                    {
                        _allCommPortLedDisplayDic.Add(keyValue.Key, new List<ILEDDisplayInfo>());
                    }
                    _allCommPortLedDisplayDic[keyValue.Key].Add(
                        new SimpleLEDDisplayInfo(simple.PixelColsInScanBd,
                            simple.PixelRowsInScanBd, simple.ScanBdCols, simple.ScanBdRows, simple.PortCols,
                            simple.PortRows, simple.SenderIndex, simple.X, simple.Y,
                            simple.VirtualMode, simple.PortScanBdInfoList));
                }
            }
            foreach (KeyValuePair<string, List<StandardLEDDisplayInfo>> keyValue
                in infoCollection.LedStandards)
            {
                foreach (StandardLEDDisplayInfo standard in keyValue.Value)
                {
                    if (!_allCommPortLedDisplayDic.ContainsKey(keyValue.Key))
                    {
                        _allCommPortLedDisplayDic.Add(keyValue.Key, new List<ILEDDisplayInfo>());
                    }
                    _allCommPortLedDisplayDic[keyValue.Key].Add((StandardLEDDisplayInfo)standard.Clone());
                }
            }
            foreach (KeyValuePair<string, List<ComplexLEDDisplayInfo>> keyValue
                in infoCollection.LedComplex)
            {
                foreach (ComplexLEDDisplayInfo complex in keyValue.Value)
                {
                    if (!_allCommPortLedDisplayDic.ContainsKey(keyValue.Key))
                    {
                        _allCommPortLedDisplayDic.Add(keyValue.Key, new List<ILEDDisplayInfo>());
                    }
                    _allCommPortLedDisplayDic[keyValue.Key].Add((ComplexLEDDisplayInfo)complex.Clone());
                }
            }
        }
 private void SendAllPhysicalDisplayInfo()
 {
     WriteLog("获取各屏的LCT信息...");
     Dictionary<string, List<ILEDDisplayInfo>> ledInfos = _moniDatareader.GetAllCommPortLedDisplay();
     LEDDisplayInfoCollection lct_list = new LEDDisplayInfoCollection();
     if (ledInfos == null)
     {
         _fLogService.Info("获取各屏的LCT信息为空...");
         return;
     }
     foreach (KeyValuePair<string, List<ILEDDisplayInfo>> keyValue in ledInfos)
     {
         foreach (ILEDDisplayInfo led in keyValue.Value)
         {
             switch (led.Type)
             {
                 case LEDDisplyType.SimpleSingleType:
                     if (!lct_list.LedSimples.ContainsKey(keyValue.Key))
                     {
                         lct_list.LedSimples.Add(keyValue.Key, new List<SimpleLEDDisplayInfo>());
                     }
                     SimpleLEDDisplayInfo simple = (led as SimpleLEDDisplayInfo);
                     lct_list.LedSimples[keyValue.Key].Add(simple);
                     break;
                 case LEDDisplyType.StandardType:
                     if (!lct_list.LedStandards.ContainsKey(keyValue.Key))
                     {
                         lct_list.LedStandards.Add(keyValue.Key, new List<StandardLEDDisplayInfo>());
                     }
                     StandardLEDDisplayInfo standard = (led as StandardLEDDisplayInfo);
                     lct_list.LedStandards[keyValue.Key].Add(standard);
                     break;
                 case LEDDisplyType.ComplexType:
                     if (!lct_list.LedComplex.ContainsKey(keyValue.Key))
                     {
                         lct_list.LedComplex.Add(keyValue.Key, new List<ComplexLEDDisplayInfo>());
                     }
                     ComplexLEDDisplayInfo complex = (led as ComplexLEDDisplayInfo);
                     lct_list.LedComplex[keyValue.Key].Add(complex);
                     break;
             }
         }
     }
     SendData("AllPhysicalDisplayInfo", CommandTextParser.GetJsonSerialization<LEDDisplayInfoCollection>(lct_list));
     WriteLog("对外发送各屏的LCT信息...");
     _fLogService.Info("对外发送各屏的LCT信息...");
 }