Пример #1
0
        private void btnAddSiemens1200DataAquision_Click(object sender, EventArgs e)
        {
            Siemens1200Panel pPanel = new Siemens1200Panel();

            pPanel.TopLevel = false;
            pPanel.Parent   = mainFlowLayoutPanel;
            pPanel.Show();
        }
Пример #2
0
 private void LoadLastCfgFile()
 {
     try
     {
         StreamReader sr   = new StreamReader("DataAcquisitionConfig.ini", Encoding.Default);
         string       line = null;
         while ((line = sr.ReadLine()) != null)
         {
             if (line == "Omron501Panel")
             {
                 Omron501Panel panel = new Omron501Panel();
                 panel.TopLevel = false;
                 panel.Show();
                 panel.Parent      = mainFlowLayoutPanel;
                 line              = sr.ReadLine();
                 line              = sr.ReadLine();
                 panel.IpAddr.Text = line;
                 line              = sr.ReadLine();
                 line              = sr.ReadLine();
                 panel.Port.Text   = line;
             }
             else if (line == "MitsubishiFX3uPanel")
             {
                 MitsubishiFX3uPanel panel = new MitsubishiFX3uPanel();
                 panel.TopLevel = false;
                 panel.Show();
                 panel.Parent      = mainFlowLayoutPanel;
                 line              = sr.ReadLine();
                 line              = sr.ReadLine();
                 panel.IpAddr.Text = line;
                 line              = sr.ReadLine();
                 line              = sr.ReadLine();
                 panel.Port.Text   = line;
             }
             else if (line == "Siemens1200Panel")
             {
                 Siemens1200Panel panel = new Siemens1200Panel();
                 panel.TopLevel = false;
                 panel.Show();
                 panel.Parent      = mainFlowLayoutPanel;
                 line              = sr.ReadLine();
                 line              = sr.ReadLine();
                 panel.IpAddr.Text = line;
                 line              = sr.ReadLine();
                 line              = sr.ReadLine();
                 panel.Port.Text   = line;
             }
             else if (line == "Siemens200Panel")
             {
                 Siemens200Panel panel = new Siemens200Panel();
                 panel.TopLevel = false;
                 panel.Show();
                 panel.Parent      = mainFlowLayoutPanel;
                 line              = sr.ReadLine();
                 line              = sr.ReadLine();
                 panel.IpAddr.Text = line;
                 line              = sr.ReadLine();
                 line              = sr.ReadLine();
                 panel.Port.Text   = line;
             }
         }
         sr.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show("加载上一次关闭软件时的配置文件失败,原因:\n" + ex.Message);
     }
 }