xiongzhu пре 5 година
родитељ
комит
19352e72dd

BIN
.vs/DeviceCenter/v16/.suo


BIN
bin/x86/Debug/DeviceCenter.exe


BIN
bin/x86/Debug/DeviceCenter.pdb


+ 197 - 2
model/AcsDevice.cs

@@ -1,28 +1,223 @@
 using DeviceCenter;
 using DeviceCenter;
+using log4net;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Text;
 using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
+using System.Windows;
 
 
 namespace DeviceCenter
 namespace DeviceCenter
 {
 {
     class AcsDevice : Device
     class AcsDevice : Device
     {
     {
+        public static readonly ILog log = LogManager.GetLogger("DeviceCenter");
 
 
+        public int userId { get; set; }
         public AcsDevice()
         public AcsDevice()
         {
         {
-            this.type = Device.Type.ACS;
+            type = Device.Type.ACS;
         }
         }
 
 
         public override void Init()
         public override void Init()
         {
         {
-            throw new NotImplementedException();
+            CHCNetSDK.NET_DVR_USER_LOGIN_INFO struLoginInfo = new CHCNetSDK.NET_DVR_USER_LOGIN_INFO();
+            CHCNetSDK.NET_DVR_DEVICEINFO_V40 struDeviceInfoV40 = new CHCNetSDK.NET_DVR_DEVICEINFO_V40();
+
+            struLoginInfo.bUseAsynLogin = false;
+            struLoginInfo.sDeviceAddress = ip;
+            struLoginInfo.sUserName = username;
+            struLoginInfo.sPassword = password;
+            struLoginInfo.wPort = (ushort)port;
+
+            struDeviceInfoV40.struDeviceV30.sSerialNumber = new byte[CHCNetSDK.SERIALNO_LEN];
+
+            int m_userId = CHCNetSDK.NET_DVR_Login_V40(ref struLoginInfo, ref struDeviceInfoV40);
+            if (m_userId < 0)
+            {
+                uint nErr = CHCNetSDK.NET_DVR_GetLastError();
+                if (nErr == CHCNetSDK.NET_DVR_PASSWORD_ERROR)
+                {
+                    MessageBox.Show("user name or password error!");
+                    if (1 == struDeviceInfoV40.bySupportLock)
+                    {
+                        string strTemp1 = string.Format("Left {0} try opportunity", struDeviceInfoV40.byRetryLoginTime);
+                        MessageBox.Show(strTemp1);
+                    }
+                }
+                else if (nErr == CHCNetSDK.NET_DVR_USER_LOCKED)
+                {
+                    if (1 == struDeviceInfoV40.bySupportLock)
+                    {
+                        string strTemp1 = string.Format("user is locked, the remaining lock time is {0}", struDeviceInfoV40.dwSurplusLockTime);
+                        MessageBox.Show(strTemp1);
+                    }
+                }
+                else
+                {
+                    MessageBox.Show("net error or dvr is busy!");
+                }
+                return;
+            }
+            userId = m_userId;
+
+            CHCNetSDK.NET_DVR_SETUPALARM_PARAM struSetupAlarmParam = new CHCNetSDK.NET_DVR_SETUPALARM_PARAM();
+            struSetupAlarmParam.dwSize = (uint)Marshal.SizeOf(struSetupAlarmParam);
+            struSetupAlarmParam.byLevel = 1;
+            struSetupAlarmParam.byAlarmInfoType = 1;
+            struSetupAlarmParam.byDeployType = 1;
+            int handle = CHCNetSDK.NET_DVR_SetupAlarmChan_V41(m_userId, ref struSetupAlarmParam);
+            if (-1 == handle)
+            {
+                MessageBox.Show("Setup alarm chan failed");
+            }
         }
         }
 
 
         public override void dispose()
         public override void dispose()
         {
         {
             throw new NotImplementedException();
             throw new NotImplementedException();
         }
         }
+
+        public void onAlarm(ref CHCNetSDK.NET_DVR_ALARMER pAlarmer, IntPtr pAlarmInfo, uint dwBufLen, IntPtr pUser)
+        {
+            CHCNetSDK.NET_DVR_ACS_ALARM_INFO struAcsAlarmInfo = new CHCNetSDK.NET_DVR_ACS_ALARM_INFO();
+            struAcsAlarmInfo = (CHCNetSDK.NET_DVR_ACS_ALARM_INFO)Marshal.PtrToStructure(pAlarmInfo, typeof(CHCNetSDK.NET_DVR_ACS_ALARM_INFO));
+            CHCNetSDK.NET_DVR_LOG_V30 struFileInfo = new CHCNetSDK.NET_DVR_LOG_V30();
+            struFileInfo.dwMajorType = struAcsAlarmInfo.dwMajor;
+            struFileInfo.dwMinorType = struAcsAlarmInfo.dwMinor;
+            char[] csTmp = new char[256];
+
+            if (CHCNetSDK.MAJOR_ALARM == struFileInfo.dwMajorType)
+            {
+                TypeMap.AlarmMinorTypeMap(struFileInfo, csTmp);
+            }
+            else if (CHCNetSDK.MAJOR_OPERATION == struFileInfo.dwMajorType)
+            {
+                TypeMap.OperationMinorTypeMap(struFileInfo, csTmp);
+            }
+            else if (CHCNetSDK.MAJOR_EXCEPTION == struFileInfo.dwMajorType)
+            {
+                TypeMap.ExceptionMinorTypeMap(struFileInfo, csTmp);
+            }
+            else if (CHCNetSDK.MAJOR_EVENT == struFileInfo.dwMajorType)
+            {
+                TypeMap.EventMinorTypeMap(struFileInfo, csTmp);
+            }
+
+            String szInfo = new String(csTmp).TrimEnd('\0');
+            String szInfoBuf = null;
+            szInfoBuf = szInfo;
+            /**************************************************/
+            String name = System.Text.Encoding.UTF8.GetString(struAcsAlarmInfo.sNetUser).TrimEnd('\0');
+            for (int i = 0; i < struAcsAlarmInfo.sNetUser.Length; i++)
+            {
+                if (struAcsAlarmInfo.sNetUser[i] == 0)
+                {
+                    name = name.Substring(0, i);
+                    break;
+                }
+            }
+            /**************************************************/
+
+            szInfoBuf = string.Format("{0} time:{1,4}-{2:D2}-{3} {4:D2}:{5:D2}:{6:D2}, [{7}]({8})", szInfo, struAcsAlarmInfo.struTime.dwYear, struAcsAlarmInfo.struTime.dwMonth,
+                struAcsAlarmInfo.struTime.dwDay, struAcsAlarmInfo.struTime.dwHour, struAcsAlarmInfo.struTime.dwMinute, struAcsAlarmInfo.struTime.dwSecond,
+                struAcsAlarmInfo.struRemoteHostAddr.sIpV4, name);
+
+            if (struAcsAlarmInfo.struAcsEventInfo.byCardNo[0] != 0)
+            {
+                szInfoBuf = szInfoBuf + "+Card Number:" + System.Text.Encoding.UTF8.GetString(struAcsAlarmInfo.struAcsEventInfo.byCardNo).TrimEnd('\0');
+            }
+            String[] szCardType = { "normal card", "disabled card", "blacklist card", "night watch card", "stress card", "super card", "guest card" };
+            byte byCardType = struAcsAlarmInfo.struAcsEventInfo.byCardType;
+
+            if (byCardType != 0 && byCardType <= szCardType.Length)
+            {
+                szInfoBuf = szInfoBuf + "+Card Type:" + szCardType[byCardType - 1];
+            }
+
+            if (struAcsAlarmInfo.struAcsEventInfo.dwCardReaderNo != 0)
+            {
+                szInfoBuf = szInfoBuf + "+Card Reader Number:" + struAcsAlarmInfo.struAcsEventInfo.dwCardReaderNo;
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.dwDoorNo != 0)
+            {
+                szInfoBuf = szInfoBuf + "+Door Number:" + struAcsAlarmInfo.struAcsEventInfo.dwDoorNo;
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.dwVerifyNo != 0)
+            {
+                szInfoBuf = szInfoBuf + "+Multiple Card Authentication Serial Number:" + struAcsAlarmInfo.struAcsEventInfo.dwVerifyNo;
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.dwAlarmInNo != 0)
+            {
+                szInfoBuf = szInfoBuf + "+Alarm Input Number:" + struAcsAlarmInfo.struAcsEventInfo.dwAlarmInNo;
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.dwAlarmOutNo != 0)
+            {
+                szInfoBuf = szInfoBuf + "+Alarm Output Number:" + struAcsAlarmInfo.struAcsEventInfo.dwAlarmOutNo;
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.dwCaseSensorNo != 0)
+            {
+                szInfoBuf = szInfoBuf + "+Event Trigger Number:" + struAcsAlarmInfo.struAcsEventInfo.dwCaseSensorNo;
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.dwRs485No != 0)
+            {
+                szInfoBuf = szInfoBuf + "+RS485 Channel Number:" + struAcsAlarmInfo.struAcsEventInfo.dwRs485No;
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.dwMultiCardGroupNo != 0)
+            {
+                szInfoBuf = szInfoBuf + "+Multi Recombinant Authentication ID:" + struAcsAlarmInfo.struAcsEventInfo.dwMultiCardGroupNo;
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.byCardReaderKind != 0)
+            {
+                szInfoBuf = szInfoBuf + "+CardReaderKind:" + struAcsAlarmInfo.struAcsEventInfo.byCardReaderKind.ToString();
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.wAccessChannel >= 0)
+            {
+                szInfoBuf = szInfoBuf + "+wAccessChannel:" + struAcsAlarmInfo.struAcsEventInfo.wAccessChannel;
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.dwEmployeeNo != 0)
+            {
+                szInfoBuf = szInfoBuf + "+EmployeeNo:" + struAcsAlarmInfo.struAcsEventInfo.dwEmployeeNo;
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.byDeviceNo != 0)
+            {
+                szInfoBuf = szInfoBuf + "+byDeviceNo:" + struAcsAlarmInfo.struAcsEventInfo.byDeviceNo.ToString();
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.wLocalControllerID >= 0)
+            {
+                szInfoBuf = szInfoBuf + "+wLocalControllerID:" + struAcsAlarmInfo.struAcsEventInfo.wLocalControllerID;
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.byInternetAccess >= 0)
+            {
+                szInfoBuf = szInfoBuf + "+byInternetAccess:" + struAcsAlarmInfo.struAcsEventInfo.byInternetAccess.ToString();
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.byType >= 0)
+            {
+                szInfoBuf = szInfoBuf + "+byType:" + struAcsAlarmInfo.struAcsEventInfo.byType.ToString();
+            }
+            if (struAcsAlarmInfo.struAcsEventInfo.bySwipeCardType != 0)
+            {
+                szInfoBuf = szInfoBuf + "+bySwipeCardType:" + struAcsAlarmInfo.struAcsEventInfo.bySwipeCardType.ToString();
+            }
+            //其它消息先不罗列了......
+            if (struAcsAlarmInfo.dwPicDataLen > 0)
+            {
+                string path = null;
+                Random rand = new Random(unchecked((int)DateTime.Now.Ticks));
+                path = string.Format(@"{0}Picture/ACS_LocalTime{1}_{2}.bmp", AppDomain.CurrentDomain.BaseDirectory, szInfo, rand.Next());
+                using (FileStream fs = new FileStream(path, FileMode.Create))
+                {
+                    int iLen = (int)struAcsAlarmInfo.dwPicDataLen;
+                    byte[] by = new byte[iLen];
+                    Marshal.Copy(struAcsAlarmInfo.pPicData, by, 0, iLen);
+                    fs.Write(by, 0, iLen);
+                    fs.Close();
+                }
+                szInfoBuf = szInfoBuf + "SavePath:" + path;
+            }
+            log.Info(szInfoBuf);
+        }
     }
     }
 }
 }

+ 55 - 2
model/CarCamDevice.cs

@@ -1,25 +1,78 @@
-using System;
+using log4net;
+using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Linq;
 using System.Text;
 using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
+using System.Windows;
 
 
 namespace DeviceCenter
 namespace DeviceCenter
 {
 {
     class CarCamDevice : Device
     class CarCamDevice : Device
     {
     {
+        public static readonly ILog log = LogManager.GetLogger("DeviceCenter");
+
+        public int userId { get; set; }
        
        
         public CarCamDevice() {
         public CarCamDevice() {
             this.type = Device.Type.CAR_CAM;
             this.type = Device.Type.CAR_CAM;
         }
         }
+
         public override void Init()
         public override void Init()
         {
         {
-            throw new NotImplementedException();
+            userId = CarCamSDK.Net_AddCamera(ip);
+            int iRet1 = CarCamSDK.Net_ConnCamera(userId, 30000, 10);
+            if (iRet1 != 0)
+            {
+                CarCamSDK.Net_DelCamera(userId);
+                MessageBox.Show("连接相机失败!", "提示");
+            }
+            else
+            {
+                CarCamSDK.Net_RegOffLineClient(userId);
+            }
         }
         }
 
 
         public override void dispose()
         public override void dispose()
         {
         {
             throw new NotImplementedException();
             throw new NotImplementedException();
         }
         }
+
+        public int onGetCarPlate(int tHandle, uint uiImageId, ref CarCamSDK.T_ImageUserInfo2 tImageInfo, ref CarCamSDK.T_PicInfo tPicInfo)
+        {
+            string strTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd_HH_mm_ss_fff");
+            log.Info("检测到车牌信息\n");
+            //车辆图像
+            if (tImageInfo.ucViolateCode == 0)
+            {
+                string szLprResult = Encoding.Default.GetString(tImageInfo.szLprResult).Replace("\0", "");
+                log.Info("车牌:" + szLprResult);
+
+                string strVehicleBrand = System.Text.Encoding.Default.GetString(tImageInfo.strVehicleBrand).Replace("\0", "");
+                log.Info("车型:" + strVehicleBrand);
+
+                string vehicleType = VehicleUtil.getVehicleType(tImageInfo.ucVehicleSize);//车辆类型
+                log.Info("车辆类型:" + vehicleType);
+
+                string vehicleColor = VehicleUtil.getColor(tImageInfo.ucPlateColor);//车牌颜色
+                log.Info("颜色:" + vehicleColor);
+
+                string path = AppDomain.CurrentDomain.BaseDirectory + "image";
+
+                if (!Directory.Exists(path))
+                {
+                    Directory.CreateDirectory(path);
+                }
+
+                string strImageFile1 = VehicleUtil.savePanoramaPic(path, ref tPicInfo, 1);
+
+                string strImageFile2 = VehicleUtil.savePanoramaPic(path, ref tPicInfo, 2); ;
+
+
+            }
+
+            return 0;
+        }
     }
     }
 }
 }

+ 41 - 1
model/Device.cs

@@ -12,6 +12,9 @@ namespace DeviceCenter
     {
     {
         private string _name;
         private string _name;
         private string _ip;
         private string _ip;
+        private int _port;
+        private string _username;
+        private string _password;
         private Device.Type _type;
         private Device.Type _type;
         private Device.Status _status;
         private Device.Status _status;
 
 
@@ -52,6 +55,42 @@ namespace DeviceCenter
                 OnPropertyChanged("ip");
                 OnPropertyChanged("ip");
             }
             }
         }
         }
+        public int port
+        {
+            get
+            {
+                return _port;
+            }
+            set
+            {
+                _port = value;
+                OnPropertyChanged("port");
+            }
+        }
+        public string username
+        {
+            get
+            {
+                return _username;
+            }
+            set
+            {
+                _username = value;
+                OnPropertyChanged("username");
+            }
+        }
+        public string password
+        {
+            get
+            {
+                return _password;
+            }
+            set
+            {
+                _password = value;
+                OnPropertyChanged("password");
+            }
+        }
         public Status status
         public Status status
         {
         {
             get
             get
@@ -66,7 +105,8 @@ namespace DeviceCenter
         }
         }
         public Type type
         public Type type
         {
         {
-            get {
+            get
+            {
                 return _type;
                 return _type;
             }
             }
             set
             set

BIN
obj/x86/Debug/DeviceCenter.csprojAssemblyReference.cache


BIN
obj/x86/Debug/DeviceCenter.exe


BIN
obj/x86/Debug/DeviceCenter.g.resources


BIN
obj/x86/Debug/DeviceCenter.pdb


+ 1 - 1
obj/x86/Debug/DeviceCenter_MarkupCompile.lref

@@ -1,4 +1,4 @@
-C:\Users\xiong\Projects\csharp\DeviceCenter\obj\x86\Debug\GeneratedInternalTypeHelper.g.cs
+
 FC:\Users\xiong\Projects\csharp\DeviceCenter\App.xaml;;
 FC:\Users\xiong\Projects\csharp\DeviceCenter\App.xaml;;
 FC:\Users\xiong\Projects\csharp\DeviceCenter\views\AddDevice.xaml;;
 FC:\Users\xiong\Projects\csharp\DeviceCenter\views\AddDevice.xaml;;
 FC:\Users\xiong\Projects\csharp\DeviceCenter\views\Login.xaml;;
 FC:\Users\xiong\Projects\csharp\DeviceCenter\views\Login.xaml;;

BIN
obj/x86/Debug/views/AddDevice.baml


+ 1 - 1
obj/x86/Debug/views/AddDevice.g.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\..\..\views\AddDevice.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F29E232DB630086027EBAFD5F9A5B6556B420385B166D002AFD99D7AEBCD6164"
+#pragma checksum "..\..\..\..\views\AddDevice.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "85F39D28DD717D4D04F300E06156C296FDCA2E74FFF74DFA5E3743CE999F8BDB"
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
 // <auto-generated>
 // <auto-generated>
 //     此代码由工具生成。
 //     此代码由工具生成。

+ 1 - 1
obj/x86/Debug/views/AddDevice.g.i.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\..\..\views\AddDevice.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F29E232DB630086027EBAFD5F9A5B6556B420385B166D002AFD99D7AEBCD6164"
+#pragma checksum "..\..\..\..\views\AddDevice.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "85F39D28DD717D4D04F300E06156C296FDCA2E74FFF74DFA5E3743CE999F8BDB"
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
 // <auto-generated>
 // <auto-generated>
 //     此代码由工具生成。
 //     此代码由工具生成。

+ 83 - 1
views/MainWindow.xaml.cs

@@ -1,9 +1,13 @@
 using DeviceCenter.model;
 using DeviceCenter.model;
 using DeviceCenter.utils;
 using DeviceCenter.utils;
+using log4net;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Collections.ObjectModel;
+using System.IO;
+using System.Runtime.InteropServices;
 using System.Threading;
 using System.Threading;
+using System.Threading.Tasks;
 using System.Windows;
 using System.Windows;
 
 
 namespace DeviceCenter
 namespace DeviceCenter
@@ -13,13 +17,20 @@ namespace DeviceCenter
     /// </summary>
     /// </summary>
     public partial class MainWindow : Window
     public partial class MainWindow : Window
     {
     {
+        public static readonly ILog log = LogManager.GetLogger("DeviceCenter");
+
         private ObservableCollection<Device> devices = new ObservableCollection<Device>();
         private ObservableCollection<Device> devices = new ObservableCollection<Device>();
         private Config config = Config.getInstance();
         private Config config = Config.getInstance();
 
 
+        private CHCNetSDK.MSGCallBack alarmCallback = null;
+        private static CarCamSDK.FGetImageCB2 carPlateCallback;
+
         public MainWindow()
         public MainWindow()
         {
         {
             InitializeComponent();
             InitializeComponent();
 
 
+            initSdk();
+
             devices.Add(new CarCamDevice() { name = "Device 1", ip = "192.168.1.10", status = Device.Status.CONNECTING });
             devices.Add(new CarCamDevice() { name = "Device 1", ip = "192.168.1.10", status = Device.Status.CONNECTING });
             devices.Add(new AcsDevice() { name = "Device 2", ip = "192.168.1.11", status = Device.Status.FAIL });
             devices.Add(new AcsDevice() { name = "Device 2", ip = "192.168.1.11", status = Device.Status.FAIL });
             devices.Add(new AcsDevice() { name = "Device 3", ip = "192.168.1.12", status = Device.Status.CONNECTED });
             devices.Add(new AcsDevice() { name = "Device 3", ip = "192.168.1.12", status = Device.Status.CONNECTED });
@@ -33,6 +44,32 @@ namespace DeviceCenter
             t.Start();
             t.Start();
         }
         }
 
 
+        private async void initSdk()
+        {
+            await Task.Run(() => {
+                CarCamSDK.Net_Init();
+                carPlateCallback = new CarCamSDK.FGetImageCB2(onGetCarPlate);
+                CarCamSDK.Net_RegImageRecv2(carPlateCallback);
+
+                //UsbSwitch.usb_relay_init();
+
+                if (!CHCNetSDK.NET_DVR_Init())
+                {
+                    MessageBox.Show("门禁SDK初始化失败");
+                }
+
+                alarmCallback = new CHCNetSDK.MSGCallBack(onAlarm);
+                if (CHCNetSDK.NET_DVR_SetDVRMessageCallBack_V50(0, alarmCallback, IntPtr.Zero))
+                {
+                    log.Info("NET_DVR_SetDVRMessageCallBack_V50 Succeed");
+                }
+                else
+                {
+                    MessageBox.Show("NET_DVR_SetDVRMessageCallBack_V50 Fail");
+                }
+            });
+        }
+
         private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
         private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
         {
         {
             //e.Cancel = true;
             //e.Cancel = true;
@@ -43,7 +80,7 @@ namespace DeviceCenter
             AddDevice addDevice = new AddDevice();
             AddDevice addDevice = new AddDevice();
             if (addDevice.ShowDialog() ?? false)
             if (addDevice.ShowDialog() ?? false)
             {
             {
-                
+
             }
             }
         }
         }
 
 
@@ -62,5 +99,50 @@ namespace DeviceCenter
                 // lv_device.Items.Refresh();
                 // lv_device.Items.Refresh();
             }
             }
         }
         }
+
+        private void onAlarm(int lCommand, ref CHCNetSDK.NET_DVR_ALARMER pAlarmer, IntPtr pAlarmInfo, uint dwBufLen, IntPtr pUser)
+        {
+            switch (lCommand)
+            {
+                case CHCNetSDK.COMM_ALARM_ACS:
+                    ProcessCommAlarmACS(ref pAlarmer, pAlarmInfo, dwBufLen, pUser);
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        private void ProcessCommAlarmACS(ref CHCNetSDK.NET_DVR_ALARMER pAlarmer, IntPtr pAlarmInfo, uint dwBufLen, IntPtr pUser)
+        {
+
+
+            foreach (Device device in devices)
+            {
+                if (device.type == Device.Type.ACS)
+                {
+                    AcsDevice acsDevice = (AcsDevice)device;
+                    if (acsDevice.userId == pAlarmer.lUserID)
+                    {
+                        acsDevice.onAlarm(ref pAlarmer, pAlarmInfo, dwBufLen, pUser);
+                    }
+                }
+            }
+        }
+
+        private int onGetCarPlate(int tHandle, uint uiImageId, ref CarCamSDK.T_ImageUserInfo2 tImageInfo, ref CarCamSDK.T_PicInfo tPicInfo)
+        {
+            foreach (Device device in devices)
+            {
+                if (device.type == Device.Type.ACS)
+                {
+                    CarCamDevice carCamDevice = (CarCamDevice)device;
+                    if (tHandle == carCamDevice.userId)
+                    {
+                        return carCamDevice.onGetCarPlate(tHandle, uiImageId, ref tImageInfo, ref tPicInfo);
+                    }
+                }
+            }
+            return 0;
+        }
     }
     }
 }
 }