- Support for WJ200 VFD
- Added M8.1 and M7.1 coolant off commands.
- Clear planner coolant and spindle state on stop.
+ - Fix web disconnect problem when downloading a bug report.
## v0.4.14
- Handle file uploads with '#' or '?' in the name.
h2 Debugging
a(href="/api/log", target="_blank")
button.pure-button.pure-button-primary View Log
- a(href="/api/bugreport")
+ a(href="/api/bugreport", download)
button.pure-button.pure-button-primary Bug Report
self.planner = bbctrl.Planner(ctrl)
self.unpausing = False
+ self.stopping = False
ctrl.state.set('cycle', 'idle')
self.planner.position_change()
self._set_cycle('idle')
+ # Planner stop
+ if state == 'READY' and self.stopping:
+ self.planner.stop()
+ self.ctrl.state.set('line', 0)
+ self.stopping = False
+
# Unpause sync
if state_changed and state != 'HOLDING': self.unpausing = False
else: super().i2c_command(Cmd.UNPAUSE)
- def stop(self): super().i2c_command(Cmd.STOP)
+ def stop(self):
+ if self._get_state() != 'jogging': self.stopping = True
+ super().i2c_command(Cmd.STOP)
+
+
def pause(self): super().pause()
import time
from tornado.web import HTTPError
from tornado import web, gen
+from tornado.concurrent import run_on_executor
+from concurrent.futures import ThreadPoolExecutor
import bbctrl
class BugReportHandler(bbctrl.RequestHandler):
- def get(self):
- import tarfile, io
+ executor = ThreadPoolExecutor(max_workers = 4)
- buf = io.BytesIO()
- tar = tarfile.open(mode = 'w:bz2', fileobj = buf)
+
+ def get_files(self):
+ files = []
def check_add(path, arcname = None):
if os.path.isfile(path):
if arcname is None: arcname = path
- tar.add(path, self.basename + '/' + arcname)
+ files.append((path, self.basename + '/' + arcname))
def check_add_basename(path):
check_add(path, os.path.basename(path))
check_add('config.json')
check_add(ctrl.get_upload(ctrl.state.get('selected', '')))
+ return files
+
+
+ @run_on_executor
+ def task(self):
+ import tarfile, io
+
+ files = self.get_files()
+
+ buf = io.BytesIO()
+ tar = tarfile.open(mode = 'w:bz2', fileobj = buf)
+ for path, name in files: tar.add(path, name)
tar.close()
- self.write(buf.getvalue())
+ return buf.getvalue()
+
+
+ @gen.coroutine
+ def get(self):
+ res = yield self.task()
+ self.write(res)
def set_default_headers(self):