Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
0bff3c93
Commit
0bff3c93
authored
Nov 04, 2011
by
Steven Devijver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added retraction to calculation, format time in lower case
parent
be5f0e49
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
pronsole.py
pronsole.py
+11
-5
No files found.
pronsole.py
View file @
0bff3c93
...
@@ -96,13 +96,14 @@ def estimate_duration(g):
...
@@ -96,13 +96,14 @@ def estimate_duration(g):
X_last_position
=
0
X_last_position
=
0
Y_last_position
=
0
Y_last_position
=
0
for
i
in
g
:
for
i
in
g
:
if
"G1"
in
i
and
(
"X"
in
i
or
"Y"
in
i
or
"F"
in
i
):
if
"G1"
in
i
and
(
"X"
in
i
or
"Y"
in
i
or
"F"
in
i
or
"E"
in
i
):
parts
=
i
.
split
(
" "
)
parts
=
i
.
split
(
" "
)
X
=
get_coordinate_value
(
"X"
,
parts
[
1
:])
X
=
get_coordinate_value
(
"X"
,
parts
[
1
:])
Y
=
get_coordinate_value
(
"Y"
,
parts
[
1
:])
Y
=
get_coordinate_value
(
"Y"
,
parts
[
1
:])
F
=
get_coordinate_value
(
"F"
,
parts
[
1
:])
F
=
get_coordinate_value
(
"F"
,
parts
[
1
:])
E
=
get_coordinate_value
(
"E"
,
parts
[
1
:])
if
(
X
is
None
and
Y
is
None
and
F
is
not
None
):
if
(
X
is
None
and
Y
is
None
and
E
is
None
and
F
is
not
None
):
fallback_feedrate
=
F
fallback_feedrate
=
F
continue
continue
...
@@ -113,7 +114,9 @@ def estimate_duration(g):
...
@@ -113,7 +114,9 @@ def estimate_duration(g):
feedrate
=
F
/
60
feedrate
=
F
/
60
distance
=
0
distance
=
0
if
(
X
is
not
None
and
Y
is
None
):
if
(
X
is
None
and
Y
is
None
and
E
is
not
None
and
E
<
0.0
):
distance
=
abs
(
E
)
elif
(
X
is
not
None
and
Y
is
None
):
distance
=
X
-
X_last_position
distance
=
X
-
X_last_position
X_last_position
=
X
X_last_position
=
X
elif
(
X
is
None
and
Y
is
not
None
):
elif
(
X
is
None
and
Y
is
not
None
):
...
@@ -125,6 +128,9 @@ def estimate_duration(g):
...
@@ -125,6 +128,9 @@ def estimate_duration(g):
distance
=
sqrt
(
X_distance
*
X_distance
+
Y_distance
*
Y_distance
)
distance
=
sqrt
(
X_distance
*
X_distance
+
Y_distance
*
Y_distance
)
X_last_position
=
X
X_last_position
=
X
Y_last_position
=
Y
Y_last_position
=
Y
else
:
continue
time_for_move
=
distance
/
feedrate
time_for_move
=
distance
/
feedrate
acceleration
=
(
feedrate
-
initial_feedrate
)
/
time_for_move
acceleration
=
(
feedrate
-
initial_feedrate
)
/
time_for_move
...
@@ -144,7 +150,7 @@ def estimate_duration(g):
...
@@ -144,7 +150,7 @@ def estimate_duration(g):
mod_minutes
=
total_duration
%
(
60
*
60
)
mod_minutes
=
total_duration
%
(
60
*
60
)
mod_seconds
=
mod_minutes
%
60
mod_seconds
=
mod_minutes
%
60
return
"{0:02d}
H{1:02d}M
"
.
format
(
int
((
total_duration
-
mod_minutes
)
/
(
60
*
60
)),
int
((
mod_minutes
-
mod_seconds
)
/
60
))
return
"{0:02d}
h{1:02d}m
"
.
format
(
int
((
total_duration
-
mod_minutes
)
/
(
60
*
60
)),
int
((
mod_minutes
-
mod_seconds
)
/
60
))
class
Settings
:
class
Settings
:
#def _temperature_alias(self): return {"pla":210,"abs":230,"off":0}
#def _temperature_alias(self): return {"pla":210,"abs":230,"off":0}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment