Commit 28c05419 authored by kliment's avatar kliment

Merge pull request #179 from iXce/master

Handle exceptions raised when printer is disconnected 
parents 41986971 b444ebcd
......@@ -65,7 +65,6 @@ This alternative approach is confirmed to work on Mac OS X 10.6.8.
`sudo python setup.py install`
Then repeat the same with http://launchpad.net/pyreadline/trunk/1.7/+download/pyreadline-1.7.zip
Then repeat the same with http://http://pyglet.googlecode.com/files/pyglet-1.1.4.zip
# USING PRONTERFACE
......
......@@ -275,7 +275,7 @@ class gviz(wx.Panel):
start_pos = self.hilightpos[:] if hilight else self.lastpos[:]
if gcode[0] == "g1":
if gcode[0] in [ "g0", "g1" ]:
target = _readgcode()
line = [ _x(start_pos[0]), _y(start_pos[1]), _x(target[0]), _y(target[1]) ]
if not hilight:
......
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2012-01-09 15:07+CET\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Italian RepRap Community <reprap-italia@googlegroups.com>\n"
"Language-Team: Italian RepRap Community <reprap-italia@googlegroups.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
#: plater.py:223
msgid "Plate building tool"
msgstr "Strumento di posizionamento sul piatto"
#: plater.py:229
msgid "Clear"
msgstr "Pulisci"
#: plater.py:230
msgid "Load"
msgstr "Carica"
#: plater.py:232
msgid "Export"
msgstr "Esporta"
#: plater.py:235
msgid "Done"
msgstr "Fatto"
#: plater.py:237
msgid "Cancel"
msgstr "Cancella"
#: plater.py:239
msgid "Snap to Z = 0"
msgstr "Vai a Z = 0"
#: plater.py:240
msgid "Put at 100, 100"
msgstr "Metti a 100,100"
#: plater.py:241
msgid "Delete"
msgstr "Elimina"
#: plater.py:242
msgid "Auto"
msgstr "Automatico"
#: plater.py:266
msgid "Autoplating"
msgstr "Posizionamento automatico sul piatto"
#: plater.py:294
msgid "Bed full, sorry sir :("
msgstr "Il letto è pieno, mi dispiace :("
#: plater.py:304
msgid "Are you sure you want to clear the grid? All unsaved changes will be lost."
msgstr "Sei sicuro di voler pulire la griglia? Tutte le modifiche non salvate saranno perse."
#: plater.py:304
msgid "Clear the grid?"
msgstr "Pulire la griglia?"
#: plater.py:346
msgid "Pick file to save to"
msgstr "Scegli un file in cui salvare"
#: plater.py:347
msgid "STL files (;*.stl;)"
msgstr "files STL (;*.stl;)"
#: plater.py:367
msgid "wrote "
msgstr "scritti "
#: plater.py:370
msgid "Pick file to load"
msgstr "Scegli un file da caricare"
#: plater.py:371
msgid "STL files (;*.stl;)|*.stl|OpenSCAD files (;*.scad;)|*.scad"
msgstr "files STL (;*.stl;)|*.stl|files OpenSCAD (;*.scad;)|*.scad"
This diff is collapsed.
......@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
from serial import Serial
from serial import Serial, SerialException
from threading import Thread
from select import error as SelectError
import time, getopt, sys
......@@ -100,6 +100,9 @@ class printcore():
break
else:
raise
except SerialException, e:
print "Can't read from printer (disconnected?)."
break
if(len(line)>1):
self.log+=[line]
......@@ -279,7 +282,10 @@ class printcore():
self.sendcb(command)
except:
pass
try:
self.printer.write(str(command+"\n"))
except SerialException, e:
print "Can't write to printer (disconnected?)."
if __name__ == '__main__':
baud = 115200
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment