public bool UpdatePointDeteConfig(string sn, DetectConfigParams detectParams)
 {
     Dictionary<string, DetectConfigParams> detectParamList = new Dictionary<string, DetectConfigParams>();
     detectParamList.Add(sn, detectParams);
     string serializeStr = JsonConvert.SerializeObject(detectParamList);
     SetPointDeteConfig(serializeStr);
     return SavePointDeteConfig(sn, JsonConvert.SerializeObject(detectParams));
 }
        public void DetectPoint(string comName, ILEDDisplayInfo ledDisplayInfo, DetectConfigParams detectParams, object usertoken)
        {
            lock (detectPointObj)
            {
                if (_serverProxy == null)
                {
                    _detectPointRes = new SpotInspectionResult();
                    _detectPointRes.Result = false;
                    if (DetectPointCompletedEvent != null)
                        DetectPointCompletedEvent(_detectPointRes, usertoken);
                    return;
                }
                var _detectPointPerformer = new DetectPointPerformer(AppDataConfig.RAMTable_PATH, usertoken as string);
                _detectPointPerformer.CompletedDetectOneScanBdEvent += detectPointPerformer_CompletedDetectOneScanBdEvent;
                _detectPointPerformer.CompletedDetectAllScanBdEvent += detectPointPerformer_CompletedDetectAllScanBdEvent;
                _detectPointPerformer.ServerProxy = _serverProxy;
                _detectPointPerformer.SelectedPortName = comName;

                _detectPointUserToken = usertoken;
                _detectPointRes = new SpotInspectionResult();
                _detectPointRes.Result = true;
                if (_spotInspectionReusltTable.ContainsKey(usertoken as string))
                {
                    _spotInspectionReusltTable[usertoken as string] = _detectPointRes;
                }
                else
                {
                    _spotInspectionReusltTable.Add(usertoken as string, _detectPointRes);
                }
                DetectConfigParams tmpDetect = null;
                if (ledDisplayInfo.VirtualMode == VirtualModeType.Led4Mode1 || ledDisplayInfo.VirtualMode == VirtualModeType.Led4Mode2) tmpDetect = new DetectConfigParams(detectParams.DriverChipType, true, detectParams.ThresholdGrade, detectParams.DetectType, detectParams.IsUseCurrentGain, detectParams.RedGain, detectParams.GreenGain, detectParams.BlueGain, detectParams.VRedGain);
                else tmpDetect = new DetectConfigParams(detectParams.DriverChipType, false, detectParams.ThresholdGrade, detectParams.DetectType, detectParams.IsUseCurrentGain, detectParams.RedGain, detectParams.GreenGain, detectParams.BlueGain, detectParams.VRedGain);
                DetectPointError res = _detectPointPerformer.DetectPoint(ledDisplayInfo, tmpDetect);
                if (res != DetectPointError.OK)
                {
                    _detectPointRes = new SpotInspectionResult();
                    _detectPointRes.Id = usertoken as string;
                    _detectPointRes.Result = false;
                    if (DetectPointCompletedEvent != null)
                        DetectPointCompletedEvent(_detectPointRes, usertoken);
                }
            }
        }