Beispiel #1
0
        void FormMain_Load(object sender, EventArgs e)                              //窗体加载函数
        {
            /*************恢复参数 Start****************/
            int _parameter1 = Properties.Settings.Default._parameter1;

            checkBox_Color.Checked                 = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_anti_color);
            checkBox_LimitRecLen.Checked           = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_max_recv_length);
            checkBox_Cmdline.Checked               = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_cmdline_chk);
            checkBox_Backgroup.Checked             = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_run_in_backgroup);
            checkBox_ClearRecvWhenFastSave.Checked = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_clear_data_when_fastsave);
            checkBox_Fliter.Checked                = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_messy_code_fliter);
            checkBox_MidMouseClear.Checked         = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_middle_mouse_clear);
            checkBox_esc_clear_data.Checked        = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_esc_clear);
            checkBox_ASCII_Rcv.Checked             = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_ascii_receive);
            checkBox_ASCII_Snd.Checked             = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_ascii_send);

            etcp.is_server = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_netcom_is_server);
            textBox_custom_baudrate.Text = Properties.Settings.Default.user_baudrate;
            button_FastSavePath.Text     = "Fast save path: " + Properties.Settings.Default.fastsave_path;

            Func_Set_AddTime_Color();

            TextFont_Change();
            /*************恢复参数 End******************/


            /*************网络初始化 Start****************/
            label_ShowIP.Text = etcp.ShowLocalIP();
            etcp.Init();
            Func_NetCom_ChangeFont(etcp.is_server);
            /*************网络初始化 End******************/


            /*************串口初始化 Start****************/
            com.fm.etcp = etcp;
            com.fm.fp   = fp;

            com.ControlModule_Init(comboBox_COMNumber, comboBox_COMBaudrate,
                                   comboBox_COMCheckBit, comboBox_COMDataBit, comboBox_COMStopBit);
            com.Init(checkBox_Cmdline.Checked, checkBox_ASCII_Rcv.Checked, checkBox_ASCII_Snd.Checked,
                     checkBox_Fliter.Checked, int.Parse(textBox_custom_baudrate.Text));

            com.thread_txt_update = new Thread(ThreadEntry_TxtUpdate);
            com.thread_txt_update.IsBackground = true;
            com.thread_txt_update.Start();
            /*************串口初始化 End******************/


            /*************FastPrint start****************/
            fp.Init(Properties.Settings.Default.fp_hex0_path,
                    Properties.Settings.Default.fp_hex1_path);
            Func_FastPrint_Init();
            /*************FastPrint End******************/

            Set_Form_Text("", "");
        }
Beispiel #2
0
        void FormMain_Load(object sender, EventArgs e)                              //窗体加载函数
        {
            /*************恢复参数 Start****************/
            int _parameter1 = Properties.Settings.Default._parameter1;

            checkBox_Color.Checked                 = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_anti_color);
            checkBox_LimitRecLen.Checked           = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_max_recv_length);
            checkBox_Cmdline.Checked               = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_cmdline_chk);
            checkBox_Backgroup.Checked             = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_run_in_backgroup);
            checkBox_ClearRecvWhenFastSave.Checked = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_clear_data_when_fastsave);
            checkBox_Fliter.Checked                = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_messy_code_fliter);
            checkBox_MidMouseClear.Checked         = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_middle_mouse_clear);
            checkBox_esc_clear_data.Checked        = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_esc_clear);
            checkBox_ASCII_Rcv.Checked             = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_ascii_receive);
            checkBox_ASCII_Snd.Checked             = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_ascii_send);

            etcp.is_server = Parameter.GetBoolFromParameter(_parameter1, Parameter._BitShift_netcom_is_server);
            textBox_custom_baudrate.Text = Properties.Settings.Default.user_baudrate;
            button_FastSavePath.Text     = "Fast save path: " + Properties.Settings.Default.fastsave_path;

            Func_Set_AddTime_Color();

            TextFont_Change();
            /*************恢复参数 End******************/

            Dbg.Init(textBox_Message);

            /*************网络初始化 Start****************/
            label_ShowIP.Text = etcp.ShowLocalIP();
            etcp.Init();
            Func_NetCom_ChangeFont(etcp.is_server);
            /*************网络初始化 End******************/


            /*************串口初始化 Start****************/
            COM_Op.ControlModule_Init(comboBox_COMNumber, comboBox_COMBaudrate, comboBox_COMCheckBit,
                                      comboBox_COMDataBit, comboBox_COMStopBit, 0, main_com.serialport);
            Form_COM_Init();
            Form_SCOM_Init();
            /*************串口初始化 End******************/


            /*************FastPrint start****************/
            fp.Init(Properties.Settings.Default.fp_hex0_path,
                    Properties.Settings.Default.fp_hex1_path);
            /*************FastPrint End******************/

            /****************eCMD start******************/
            RunEXE.Init(textBox_RunExeCode, button_SelectEXE);
            /****************eCMD End********************/

            string current_com_str = "";

            if (comboBox_COMNumber.SelectedIndex != -1)
            {
                current_com_str = comboBox_COMNumber.SelectedItem.ToString();
            }
            Set_Form_Text("", current_com_str);

            FormMain_SizeChanged(null, null);
        }