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
523a2a4f
Commit
523a2a4f
authored
May 06, 2012
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'experimental' of
https://github.com/jezmy/Printrun
into experimental
parents
8237b634
8bdb86f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
pronsole.py
pronsole.py
+1
-1
pronterface.py
pronterface.py
+16
-15
No files found.
pronsole.py
View file @
523a2a4f
...
...
@@ -1116,7 +1116,7 @@ class pronsole(cmd.Cmd):
if
(
self
.
sdprinting
):
self
.
p
.
send_now
(
"M27"
)
time
.
sleep
(
interval
)
print
(
self
.
tempreadings
.
replace
(
"
\r
"
,
""
)
.
replace
(
"T"
,
"Hotend"
)
.
replace
(
"B"
,
"Bed"
)
.
replace
(
"
\n
"
,
""
)
.
replace
(
"ok "
,
""
))
#
print (self.tempreadings.replace("\r","").replace("T","Hotend").replace("B","Bed").replace("\n","").replace("ok ",""))
if
(
self
.
p
.
printing
):
print
"Print progress: "
,
100
*
float
(
self
.
p
.
queueindex
)
/
len
(
self
.
p
.
mainqueue
),
"
%
"
...
...
pronterface.py
View file @
523a2a4f
...
...
@@ -39,6 +39,8 @@ StringIO=cStringIO
thread
=
threading
.
Thread
winsize
=
(
800
,
500
)
layerindex
=
0
global
buttonSize
buttonSize
=
(
70
,
25
)
# Define sizes for the buttons on top rows
if
os
.
name
==
"nt"
:
winsize
=
(
800
,
530
)
try
:
...
...
@@ -498,30 +500,30 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
#lower section contains the rest of the window - manual controls, console, visualizations
#TOP ROW:
uts
=
self
.
uppertopsizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
rescanbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Port"
),
s
tyle
=
wx
.
BU_EXACTFIT
)
self
.
rescanbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Port"
),
s
ize
=
(
70
,
25
)
)
self
.
rescanbtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
rescanports
)
uts
.
Add
(
self
.
rescanbtn
,
0
,
wx
.
TOP
|
wx
.
LEFT
,
0
)
self
.
serialport
=
wx
.
ComboBox
(
self
.
panel
,
-
1
,
choices
=
self
.
scanserial
(),
style
=
wx
.
CB_DROPDOWN
)
style
=
wx
.
CB_DROPDOWN
,
size
=
(
100
,
25
)
)
self
.
rescanports
()
uts
.
Add
(
self
.
serialport
)
uts
.
Add
(
wx
.
StaticText
(
self
.
panel
,
-
1
,
"@"
),
0
,
wx
.
RIGHT
|
wx
.
ALIGN_CENTER
,
0
)
self
.
baud
=
wx
.
ComboBox
(
self
.
panel
,
-
1
,
choices
=
[
"2400"
,
"9600"
,
"19200"
,
"38400"
,
"57600"
,
"115200"
,
"250000"
],
style
=
wx
.
CB_DROPDOWN
)
style
=
wx
.
CB_DROPDOWN
,
size
=
(
100
,
25
)
)
try
:
self
.
baud
.
SetValue
(
"115200"
)
self
.
baud
.
SetValue
(
str
(
self
.
settings
.
baudrate
))
except
:
pass
uts
.
Add
(
self
.
baud
)
self
.
connectbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Connect"
),
style
=
wx
.
BU_EXACTFIT
)
self
.
connectbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Connect"
),
size
=
buttonSize
)
uts
.
Add
(
self
.
connectbtn
)
self
.
connectbtn
.
SetToolTipString
(
_
(
"Connect to the printer"
))
self
.
connectbtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
connect
)
self
.
resetbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Reset"
),
style
=
wx
.
BU_EXACTFIT
)
self
.
resetbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Reset"
),
size
=
buttonSize
)
self
.
resetbtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
reset
)
uts
.
Add
(
self
.
resetbtn
)
#self.minibtn=wx.Button(self.panel,-1,_("Mini mode"),style=wx.BU_EXACTFIT)
...
...
@@ -535,23 +537,21 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
#SECOND ROW
ubs
=
self
.
upperbottomsizer
=
uts
#wx.BoxSizer(wx.HORIZONTAL)
self
.
loadbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Load file"
),
style
=
wx
.
BU_EXACTFIT
)
self
.
loadbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Load file"
),
size
=
buttonSize
)
self
.
loadbtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
loadfile
)
ubs
.
Add
(
self
.
loadbtn
)
self
.
platebtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Compose"
),
style
=
wx
.
BU_EXACTFIT
)
self
.
platebtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Compose"
),
size
=
buttonSize
)
self
.
platebtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
plate
)
#self.printerControls.append(self.uploadbtn)
ubs
.
Add
(
self
.
platebtn
)
self
.
sdbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"SD"
),
style
=
wx
.
BU_EXACTFIT
)
self
.
sdbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"SD"
),
size
=
buttonSize
)
self
.
sdbtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
sdmenu
)
self
.
printerControls
.
append
(
self
.
sdbtn
)
ubs
.
Add
(
self
.
sdbtn
)
self
.
printbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Print"
),
style
=
wx
.
BU_EXACTFIT
)
self
.
printbtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
printfile
)
self
.
printbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Print"
),
size
=
buttonSize
)
self
.
printbtn
.
Disable
()
ubs
.
Add
(
self
.
printbtn
)
self
.
pausebtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Pause"
),
style
=
wx
.
BU_EXACTFIT
)
self
.
pausebtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
pause
)
self
.
pausebtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Pause"
),
size
=
buttonSize
)
ubs
.
Add
(
self
.
pausebtn
)
#Right full view
lrs
=
self
.
lowerrsizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
...
...
@@ -1298,9 +1298,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
pass
tstring
=
l
.
rstrip
()
#print tstring
if
(
tstring
!=
"ok"
and
tstring
!=
"wait"
):
print
"["
+
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
localtime
(
time
.
time
()))
+
"] "
+
tstring
#wx.CallAfter(self.logbox.AppendText,tstring+"\n")
if
(
tstring
!=
"ok"
)
and
(
tstring
!=
"wait"
)
and
(
"ok T:"
not
in
tstring
):
# print "*"+tstring+"*"
# print "[" + time.strftime('%H:%M:%S',time.localtime(time.time())) + "] " + tstring
wx
.
CallAfter
(
self
.
logbox
.
AppendText
,
tstring
+
"
\n
"
)
for
i
in
self
.
recvlisteners
:
i
(
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