private void CheckBox_Unchecked(object sender, RoutedEventArgs e) { if (!isConnectted) { return; } CheckBox obj = (CheckBox)sender; String con = obj.Content.ToString(); if (con == "Grab") // cancel grab { currentCmd.isJoint = isJoint; currentCmd.cmd = JogCmd.JogRelease; DobotDll.SetJogInstantCmd(ref currentCmd); } else if (con == "Laser") // release laser { currentCmd.isJoint = isJoint; currentCmd.cmd = JogCmd.JogLaserOff; DobotDll.SetJogInstantCmd(ref currentCmd); } }
private void CheckBox_Checked(object sender, RoutedEventArgs e) { if (!isConnectted) { return; } CheckBox obj = (CheckBox)sender; String con = obj.Content.ToString(); if (con == "Grab") // grab { currentCmd.isJoint = isJoint; currentCmd.cmd = JogCmd.JogGrab; DobotDll.SetJogInstantCmd(ref currentCmd); } else if (con == "Laser") // Shutting { currentCmd.isJoint = isJoint; currentCmd.cmd = JogCmd.JogLaserOn; DobotDll.SetJogInstantCmd(ref currentCmd); } }
//Notaus-Event, versetzt den roboter in den Ruhezustand private void btn_notaus_Click(object sender, EventArgs e) { currentCmd.cmd = JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); }
//Z- private void btnzminus_MouseDown(object sender, MouseEventArgs e) { currentCmd.cmd = JogCmd.JogCNPressed; DobotDll.SetJogInstantCmd(ref currentCmd); }
//Stillstand (wird bei allen buttons bei mouse-down aufgerunfen) private void btnxplus_MouseUp(object sender, MouseEventArgs e) { currentCmd.cmd = JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); }
// control event handle private void OnEvent(object sender, MouseButtonEventArgs e) { if (!isConnectted) { return; } Button obj = (Button)sender; String con = obj.Content.ToString(); switch (con) { case "X+": case "Joint1+": { currentCmd.isJoint = isJoint; currentCmd.cmd = e.ButtonState == MouseButtonState.Pressed? JogCmd.JogAPPressed : JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); } break; case "X-": case "Joint1-": { currentCmd.isJoint = isJoint; currentCmd.cmd = e.ButtonState == MouseButtonState.Pressed ? JogCmd.JogANPressed : JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); } break; case "Y+": case "Joint2+": { currentCmd.isJoint = isJoint; currentCmd.cmd = e.ButtonState == MouseButtonState.Pressed ? JogCmd.JogBPPressed : JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); } break; case "Y-": case "Joint2-": { currentCmd.isJoint = isJoint; currentCmd.cmd = e.ButtonState == MouseButtonState.Pressed ? JogCmd.JogBNPressed : JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); } break; case "Z+": case "Joint3+": { currentCmd.isJoint = isJoint; currentCmd.cmd = e.ButtonState == MouseButtonState.Pressed ? JogCmd.JogCPPressed : JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); } break; case "Z-": case "Joint3-": { currentCmd.isJoint = isJoint; currentCmd.cmd = e.ButtonState == MouseButtonState.Pressed ? JogCmd.JogCNPressed : JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); } break; case "R+": case "Joint4+": { currentCmd.isJoint = isJoint; currentCmd.cmd = e.ButtonState == MouseButtonState.Pressed ? JogCmd.JogDPPressed : JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); } break; case "R-": case "Joint4-": { currentCmd.isJoint = isJoint; currentCmd.cmd = e.ButtonState == MouseButtonState.Pressed ? JogCmd.JogDNPressed : JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); } break; case "Gripper+": { currentCmd.isJoint = isJoint; currentCmd.cmd = e.ButtonState == MouseButtonState.Pressed ? JogCmd.JogGPPressed : JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); } break; case "Gripper-": { currentCmd.isJoint = isJoint; currentCmd.cmd = e.ButtonState == MouseButtonState.Pressed ? JogCmd.JogGNPressed : JogCmd.JogIdle; DobotDll.SetJogInstantCmd(ref currentCmd); } break; default: break; } }