示例#1
0
        /// <summary>
        /// 用于注销当前子窗体信息
        /// </summary>
        public void Log_Off()
        {
            //设置图标
            btn_connect_com.Content = "Connect";

            // 串口关闭的时候清空显示
            btn_connect_com.Content = "Connect";
            for (int i = 0; i < mDataInfoLabelList.Count; i++)
            {
                mDataInfoLabelList[i].Content = null;
            }
            GpsState.SetUnactive();
        }
示例#2
0
        /// <summary>
        /// 更新线程
        /// </summary>
        public void UpdateUI_Thread()
        {
            // 更新UI
            this.Dispatcher.Invoke(new Action(() =>
            {
                // 扫描更新界面
                for (int i = 0; i < mDataInfoLabelList.Count; i++)
                {
                    // 是否可以更新
                    if (mModel.MCustomDataModel.DataBaseList[i] != null)
                    {
                        if (mModel.MCustomDataModel.DataBaseList[i].IsUpdate == true)
                        {
                            // 设置信息
                            mDataInfoLabelList[i].Content = mModel.MCustomDataModel.DataBaseList[i].Info;

                            mModel.MCustomDataModel.DataBaseList[i].IsUpdate = false;
                        }
                        else
                        {
                            // 如果在范围内
                            if (i >= CustomDataModel.LABEL_PSEUDORANGE && i <= CustomDataModel.LABEL_GDOP)
                            {
                                mDataInfoLabelList[i].Content = "----";
                            }
                        }
                    }
                }

                // 如果定位标志可更新
                if (mModel.MCustomDataModel.DataBaseList[CustomDataModel.POS_STATE].IsUpdate)
                {
                    // 获取id号
                    int id = Convert.ToInt32(mModel.MCustomDataModel.DataBaseList[CustomDataModel.POS_STATE].Info);

                    // 如果id正确
                    if (id == User_Model.GGA_POS_SUCCESSFUL_IDENTIFIER1 || id == User_Model.GGA_POS_SUCCESSFUL_IDENTIFIER2)
                    {
                        // 激活状态
                        GpsState.SetActive();
                    }
                    else
                    {
                        GpsState.SetUnactive();
                    }
                    mModel.MCustomDataModel.DataBaseList[CustomDataModel.POS_STATE].IsUpdate = false;
                }
            }));
        }