public void on_plate(string bstrIP, string bstrNumber, string bstrColor, IntPtr vPicData, UInt32 nPicLen,
IntPtr vCloseUpPicData, UInt32 nCloseUpPicLen, short nSpeed, short nVehicleType, short nReserved1, short nReserved2, Single fPlateConfidence,
UInt32 nVehicleColor, UInt32 nPlateType, UInt32 nVehicleDir, UInt32 nAlarmType, UInt32 nCapTime, Int32 index, uint u32ResultHigh, uint u32ResultLow)
{
if (m_bExit)
return;
WeighData_Info mWeighData_Info = Helpers.ServiceHelper.msClient.GetWeighDataModel(string.Format(" Licenseplate like '%{0}%'", bstrNumber.Substring(1)));
if (null != mWeighData_Info)
bstrNumber = mWeighData_Info.Licenseplate;
#if VERSION32
IntPtr vdcPtr = (IntPtr)u32ResultLow;
#else
ulong tmp = ((ulong)u32ResultHigh << 32) + (ulong)u32ResultLow;
IntPtr vdcPtr = (IntPtr)tmp;
#endif
string Licenseplate = UserHelper.GetTableLicenseplate(bstrNumber.Substring(1));
if (string.Empty != Licenseplate) bstrNumber = Licenseplate;
if (vdcPtr != IntPtr.Zero)
{
//将数据拷贝到ICE_VDC_PICTRUE_INFO_S结构体
vdcInfo = (ICE_VDC_PICTRUE_INFO_S)Marshal.PtrToStructure(vdcPtr, typeof(ICE_VDC_PICTRUE_INFO_S));
//获得车款结构体指针,并拷贝
if (vdcInfo.pstVbrResult != IntPtr.Zero)
{
vbrResult = (ICE_VBR_RESULT_S)Marshal.PtrToStructure(vdcInfo.pstVbrResult, typeof(ICE_VBR_RESULT_S));
if (vbrResult.szLogName.Length == 0)
vbrResult.szLogName = "未知";
//委托,用于显示识别数据(showCount),vdcInfo.stPlateInfo表示车牌信息
if ((this == null) || (this.IsDisposed) || (!this.IsHandleCreated)) return;
this.BeginInvoke(updatePlateInfo, bstrIP, bstrNumber, bstrColor,
nVehicleColor, nAlarmType, nVehicleType, nCapTime, index, vbrResult.szLogName, vdcInfo.stPlateInfo.stPlateRect);
}
else
{
if ((this == null) || (this.IsDisposed) || (!this.IsHandleCreated)) return;
this.BeginInvoke(updatePlateInfo, bstrIP, bstrNumber, bstrColor,
nVehicleColor, nAlarmType, nVehicleType, nCapTime, index, "", vdcInfo.stPlateInfo.stPlateRect);//委托,用于显示识别数据(showCount),vdcInfo.stPlateInfo表示车牌信息
}
}
else
{
if ((this == null) || (this.IsDisposed) || (!this.IsHandleCreated)) return;
this.BeginInvoke(updatePlateInfo, bstrIP, bstrNumber, bstrColor,
nVehicleColor, nAlarmType, nVehicleType, nCapTime, index, "", null);//委托,用于显示识别数据(showCount)
}
if (nPicLen > 0)//全景图数据长度不为0
{
IntPtr ptr2 = (IntPtr)vPicData;
byte[] datajpg2 = new byte[nPicLen];
Marshal.Copy(ptr2, datajpg2, 0, datajpg2.Length);//拷贝图片数据
//存图
if (vdcInfo.pstVbrResult != IntPtr.Zero)
storePic(datajpg2, bstrIP, bstrNumber, false, nCapTime, vbrResult.fResFeature, vbrResult.szLogName);
else
storePic(datajpg2, bstrIP, bstrNumber, false, nCapTime, null, "");
}
if (nCloseUpPicLen > 0)//车牌图数据长度不为0
{
IntPtr ptr = (IntPtr)vCloseUpPicData;
byte[] datajpg = new byte[nCloseUpPicLen];
Marshal.Copy(ptr, datajpg, 0, datajpg.Length);//拷贝图片数据
//存图
if (vdcInfo.pstVbrResult != IntPtr.Zero)
storePic(datajpg, bstrIP, bstrNumber, true, nCapTime, null, vbrResult.szLogName);
else
storePic(datajpg, bstrIP, bstrNumber, true, nCapTime, null, "");
}
}