Esempio n. 1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public busModule()
        {
            try
            {
                m_IsSucces = false;

                frmLoadReader loadReader = new frmLoadReader();

                loadReader.ShowDialog();

                m_SParams = loadReader.SParams;

                m_SetFile = loadReader.SetFile;

                if (loadReader.SParams.RunType == 1)
                {
                    if (loadReader.IsExitPrg)
                    {
                        //采集模块加载失败!
                        return;
                    }

                    m_IsSucces = true;

                    Reader = loadReader.ReaderO;

                    ReadRunning = false;

                    Sound = new Sound(@"\platform\WavAlias\BEEP.wav");



                    Dictags = new Dictionary <string, int>();

                    lockobj = new Object();

                    m_PowerC = loadReader.Power;
                }
                else if (loadReader.SParams.RunType == 0)
                {
                    m_PowerC = new PowerC((PDA_Type)m_SParams.PdaType);
                }
                else
                {
                    frmUpdateForm ufrm = new frmUpdateForm(m_SParams.Comv);
                    ufrm.ShowDialog();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 设置默认参数信息
        /// </summary>
        private void SetDefault()
        {
            try
            {
                Setting.Params sptemp = Setfile.SetDefault();
                Setfile.Creatxmlfile();
                Setfile.SaveParams(sptemp);

                sparmas = sptemp;
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 画面初始化加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LoadForm_Load(object sender, EventArgs e)
        {
            //读取参数表
            try
            {
                SetLangeage();

                dlog = new log();
                dlog.CreatLogFile("load_reader_log.txt");
                Setfile = new Setting();
                sparmas = Setfile.ReadParams();
            }
            catch (System.Exception ex)
            {
                try
                {
                    SetDefault();
                }
                catch (System.Exception ex2)
                {
                    IsExit = true;
                    this.Close();
                    return;
                }
            }

            powerC = new PowerC((PowerControl.PDA_Type)sparmas.PdaType);
            if (sparmas.PdaType != 1 && sparmas.PdaType != 4 && sparmas.PdaType != -1)
            {
                powerC.PowerUP();
            }

            if (sparmas.RunType == 1)
            {
                Funpercent = HandlePercent;
                RunThread  = new Thread(new ThreadStart(Running));
                RunThread.Start();
                Runningl = true;
            }
            else
            {
                this.Close();
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 设置默认参数信息
        /// </summary>
        private void SetDefault()
        {
            try
            {

                Setting.Params sptemp = Setfile.SetDefault();
                Setfile.Creatxmlfile();
                Setfile.SaveParams(sptemp);

                sparmas = sptemp;
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 画面初始化加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LoadForm_Load(object sender, EventArgs e)
        {
            //读取参数表
            try
            {
                SetLangeage();

                dlog = new log();
                dlog.CreatLogFile("load_reader_log.txt");
                Setfile = new Setting();
                sparmas = Setfile.ReadParams();

            }
            catch (System.Exception ex)
            {
                try
                {
                    SetDefault();
                }
                catch (System.Exception ex2)
                {
                    IsExit = true;
                    this.Close();
                    return;
                }
            }

            powerC = new PowerC((PowerControl.PDA_Type)sparmas.PdaType);
            if (sparmas.PdaType != 1 && sparmas.PdaType != 4 && sparmas.PdaType != -1)
                powerC.PowerUP();

            if (sparmas.RunType == 1)
            {
                Funpercent = HandlePercent;
                RunThread = new Thread(new ThreadStart(Running));
                RunThread.Start();
                Runningl = true;
            }
            else
                this.Close();
        }