Merge branch 'mrbeam' of https://github.com/mrbeam/OctoPrint into mrbeam

This commit is contained in:
Teja 2015-10-31 18:21:32 +01:00
commit 099c5dc33c
5 changed files with 1195 additions and 13 deletions

View file

@ -86,9 +86,10 @@ class Events(object):
# Settings
SETTINGS_UPDATED = "SettingsUpdated"
# GRBL
LIMITS_HIT = "LimitsHit"
SOFT_RESET = "Soft-Reset"
RT_STATE = "RealTimeState"

View file

@ -23,7 +23,7 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms
import re
import octoprint.util.comm_acc as comm
import octoprint.util.comm_acc2 as comm
import octoprint.util as util
from octoprint.settings import settings

View file

@ -22,7 +22,7 @@ from octoprint.plugin import plugin_manager, ProgressPlugin
from octoprint.printer import PrinterInterface, PrinterCallback, UnknownScript
from octoprint.printer.estimation import TimeEstimationHelper
from octoprint.settings import settings
from octoprint.util import comm_acc as comm
from octoprint.util import comm_acc2 as comm
from octoprint.util import InvariantContainer

View file

@ -1888,22 +1888,34 @@ class MachineCom(object):
self._doSendWithoutChecksum(commandToSend)
def _doSendWithoutChecksum(self, cmd):
self._log("Send: %s" % cmd)
self.acc_line_lengths.append(len(cmd)+1) # Track number of characters in grbl serial read buffer
try:
self._serial.write(cmd + '\n')
except serial.SerialTimeoutException:
self._log("Serial timeout while writing to serial port, trying again.")
if cmd == "?":
try:
self._serial.write(cmd)
except serial.SerialTimeoutException:
self._log("Serial timeout while writing to serial port, trying again.")
try:
self._serial.write(cmd)
except:
self._log("Unexpected error while writing serial port: %s" % (get_exception_string()))
self._errorValue = get_exception_string()
self.close(True)
else:
self._log("Send: %s" % cmd)
self.acc_line_lengths.append(len(cmd)+1) # Track number of characters in grbl serial read buffer
try:
self._serial.write(cmd + '\n')
except serial.SerialTimeoutException:
self._log("Serial timeout while writing to serial port, trying again.")
try:
self._serial.write(cmd + '\n')
except:
self._log("Unexpected error while writing serial port: %s" % (get_exception_string()))
self._errorValue = get_exception_string()
self.close(True)
except:
self._log("Unexpected error while writing serial port: %s" % (get_exception_string()))
self._errorValue = get_exception_string()
self.close(True)
except:
self._log("Unexpected error while writing serial port: %s" % (get_exception_string()))
self._errorValue = get_exception_string()
self.close(True)
##~~ command handlers
def _gcode_H_sent(self, cmd, cmd_type=None):

File diff suppressed because it is too large Load diff