Skip to content

Commit

Permalink
Merge pull request #27 from flux3dp/dev
Browse files Browse the repository at this point in the history
Release v0.4b16
  • Loading branch information
yagami-cerberus committed Mar 29, 2016
2 parents 7f87b26 + 51327aa commit 6c374d9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fluxghost/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

__version__ = "0.4b15"
__version__ = "0.4b16"
DEBUG = False
8 changes: 6 additions & 2 deletions fluxghost/websocket/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def on_binary_message(self, buf):
else:
self.send_fatal("PROTOCOL_ERROR", "Can not accept binary data")

def simple_binary_transfer(self, mimetype, size, cmd, upload_to=None):
def simple_binary_transfer(self, mimetype, size, cmd, upload_to=None,
cb=None):
bin_sock = self.robot.begin_upload(mimetype, int(size),
cmd=cmd, upload_to=upload_to)
upload_meta = {'sent': 0}
Expand All @@ -95,6 +96,8 @@ def binary_handler(buf):
resp = self.robot.get_resp().decode("ascii", "ignore")
if resp == "ok":
self.send_ok()
if cb:
cb()
else:
errargs = resp.split(" ")
self.send_error(*(errargs[1:]))
Expand Down Expand Up @@ -522,7 +525,8 @@ def upload_callback(swap):
return

def update_fw(self, mimetype, ssize):
self.simple_binary_transfer(mimetype, int(ssize), "update_fw")
self.simple_binary_transfer(mimetype, int(ssize), "update_fw",
cb=lambda: self.close())

def update_mbfw(self, mimetype, ssize):
self.simple_binary_transfer(mimetype, int(ssize), "update_mbfw")
Expand Down
5 changes: 4 additions & 1 deletion fluxghost/websocket/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ def on_text_message(self, message):

cmd = payload.get("cmd")
if cmd == "poke":
self.server.discover.poke(payload["ipaddr"])
try:
self.server.discover.poke(payload["ipaddr"])
except Exception as e:
logger.error("Poke error: %s", repr(e))
else:
self.send_error("UNKNOWN_COMMAND")

Expand Down
1 change: 1 addition & 0 deletions fluxghost/websocket/scan_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def get_cab(self):
self.scan_settings.cab_r += tmp[1]
else:
pass
L.info('callibration: m:{} l:{} r:{}'.format(self.scan_settings.cab_m, self.scan_settings.cab_l, self.scan_settings.cab_r))
# self.cameraX += self.scan_settings.cab_m - (self.scan_settings.img_width / 2) / 125 *

self.scan_settings.LLaserAdjustment = int(self.scan_settings.cab_m) - (self.scan_settings.img_width / 2)
Expand Down
2 changes: 1 addition & 1 deletion fluxghost/websocket/scan_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from fluxclient import SUPPORT_PCL
from fluxclient.scanner.scan_settings import ScanSetting
from fluxclient.scanner.pc_process import PcProcess, PcProcessNoPCL
from fluxclient.scanner.pc_process import PcProcess

logger = logging.getLogger("WS.3DSCAN-MODELING")

Expand Down

0 comments on commit 6c374d9

Please sign in to comment.