mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-19 04:37:51 -06:00
Add fields from CuraEngine
The idea of this issue is to mimic the implementation of CuraEngine. So let's transform its entire algorithm into Python. Contributes to issue CURA-5561.
This commit is contained in:
parent
842ee7c00e
commit
582f06dfff
1 changed files with 18 additions and 3 deletions
|
@ -115,6 +115,22 @@ class Command:
|
||||||
self._is_comment = False # type: bool
|
self._is_comment = False # type: bool
|
||||||
self._is_empty = False # type: bool
|
self._is_empty = False # type: bool
|
||||||
|
|
||||||
|
#Fields taken from CuraEngine's implementation.
|
||||||
|
self._recalculate = False
|
||||||
|
self._accelerate_until = 0
|
||||||
|
self._decelerate_after = 0
|
||||||
|
self._initial_feedrate = 0
|
||||||
|
self._final_feedrate = 0
|
||||||
|
self._entry_speed = 0
|
||||||
|
self._max_entry_speed =0
|
||||||
|
self._nominal_length = False
|
||||||
|
self._nominal_feedrate = 0
|
||||||
|
self._max_travel = 0
|
||||||
|
self._distance = 0
|
||||||
|
self._acceleration = 0
|
||||||
|
self._delta = [0, 0, 0]
|
||||||
|
self._abs_delta = [0, 0, 0]
|
||||||
|
|
||||||
def get_after_state(self) -> State:
|
def get_after_state(self) -> State:
|
||||||
return self._after_state
|
return self._after_state
|
||||||
|
|
||||||
|
@ -136,10 +152,9 @@ class Command:
|
||||||
|
|
||||||
return self._cmd_str.strip() + " ; --- " + info + os.linesep
|
return self._cmd_str.strip() + " ; --- " + info + os.linesep
|
||||||
|
|
||||||
|
## Estimates the execution time of this command and calculates the state
|
||||||
|
# after this command is executed.
|
||||||
def process(self) -> None:
|
def process(self) -> None:
|
||||||
"""
|
|
||||||
Estimates the execution time of this command and calculates the state after this command is executed.
|
|
||||||
"""
|
|
||||||
line = self._cmd_str.strip()
|
line = self._cmd_str.strip()
|
||||||
if not line:
|
if not line:
|
||||||
self._is_empty = True
|
self._is_empty = True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue