Пример #1
0
        private void LoadForm_Load(object sender, EventArgs e)
        {
            dlog.WirteLog("loadstart\r\n");
            //读取参数表
            try
            {
                //dlog = new log();
                //dlog.CreatLogFile("log.txt");
                Setfile = new Setting();
                sparmas = Setfile.ReadParams();
            }
            catch //(System.Exception ex)
            {
                try
                {
                    SetDefault();
                }
                catch //(System.Exception ex2)
                {
                    IsExit = true;
                    this.Close();
                    return;
                }
            }
            dlog.WirteLog("read params\r\n");
            Pc = new PowerC((PowerControl.PDA_Type)sparmas.PdaType);
            //if (sparmas.PdaType != 1 && sparmas.PdaType != 4 && sparmas.PdaType != -1)
            Pc.PowerUP();
            dlog.WirteLog("power up\r\n");
            if (sparmas.RunType == 1)
            {
                Funpercent = HandlePercent;
                RunThread  = new Thread(new ThreadStart(Running));
                RunThread.Start();
                //if (dlog != null)
                //    dlog.WirteLog("connect name:" + RunThread.Name + " " + RunThread.ManagedThreadId.ToString()+"\n");
                Runningl = true;

                dlog.WirteLog("connect to reader\r\n");
            }
            else
            {
                this.Close();
            }
        }
Пример #2
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();
            }
        }
Пример #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();
        }