private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!isConnectted) { return; } ComboBox obj = (ComboBox)sender; String tag = obj.Tag.ToString(); if (tag == "mode") { bool isJ = ((ComboBoxItem)obj.SelectedItem).Content.ToString() == "Axis"; isJoint = isJ ? (byte)1 : (byte)0; if (isJ) { XI.Content = "Joint1+"; YI.Content = "Joint2+"; ZI.Content = "Joint3+"; RI.Content = "Joint4+"; XN.Content = "Joint1-"; YN.Content = "Joint2-"; ZN.Content = "Joint3-"; RN.Content = "Joint4-"; } else { XI.Content = "X+"; YI.Content = "Y+"; ZI.Content = "Z+"; RI.Content = "R+"; XN.Content = "X-"; YN.Content = "Y-"; ZN.Content = "Z-"; RN.Content = "R-"; } } else if (tag == "headType") { string str = ((ComboBoxItem)obj.SelectedItem).Content.ToString(); if (str == "SuctionCup") { cbGrab.IsEnabled = false; cbLaser.IsEnabled = false; cbSuctionCup.IsEnabled = true; EndTypeParams endType; endType.xBias = 59.7f; endType.yBias = 0; endType.zBias = 0; DobotDll.SetEndEffectorParams(ref endType); } else if (str == "Gripper") { cbGrab.IsEnabled = true; cbLaser.IsEnabled = false; cbSuctionCup.IsEnabled = false; EndTypeParams endType; endType.xBias = 59.7f; endType.yBias = 0; endType.zBias = 0; DobotDll.SetEndEffectorParams(ref endType); } else if (str == "Laser") { cbGrab.IsEnabled = false; cbLaser.IsEnabled = true; cbSuctionCup.IsEnabled = false; EndTypeParams endType; endType.xBias = 70f; endType.yBias = 0; endType.zBias = 0; DobotDll.SetEndEffectorParams(ref endType); } } }