예제 #1
0
        /// <summary>
        /// 响应设备设置name结果通知
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="strDeviceMac"></param>
        private static void deviceNameResultNotify(IntPtr ctx, String strDeviceMac, int res, String strDeviceName)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                rbtNetThis.deviceNameResult_?.Invoke(ctx, strDeviceMac, res, strDeviceName);
            }
        }
예제 #2
0
        private static void deviceBattery(IntPtr ctx, String pMac, eBatteryStatus battery)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null && rbtNetThis.DeviceBatteryEvt_ != null)
            {
                rbtNetThis.DeviceBatteryEvt_(ctx, pMac, battery);
            }
        }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="strDeviceMac"></param>
        /// <param name="us"></param>
        /// <param name="ux"></param>
        /// <param name="uy"></param>
        /// <param name="up"></param>
        /// <param name="buffer"></param>
        /// <param name="len"></param>
        private static void originDataNotifyEx(IntPtr ctx, IntPtr strDeviceMac, int currentPage, ushort us, ushort ux, ushort uy, ushort up, IntPtr buffer, int len)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                rbtNetThis.originDataNewExEvt_?.Invoke(ctx, strDeviceMac, currentPage, us, ux, uy, up, buffer, len);
            }
        }
예제 #4
0
        /// <summary>
        /// 设备删除离线笔记回调
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="pMac"></param>
        /// <param name="result"></param>
        private static void deleteNotes(IntPtr ctx, String pMac, int result)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                rbtNetThis.deleteNotesEvt_?.Invoke(ctx, pMac, result);
            }
        }
예제 #5
0
        /// <summary>
        /// 响应设备MAC地址通知
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="strDeviceMac"></param>
        private static void deviceMacNotify(IntPtr ctx, System.String strDeviceMac)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                rbtNetThis.deviceMacEvt_?.Invoke(ctx, strDeviceMac);
            }
        }
예제 #6
0
        private static void keyAnswer(IntPtr ctx, String pMac, int key)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null && rbtNetThis.KeyAnswerEvt_ != null)
            {
                rbtNetThis.KeyAnswerEvt_(ctx, pMac, key);
            }
        }
예제 #7
0
        /// <summary>
        /// 响应设备设置name通知
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="strDeviceMac"></param>
        private static void deviceNameNotify(IntPtr ctx, System.String strDeviceMac, System.String strDeviceName)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null && rbtNetThis.deviceNameEvt_ != null)
            {
                rbtNetThis.deviceNameEvt_(ctx, strDeviceMac, strDeviceName);
            }
        }
예제 #8
0
        /// <summary>
        /// 处理画布清空事件
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="pmac"></param>
        private static void deviceClearCanvas(IntPtr ctx, String pmac, int type, int canvasID)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null && rbtNetThis.deviceError_ != null)
            {
                rbtNetThis.deviceCanvasID_(ctx, pmac, type, canvasID);
            }
        }
예제 #9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="pMac"></param>
        /// <param name="type"></param>
        private static void deviceType(IntPtr ctx, String pMac, int type)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null && rbtNetThis.DeviceTypeEvt_ != null)
            {
                rbtNetThis.DeviceTypeEvt_(ctx, pMac, type);
            }
        }
예제 #10
0
        /// <summary>
        /// 设备上报选择题答题结果事件
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="strDeviceMac"></param>
        /// <param name="result"></param>
        /// <param name="nResultSize"></param>
        private static void deviceAnswerResult(IntPtr ctx, IntPtr strDeviceMac, int resID, IntPtr result, int nResultSize)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null && rbtNetThis.deviceAnswerResultEvt_ != null)
            {
                rbtNetThis.deviceAnswerResultEvt_(ctx, strDeviceMac, resID, result, nResultSize);
            }
        }
예제 #11
0
        /// <summary>
        /// 处理设备错误信息的方法
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="pmac"></param>
        /// <param name="cmd"></param>
        /// <param name="msg"></param>
        private static void deviceError(IntPtr ctx, String pmac, int cmd, String msg)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null && rbtNetThis.deviceError_ != null)
            {
                rbtNetThis.deviceError_(ctx, pmac, cmd, msg);
            }
        }
예제 #12
0
        /// <summary>
        /// 响应设备连接断开消息
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="strDeviceMac"></param>
        private static void deviceDisconnect(IntPtr ctx, IntPtr strDeviceMac)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null && rbtNetThis.deviceDisconnectEvt_ != null)
            {
                rbtNetThis.deviceDisconnectEvt_(ctx, strDeviceMac);
            }
        }
예제 #13
0
        /// <summary>
        /// 设备按键消息上报通知
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="strDeviceMac"></param>
        /// <param name="keyValue"></param>
        private static void deviceKeyPress(IntPtr ctx, IntPtr strDeviceMac, int keyValue)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null && rbtNetThis.deviceKeyPressEvt_ != null)
            {
                rbtNetThis.deviceKeyPressEvt_(ctx, strDeviceMac, keyValue);
            }
        }
예제 #14
0
        private static void hardInfo(IntPtr ctx, String pMac, int xRange, int yRange, int LPI, int pageNum)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null && rbtNetThis.HardInfoEvt_ != null)
            {
                rbtNetThis.HardInfoEvt_(ctx, pMac, xRange, yRange, LPI, pageNum);
            }
        }
예제 #15
0
        /// <summary>
        /// 优化笔记数据回调
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="pmac"></param>
        /// <param name="us"></param>
        /// <param name="ux"></param>
        /// <param name="uy"></param>
        /// <param name="width"></param>
        /// <param name="speed"></param>
        private static void optimizeDataEx(IntPtr ctx, IntPtr pmac, int currentPage, ushort us, ushort ux, ushort uy, float width, float speed)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                rbtNetThis.optimizeDataExEvt_?.Invoke(ctx, pmac, currentPage, us, ux, uy, width, speed);
            }
        }
예제 #16
0
        private static void deviceInfo(IntPtr ctx, String pMac, String version, String deviceMac, int hardNum)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null && rbtNetThis.DeviceInfoEvt_ != null)
            {
                rbtNetThis.DeviceInfoEvt_(ctx, pMac, version, deviceMac, hardNum);
            }
        }
예제 #17
0
        private static void errorPacket(IntPtr ctx)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                rbtNetThis.errorPacketEvt_?.Invoke(ctx);
            }
        }
예제 #18
0
        /// <summary>
        /// 设备上线回调
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="strDeviceMac"></param>
        private static void accept(IntPtr ctx, string strDeviceMac)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                rbtNetThis.acceptEvt_?.Invoke(ctx, strDeviceMac);
            }
        }
예제 #19
0
        /// <summary>
        /// 测试类题目切换题目上报的题号
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="pMac"></param>
        /// <param name="nNum"></param>
        private static void currentWritingNum(IntPtr ctx, String pMac, int nNum)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                rbtNetThis.CurrentWritingNumEvt_?.Invoke(ctx, pMac, nNum);
            }
        }
예제 #20
0
        /// <summary>
        /// X10上报扫描信息(x坐标,y坐标,旋转角度)
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="pMac"></param>
        /// <param name="fX"></param>
        /// <param name="fY"></param>
        /// <param name="nAngle"></param>
        private static void oidPageInfo(IntPtr ctx, String pMac, float fX, float fY, int nAngle)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                rbtNetThis.oidPageInfoEvt_?.Invoke(ctx, pMac, fX, fY, nAngle);
            }
        }
예제 #21
0
        private static void optimizeData(IntPtr ctx, IntPtr pmac, ushort us, ushort ux, ushort uy, float width, float speed)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                if (rbtNetThis.deviceOptimizeDataEvt_ != null)
                {
                    rbtNetThis.deviceOptimizeDataEvt_(ctx, pmac, us, ux, uy, width, speed);
                }
            }
        }
예제 #22
0
        /// <summary>
        /// 设备ip地址回调
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="pMac"></param>
        /// <param name="ip"></param>
        private static void deviceip(IntPtr ctx, String pMac, String ip)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                string wd = ip.Substring(0, ip.LastIndexOf('.'));
                if (ipdic.ContainsKey(wd))
                {
                    rbtNetThis.DeviceIpEvt_?.Invoke(ctx, pMac, ip, ipdic[wd]);
                }
            }
        }
예제 #23
0
        /// <summary>
        /// 设备上报页码识别事件
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="strDeviceMac"></param>
        /// <param name="nNoteId"></param>
        /// <param name="nPageId"></param>
        private static void deviceShowPageNew(IntPtr ctx, IntPtr strDeviceMac, int nNoteId, int nPageId, int nPageInfo)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                int _nPageInfo = 0;
                if (nPageInfo != 0)
                {
                    string d    = System.Convert.ToString(nPageInfo, 2);
                    int    dlen = d.Length;
                    for (int j = 0; j < 17 - dlen; j++)
                    {
                        d = "0" + d;
                    }
                    switch (rbtNetThis.pt)
                    {
                    case PrintType.Base:
                    default:
                        _nPageInfo = nPageInfo;
                        break;

                    case PrintType.Fault_tolerance:
                        string code = "" + d[1] + d[6] + d[9] + d[12] + d[15];
                        _nPageInfo = Convert.ToInt32(code, 2);
                        break;

                    case PrintType.Fault_tolerance2:
                        string code2 = "" + d[0] + d[2] + d[5] + d[7] + d[9] + d[11] + d[13] + d[15];
                        _nPageInfo = Convert.ToInt32(code2, 2);
                        break;

                    case PrintType.TyMode:
                        string code3 = "" + d[9] + d[10] + d[11] + d[12] + d.Substring(0, 9);
                        string code4 = "" + d[13] + d[14] + d[15] + d[16];
                        _nPageInfo = nPageInfo;
                        nNoteId    = Convert.ToInt32(code3, 2);
                        nPageId    = Convert.ToInt32(code4, 2);
                        break;
                    }
                }

                rbtNetThis.deviceShowPageNewEvt_?.Invoke(ctx, strDeviceMac, nNoteId, nPageId, _nPageInfo);
                rbtNetThis.deviceShowPageEvt_?.Invoke(ctx, strDeviceMac, nNoteId, nPageId);
            }
        }
예제 #24
0
        /// <summary>
        /// 设备上报页码识别事件
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="strDeviceMac"></param>
        /// <param name="nNoteId"></param>
        /// <param name="nPageId"></param>
        private static void deviceShowPageNew(IntPtr ctx, IntPtr strDeviceMac, int nNoteId, int nPageId, int nPageInfo)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                if (rbtNetThis.deviceShowPageNewEvt_ != null)
                {
                    rbtNetThis.deviceShowPageNewEvt_(ctx, strDeviceMac, nNoteId, nPageId, nPageInfo);
                }
                else if (rbtNetThis.deviceShowPageEvt_ != null)
                {
                    rbtNetThis.deviceShowPageEvt_(ctx, strDeviceMac, nNoteId, nPageId);
                }
            }
        }
예제 #25
0
        /// <summary>
        /// 坐标原点数据通知
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="strDeviceMac"></param>
        /// <param name="us"></param>
        /// <param name="ux"></param>
        /// <param name="uy"></param>
        /// <param name="up"></param>
        /// <param name="buffer"></param>
        /// <param name="len"></param>
        private static void originDataNotifyNew(IntPtr ctx, IntPtr strDeviceMac, ushort us, ushort ux, ushort uy, ushort up, IntPtr buffer, int len)
        {
            GCHandle thisHandle = GCHandle.FromIntPtr(ctx);
            RbtNet   rbtNetThis = (RbtNet)thisHandle.Target;

            if (rbtNetThis != null)
            {
                if (rbtNetThis.deviceOriginDataNewEvt_ != null)
                {
                    rbtNetThis.deviceOriginDataNewEvt_(ctx, strDeviceMac, us, ux, uy, up, buffer, len);
                }
                else if (rbtNetThis.deviceOriginDataEvt_ != null)
                {
                    string bufferStr = Marshal.PtrToStringAnsi(buffer);
                    rbtNetThis.deviceOriginDataEvt_(ctx, strDeviceMac, us, ux, uy, up);
                }
            }
        }