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
eaa2a4c0
Commit
eaa2a4c0
authored
Aug 07, 2011
by
Keegi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
settings for bed size/grid lines
parent
df051e60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
gviz.py
gviz.py
+12
-11
pronterface.py
pronterface.py
+10
-2
No files found.
gviz.py
View file @
eaa2a4c0
import
wx
,
time
import
wx
,
time
class
window
(
wx
.
Frame
):
class
window
(
wx
.
Frame
):
def
__init__
(
self
,
f
,
size
=
(
600
,
600
),
bedsize
=
(
200
,
200
)):
def
__init__
(
self
,
f
,
size
=
(
600
,
600
),
bedsize
=
(
200
,
200
)
,
grid
=
(
10
,
50
)
):
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Layer view (Use shift+mousewheel to switch layers)"
,
size
=
(
size
[
0
],
size
[
1
]))
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Layer view (Use shift+mousewheel to switch layers)"
,
size
=
(
size
[
0
],
size
[
1
]))
self
.
p
=
gviz
(
self
,
size
=
size
,
bedsize
=
bedsize
)
self
.
p
=
gviz
(
self
,
size
=
size
,
bedsize
=
bedsize
,
grid
=
grid
)
s
=
time
.
time
()
s
=
time
.
time
()
for
i
in
f
:
for
i
in
f
:
self
.
p
.
addgcode
(
i
)
self
.
p
.
addgcode
(
i
)
...
@@ -53,10 +53,11 @@ class window(wx.Frame):
...
@@ -53,10 +53,11 @@ class window(wx.Frame):
elif
z
<
0
:
self
.
p
.
zoom
(
event
.
GetX
(),
event
.
GetY
(),
1
/
1.2
)
elif
z
<
0
:
self
.
p
.
zoom
(
event
.
GetX
(),
event
.
GetY
(),
1
/
1.2
)
class
gviz
(
wx
.
Panel
):
class
gviz
(
wx
.
Panel
):
def
__init__
(
self
,
parent
,
size
=
(
200
,
200
),
bedsize
=
(
200
,
200
)):
def
__init__
(
self
,
parent
,
size
=
(
200
,
200
),
bedsize
=
(
200
,
200
)
,
grid
=
(
10
,
50
)
):
wx
.
Panel
.
__init__
(
self
,
parent
,
-
1
,
size
=
(
size
[
0
],
size
[
1
]))
wx
.
Panel
.
__init__
(
self
,
parent
,
-
1
,
size
=
(
size
[
0
],
size
[
1
]))
self
.
size
=
size
self
.
size
=
size
self
.
bedsize
=
bedsize
self
.
bedsize
=
bedsize
self
.
grid
=
grid
self
.
lastpos
=
[
0
,
0
,
0
,
0
,
0
]
self
.
lastpos
=
[
0
,
0
,
0
,
0
,
0
]
self
.
hilightpos
=
self
.
lastpos
[:]
self
.
hilightpos
=
self
.
lastpos
[:]
self
.
Bind
(
wx
.
EVT_PAINT
,
self
.
paint
)
self
.
Bind
(
wx
.
EVT_PAINT
,
self
.
paint
)
...
@@ -126,14 +127,14 @@ class gviz(wx.Panel):
...
@@ -126,14 +127,14 @@ class gviz(wx.Panel):
dc
.
SelectObject
(
self
.
blitmap
)
dc
.
SelectObject
(
self
.
blitmap
)
dc
.
SetBackground
(
wx
.
Brush
((
250
,
250
,
200
)))
dc
.
SetBackground
(
wx
.
Brush
((
250
,
250
,
200
)))
dc
.
Clear
()
dc
.
Clear
()
dc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
1
00
,
100
,
10
0
)))
dc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
1
80
,
180
,
15
0
)))
for
i
in
xrange
(
max
(
self
.
bedsize
)
/
10
)
:
for
grid_unit
in
self
.
grid
:
dc
.
DrawLine
(
self
.
translate
[
0
],
self
.
translate
[
1
]
+
i
*
self
.
scale
[
1
]
*
10
,
self
.
translate
[
0
]
+
self
.
scale
[
0
]
*
max
(
self
.
bedsize
),
self
.
translate
[
1
]
+
i
*
self
.
scale
[
1
]
*
10
)
if
grid_unit
>
0
:
dc
.
DrawLine
(
self
.
translate
[
0
]
+
i
*
self
.
scale
[
0
]
*
10
,
self
.
translate
[
1
],
self
.
translate
[
0
]
+
i
*
self
.
scale
[
0
]
*
10
,
self
.
translate
[
1
]
+
self
.
scale
[
1
]
*
max
(
self
.
bedsize
))
for
x
in
xrange
(
int
(
self
.
bedsize
[
0
]
/
grid_unit
)
+
1
):
dc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
0
,
0
,
0
)
))
dc
.
DrawLine
(
self
.
translate
[
0
]
+
x
*
self
.
scale
[
0
]
*
grid_unit
,
self
.
translate
[
1
],
self
.
translate
[
0
]
+
x
*
self
.
scale
[
0
]
*
grid_unit
,
self
.
translate
[
1
]
+
self
.
scale
[
1
]
*
max
(
self
.
bedsize
))
for
i
in
xrange
(
max
(
self
.
bedsize
)
/
50
):
for
y
in
xrange
(
int
(
self
.
bedsize
[
1
]
/
grid_unit
)
+
1
):
dc
.
DrawLine
(
self
.
translate
[
0
],
self
.
translate
[
1
]
+
i
*
self
.
scale
[
1
]
*
50
,
self
.
translate
[
0
]
+
self
.
scale
[
0
]
*
max
(
self
.
bedsize
),
self
.
translate
[
1
]
+
i
*
self
.
scale
[
1
]
*
50
)
dc
.
DrawLine
(
self
.
translate
[
0
],
self
.
translate
[
1
]
+
y
*
self
.
scale
[
1
]
*
grid_unit
,
self
.
translate
[
0
]
+
self
.
scale
[
0
]
*
max
(
self
.
bedsize
),
self
.
translate
[
1
]
+
y
*
self
.
scale
[
1
]
*
grid_unit
)
dc
.
DrawLine
(
self
.
translate
[
0
]
+
i
*
self
.
scale
[
0
]
*
50
,
self
.
translate
[
1
],
self
.
translate
[
0
]
+
i
*
self
.
scale
[
0
]
*
50
,
self
.
translate
[
1
]
+
self
.
scale
[
1
]
*
max
(
self
.
bedsize
))
dc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
0
,
0
,
0
)
))
if
not
self
.
showall
:
if
not
self
.
showall
:
self
.
size
=
self
.
GetSize
()
self
.
size
=
self
.
GetSize
()
dc
.
SetBrush
(
wx
.
Brush
((
43
,
144
,
255
)))
dc
.
SetBrush
(
wx
.
Brush
((
43
,
144
,
255
)))
...
...
pronterface.py
View file @
eaa2a4c0
...
@@ -45,6 +45,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -45,6 +45,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
settings
.
last_file_path
=
""
self
.
settings
.
last_file_path
=
""
self
.
settings
.
last_temperature
=
0.0
self
.
settings
.
last_temperature
=
0.0
self
.
settings
.
last_bed_temperature
=
0.0
self
.
settings
.
last_bed_temperature
=
0.0
self
.
settings
.
bed_size_x
=
200.
self
.
settings
.
bed_size_y
=
200.
self
.
settings
.
preview_grid_step1
=
10.
self
.
settings
.
preview_grid_step2
=
50.
self
.
filename
=
filename
self
.
filename
=
filename
os
.
putenv
(
"UBUNTU_MENUPROXY"
,
"0"
)
os
.
putenv
(
"UBUNTU_MENUPROXY"
,
"0"
)
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Printer Interface"
,
size
=
size
);
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Printer Interface"
,
size
=
size
);
...
@@ -509,9 +513,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -509,9 +513,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
zfeedc
.
SetBackgroundColour
((
180
,
255
,
180
))
self
.
zfeedc
.
SetBackgroundColour
((
180
,
255
,
180
))
self
.
zfeedc
.
SetForegroundColour
(
"black"
)
self
.
zfeedc
.
SetForegroundColour
(
"black"
)
lls
.
Add
((
10
,
0
),
pos
=
(
0
,
11
),
span
=
(
1
,
1
))
lls
.
Add
((
10
,
0
),
pos
=
(
0
,
11
),
span
=
(
1
,
1
))
self
.
gviz
=
gviz
.
gviz
(
self
.
panel
,(
300
,
300
),(
200
,
200
))
self
.
gviz
=
gviz
.
gviz
(
self
.
panel
,(
300
,
300
),
bedsize
=
(
self
.
settings
.
bed_size_x
,
self
.
settings
.
bed_size_y
),
grid
=
(
self
.
settings
.
preview_grid_step1
,
self
.
settings
.
preview_grid_step2
))
self
.
gviz
.
showall
=
1
self
.
gviz
.
showall
=
1
self
.
gwindow
=
gviz
.
window
([])
self
.
gwindow
=
gviz
.
window
([],
bedsize
=
(
self
.
settings
.
bed_size_x
,
self
.
settings
.
bed_size_y
),
grid
=
(
self
.
settings
.
preview_grid_step1
,
self
.
settings
.
preview_grid_step2
))
self
.
gviz
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
self
.
showwin
)
self
.
gviz
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
self
.
showwin
)
self
.
gwindow
.
Bind
(
wx
.
EVT_CLOSE
,
lambda
x
:
self
.
gwindow
.
Hide
())
self
.
gwindow
.
Bind
(
wx
.
EVT_CLOSE
,
lambda
x
:
self
.
gwindow
.
Hide
())
cs
=
self
.
centersizer
=
wx
.
GridBagSizer
()
cs
=
self
.
centersizer
=
wx
.
GridBagSizer
()
...
...
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