From ebc75fc65a76b0e1a1863ea0b1812176f5d61e79 Mon Sep 17 00:00:00 2001 From: Jim Morris Date: Sat, 7 Feb 2015 17:57:44 -0800 Subject: [PATCH] fix M665 --- src/modules/robot/Robot.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/modules/robot/Robot.cpp b/src/modules/robot/Robot.cpp index 57270bc6..9b881584 100644 --- a/src/modules/robot/Robot.cpp +++ b/src/modules/robot/Robot.cpp @@ -546,24 +546,24 @@ void Robot::on_gcode_received(void *argument) case 665: { // M665 set optional arm solution variables based on arm solution. gcode->mark_as_taken(); - // the parameter args could be any letter except S so ask solution what options it supports - BaseSolution::arm_options_t options; + // the parameter args could be any letter each arm solution only accepts certain ones + BaseSolution::arm_options_t options= gcode->get_args(); + options.erase('S'); // don't include the S + options.erase('U'); // don't include the U + if(options.size() > 0) { + // set the specified options + arm_solution->set_optional(options); + } + options.clear(); if(arm_solution->get_optional(options)) { + // foreach optional value for(auto &i : options) { - // foreach optional value - char c = i.first; - if(gcode->has_letter(c)) { // set new value - i.second = gcode->get_value(c); - } // print all current values of supported options gcode->stream->printf("%c: %8.4f ", i.first, i.second); gcode->add_nl = true; } - // set the new options - arm_solution->set_optional(options); } - if(gcode->has_letter('S')) { // set delta segments per second, not saved by M500 this->delta_segments_per_second = gcode->get_value('S'); gcode->stream->printf("Delta segments set to %8.4f segs/sec\n", this->delta_segments_per_second); -- 2.20.1