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
b3da9b12
Commit
b3da9b12
authored
Jun 08, 2011
by
kliment
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SD Upload works.
parent
d2319d8f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
pronterface.py
pronterface.py
+28
-1
No files found.
pronterface.py
View file @
b3da9b12
...
@@ -12,6 +12,10 @@ if os.name=="nt":
...
@@ -12,6 +12,10 @@ if os.name=="nt":
except
:
except
:
pass
pass
def
dosify
(
name
):
return
os
.
path
.
split
(
name
)[
1
]
.
split
(
"."
)[
0
][:
8
]
+
".g"
class
PronterWindow
(
wx
.
Frame
):
class
PronterWindow
(
wx
.
Frame
):
def
__init__
(
self
,
filename
=
None
,
size
=
(
800
,
500
)):
def
__init__
(
self
,
filename
=
None
,
size
=
(
800
,
500
)):
self
.
filename
=
filename
self
.
filename
=
filename
...
@@ -37,7 +41,6 @@ class PronterWindow(wx.Frame):
...
@@ -37,7 +41,6 @@ class PronterWindow(wx.Frame):
#Commands to implement:
#Commands to implement:
#gcodes(console) move/extrude/settemp/bedtemp/extrude/reverse(control panel)
#gcodes(console) move/extrude/settemp/bedtemp/extrude/reverse(control panel)
#upload
#help
#help
def
scanserial
(
self
):
def
scanserial
(
self
):
...
@@ -296,7 +299,31 @@ class PronterWindow(wx.Frame):
...
@@ -296,7 +299,31 @@ class PronterWindow(wx.Frame):
return
return
self
.
p
.
startprint
(
self
.
f
)
self
.
p
.
startprint
(
self
.
f
)
def
endupload
(
self
):
self
.
p
.
send_now
(
"M29 "
)
wx
.
CallAfter
(
self
.
status
.
SetStatusText
,
"File upload complete"
)
time
.
sleep
(
0.5
)
self
.
p
.
clear
=
True
self
.
uploading
=
False
def
uploadtrigger
(
self
,
l
):
if
"Writing to file"
in
l
:
self
.
uploading
=
True
self
.
p
.
startprint
(
self
.
f
)
self
.
p
.
endcb
=
self
.
endupload
self
.
recvlisteners
.
remove
(
self
.
uploadtrigger
)
elif
"open failed, File"
in
l
:
self
.
recvlisteners
.
remove
(
self
.
uploadtrigger
)
def
upload
(
self
,
event
):
def
upload
(
self
,
event
):
if
not
len
(
self
.
f
):
return
if
not
self
.
p
.
online
:
return
dlg
=
wx
.
TextEntryDialog
(
self
,
"Enter a target filename in 8.3 format:"
,
"Pick SD filename"
,
dosify
(
self
.
filename
))
if
dlg
.
ShowModal
()
==
wx
.
ID_OK
:
self
.
p
.
send_now
(
"M28 "
+
dlg
.
GetValue
())
self
.
recvlisteners
+=
[
self
.
uploadtrigger
]
pass
pass
def
pause
(
self
,
event
):
def
pause
(
self
,
event
):
...
...
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