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
4158bc63
Commit
4158bc63
authored
Jun 04, 2012
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only enable webinterface if CherryPy is available. Fix buttons on the web
parent
6f04dc68
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
351 additions
and
36 deletions
+351
-36
CherryPy-3.2.2-py2.7.egg
libs/CherryPy-3.2.2/dist/CherryPy-3.2.2-py2.7.egg
+0
-0
files.txt
libs/CherryPy-3.2.2/files.txt
+231
-0
pronterface.py
pronterface.py
+69
-26
webinterface.py
webinterface.py
+51
-10
No files found.
libs/CherryPy-3.2.2/dist/CherryPy-3.2.2-py2.7.egg
View file @
4158bc63
No preview for this file type
libs/CherryPy-3.2.2/files.txt
0 → 100644
View file @
4158bc63
This diff is collapsed.
Click to expand it.
pronterface.py
View file @
4158bc63
This diff is collapsed.
Click to expand it.
webinterface.py
View file @
4158bc63
...
@@ -131,15 +131,15 @@ class MoveButton(object):
...
@@ -131,15 +131,15 @@ class MoveButton(object):
if
(
margs
and
axis
==
"x"
):
if
(
margs
and
axis
==
"x"
):
distance
=
margs
.
pop
(
0
)
distance
=
margs
.
pop
(
0
)
gPronterPtr
.
onecmd
(
'move X
%
s'
%
distance
)
gPronterPtr
.
onecmd
(
'move X
%
s'
%
distance
)
return
"Moving X Axis "
+
str
(
distance
)
return
ReloadPage
(
"Moving X Axis "
+
str
(
distance
)
)
if
(
margs
and
axis
==
"y"
):
if
(
margs
and
axis
==
"y"
):
distance
=
margs
.
pop
(
0
)
distance
=
margs
.
pop
(
0
)
gPronterPtr
.
onecmd
(
'move Y
%
s'
%
distance
)
gPronterPtr
.
onecmd
(
'move Y
%
s'
%
distance
)
return
"Moving Y Axis "
+
str
(
distance
)
return
ReloadPage
(
"Moving Y Axis "
+
str
(
distance
)
)
if
(
margs
and
axis
==
"z"
):
if
(
margs
and
axis
==
"z"
):
distance
=
margs
.
pop
(
0
)
distance
=
margs
.
pop
(
0
)
gPronterPtr
.
onecmd
(
'move Z
%
s'
%
distance
)
gPronterPtr
.
onecmd
(
'move Z
%
s'
%
distance
)
return
"Moving Z Axis "
+
str
(
distance
)
return
ReloadPage
(
"Moving Z Axis "
+
str
(
distance
)
)
raise
cherrypy
.
HTTPError
(
400
,
"Unmached Move Command!"
)
raise
cherrypy
.
HTTPError
(
400
,
"Unmached Move Command!"
)
axis
.
exposed
=
True
axis
.
exposed
=
True
axis
.
_cp_config
=
{
'tools.basic_auth.on'
:
True
,
axis
.
_cp_config
=
{
'tools.basic_auth.on'
:
True
,
...
@@ -147,6 +147,21 @@ class MoveButton(object):
...
@@ -147,6 +147,21 @@ class MoveButton(object):
'tools.basic_auth.users'
:
users
,
'tools.basic_auth.users'
:
users
,
'tools.basic_auth.encrypt'
:
clear_text
}
'tools.basic_auth.encrypt'
:
clear_text
}
class
CustomButton
(
object
):
def
button
(
self
,
*
args
):
if
not
args
:
raise
cherrypy
.
HTTPError
(
400
,
"No Custom Command Provided!"
)
margs
=
list
(
args
)
command
=
margs
.
pop
(
0
)
if
(
command
):
gPronterPtr
.
onecmd
(
command
)
return
ReloadPage
(
str
(
command
))
button
.
exposed
=
True
button
.
_cp_config
=
{
'tools.basic_auth.on'
:
True
,
'tools.basic_auth.realm'
:
'My Print Server'
,
'tools.basic_auth.users'
:
users
,
'tools.basic_auth.encrypt'
:
clear_text
}
class
HomeButton
(
object
):
class
HomeButton
(
object
):
def
axis
(
self
,
*
args
):
def
axis
(
self
,
*
args
):
if
not
args
:
if
not
args
:
...
@@ -241,6 +256,7 @@ class WebInterface(object):
...
@@ -241,6 +256,7 @@ class WebInterface(object):
status
=
XMLstatus
()
status
=
XMLstatus
()
home
=
HomeButton
()
home
=
HomeButton
()
move
=
MoveButton
()
move
=
MoveButton
()
custom
=
CustomButton
()
def
index
(
self
):
def
index
(
self
):
pageText
=
PrintHeader
()
+
self
.
name
+
PrintMenu
()
pageText
=
PrintHeader
()
+
self
.
name
+
PrintMenu
()
...
@@ -264,15 +280,40 @@ class WebInterface(object):
...
@@ -264,15 +280,40 @@ class WebInterface(object):
pageText
+=
"<div id='control_xy'>"
pageText
+=
"<div id='control_xy'>"
pageText
+=
"<img src='/images/control_xy.png' usemap='#xymap'/>"
pageText
+=
"<img src='/images/control_xy.png' usemap='#xymap'/>"
pageText
+=
'<map name="xymap">'
pageText
+=
'<map name="xymap">'
pageText
+=
'<area shape="rect" coords="0,0,44,44" href="/home/axis/x" alt="X Home" />'
pageText
+=
'<area shape="rect" coords="200,44,244,0" href="/home/axis/y" alt="Y Home" />'
pageText
+=
'<area shape="rect" coords="8,5,51,48" href="/home/axis/x" alt="X Home" title="X Home" />'
pageText
+=
'<area shape="rect" coords="195,195,244,244" href="/home/axis/z" alt="Z Home" />'
pageText
+=
'<area shape="rect" coords="195,6,236,46" href="/home/axis/y" alt="Y Home" title="Y Home" />'
pageText
+=
'<area shape="rect" coords="0,244,44,196" href="/home/axis/all" alt="All Home" />'
pageText
+=
'<area shape="rect" coords="7,192,48,232" href="/home/axis/all" alt="All Home" title="All Home" />'
#TODO Map X, Y Moves
pageText
+=
'<area shape="rect" coords="194,192,235,232" href="/home/axis/z" alt="Z Home" title="Z Home" />'
pageText
+=
'<area shape="rect" coords="62,7,185,34" href="/move/axis/y/100" alt="Y 100" title="Y 100" />'
pageText
+=
'<area shape="rect" coords="68,34,175,61" href="/move/axis/y/10" alt="Y 10" title="Y 10" />'
pageText
+=
'<area shape="rect" coords="80,60,163,84" href="/move/axis/y/1" alt="Y 1" title="Y 1" />'
pageText
+=
'<area shape="rect" coords="106,83,138,107" href="/move/axis/y/.1" alt="Y .1" title="Y .1" />'
pageText
+=
'<area shape="rect" coords="110,135,142,159" href="/move/axis/y/-.1" alt="Y -.1" title="Y -.1" />'
pageText
+=
'<area shape="rect" coords="81,157,169,181" href="/move/axis/y/-1" alt="Y -1" title="Y -1" />'
pageText
+=
'<area shape="rect" coords="69,180,178,206" href="/move/axis/y/-10" alt="Y -10" title="Y -10" />'
pageText
+=
'<area shape="rect" coords="60,205,186,231" href="/move/axis/y/-100" alt="Y -100" title="Y -100" />'
pageText
+=
'<area shape="rect" coords="11,53,37,179" href="/move/axis/x/-100" alt="X -100" title="X -100" />'
pageText
+=
'<area shape="rect" coords="210,59,236,185" href="/move/axis/x/100" alt="X 100" title="X 100" />'
pageText
+=
'<area shape="rect" coords="38,60,64,172" href="/move/axis/x/-10" alt="X -10" title="X -10" />'
pageText
+=
'<area shape="rect" coords="185,66,211,178" href="/move/axis/x/10" alt="X 10" title="X 10" />'
pageText
+=
'<area shape="rect" coords="62,84,83,157" href="/move/axis/x/-1" alt="X -1" title="X -1" />'
pageText
+=
'<area shape="rect" coords="163,87,187,160" href="/move/axis/x/1" alt="X 1" title="X 1" />'
pageText
+=
'<area shape="rect" coords="82,104,110,139" href="/move/axis/x/-.1" alt="X -.1" title="X -.1" />'
pageText
+=
'<area shape="rect" coords="137,105,165,140" href="/move/axis/x/.1" alt="X .1" title="X .1" />'
pageText
+=
"</map>"
pageText
+=
"</map>"
pageText
+=
"</div>
\n
"
#endxy
pageText
+=
"</div>
\n
"
#endxy
pageText
+=
"<div id='control_z'>"
pageText
+=
"<div id='control_z'>"
pageText
+=
"<img src='/images/control_z.png' />"
pageText
+=
"<img src='/images/control_z.png' usemap='#zmap'/>"
pageText
+=
'<map name="zmap">'
pageText
+=
'<area shape="rect" coords="4,35,54,64" href="/move/axis/z/10" alt="Z 10" title="Z 10" />'
pageText
+=
'<area shape="rect" coords="4,60,54,89" href="/move/axis/z/1" alt="Z 1" title="Z 1" />'
pageText
+=
'<area shape="rect" coords="4,87,54,116" href="/move/axis/z/.1" alt="Z .1" title="Z .1" />'
pageText
+=
'<area shape="rect" coords="4,121,54,150" href="/move/axis/z/-.1" alt="Z -.1" title="Z -.1" />'
pageText
+=
'<area shape="rect" coords="4,147,54,176" href="/move/axis/z/-1" alt="Z -1" title="Z -1" />'
pageText
+=
'<area shape="rect" coords="4,173,54,202" href="/move/axis/z/-10" alt="Z -10" title="Z -10" />'
pageText
+=
"</map>"
#TODO Map Z Moves
#TODO Map Z Moves
pageText
+=
"</div>
\n
"
#endz
pageText
+=
"</div>
\n
"
#endz
pageText
+=
"</div>
\n
"
#endgui
pageText
+=
"</div>
\n
"
#endgui
...
...
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