mirror of
https://github.com/sinseman44/PyCNC.git
synced 2026-05-06 21:28:12 +00:00
correct my last commit, it's better like that
This commit is contained in:
@@ -55,10 +55,10 @@ class Coordinates(object):
|
|||||||
:param base_e: Base for e axis.
|
:param base_e: Base for e axis.
|
||||||
:return: New rounded object.
|
:return: New rounded object.
|
||||||
"""
|
"""
|
||||||
return Coordinates(round(self.x / base_x) * base_x,
|
return Coordinates(round(self.x / base_x, 2) * base_x,
|
||||||
round(self.y / base_y) * base_y,
|
round(self.y / base_y, 2) * base_y,
|
||||||
round(self.z / base_z) * base_z,
|
round(self.z / base_z, 2) * base_z,
|
||||||
round(self.e / base_e) * base_e)
|
round(self.e / base_e, 2) * base_e)
|
||||||
|
|
||||||
def find_max(self):
|
def find_max(self):
|
||||||
""" Find a maximum value of all values.
|
""" Find a maximum value of all values.
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class GMachine(object):
|
|||||||
|
|
||||||
def __check_delta(self, delta):
|
def __check_delta(self, delta):
|
||||||
pos = self._position + 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),
|
if not pos.is_in_aabb(Coordinates(0.0, 0.0, 0.0, 0.0),
|
||||||
Coordinates(TABLE_SIZE_X_MM, TABLE_SIZE_Y_MM,
|
Coordinates(TABLE_SIZE_X_MM, TABLE_SIZE_Y_MM,
|
||||||
TABLE_SIZE_Z_MM, 0)):
|
TABLE_SIZE_Z_MM, 0)):
|
||||||
@@ -119,10 +119,10 @@ class GMachine(object):
|
|||||||
|
|
||||||
def _move_linear(self, delta, velocity, safe_zero=False):
|
def _move_linear(self, delta, velocity, safe_zero=False):
|
||||||
if not safe_zero:
|
if not safe_zero:
|
||||||
delta = delta.round(round(1.0 / STEPPER_PULSES_PER_MM_X, 2),
|
delta = delta.round(1.0 / STEPPER_PULSES_PER_MM_X,
|
||||||
round(1.0 / STEPPER_PULSES_PER_MM_Y, 2),
|
1.0 / STEPPER_PULSES_PER_MM_Y,
|
||||||
round(1.0 / STEPPER_PULSES_PER_MM_Z, 2),
|
1.0 / STEPPER_PULSES_PER_MM_Z,
|
||||||
round(1.0 / STEPPER_PULSES_PER_MM_E, 2))
|
1.0 / STEPPER_PULSES_PER_MM_E)
|
||||||
if delta.is_zero():
|
if delta.is_zero():
|
||||||
return
|
return
|
||||||
self.__check_delta(delta)
|
self.__check_delta(delta)
|
||||||
|
|||||||
Reference in New Issue
Block a user