Exemplo n.º 1
0
        private int OnPlateResult(int handle, IntPtr pUserData, IntPtr pResult, uint uNumPlates, CVzClientSDK.VZ_LPRC_RESULT_TYPE eResultType, IntPtr pImgFull, IntPtr pImgPlateClip)
        {
            DataUploadRecord record = new DataUploadRecord();

            try
            {
                CVzClientSDK.TH_PlateResult result = (CVzClientSDK.TH_PlateResult)Marshal.PtrToStructure(pResult, typeof(CVzClientSDK.TH_PlateResult));
                string str  = new string(result.license);
                string str2 = new string(result.color);
                record.PlateColorStr = str2.Substring(0, str2.IndexOf('\0'));
                record.plateNum      = str.Substring(0, str.IndexOf('\0'));
                record.picCapTime    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                record.ip            = this.IP;
            }
            catch (Exception)
            {
            }
            finally
            {
                DataUploadEventArgs e = new DataUploadEventArgs {
                    TempRecordInfo = record
                };
                this.OnShapeChanged(e);
            }
            return(0);
        }
 public HandReleaseForm(DataUploadRecord record)
 {
     InitializeComponent();
     dataUploadRecord = record;
     this.cmbCarType.SelectedValue = (int)record.CarType;
     this.tbCarNo.CarNO            = record.plateNum;
 }
Exemplo n.º 3
0
        public void control_UserControlBtnClicked(object sender, string ID)
        {
            DataUploadRecord dataUploadRecord = new DataUploadRecord();
            CR_INOUT_RECODE  inOutRecord      = bllRecord.GetModel(ID);

            if (null != inOutRecord)
            {
                dataUploadRecord.plateNum       = inOutRecord.VEHICLE_NO;
                dataUploadRecord.REPORTIMG_TIME = inOutRecord.IN_TIME;
                dataUploadRecord.PARTITION_CODE = inOutRecord.IN_PARTITION_CODE;
                var partitionChildren = CommHelper.GetOrgInfos(dataUploadRecord.PARTITION_CODE);
                //查找中央缴费定点
                if (null != partitionChildren && partitionChildren.Count > 0)
                {
                    var centralPaymentChannel = partitionChildren.Where(x => x.channelType == enumChannelType.centerPayment).FirstOrDefault();
                    if (null != centralPaymentChannel)
                    {
                        dataUploadRecord.CHN_CODE = centralPaymentChannel.ORGANIZATION_CODE;
                    }
                }
                dataUploadRecord.CHANNEL_TYPE = enumChannelType.centerPayment;
                dataUploadRecord.INOUT_RECODE = inOutRecord;
                DataUploadEventArgs args = new DataUploadEventArgs()
                {
                    TempRecordInfo = dataUploadRecord
                };
                ThreadMessageTransact.Instance.AcceptFormalData(dataUploadRecord);
            }
        }
Exemplo n.º 4
0
        public void control_UserControlBtnClicked(object sender, string ID)
        {
            DataUploadRecord dataUploadRecord = new DataUploadRecord();
            CR_INOUT_RECODE  inOutRecord      = bllRecord.GetModel(ID);

            if (null != inOutRecord)
            {
                dataUploadRecord.plateNum       = inOutRecord.VEHICLE_NO;
                dataUploadRecord.REPORTIMG_TIME = inOutRecord.IN_TIME;
                dataUploadRecord.CHANNEL_TYPE   = enumChannelType.chn_out;
                dataUploadRecord.INOUT_RECODE   = inOutRecord;
                dataUploadRecord.OPERATER_TYPE  = enumOperaterType.HandReleaseOut;
            }
            ThreadMessageTransact.Instance.triggerEvent(dataUploadRecord, true);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 响应广播消息
        /// </summary>
        /// <param name="recordInfo"></param>
        /// <param name="isWaitOne"></param>
        private void ActiveMessage(ProcessRecord recordInfo, bool isWaitOne)
        {
            /// <summary>
            /// 显示收费框
            /// </summary>
            if (recordInfo.OPERATER_TYPE == enumOperaterType.ShowCharge)
            {
                var        MonitorWidth  = SystemInformation.PrimaryMonitorSize.Width;
                var        MonitorHeight = SystemInformation.PrimaryMonitorSize.Height;
                ChargeForm chargeForm    = new ChargeForm(recordInfo);

                //chargeForm.Width = MonitorWidth / 3;
                //chargeForm.Height = chargeForm.Width / 4 * 3 - 40;

                Point point = new Point();
                point.X             = MonitorWidth - chargeForm.Width;
                point.Y             = MonitorHeight - chargeForm.Height - bottomTitleHeight;
                chargeForm.Location = point;
                //if (isWaitOne)
                //    chargeForm.ShowDialog();
                //else
                chargeForm.Show();
            }
            /// <summary>
            /// 车牌矫正框
            /// </summary>
            if (recordInfo.OPERATER_TYPE == enumOperaterType.PlateCorrection)
            {
                var MonitorWidth  = SystemInformation.PrimaryMonitorSize.Width;
                var MonitorHeight = SystemInformation.PrimaryMonitorSize.Height;
                PlateCorrectionForm plateCorrectionForm = new PlateCorrectionForm(recordInfo);

                //plateCorrectionForm.Width = MonitorWidth / 7 * 2;
                //plateCorrectionForm.Height = plateCorrectionForm.Width / 5 * 3 - 40;

                Point point = new Point();
                point.X = MonitorWidth - plateCorrectionForm.Width;
                point.Y = MonitorHeight - plateCorrectionForm.Height - bottomTitleHeight;
                plateCorrectionForm.Location = point;
                //if (isWaitOne)
                //    plateCorrectionForm.ShowDialog();
                //else
                plateCorrectionForm.Show();
            }
            /// <summary>
            /// 确认开闸框
            /// </summary>
            if (recordInfo.OPERATER_TYPE == enumOperaterType.OpenInConfirmGate)
            {
                var             MonitorWidth    = SystemInformation.PrimaryMonitorSize.Width;
                var             MonitorHeight   = SystemInformation.PrimaryMonitorSize.Height;
                ConfirmGateForm confirmGateForm = new ConfirmGateForm(recordInfo);

                //confirmGateForm.Width = MonitorWidth / 7 * 2;
                //confirmGateForm.Height = confirmGateForm.Width / 5 * 3 - 40;

                Point point = new Point();
                point.X = MonitorWidth - confirmGateForm.Width;
                point.Y = MonitorHeight - confirmGateForm.Height - bottomTitleHeight;
                confirmGateForm.Location = point;
                //if (isWaitOne)
                //    confirmGateForm.ShowDialog();
                //else
                confirmGateForm.Show();
            }
            /// <summary>
            /// 锁屏幕
            /// </summary>
            if (recordInfo.OPERATER_TYPE == enumOperaterType.LockForm)
            {
                LockFormPanel form = new LockFormPanel();
                form.ShowDialog();
            }
            /// <summary>
            /// 手工放行入场
            /// </summary>
            if (recordInfo.OPERATER_TYPE == enumOperaterType.HandReleaseIn)
            {
                DataUploadRecord dataUploadRecord = new DataUploadRecord();
                dataUploadRecord.REPORTIMG_TIME = DateTime.Now;
                dataUploadRecord.CHANNEL_TYPE   = enumChannelType.chn_in;
                HandReleaseForm handReleaseForm = new HandReleaseForm(dataUploadRecord);
                handReleaseForm.Title = "手工放行入场";
                handReleaseForm.ShowDialog();
            }
            /// <summary>
            /// 手工放行出场
            /// </summary>
            if (recordInfo.OPERATER_TYPE == enumOperaterType.HandReleaseOut)
            {
                DataUploadRecord dataUploadRecord = new DataUploadRecord();
                dataUploadRecord.plateNum       = recordInfo.INOUT_RECODE.VEHICLE_NO;
                dataUploadRecord.CarType        = recordInfo.CarType;
                dataUploadRecord.REPORTIMG_TIME = DateTime.Now;
                dataUploadRecord.CHANNEL_TYPE   = enumChannelType.chn_out;
                HandReleaseForm handReleaseForm = new HandReleaseForm(dataUploadRecord);
                handReleaseForm.Title = "手工放行出场";
                handReleaseForm.ShowDialog();
            }
            /// <summary>
            /// 无牌车放行入场
            /// </summary>
            if (recordInfo.OPERATER_TYPE == enumOperaterType.UnlicensedIn)
            {
                DataUploadRecord dataUploadRecord = new DataUploadRecord();
                dataUploadRecord.REPORTIMG_TIME = DateTime.Now;
                dataUploadRecord.CHANNEL_TYPE   = enumChannelType.chn_in;
                UnlicensedCarsEnter unlicensedCarsEnterForm = new UnlicensedCarsEnter(dataUploadRecord);
                unlicensedCarsEnterForm.Title = "无牌车放行入场";
                unlicensedCarsEnterForm.ShowDialog();
            }
            /// <summary>
            /// 无牌车放行出场
            /// </summary>
            if (recordInfo.OPERATER_TYPE == enumOperaterType.UnlicensedOut)
            {
                DataUploadRecord dataUploadRecord = new DataUploadRecord();
                dataUploadRecord.REPORTIMG_TIME = DateTime.Now;
                dataUploadRecord.CHANNEL_TYPE   = enumChannelType.chn_out;
                UnlicensedCarsEnter unlicensedCarsEnterForm = new UnlicensedCarsEnter(dataUploadRecord);
                unlicensedCarsEnterForm.Title = "无牌车放行出场";
                unlicensedCarsEnterForm.ShowDialog();
            }
            /// <summary>
            /// 退出系统
            /// </summary>
            if (recordInfo.OPERATER_TYPE == enumOperaterType.Quit)
            {
                G5MessageBox msgBox = new G5MessageBox("确定要退出吗?");
                DialogResult result = msgBox.ShowDialog();
                if (result == DialogResult.Yes)
                {
                    System.Environment.Exit(0);
                    this.Close();
                }
            }
        }
Exemplo n.º 6
0
        public void SDK_OnPlate(IntPtr pvParam, [In, MarshalAs(UnmanagedType.LPStr)] string pcIP, [In, MarshalAs(UnmanagedType.LPStr)] string pcNumber, [In, MarshalAs(UnmanagedType.LPStr)] string pcColor, IntPtr pcPicData, uint u32PicLen, IntPtr pcCloseUpPicData, uint u32CloseUpPicLen, short s16PlatePosLeft, short s16PlatePosTop, short s16PlatePosRight, short s16PlatePosBottom, float fPlateConfidence, uint u32VehicleColor, uint u32PlateType, uint u32VehicleDir, uint u32AlarmType, uint u32SerialNum, uint u32Reserved2, uint u32Reserved3, uint u32Reserved4)
        {
            DataUploadRecord record = new DataUploadRecord();

            try
            {
                ulong  num = u32Reserved3 + u32Reserved4;
                IntPtr ptr = (IntPtr)num;
                if (ptr != IntPtr.Zero)
                {
                    this.vdcInfo = (ICE_VDC_PICTRUE_INFO_S)Marshal.PtrToStructure(ptr, typeof(ICE_VDC_PICTRUE_INFO_S));
                    if (this.vdcInfo.pstVbrResult != IntPtr.Zero)
                    {
                        this.vbrResult = (ICE_VBR_RESULT_S)Marshal.PtrToStructure(this.vdcInfo.pstVbrResult, typeof(ICE_VBR_RESULT_S));
                    }
                    record.ip       = pcIP;
                    record.plateNum = pcNumber;
                    if (PlateColor.ContainsKey(pcColor))
                    {
                        record.PlateColor = PlateColor[pcColor];
                    }
                    IntPtr source      = pcPicData;
                    byte[] destination = new byte[u32PicLen];
                    Marshal.Copy(source, destination, 0, destination.Length);
                    record.fullPicData = destination;
                    record.fullPicLen  = (int)u32PicLen;
                    IntPtr ptr3    = pcPicData;
                    byte[] buffer2 = new byte[u32PicLen];
                    Marshal.Copy(ptr3, buffer2, 0, buffer2.Length);
                    record.smallPicData    = buffer2;
                    record.smallPicLen     = (int)u32CloseUpPicLen;
                    record.picCapTime      = DateTime.Now.ToString();
                    record.plateConfidence = fPlateConfidence;
                    record.plateType       = (int)u32PlateType;
                    if ((this.vbrResult.fResFeature != null) && (this.vbrResult.fResFeature.Length > 0))
                    {
                        record.specialCode = this.getFeatureCode(this.vbrResult.fResFeature);
                    }
                    record.carType = (int)u32VehicleColor;
                    int    num2       = (int)pvParam;
                    string strPicName = string.Empty;
                    lock (IsLock)
                    {
                        if (u32PicLen > 0)
                        {
                            IntPtr ptr4    = pcPicData;
                            byte[] buffer3 = new byte[u32PicLen];
                            Marshal.Copy(ptr4, buffer3, 0, buffer3.Length);
                            this.storePic(buffer3, "", pcIP, "", false, 0, null, "", out strPicName);
                        }
                    }
                    record.fullPicName = strPicName;
                }
            }
            catch (Exception)
            {
            }
            finally
            {
                float num3 = ((record.plateConfidence - 10f) / 18f) * 100f;
                if ((num3 > ConfigHelper.RecognitionRate) && (this.LastUpLoad.AddSeconds(3.0) <= DateTime.Now))
                {
                    this.LastUpLoad = DateTime.Now;
                    DataUploadEventArgs e = new DataUploadEventArgs {
                        TempRecordInfo = record
                    };
                    this.OnShapeChanged(e);
                }
            }
        }
 public UnlicensedCarsEnter(DataUploadRecord record)
 {
     InitializeComponent();
     dataUploadRecord = record;
 }