public static string TachoMotor_Commands_To_String(TachoMotor_Commands x) { switch (x) { case (TachoMotor_Commands.reset): return("reset"); case (TachoMotor_Commands.run_direct): return("run-direct"); case (TachoMotor_Commands.run_forever): return("run-forever"); case (TachoMotor_Commands.run_timed): return("run-timed"); case (TachoMotor_Commands.run_to_abs_pos): return("run-to-abs-pos"); case (TachoMotor_Commands.run_to_rel_pos): return("run-to-rel-pos"); case (TachoMotor_Commands.stop): return("stop"); default: return("INVALID"); } }
public void SetCommand(TachoMotor_Commands to) { if (to == TachoMotor_Commands.unknown) { throw new InvalidOperationException("this is a filler since command cant be read from DO NOT USE THIS AS A COMMAND TO SEND"); } else { WriteVar("command", TachoMotor_Commands_To_String(to)); } }