This commit is contained in:
2026-05-07 11:13:51 +02:00
parent 1bc7e5eb9e
commit 1575445df4
8 changed files with 141 additions and 64 deletions
+4 -2
View File
@@ -43,6 +43,7 @@ logger = get_task_logger(__name__)
redisDB = Redis(host=settings.REDIS_HOST, port=settings.REDIS_PORT, db=0, decode_responses=True)
cameraDB = reductstore.ReductStore(name='camera')
planarianDB = planarian_metrics.ReductStoreClient(url=settings.REDUCTSTORE_URL, token=settings.REDUCTSTORE_TOKEN)
async_to_sync(planarianDB.connect)()
class CameraRecordManager():
@@ -281,9 +282,10 @@ class ScannerProcess(Task):
record,
self.cam._params.experiment,
self.cam._params.well,
entry_name=uuid,
uuid=uuid,
planarian=pid,
record_type='metrics',
ts_us=ts,
)
def _store_frame(self, uuid, frame, ts, frame_count):
@@ -311,7 +313,7 @@ class ScannerProcess(Task):
try:
(uuid, ts, frame, metrics, frame_count) = self.record_queue.get()
if self.cam.use_tracking:
self._store_metric(uuid, metrics, ts)
self._store_metric(uuid, metrics, ts.timestamp())
self._store_frame(uuid, frame, ts, frame_count)
@@ -58,8 +58,8 @@
<div class="w3-margin-top w3-padding w3-small">
<span id="_ts"></span>
</div>
<div class="w3-margin-top w3-padding w3-small">
<span id="_scan_state" class="w3-text-amber w3-border"></span>
<div class="w3-margin-top w3-small">
<span id="_scan_state" class="w3-text-amber w3-padding"></span>
</div>
</div>
</div>
-1
View File
@@ -19,6 +19,5 @@ urlpatterns = [
path('replay/', views.replay_view, name='replay'),
path('api/stats/', views.stats_view, name='api_stats'),
path('api/video/', views.download_api, name='download_api'),
path('api/restart/', views.restart_all, name='restart_all'),
path('api/export/', views.export_api, name='export_api'),
]
-12
View File
@@ -156,18 +156,6 @@ def images_view(request):
return render(request, "scanner/images.html", context=global_context(request, **ctx))
## replay
@require_GET
@csrf_exempt
def restart_all(request):
#http://scanner.local:9001/index.html?processname=test_tube%3Aservices&action=restart
#http://scanner.local:9001/index.html?processname=test_tube%3AwebUI&action=start
#http://scanner.local:9001/index.html?action=restartall
#supervisor_restart_service('index.html?action=restartall')
supervisor_restart_service('index.html?processname=test_tube%3Aservices&action=restart')
return JsonResponse({"state": True})
@require_POST
@csrf_exempt
def download_api(request):