Пример #1
0
        private void but_server_Click(object sender, EventArgs e)
        {
            try
            {
                server?.Stop();
                switch (version)
                {
                case MitsubishiVersion.A_1E:
                    server = new MitsubishiA1EServer(int.Parse(txt_port.Text.Trim()));
                    break;

                case MitsubishiVersion.Qna_3E:
                    server = new MitsubishiQna3EServer(int.Parse(txt_port.Text.Trim()));
                    break;
                }
                server.Start();
                but_server.Enabled       = false;
                but_close_server.Enabled = true;
                AppendText($"开启仿真模拟服务");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void but_server_Click(object sender, EventArgs e)
 {
     try
     {
         server?.Stop();
         server = new OmronFinsServer(int.Parse(txt_port.Text.Trim()));
         server.Start();
         but_server.Enabled       = false;
         but_close_server.Enabled = true;
         AppendText($"开启仿真模拟服务");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }