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
fb684a36
Commit
fb684a36
authored
May 22, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'experimental' of github.com:kliment/Printrun into experimental
Conflicts: pronterface.py
parents
98bdfdb5
17c4166a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
29 deletions
+21
-29
graph.py
printrun/graph.py
+3
-14
gui.py
printrun/gui.py
+1
-1
pronsole.py
pronsole.py
+9
-9
pronterface.py
pronterface.py
+8
-5
No files found.
printrun/graph.py
View file @
fb684a36
...
...
@@ -22,14 +22,12 @@ from bufferedcanvas import *
class
Graph
(
BufferedCanvas
):
'''A class to show a Graph with Pronterface.'''
def
__init__
(
self
,
parent
,
id
,
pos
=
wx
.
DefaultPosition
,
def
__init__
(
self
,
parent
,
id
,
root
,
pos
=
wx
.
DefaultPosition
,
size
=
wx
.
Size
(
150
,
80
),
style
=
0
):
# Forcing a no full repaint to stop flickering
style
=
style
|
wx
.
NO_FULL_REPAINT_ON_RESIZE
#call super function
super
(
Graph
,
self
)
.
__init__
(
parent
,
id
,
pos
,
size
,
style
)
#BufferedCanvas.__init__(self, parent, id)
self
.
root
=
root
self
.
extruder0temps
=
[
0
]
self
.
extruder0targettemps
=
[
0
]
...
...
@@ -50,18 +48,10 @@ class Graph(BufferedCanvas):
self
.
_lastyvalue
=
0
#self.sizer = wx.BoxSizer(wx.HORIZONTAL)
#self.sizer.Add(wx.Button(self, -1, "Button1", (0, 0)))
#self.SetSizer(self.sizer)
def
OnPaint
(
self
,
evt
):
dc
=
wx
.
PaintDC
(
self
)
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
def
Destroy
(
self
):
#call the super method
super
(
wx
.
Panel
,
self
)
.
Destroy
()
def
updateTemperatures
(
self
,
event
):
self
.
AddBedTemperature
(
self
.
bedtemps
[
-
1
])
self
.
AddBedTargetTemperature
(
self
.
bedtargettemps
[
-
1
])
...
...
@@ -79,8 +69,6 @@ class Graph(BufferedCanvas):
#b = gc.CreateLinearGradientBrush(0, 0, w, h, col1, col2)
gc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
255
,
0
,
0
,
0
),
4
))
gc
.
SetBrush
(
gc
.
CreateBrush
(
wx
.
Brush
(
wx
.
Colour
(
0
,
0
,
0
,
0
))))
gc
.
DrawRectangle
(
0
,
0
,
self
.
width
,
self
.
height
)
#gc.SetBrush(wx.Brush(wx.Colour(245, 245, 255, 52)))
...
...
@@ -238,6 +226,7 @@ class Graph(BufferedCanvas):
self
.
Refresh
()
def
draw
(
self
,
dc
,
w
,
h
):
dc
.
SetBackground
(
wx
.
Brush
(
self
.
root
.
settings
.
bgcolor
))
dc
.
Clear
()
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
self
.
width
=
w
...
...
printrun/gui.py
View file @
fb684a36
...
...
@@ -190,7 +190,7 @@ class LeftPane(wx.GridBagSizer):
else
:
self
.
Add
(
root
.
tempdisp
,
pos
=
(
6
,
0
),
span
=
(
1
,
6
))
root
.
graph
=
Graph
(
root
.
panel
,
wx
.
ID_ANY
)
root
.
graph
=
Graph
(
root
.
panel
,
wx
.
ID_ANY
,
root
)
self
.
Add
(
root
.
graph
,
pos
=
(
4
,
5
),
span
=
(
2
,
1
))
class
VizPane
(
wx
.
BoxSizer
):
...
...
pronsole.py
View file @
fb684a36
...
...
@@ -825,25 +825,25 @@ class pronsole(cmd.Cmd):
self
.
log
(
"! os.listdir('.')"
)
def
default
(
self
,
l
):
if
(
l
[
0
]
in
self
.
commandprefixes
.
upper
()
):
if
(
self
.
p
and
self
.
p
.
online
)
:
if
(
not
self
.
p
.
loud
)
:
if
l
[
0
]
in
self
.
commandprefixes
.
upper
(
):
if
self
.
p
and
self
.
p
.
online
:
if
not
self
.
p
.
loud
:
self
.
log
(
"SENDING:"
+
l
)
self
.
p
.
send_now
(
l
)
else
:
self
.
log
(
_
(
"Printer is not online."
))
return
elif
(
l
[
0
]
in
self
.
commandprefixes
.
lower
()
):
if
(
self
.
p
and
self
.
p
.
online
)
:
if
(
not
self
.
p
.
loud
)
:
elif
l
[
0
]
in
self
.
commandprefixes
.
lower
(
):
if
self
.
p
and
self
.
p
.
online
:
if
not
self
.
p
.
loud
:
self
.
log
(
"SENDING:"
+
l
.
upper
())
self
.
p
.
send_now
(
l
.
upper
())
else
:
self
.
log
(
_
(
"Printer is not online."
))
return
elif
(
l
[
0
]
==
"@"
)
:
if
(
self
.
p
and
self
.
p
.
online
)
:
if
(
not
self
.
p
.
loud
)
:
elif
l
[
0
]
==
"@"
:
if
self
.
p
and
self
.
p
.
online
:
if
not
self
.
p
.
loud
:
self
.
log
(
"SENDING:"
+
l
[
1
:])
self
.
p
.
send_now
(
l
[
1
:])
else
:
...
...
pronterface.py
View file @
fb684a36
...
...
@@ -946,7 +946,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
onecmd
(
'home'
)
else
:
return
self
.
onecmd
(
'M114'
)
self
.
p
.
send_now
(
'M114'
)
def
moveXY
(
self
,
x
,
y
):
# When user clicks on the XY control, the Z control no longer gets spacebar/repeat signals
...
...
@@ -957,12 +957,12 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
onecmd
(
'move Y
%
s'
%
y
)
else
:
return
self
.
onecmd
(
'M114'
)
self
.
p
.
send_now
(
'M114'
)
def
moveZ
(
self
,
z
):
if
z
!=
0
:
self
.
onecmd
(
'move Z
%
s'
%
z
)
self
.
onecmd
(
'M114'
)
self
.
p
.
send_now
(
'M114'
)
# When user clicks on the Z control, the XY control no longer gets spacebar/repeat signals
self
.
xyb
.
clearRepeat
()
...
...
@@ -1127,15 +1127,18 @@ class PronterWindow(MainWindow, pronsole.pronsole):
return
retval
def
recvcb
(
self
,
l
):
if
"ok C:"
in
l
:
isreport
=
False
if
"ok C:"
in
l
or
"Count"
in
l
:
self
.
posreport
=
l
self
.
update_pos
()
isreport
=
True
if
"ok T:"
in
l
:
self
.
tempreport
=
l
wx
.
CallAfter
(
self
.
tempdisp
.
SetLabel
,
self
.
tempreport
.
strip
()
.
replace
(
"ok "
,
""
))
self
.
update_tempdisplay
()
isreport
=
True
tstring
=
l
.
rstrip
()
if
self
.
p
.
loud
or
(
tstring
not
in
[
"ok"
,
"wait"
]
and
"ok T:"
not
in
tstring
and
"ok C:"
not
in
tstring
):
if
self
.
p
.
loud
or
(
tstring
not
in
[
"ok"
,
"wait"
]
and
not
isreport
):
wx
.
CallAfter
(
self
.
addtexttolog
,
tstring
+
"
\n
"
);
for
listener
in
self
.
recvlisteners
:
listener
(
l
)
...
...
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