コード例 #1
0
        public PlateRecognitionResult Recognize(int parkID, int entranceID)
        {
            //if (_plnImp != null)
            //{
            //    return _plnImp.Recognize(parkID, entranceID);
            //}

            IPlateRecognition plnImp = null;
            //默认车牌识别类型
            CarPlateRecognizationType reconizationType = AppSettings.CurrentSetting.CarPlateRecognization;

            try
            {
                EntranceInfo entrance = ParkBuffer.Current.GetEntrance(parkID, entranceID);
                if (entrance != null)
                {
                    //如果是使用信路通识别的
                    if (entrance.CarPlateIP != "0.0.0.0" &&
                        !string.IsNullOrEmpty(entrance.CarPlateIP))
                    {
                        reconizationType = CarPlateRecognizationType.XinLuTong;
                    }
                    else
                    {
                        foreach (VideoSourceInfo video in entrance.VideoSources)
                        {
                            if (video.IsForCarPlate)
                            {
                                //使用大华摄像机的
                                if (video.VideoSourceType == (int)VideoServerType.DaHua)
                                {
                                    reconizationType = CarPlateRecognizationType.DaHua;
                                }
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex);
            }

            if (_plnImps.ContainsKey((int)reconizationType))
            {
                plnImp = _plnImps[(int)reconizationType];
            }

            if (plnImp != null)
            {
                return(plnImp.Recognize(parkID, entranceID));
            }

            return(new PlateRecognitionResult());
        }
コード例 #2
0
ファイル: AppSettings.cs プロジェクト: josephca88/510-Null
        public AppSettings(string path)
        {
            if (File.Exists(path))
            {
                try
                {
                    _path     = path;
                    this._doc = new XmlDocument();
                    this._doc.Load(_path);
                    _parent = this._doc.SelectSingleNode("configuration/appSettings");

                    _WorkstationID = GetConfigContent("WorkStationID");
                    _ParkConnect   = GetConfigContent("Parking");

                    _StandbyParkConnect = GetConfigContent("StandbyParking");

                    _SnapShotSavePath = GetConfigContent("SnapShotSavePath");

                    string temp = GetConfigContent("SystemType");
                    _SystemType = (!string.IsNullOrEmpty(temp) && temp == "1") ? SystemType.Server : SystemType.WorkStation;

                    temp          = GetConfigContent("SelectedParking");
                    _SelectedPark = (string.IsNullOrEmpty(temp) || temp == "0") ? DataBaseType.Master : DataBaseType.Standby;

                    temp = GetConfigContent("ParkFeeLedCOMPort");
                    byte.TryParse(temp, out _ParkFeeLedCOMPort);

                    temp = GetConfigContent("ParkFeeLedType");
                    byte.TryParse(temp, out _ParkFeeLedType);

                    temp = GetConfigContent("TicketReaderCOMPort");
                    byte.TryParse(temp, out _TicketReaderCOMPort);

                    temp = GetConfigContent("BillPrinterCOMPort");
                    byte.TryParse(temp, out _BillPrinterCOMPort);

                    temp = GetConfigContent("YCTReaderCOMPort");
                    byte.TryParse(temp, out _YCTReaderCOMPort);

                    temp = GetConfigContent("ParkFullLedCOMPort");
                    byte.TryParse(temp, out _ParkFullLedCOMPort);

                    temp = GetConfigContent("ThreeLedCOMPort");
                    byte.TryParse(temp, out _VehicleLedCOMPort);

                    temp = GetConfigContent("Debug");
                    bool.TryParse(temp, out _Debug);

                    temp = GetConfigContent("DatabaseNeedUpgrade");
                    bool.TryParse(temp, out _DatabaseNeedUpgrade);

                    temp = GetConfigContent("OpenLastOpenedVideo");
                    bool.TryParse(temp, out _OpenLastOpenedVideo);

                    temp = GetConfigContent("ShowOnlyListenedPark");
                    bool.TryParse(temp, out _ShowOnlyListenedPark);

                    temp = GetConfigContent("Optimized");
                    bool.TryParse(temp, out _Optimized);

                    temp = GetConfigContent("NeedPasswordWhenExit");
                    bool.TryParse(temp, out _NeedPasswordWhenExit);

                    _Language = GetConfigContent("Language");

                    temp = GetConfigContent("RememberLogID");
                    bool.TryParse(temp, out _RememberLogID);

                    temp = GetConfigContent("EnableTTS");
                    bool.TryParse(temp, out _EnableTTS);

                    temp = GetConfigContent("EnlargeMemo");
                    bool.TryParse(temp, out _EnlargeMemo);

                    temp = GetConfigContent("ChargeAfterMemo");
                    bool.TryParse(temp, out _ChargeAfterMemo);

                    temp = GetConfigContent("ShowAPMMonitor");
                    bool.TryParse(temp, out _ShowAPMMonitor);

                    temp = GetConfigContent("EnableZST");
                    bool.TryParse(temp, out _EnableZST);

                    _ZSTReaderIP = GetConfigContent("ZSTReaderIP");

                    temp = GetConfigContent("EnableWriteCard");
                    bool.TryParse(temp, out _EnableWriteCard);

                    temp = GetConfigContent("AuotAddToFirewallException");
                    bool.TryParse(temp, out _AuotAddToFirewallException);

                    _ParkingCommunicationIP = GetConfigContent("ParkingCommunicationIP");

                    temp = GetConfigContent("AllowChangeParkWorkMode");
                    bool.TryParse(temp, out _AllowChangeParkWorkMode);

                    temp = GetConfigContent("CheckConnectionWithPing");
                    bool.TryParse(temp, out _CheckConnectionWithPing);

                    temp = GetConfigContent("ParkVacantLed");
                    if (!string.IsNullOrEmpty(temp))
                    {
                        int.TryParse(temp, out _ParkVacantLed);
                    }

                    temp = GetConfigContent("SwitchEntrance");
                    bool.TryParse(temp, out _SwitchEntrance);

                    temp = GetConfigContent("EnableHotel");
                    bool.TryParse(temp, out _EnableHotel);

                    temp = GetConfigContent("NewCardValidCommand");
                    bool.TryParse(temp, out _NewCardValidCommand);

                    temp = GetConfigContent("ParkingSamNO");
                    byte.TryParse(temp, out _ParkingSamNO);

                    temp             = GetConfigContent("EnablePosButton");
                    _EnablePOSButton = bool.TryParse(temp, out _EnablePOSButton) ? _EnablePOSButton : true;//默认显示

                    temp = GetConfigContent("SpeakPromptWhenCarArrival");
                    bool.TryParse(temp, out _SpeakPromptWhenCarArrival);

                    temp = GetConfigContent("CarPlateRecognization");
                    if (temp == "VECON")
                    {
                        _CarPlateRecognization = CarPlateRecognizationType.VECON;
                    }
                    else if (temp == "XinLuTong")
                    {
                        _CarPlateRecognization = CarPlateRecognizationType.XinLuTong;
                    }
                    else if (temp == "DaHua")
                    {
                        _CarPlateRecognization = CarPlateRecognizationType.DaHua;
                    }
                    else
                    {
                        //默认用文通
                        _CarPlateRecognization = CarPlateRecognizationType.WINTONE;
                    }
                }
                catch
                {
                }
            }
        }