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
83d593ee
Commit
83d593ee
authored
Jun 24, 2011
by
kliment
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add custom button support, change progress bar color, make gcode preview bigger
parent
96243e18
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
12 deletions
+66
-12
README
README
+3
-3
custombtn.txt
custombtn.txt
+16
-0
gviz.py
gviz.py
+8
-5
pronterface.py
pronterface.py
+39
-4
No files found.
README
View file @
83d593ee
...
...
@@ -14,18 +14,18 @@ http://downloads.sourceforge.net/wxpython/wxPython2.8-win32-unicode-2.8.12.0-py2
http://launchpad.net/pyreadline/trunk/1.7/+download/pyreadline-1.7.win32.exe
On Ubuntu/debian, do:
apt-get install python-serial python-wxgtk2.8
sudo
apt-get install python-serial python-wxgtk2.8
On Mac OS X, download and install:
http://downloads.sourceforge.net/wxpython/wxPython2.8-osx-unicode-2.8.12.0-universal-py2.6.dmg
Grab the source for pyserial from http://pypi.python.org/packages/source/p/pyserial/pyserial-2.5.tar.gz
Unzip pyserial to a folder. Then, in a terminal, change to the folder you unzipped to, then type in:
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
sudo python setup.py install
Alternatively, you can run python in 32 bit mode by setting the following environment variable before running:
Alternatively, you can run python in 32 bit mode by setting the following environment variable before running
the setup.py command
:
export VERSIONER_PYTHON_PREFER_32_BIT=yes
sudo python setup.py install
Then repeat the same with http://launchpad.net/pyreadline/trunk/1.7/+download/pyreadline-1.7.zip
USING PRONTERFACE
...
...
custombtn.txt
0 → 100644
View file @
83d593ee
btns=[
###Defining custom buttons for pronterface is easy. Here's how.
###Below these instructions, add a line with the following format for each button
# ["button name","command",color(RGB)], <--That comma is important, do not forget it
###As an example: (Remove the # to try it out):
#["Read temp","M105",(200,100,100)],
###You can use gcodes or any pronsole/pronterface commands
###The first three buttons will end up at the top of the window, visible in mini mode
###The rest of the buttons will be at the bottom of the gcode preview
###ADD BUTTON DEFINITIONS BELOW THIS LINE
###ADD BUTTON DEFINITIONS ABOVE THIS LINE
]
gviz.py
View file @
83d593ee
...
...
@@ -9,6 +9,8 @@ class window(wx.Frame):
self
.
p
.
addgcode
(
i
)
#print time.time()-s
self
.
p
.
Bind
(
wx
.
EVT_KEY_DOWN
,
self
.
key
)
self
.
Bind
(
wx
.
EVT_KEY_DOWN
,
self
.
key
)
def
key
(
self
,
event
):
x
=
event
.
GetKeyCode
()
#print x
...
...
@@ -70,11 +72,12 @@ class gviz(wx.Panel):
dc
=
wx
.
PaintDC
(
self
)
dc
.
SetBackground
(
wx
.
Brush
((
250
,
250
,
200
)))
dc
.
Clear
()
dc
.
SetBrush
(
wx
.
Brush
((
0
,
0
,
0
)))
if
not
self
.
showall
:
dc
.
SetBrush
(
wx
.
Brush
((
43
,
144
,
255
)))
dc
.
DrawRectangle
(
self
.
size
[
0
]
-
15
,
0
,
15
,
self
.
size
[
1
])
dc
.
SetBrush
(
wx
.
Brush
((
0
,
255
,
0
)))
if
len
(
self
.
layers
):
dc
.
DrawRectangle
(
self
.
size
[
0
]
-
14
,(
1.0
-
(
1.0
*
self
.
layerindex
)
/
len
(
self
.
layers
))
*
self
.
size
[
1
],
13
,
self
.
size
[
1
]
-
1
)
dc
.
DrawRectangle
(
self
.
size
[
0
]
-
14
,(
1.0
-
(
1.0
*
(
self
.
layerindex
+
1
)
)
/
len
(
self
.
layers
))
*
self
.
size
[
1
],
13
,
self
.
size
[
1
]
-
1
)
if
self
.
showall
:
l
=
[]
for
i
in
self
.
layers
:
...
...
pronterface.py
View file @
83d593ee
...
...
@@ -83,13 +83,20 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
[
"Extrude"
,(
"extrude"
),(
13
,
0
),(
225
,
200
,
200
),(
1
,
2
)],
[
"Reverse"
,(
"reverse"
),(
14
,
0
),(
225
,
200
,
200
),(
1
,
2
)],
]
self
.
custombuttons
=
[]
self
.
btndict
=
{}
self
.
load_rc
(
".pronsolerc"
)
customdict
=
{}
try
:
execfile
(
"custombtn.txt"
,
customdict
)
self
.
custombuttons
=
customdict
[
"btns"
]
except
:
pass
self
.
popmenu
()
self
.
popwindow
()
self
.
t
=
Tee
(
self
.
catchprint
)
self
.
stdout
=
sys
.
stdout
self
.
mini
=
False
self
.
load_rc
(
".pronsolerc"
)
self
.
p
.
sendcb
=
self
.
sentcb
self
.
curlayer
=
0
...
...
@@ -257,7 +264,17 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
ubs
.
Add
(
self
.
monitorbox
)
ubs
.
Add
(
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Monitor
\n
printer"
,
pos
=
(
470
,
37
)))
self
.
monitorbox
.
Bind
(
wx
.
EVT_CHECKBOX
,
self
.
setmonitor
)
try
:
for
i
in
self
.
custombuttons
[:
3
]:
if
i
is
None
:
continue
b
=
wx
.
Button
(
self
.
panel
,
-
1
,
i
[
0
])
b
.
properties
=
i
b
.
SetBackgroundColour
(
i
[
2
])
b
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
procbutton
)
ubs
.
Add
(
b
)
except
:
pass
#Right full view
lrs
=
self
.
lowerrsizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
logbox
=
wx
.
TextCtrl
(
self
.
panel
,
size
=
(
350
,
340
),
pos
=
(
440
,
75
),
style
=
wx
.
TE_MULTILINE
)
...
...
@@ -329,11 +346,29 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
zfeedc
.
SetBackgroundColour
((
180
,
255
,
180
))
self
.
zfeedc
.
SetForegroundColour
(
"black"
)
lls
.
Add
((
10
,
0
),
pos
=
(
0
,
11
),
span
=
(
1
,
1
))
self
.
gviz
=
gviz
.
gviz
(
self
.
panel
,(
200
,
200
),(
200
,
200
))
self
.
gviz
=
gviz
.
gviz
(
self
.
panel
,(
300
,
300
),(
200
,
200
))
self
.
gviz
.
showall
=
1
self
.
gwindow
=
gviz
.
window
([])
self
.
gviz
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
self
.
showwin
)
self
.
gwindow
.
Bind
(
wx
.
EVT_CLOSE
,
lambda
x
:
self
.
gwindow
.
Hide
())
lls
.
Add
(
self
.
gviz
,
pos
=
(
0
,
10
),
span
=
(
9
,
1
))
cs
=
wx
.
GridBagSizer
()
cs
.
Add
(
self
.
gviz
,
pos
=
(
0
,
0
),
span
=
(
1
,
3
))
posindex
=
0
try
:
for
i
in
self
.
custombuttons
[
3
:]:
if
i
is
None
:
continue
b
=
wx
.
Button
(
self
.
panel
,
-
1
,
i
[
0
])
b
.
properties
=
i
b
.
SetBackgroundColour
(
i
[
2
])
b
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
procbutton
)
cs
.
Add
(
b
,
pos
=
(
1
+
posindex
/
3
,
posindex
%
3
),
span
=
(
1
,
1
))
posindex
+=
1
except
:
pass
lls
.
Add
(
cs
,
pos
=
(
0
,
10
),
span
=
(
15
,
1
))
self
.
uppersizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
uppersizer
.
Add
(
self
.
uppertopsizer
)
...
...
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