示例#1
0
        public Plate()
        {
            ConnectCallback = new CLIENT_LPRC_ConnectCallback(OnConnectCallback);
            DataEx2Callback = new CLIENT_LPRC_DataEx2Callback(OnDataEx2Callback);
            JpegCallback    = new CLIENT_LPRC_JpegCallback(OnJpegCallback);
            //SerialDataCallback = new CLIENT_LPRC_SerialDataCallback(OnSerialDataCallback);
            pIP = Marshal.StringToHGlobalAnsi(Properties.Settings.Default.Plate_IPAddr);

            //注册回调函数
            NativeMethods.CLIENT_LPRC_RegCLIENTConnEvent(ConnectCallback);
            NativeMethods.CLIENT_LPRC_RegDataEx2Event(DataEx2Callback);
            NativeMethods.CLIENT_LPRC_RegJpegEvent(JpegCallback);
            //NativeMethods.CLIENT_LPRC_RegSerialDataEvent(SerialDataCallback);

            CallbackTimer = new System.Threading.Timer(PlateStartLink, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(0));
        }
示例#2
0
        public Plate()
        {
            this.ConnectCallback    = new CLIENT_LPRC_ConnectCallback(this.OnConnectCallback);
            this.DataEx2Callback    = new CLIENT_LPRC_DataEx2Callback(OnDataEx2Callback);
            this.JpegCallback       = new CLIENT_LPRC_JpegCallback(OnJpegCallback);
            this.SerialDataCallback = new CLIENT_LPRC_SerialDataCallback(OnSerialDataCallback);
            pIP = Marshal.StringToHGlobalAnsi(Properties.Settings.Default.PlateIPAddr);

            //注册回调函数
            NativeMethods.CLIENT_LPRC_RegCLIENTConnEvent(this.ConnectCallback);
            NativeMethods.CLIENT_LPRC_RegDataEx2Event(this.DataEx2Callback);
            NativeMethods.CLIENT_LPRC_RegJpegEvent(this.JpegCallback);
            NativeMethods.CLIENT_LPRC_RegSerialDataEvent(this.SerialDataCallback);

            delegatesOpenGate = Gate.Gate.OpenDoor;
        }
示例#3
0
        private bool disposedValue = false; // 要检测冗余调用

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: 释放托管状态(托管对象)。
                    CallbackTimer.Dispose();
                }
                //释放所有SDK资源
                Play(false);
                ConnectCallback = null;
                DataEx2Callback = null;
                JpegCallback    = null;
                //SerialDataCallback = null;
                NativeMethods.CLIENT_LPRC_QuitSDK();

                // TODO: 释放未托管的资源(未托管的对象)并在以下内容中替代终结器。
                // TODO: 将大型字段设置为 null。
                disposedValue = true;
            }
        }
示例#4
0
 public static extern void CLIENT_LPRC_RegJpegEvent(CLIENT_LPRC_JpegCallback JpegInfo);