Skip to content

Free Motion Capture for Everyone πŸ’€βœ¨

TypeScript

ws connects (view doesn't see it tho)

jonmatthisc77d95a79592
diff --git a/freemocap-ui/src/hooks/use-websocket.tsx b/freemocap-ui/src/hooks/use-websocket.tsx
index 9daf4abf..32c41c8b 100644
--- a/freemocap-ui/src/hooks/use-websocket.tsx
+++ b/freemocap-ui/src/hooks/use-websocket.tsx
@@ -1,5 +1,5 @@
import {useEffect, useState} from "react";
-import {CaptureType, WebsocketConnection, OnMessageHandler} from "../services/websocket-connection";
+import {CaptureType, WebsocketConnection, OnMessageHandler} from "@/services/websocket-connection";
export const useWebsocket = (captureType: CaptureType,
port: number,
diff --git a/freemocap-ui/src/services/websocket-connection.tsx b/freemocap-ui/src/services/websocket-connection.tsx
index 66c6db83..f55ad29d 100644
--- a/freemocap-ui/src/services/websocket-connection.tsx
+++ b/freemocap-ui/src/services/websocket-connection.tsx
@@ -11,7 +11,7 @@ export class WebsocketConnection {
constructor(private readonly _captureType: CaptureType = CaptureType.ConnectCameras,
private readonly _port: number = 8005) {
- this._base_host_url = `ws://localhost:${_port}/websocket`;
+ this._base_host_url = `ws://localhost:${_port}/skellycam/websocket`;
this._host_url = `${this._base_host_url}/${this._captureType}`
console.log(`WebsocketConnection.constructor: ${this._host_url}`);
}
diff --git a/freemocap-ui/src/views/Default.tsx b/freemocap-ui/src/views/Default.tsx
index 6b9aa285..bfb03b06 100644
--- a/freemocap-ui/src/views/Default.tsx
+++ b/freemocap-ui/src/views/Default.tsx
@@ -1,7 +1,7 @@
import {Box, Typography} from "@mui/material";
import React from "react";
import {useAsync} from "react-use";
-import {AvailableCameraDevices} from "../services/detectCameraDevices";
+import {AvailableCameraDevices} from "@/services/detectCameraDevices";
export const DefaultView = () => {
const [Container] = [Box, Box];
diff --git a/freemocap-ui/src/views/PythonCamerasView.tsx b/freemocap-ui/src/views/PythonCamerasView.tsx
index 20c71b60..1d28ccad 100644
--- a/freemocap-ui/src/views/PythonCamerasView.tsx
+++ b/freemocap-ui/src/views/PythonCamerasView.tsx
@@ -12,6 +12,7 @@ export const PythonCamerasView = () => {
return (
<Box sx={{display: "flex", flexDirection: "column"}}>
Hi wowowwwee
+ <br/>
websocket status: {websocketConnection.isConnectionClosed ? "closed" : "open"}
{!websocketConnection.isConnectionClosed && Object.entries(dataUrls).map(([cameraId, url]) => (
<img key={cameraId} src={url} alt={`video capture from camera ${cameraId}`}/>
diff --git a/freemocap/api/routers.py b/freemocap/api/routers.py
index d4ac593e..93e077d5 100644
--- a/freemocap/api/routers.py
+++ b/freemocap/api/routers.py
@@ -1,5 +1,18 @@
from skellycam import SKELLYCAM_ROUTERS
+from freemocap.api.http.app.health import health_router
+from freemocap.api.http.app.shutdown import app_shutdown_router
+from freemocap.api.http.app.state import state_router
+from freemocap.api.http.ui.ui_router import ui_router
+
FREEMOCAP_ROUTERS = {
+ "/ui": {
+ "ui": ui_router
+ },
+ "/app": {
+ "health": health_router,
+ "state": state_router,
+ "shutdown": app_shutdown_router
+ },
**SKELLYCAM_ROUTERS
}