public override void Execute(string key, object data)
        {
            if (_client == null)
                return;

            List<LedBasicInfo> obj;
            using (var stringReader = new StringReader(data as string))
            {
                obj = JsonConvert.DeserializeObject<List<LedBasicInfo>>(data as string);
            }
            GetLedList().Clear();
            foreach (var basicInfo in obj)
            {
                var led = new Led()
                {
                    SerialNumber = basicInfo.Sn,
                    Height = basicInfo.Height,
                    Width = basicInfo.Width
                };
                GetLedList().Add(led);
                var updateConfigRequest = new
                {
                    mac = AppDataConfig.CurrentMAC,
                    sn_num = basicInfo.Sn,
                    led_height = basicInfo.Height,
                    led_width = basicInfo.Width,
                    card_num = GetCardNum(basicInfo.PartInfos),
                    IsSupportPointDetect = basicInfo.IsSupportPointDetect,
                    IsSupportAutoBrightness = true,
                    PointCount = basicInfo.PointCount
                };
                RestFulClient.Instance.Post("api/index/updateConf", updateConfigRequest, null);
            }
            _client.NotifyLedBaseInfoUpdated(obj);
        }
Exemple #2
0
 private Led(Led led)
 {
     this.AcquistionConfig =led.AcquistionConfig ==null?null:led.AcquistionConfig.Clone() as LedAcquisitionConfig;
     this.AlarmConfig = led.AlarmConfig == null? null: led.AlarmConfig.Clone() as LedAlarmConfig;
     this.Components =led.Components == null? null: led.Components.Select(t => (ComponentBase)t.Clone()).ToList() as List<ComponentBase>;
     this.Description =string.IsNullOrEmpty(led.Description)?string.Empty: led.Description.Clone() as string;
     this.Height = led.Height;
     this.Width = led.Width;
     this.Mac =string.IsNullOrEmpty(led.Mac)?string.Empty: led.Mac.Clone() as string;
     this.MonitoringConfig =led.MonitoringConfig==null?null: led.MonitoringConfig.Clone() as LedMonitoringConfig;
     this.RegistationInfo =led.RegistationInfo==null?null: led.RegistationInfo.Clone() as LedRegistationInfo;
     this.SerialNumber = string.IsNullOrEmpty(led.SerialNumber)?string.Empty:led.SerialNumber.Clone() as string;
 }
Exemple #3
0
 private Led(Led led)
 {
     this.AcquistionConfig = led.AcquistionConfig == null?null:led.AcquistionConfig.Clone() as LedAcquisitionConfig;
     this.AlarmConfig      = led.AlarmConfig == null? null: led.AlarmConfig.Clone() as LedAlarmConfig;
     this.Components       = led.Components == null? null: led.Components.Select(t => (ComponentBase)t.Clone()).ToList() as List <ComponentBase>;
     this.Description      = string.IsNullOrEmpty(led.Description)?string.Empty: led.Description.Clone() as string;
     this.Height           = led.Height;
     this.Width            = led.Width;
     this.Mac = string.IsNullOrEmpty(led.Mac)?string.Empty: led.Mac.Clone() as string;
     this.MonitoringConfig = led.MonitoringConfig == null?null: led.MonitoringConfig.Clone() as LedMonitoringConfig;
     this.RegistationInfo  = led.RegistationInfo == null?null: led.RegistationInfo.Clone() as   LedRegistationInfo;
     this.SerialNumber     = string.IsNullOrEmpty(led.SerialNumber)?string.Empty:led.SerialNumber.Clone() as string;
 }
Exemple #4
0
 public object Clone()
 {
     var led = new Led(this);
     return led;
 }
Exemple #5
0
        public object Clone()
        {
            var led = new Led(this);

            return(led);
        }