ENH: modify config for N1

Change-Id: I151eb7ecabb1e5a8a2af95294cc03ffe92f6b660
Signed-off-by: Stone Li <stone.li@bambulab.com>
(cherry picked from commit 6d02a722798302c8648a62d86bcddc2650a47ea4)
This commit is contained in:
Stone Li 2023-07-05 20:07:08 +08:00 committed by Lane.Wei
parent 68d40d3c14
commit b7a0499abc
2 changed files with 19 additions and 2 deletions

View file

@ -1983,8 +1983,17 @@ int MachineObject::command_ams_switch_filament(bool switch_filament)
return this->publish_json(j.dump());
}
int MachineObject::command_axis_control(std::string axis, double unit, double value, int speed)
int MachineObject::command_axis_control(std::string axis, double unit, double input_val, int speed)
{
double value = input_val;
if (!is_core_xy()) {
if ( axis.compare("Y") == 0
|| axis.compare("Z") == 0) {
value = -1.0 * input_val;
}
}
char cmd[256];
if (axis.compare("X") == 0
|| axis.compare("Y") == 0
@ -2415,6 +2424,13 @@ bool MachineObject::is_printing_finished()
return false;
}
bool MachineObject::is_core_xy()
{
if (printer_type == "N1")
return false;
return true;
}
void MachineObject::reset_update_time()
{
BOOST_LOG_TRIVIAL(trace) << "reset reset_update_time, dev_id =" << dev_id;

View file

@ -811,7 +811,7 @@ public:
int command_set_printing_option(bool auto_recovery);
// axis string is X, Y, Z, E
int command_axis_control(std::string axis, double unit = 1.0f, double value = 1.0f, int speed = 3000);
int command_axis_control(std::string axis, double unit = 1.0f, double input_val = 1.0f, int speed = 3000);
// calibration printer
bool is_support_command_calibration();
@ -852,6 +852,7 @@ public:
bool is_in_printing();
bool is_in_prepare();
bool is_printing_finished();
bool is_core_xy();
void reset_update_time();
void reset();
static bool is_in_printing_status(std::string status);