Пример #1
0
 /// <summary>
 /// 获取激光雷达实例
 /// </summary>
 /// <param name="portName"></param>
 /// <returns></returns>
 public static UrgPort getInstance(string portName)
 {
     if (urgPort == null)
     {
         urgPort = new UrgPort(portName);
     }
     return(urgPort);
 }
Пример #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     urg = UrgPort.getInstance(this.textBox1.Text);
     if (!openState)
     {
         openState         = urg.openPort();
         this.button1.Text = "closePort";
     }
     else
     {
         openState         = !urg.closePort();
         this.button1.Text = "openPort";
     }
 }