Merge branch 'mrbeam' of https://github.com/mrbeam/OctoPrint into mrbeam
This commit is contained in:
commit
099c5dc33c
5 changed files with 1195 additions and 13 deletions
|
|
@ -86,9 +86,10 @@ class Events(object):
|
|||
|
||||
# Settings
|
||||
SETTINGS_UPDATED = "SettingsUpdated"
|
||||
|
||||
|
||||
# GRBL
|
||||
LIMITS_HIT = "LimitsHit"
|
||||
SOFT_RESET = "Soft-Reset"
|
||||
RT_STATE = "RealTimeState"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
1169
src/octoprint/util/comm_acc2.py
Normal file
1169
src/octoprint/util/comm_acc2.py
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue