Exemplo n.º 1
0
        public int openGpsDialog(Pu pu, int channelNo)
        {
            foreach (OneDialog dlg in m_gpsDialogs)
            {
                if (dlg.pu.id.Equals(pu.id, StringComparison.CurrentCultureIgnoreCase) &&
                    dlg.channelNo == channelNo)
                {
                    LogHelper.LogHelper.RecordLog(51, string.Format("已经发送打开[{0}, {1}]Gps通道的命令", pu.puName, channelNo));
                    return(-1);
                }
            }
            IntPtr dialog = IntPtr.Zero;
            int    ret    = BVCU.ManagedLayer_CuOpenGpsDialog(m_bvsdkHandle, ref dialog, m_session.Handle, Encoding.UTF8.GetBytes(pu.id), channelNo, m_bvsdkEventHandler.gpsDialog_OnEvent, m_bvsdkEventHandler.gpsDialog_OnData);

            if (BVCU.BVCU_RESULT_S_OK == ret)
            {
                OneDialog dlg = new OneDialog();
                dlg.dialogHandle = dialog;
                dlg.channelNo    = channelNo;
                dlg.pu           = pu;
                m_gpsDialogs.Add(dlg);

                LogHelper.LogHelper.RecordLog(3, string.Format("正在打开{0}, {1}的Gps通道...", pu.puName, channelNo));
                return(0);
            }
            else
            {
                LogHelper.LogHelper.RecordLog(3, string.Format("打开{0}, {1}的Gps通道失败, 错误码:{2}", pu.puName, channelNo, ret));
            }
            return(-1);
        }
Exemplo n.º 2
0
        public int openGpsDialog(Session.Pu pu, int channelNo)
        {
            foreach (OneDialog dlg in m_gpsDialogs)
            {
                if (dlg.pu.id.Equals(pu.id, StringComparison.CurrentCultureIgnoreCase) &&
                    dlg.channelNo == channelNo)
                {
                    return(-1);
                }
            }
            IntPtr dialog = IntPtr.Zero;

            if (BVCU.ManagedLayer_CuOpenGpsDialog(m_bvsdkHandle, ref dialog, m_session.Handle, Encoding.UTF8.GetBytes(pu.id),
                                                  channelNo, m_bvsdkEventHandler.gpsDialog_OnEvent, m_bvsdkEventHandler.gpsDialog_OnData)
                == BVCU.BVCU_RESULT_S_OK)
            {
                OneDialog dlg = new OneDialog();
                dlg.dialogHandle = dialog;
                dlg.channelNo    = channelNo;
                dlg.pu           = pu;
                m_gpsDialogs.Add(dlg);
                return(0);
            }
            return(-1);
        }