Exemple #1
0
 public FormKeyenceSR700(KeyenceSR700Data data)
 {
     InitializeComponent();
     codeReaderData = data;
     panelMain.Text = data.Name;
     driver         = null;
 }
Exemple #2
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     try
     {
         if (null == codeReaderData)
         {
             throw new Exception();
         }
         if (null == driver)
         {
             if (!HardwareManage.dicHardwareDriver.ContainsKey(codeReaderData.Name))
             {
                 throw new Exception();
             }
             driver = (KeyenceSR700)HardwareManage.dicHardwareDriver[codeReaderData.Name];
         }
         if (driver.IsConnected())
         {
             labConnSta.Text      = "Connect successfully.";
             labConnSta.BackColor = Color.Green;
             btnConnect.Text      = "Disconnect";
         }
         else
         {
             labConnSta.Text      = "Connect failed.";
             labConnSta.BackColor = Color.Red;
             btnConnect.Text      = "Connect";
         }
     }
     catch (Exception)
     {
         driver               = null;
         labConnSta.Text      = "Connect failed.";
         labConnSta.BackColor = Color.Red;
     }
 }