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
7f96ca82
Commit
7f96ca82
authored
Jun 01, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better integration of RPC server, fix bugs
parent
34e638e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
4 deletions
+21
-4
pronsole.py
printrun/pronsole.py
+14
-2
pronterface.py
printrun/pronterface.py
+1
-0
rpc.py
printrun/rpc.py
+6
-2
No files found.
printrun/pronsole.py
View file @
7f96ca82
...
...
@@ -462,6 +462,7 @@ class pronsole(cmd.Cmd):
self
.
p
.
onlinecb
=
self
.
online
self
.
p
.
errorcb
=
self
.
logError
self
.
fgcode
=
None
self
.
rpc_server
=
None
self
.
listing
=
0
self
.
sdfiles
=
[]
self
.
paused
=
False
...
...
@@ -484,6 +485,8 @@ class pronsole(cmd.Cmd):
self
.
settings
.
_bedtemp_abs_cb
=
self
.
set_temp_preset
self
.
settings
.
_bedtemp_pla_cb
=
self
.
set_temp_preset
self
.
update_build_dimensions
(
None
,
self
.
settings
.
build_dimensions
)
self
.
update_tcp_streaming_mode
(
None
,
self
.
settings
.
tcp_streaming_mode
)
self
.
update_rpc_server
(
None
,
self
.
settings
.
rpc_server
)
self
.
monitoring
=
0
self
.
starttime
=
0
self
.
extra_print_time
=
0
...
...
@@ -635,6 +638,10 @@ class pronsole(cmd.Cmd):
self
.
prompt
=
self
.
promptf
()
return
stop
def
kill
(
self
):
if
self
.
rpc_server
is
not
None
:
self
.
rpc_server
.
shutdown
()
def
write_prompt
(
self
):
sys
.
stdout
.
write
(
self
.
promptf
())
sys
.
stdout
.
flush
()
...
...
@@ -977,8 +984,13 @@ class pronsole(cmd.Cmd):
self
.
p
.
tcp_streaming_mode
=
self
.
settings
.
tcp_streaming_mode
def
update_rpc_server
(
self
,
param
,
value
):
if
value
and
self
.
rpc_server
is
not
None
:
self
.
rpc_server
=
ProntRPC
(
self
)
if
value
:
if
self
.
rpc_server
is
None
:
self
.
rpc_server
=
ProntRPC
(
self
)
else
:
if
self
.
rpc_server
is
not
None
:
self
.
rpc_server
.
shutdown
()
self
.
rpc_server
=
None
# --------------------------------------------------------------
# Command line options handling
...
...
printrun/pronterface.py
View file @
7f96ca82
...
...
@@ -325,6 +325,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
Close
()
def
kill
(
self
,
e
):
pronsole
.
pronsole
.
kill
(
self
)
global
pronterface_quitting
pronterface_quitting
=
True
self
.
statuscheck
=
False
...
...
printrun/rpc.py
View file @
7f96ca82
...
...
@@ -17,16 +17,20 @@ class ProntRPC(object):
def
run_server
(
self
):
self
.
server
.
serve_forever
()
def
shutdown
(
self
):
self
.
server
.
shutdown
()
self
.
thread
.
join
()
def
get_status
(
self
):
if
self
.
pronsole
.
p
.
printing
:
progress
=
100
*
float
(
self
.
pronsole
.
p
.
queueindex
)
/
len
(
self
.
pronsole
.
p
.
mainqueue
)
elif
self
.
pronsole
.
sdprinting
:
progress
=
self
.
percentdone
else
:
progress
=
None
else
:
progress
=
-
1
if
self
.
pronsole
.
p
.
printing
or
self
.
pronsole
.
sdprinting
:
eta
=
self
.
get_eta
()
else
:
eta
=
None
eta
=
-
1
return
{
"filename"
:
self
.
pronsole
.
filename
,
"progress"
:
progress
,
"eta"
:
eta
,
...
...
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