correct my last commit, it's better like that

This commit is contained in:
sinseman44
2020-11-11 11:44:38 +00:00
parent 9f72d48a5a
commit a0b5b0d0d5
2 changed files with 9 additions and 9 deletions

View File

@@ -55,10 +55,10 @@ class Coordinates(object):
:param base_e: Base for e axis.
:return: New rounded object.
"""
return Coordinates(round(self.x / base_x) * base_x,
round(self.y / base_y) * base_y,
round(self.z / base_z) * base_z,
round(self.e / base_e) * base_e)
return Coordinates(round(self.x / base_x, 2) * base_x,
round(self.y / base_y, 2) * base_y,
round(self.z / base_z, 2) * base_z,
round(self.e / base_e, 2) * base_e)
def find_max(self):
""" Find a maximum value of all values.

View File

@@ -103,7 +103,7 @@ class GMachine(object):
def __check_delta(self, delta):
pos = self._position + delta
logging.debug("_check_delta : pos init = {} - delta = {} - pos = {}".format(self._position, delta, pos))
logging.debug("_check_delta : pos init : {}, delta : {}, result : {}".format(self._position, delta, pos))
if not pos.is_in_aabb(Coordinates(0.0, 0.0, 0.0, 0.0),
Coordinates(TABLE_SIZE_X_MM, TABLE_SIZE_Y_MM,
TABLE_SIZE_Z_MM, 0)):
@@ -119,10 +119,10 @@ class GMachine(object):
def _move_linear(self, delta, velocity, safe_zero=False):
if not safe_zero:
delta = delta.round(round(1.0 / STEPPER_PULSES_PER_MM_X, 2),
round(1.0 / STEPPER_PULSES_PER_MM_Y, 2),
round(1.0 / STEPPER_PULSES_PER_MM_Z, 2),
round(1.0 / STEPPER_PULSES_PER_MM_E, 2))
delta = delta.round(1.0 / STEPPER_PULSES_PER_MM_X,
1.0 / STEPPER_PULSES_PER_MM_Y,
1.0 / STEPPER_PULSES_PER_MM_Z,
1.0 / STEPPER_PULSES_PER_MM_E)
if delta.is_zero():
return
self.__check_delta(delta)