Skip to content

Commit

Permalink
fix (API): fixed loading scans
Browse files Browse the repository at this point in the history
- fixed loading previous scans from library.
  • Loading branch information
Mario Lukas committed Nov 25, 2019
1 parent c2283f6 commit 6235dd6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion debian/fabscanpi-server.init
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh
# /etc/init.d/fabscanpi-server
### BEGIN INIT INFO
# Provides: fabscanpi-server
Expand Down
10 changes: 7 additions & 3 deletions src/fabscan/lib/file/FSScans.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@ def get_list_of_scans(self, host):
response['scans'] = []

for dir in subdirectories:
if dir != "debug":
if os.path.os.path.exists(basedir + dir + "/scan_" + dir + ".ply"):
if dir != "debug" and dir != 'calibration':
if any(File.endswith(".ply") for File in os.listdir(basedir + dir)):
scan = dict()
scan['id'] = str(dir)
scan['pointcloud'] = str("http://" + host + "/scans/" + dir + "/scan_" + dir + ".ply")
if os.path.os.path.exists(basedir + dir + "/scan_" + dir + "_both.ply"):
scan['pointcloud'] = str("http://" + host + "/scans/" + dir + "/scan_" + dir + "_both.ply")
else:
scan['pointcloud'] = str("http://" + host + "/scans/" + dir + "/scan_" + dir + "_0.ply")

scan['thumbnail'] = str("http://" + host + "/scans/" + dir + "/thumbnail_" + dir + ".png")
response['scans'].append(scan)

Expand Down
2 changes: 1 addition & 1 deletion src/fabscan/lib/util/FSUpdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def upgrade_is_available(current_version, online_lookup_ip):
def do_upgrade():
try:
rc_update = FSSystem.run_command("sudo apt-get update")
rc_upgrade = FSSystem.run_command("sudo apt-get install fabscanpi-server")
rc_upgrade = FSSystem.run_command("sudo apt-get install -o Dpkg::Options::='--force-confnew' fabscanpi-server")
return (rc_update == 0 and rc_upgrade == 0)

except Exception, e:
Expand Down
4 changes: 0 additions & 4 deletions src/fabscan/server/FSScanServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ def on_server_command(self, mgr, event):
self.eventManager.instance.broadcast_client_message(FSEvents.ON_INFO_MESSAGE, message)
self._logger.error('Update failed.')

if command == FSCommand.RESTART_SERVER:
self.restart = True
self.restart()

def restart(self, override_sys=False):
message = {
"message": "RESTARTING_SERVER",
Expand Down

0 comments on commit 6235dd6

Please sign in to comment.