private void CarSenseHandler(CarSenseReport report) { if (report.InOrOutFlag == 1) { OptStatus = EntranceOperationStatus.CarArrival; CarplateRecReport re = new CarplateRecReport(report.ParkID, report.EntranceID, report.EventDateTime, this.EntranceName); AddToReportPool(re); } else { OptStatus = EntranceOperationStatus.CarLeave; } if (IsExitDevice) { StopCapture(); //出口在收到车到车走事件时取消收卡 } OnCarSenseReporting(report); }
private void CarplateRecHandler(CarplateRecReport report) { try { string carPlate = string.Empty; for (int i = 0; i < 10; i++) { PlateRecognitionResult ret = CarPalteRecognize(this.Park.RootParkID, this.EntranceID); if (ret != null && !string.IsNullOrEmpty(ret.CarPlate) && ret.CarPlate != carPlate) { carPlate = ret.CarPlate; FileLog.Log(this.EntranceName, "识别到车牌号 " + ret.CarPlate); //先寻找完全匹配的车牌号,如果启用了允许车牌号有误差,再用较慢的方法寻找相匹配的车牌号 //这样的话只有车牌号不能完全匹配时才影响会多做一步费时的操作。 List <CardInfo> cards = GetCardHasCarplate(ret.CarPlate, 0); if ((cards == null || cards.Count == 0) && UserSetting.Current.MaxCarPlateErrorChar > 0) { cards = GetCardHasCarplate(ret.CarPlate, UserSetting.Current.MaxCarPlateErrorChar); } if (cards != null && cards.Count == 1) { CardReadReport re = new CardReadReport(); re.CardID = cards[0].CardID; re.ParkingData = null; re.ParkID = this.Park.ParkID; re.EntranceID = this.EntranceID; re.EventDateTime = DateTime.Now; re.CannotIgnored = true; re.Reader = Ralid.Park.BusinessModel.Enum.EntranceReader.DeskTopReader; re.LastCarPlate = string.Empty; this.Carplate = ret.CarPlate; this.AddToReportPool(re); break; //退出循环 } else if (cards == null || cards.Count == 0) { AlarmReport alarm = new AlarmReport( this.Park.ParkID, this.EntranceID, DateTime.Now, this.EntranceName, AlarmType.CarPlateFail, "未找到匹配的车牌,识别到的车牌号为:" + ret.CarPlate, string.Empty); if (this.AlarmReporting != null) { this.AlarmReporting(this, alarm); } } else if (cards.Count > 1) { if (AppSettings.CurrentSetting.Debug) { FileLog.Log(this.EntranceName, "多个人员匹配到车牌:" + ret.CarPlate + " 需要手动输入车牌号放行"); } AlarmReport alarm = new AlarmReport( this.Park.ParkID, this.EntranceID, DateTime.Now, this.EntranceName, AlarmType.CarPlateFail, "多个人员匹配到车牌:" + ret.CarPlate + " 需要手动输入车牌号放行", string.Empty); if (this.AlarmReporting != null) { this.AlarmReporting(this, alarm); } } } Thread.Sleep(200); } //end for } catch (ThreadAbortException ex) { } catch (Exception ex) { Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); } }