/// <summary> /// connect event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ConnectButton_Click(object sender, EventArgs e) { if (this.ReadCheckBox.Checked == false) { this.sickLidar = new SickLidar.SickLidar( this.HostTxtBox.Text, Convert.ToInt32(this.PortTxtBox.Text), this.SelectDeviceComBox.SelectedIndex, Convert.ToInt32(this.ScalingFactorTxtBox.Text), false ); if (this.SaveCheckBox.Checked == true) { this.lidarFile = new File(this.SaveCheckBox.Checked, this.ReadCheckBox.Checked); } } else { this.sickLidar = new SickLidar.SickLidar( this.SelectDeviceComBox.SelectedIndex, Convert.ToInt32(this.ScalingFactorTxtBox.Text) ); this.lidarFile = new File(this.SaveCheckBox.Checked, this.ReadCheckBox.Checked); } this.SickTimer.Interval = Convert.ToInt32(this.IntervalTxtBox.Text); this.SickTimer.Enabled = true; }
/// <summary> /// Initialize Lidar Sensor /// </summary> private void LidarConnect() { this.isIniLidarInfo = false; this.graph = new SickLidar.Graph(); this.graph.CreateGraph(zg1); if (this.LidarReadCheckBox.Checked == false) { this.sickLidar = new SickLidar.SickLidar( this.LidarHostTxtBox.Text, Convert.ToInt32(this.LidarPortTxtBox.Text), this.LidarSelectComboBox.SelectedIndex, Convert.ToDouble(this.LidarScalingTxtBox.Text), false ); if (this.LidarSaveCheckBox.Checked == true) { this.lidarFile = new SickLidar.File( this.LidarSaveCheckBox.Checked, this.LidarReadCheckBox.Checked ); } } else { this.sickLidar = new SickLidar.SickLidar( this.LidarSelectComboBox.SelectedIndex, Convert.ToDouble(this.LidarScalingTxtBox.Text) ); this.lidarFile = new SickLidar.File( this.LidarSaveCheckBox.Checked, this.LidarReadCheckBox.Checked ); } // openGl display if (this.LidarOpenGlCheckBox.Checked == true) { this.lidarOpenGlForm = new LidarOpenGlForm(); this.lidarOpenGlForm.Show(); } }