Exemplo n.º 1
0
        /// <summary>
        /// 控制板出纸票一张
        /// </summary>
        public void TakeoutATicket()
        {
            DisplayMsg("正在出票", false);
            CardInfo card = CreateATicket();

            if (card != null)
            {
                if (PrintATicket(card.CardID))
                {
                    //转发消息
                    CardReadReport cardRead = new CardReadReport();
                    cardRead.ParkID        = ParkID;
                    cardRead.EntranceID    = this.EntranceID;
                    cardRead.CardID        = card.CardID;
                    cardRead.CardType      = (byte)card.CardType;
                    cardRead.CannotIgnored = true;
                    cardRead.EventDateTime = DateTime.Now;
                    AddToReportPool(cardRead);
                    //纸票数量级减少一张
                    if (RemainTempCard > 0)
                    {
                        RemainTempCard = RemainTempCard - 1;
                    }
                }
                else
                {
                    (new CardBll(AppSettings.CurrentSetting.ParkConnect)).DeleteCard(card);
                    NotifyTicketPrinterStatus(_TicketPrinter.Status);
                }
            }
        }
Exemplo n.º 2
0
        protected override void OnCardReadingReporting(CardReadReport report)
        {
            UserSetting us = UserSetting.Current;

            if (!IsExitDevice)
            {
                //按了取卡按钮后,只接受临时卡读头上的刷卡事件,防止远距离卡对取卡进行扰
                if (this.EntranceInfo.OnlyTempReaderAfterButtonClick && this.OptStatus == EntranceOperationStatus.CardTakeingOut && !IsTempReader(report.Reader))
                {
                    return;
                }
            }
            else
            {
                //防止无效远距离卡对出场进行干扰, 出口时如果收到刷卡事件时之前有未处理的卡片事件,且卡片事件由临时读头或远程读卡产生,
                //则此时忽略非临时读头或远程读卡的事件
                if (report.Reader != EntranceReader.DeskTopReader && !IsTempReader(report.Reader))
                {
                    if (ProcessingEvent != null && (IsTempReader(ProcessingEvent.Reader) || ProcessingEvent.Reader == EntranceReader.DeskTopReader))
                    {
                        return;
                    }
                }
            }
            if (!report.CannotIgnored)
            {
                if (EntranceInfo.ReadAndTakeCardNeedCarSense && (OptStatus != EntranceOperationStatus.CarArrival && OptStatus != EntranceOperationStatus.CardTakeingOut))
                {
                    return;                                                                                                                                                       //要求地感读卡时,如果没有车压地感,则不处理
                }
            }
            base.OnCardReadingReporting(report);
        }
Exemplo n.º 3
0
        private void CardReadReportHandler(CardReadReport report)
        {
            UserSetting us = UserSetting.Current;

            if (!IsExitDevice)
            {
                //按了取卡按钮后,只接受临时卡读头上的刷卡事件,防止远距离卡对取卡进行扰
                if (this.EntranceInfo.OnlyTempReaderAfterButtonClick && this.OptStatus == EntranceOperationStatus.CardTakeingOut && !IsTempReader(report.Reader))
                {
                    return;
                }
            }
            else
            {
                //防止无效远距离卡对出场进行干扰, 出口时如果收到刷卡事件时之前有未处理的卡片事件,且卡片事件由临时读头或远程读卡产生,
                //则此时忽略非临时读头或远程读卡的事件
                if (report.Reader != EntranceReader.DeskTopReader && !IsTempReader(report.Reader))
                {
                    if (ProcessingEvent != null && (IsTempReader(ProcessingEvent.Reader) || ProcessingEvent.Reader == EntranceReader.DeskTopReader))
                    {
                        return;
                    }
                }
            }
            OnCardReadingReporting(report);
        }
Exemplo n.º 4
0
 protected virtual void OnCardReadingReporting(CardReadReport report)
 {
     if (this.CardReadingReporting != null)
     {
         this.CardReadingReporting(this, report);
     }
 }
Exemplo n.º 5
0
        private void TicketReader_BarCodeRead(object sender, BarCodeReadEventArgs e)
        {
            CardReadReport report = new CardReadReport();

            report.CardID     = e.BarCode;
            report.EntranceID = this.EntranceID;
            report.Reader     = GetFirstTempReader();
            AddToReportPool(report);
        }
Exemplo n.º 6
0
        protected override void OnCardReadingReporting(CardReadReport report)
        {
            UserSetting us = UserSetting.Current;

            if (!report.CannotIgnored)
            {
                if (EntranceInfo.ReadAndTakeCardNeedCarSense && (OptStatus != EntranceOperationStatus.CarArrival && OptStatus != EntranceOperationStatus.CardTakeingOut))
                {
                    return;                                                                                                                                                       //要求地感读卡时,如果没有车压地感,则不处理
                }
                if (!IsReadCardIntervalOver(DateTime.Now))
                {
                    return;                                        //如果未超过读卡间隔,不处理
                }
            }
            base.OnCardReadingReporting(report);
        }
Exemplo n.º 7
0
        private ReportBase DeformatCardReadReportPacket(Packet packet)
        {
            //上传卡号+CardKind+4bytesID
            CardReadReport report = new CardReadReport();

            report.Address = packet.Address;
            if (packet.Source == 0xb1)
            {
                report.Reader = EntranceReader.Reader1;
            }
            if (packet.Source == 0xb2)
            {
                report.Reader = EntranceReader.Reader2;
            }
            report.CardType = packet.ReadByteFromParameter(0);
            report.CardID   = ((uint)(SEBinaryConverter.BytesToInt(packet.ReadDataFromParameter(1, 4)))).ToString();
            return(report);
        }
Exemplo n.º 8
0
 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);
     }
 }