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
97355a82
Commit
97355a82
authored
Jun 25, 2013
by
D1plo1d
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding 'set fan' and 'set motors' to prontserve.
parent
da5d5afe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
README.md
README.md
+1
-1
prontserve.py
prontserve.py
+20
-4
No files found.
README.md
View file @
97355a82
...
@@ -25,7 +25,7 @@ A precompiled version is available at http://koti.kapsi.fi/~kliment/printrun/
...
@@ -25,7 +25,7 @@ A precompiled version is available at http://koti.kapsi.fi/~kliment/printrun/
## Linux
## Linux
### Ubuntu/Debian
### Ubuntu/Debian
You can run Printrun directly from source, as there are no packages available yet. Fetch and install the dependencies using
You can run Printrun directly from source, as there are no packages available yet. Fetch and install
x
the dependencies using
1.
`sudo apt-get install python-serial python-wxgtk2.8 python-pyglet python-tornado python-setuptools python-libxml2 python-gobject avahi-daemon libavahi-compat-libdnssd1`
1.
`sudo apt-get install python-serial python-wxgtk2.8 python-pyglet python-tornado python-setuptools python-libxml2 python-gobject avahi-daemon libavahi-compat-libdnssd1`
2.
`pip install -r requirements.txt`
2.
`pip install -r requirements.txt`
...
...
prontserve.py
View file @
97355a82
...
@@ -254,10 +254,13 @@ class ConstructSocketHandler(tornado.websocket.WebSocketHandler):
...
@@ -254,10 +254,13 @@ class ConstructSocketHandler(tornado.websocket.WebSocketHandler):
"""
)
.
strip
()
"""
)
.
strip
()
},
},
"set"
:
{
"set"
:
{
'namespaced'
:
True
,
# namespaced by the machine aspect (temp)
'namespaced'
:
True
,
# namespaced by the machine aspect (temp
/motors/fan
)
'named_args'
:
True
,
'named_args'
:
True
,
'array_args'
:
True
,
'args_error'
:
textwrap
.
dedent
(
"""
'args_error'
:
textwrap
.
dedent
(
"""
Set only accepts a namespace and a list of heater, value pairs.
Set only accepts a namespace (temp, motors or fan) and a list of
heater, value pairs for the temp or on or off for the motor and fan
namespaces.
"""
)
.
strip
()
"""
)
.
strip
()
},
},
"estop"
:
{
"estop"
:
{
...
@@ -415,11 +418,11 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -415,11 +418,11 @@ class Prontserve(pronsole.pronsole, EventEmitter):
print
"Emergency Stop!"
print
"Emergency Stop!"
self
.
fire
(
"estop"
)
self
.
fire
(
"estop"
)
def
do_construct_set
(
self
,
subCmd
,
**
kwargs
):
def
do_construct_set
(
self
,
subCmd
,
*
args
,
*
*
kwargs
):
method
=
"do_set_
%
s"
%
subCmd
method
=
"do_set_
%
s"
%
subCmd
if
not
hasattr
(
self
,
method
):
if
not
hasattr
(
self
,
method
):
raise
Exception
(
"
%
s is not a real namespace"
%
subCmd
)
raise
Exception
(
"
%
s is not a real namespace"
%
subCmd
)
getattr
(
self
,
method
)(
**
kwargs
)
getattr
(
self
,
method
)(
*
args
,
*
*
kwargs
)
def
do_set_temp
(
self
,
**
kwargs
):
def
do_set_temp
(
self
,
**
kwargs
):
# Setting each temperature individually
# Setting each temperature individually
...
@@ -433,6 +436,19 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -433,6 +436,19 @@ class Prontserve(pronsole.pronsole, EventEmitter):
self
.
target_values
[
k
]
=
kwargs
[
k
]
self
.
target_values
[
k
]
=
kwargs
[
k
]
self
.
fire
(
"target_temp_changed"
,
{
k
:
kwargs
[
k
]})
self
.
fire
(
"target_temp_changed"
,
{
k
:
kwargs
[
k
]})
def
do_set_fan
(
self
,
*
args
):
value
=
{
"on"
:
True
,
"off"
:
False
}[
args
[
0
]
.
lower
()]
if
value
:
self
.
p
.
send_now
(
"M106 S255"
)
else
:
self
.
p
.
send_now
(
"M106 S0"
)
self
.
fire
(
"fan_speed_changed"
,
255
)
def
do_set_motors
(
self
,
*
args
):
value
=
{
"on"
:
True
,
"off"
:
False
}[
args
[
0
]
.
lower
()]
self
.
p
.
send_now
({
True
:
"M17"
,
False
:
"M18"
}[
value
])
self
.
fire
(
"motors_enabled_changed"
,
value
)
def
do_set_feedrate
(
self
,
**
kwargs
):
def
do_set_feedrate
(
self
,
**
kwargs
):
# TODO: kwargs[xy] * 60 and kwargs[z] * 60
# TODO: kwargs[xy] * 60 and kwargs[z] * 60
pass
pass
...
...
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