mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-05 08:12:29 -08:00
Compare commits
55
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61b623fe82 | ||
|
|
3d83c6751a | ||
|
|
6b168e92ab | ||
|
|
e2d7d354c6 | ||
|
|
cc6f297b92 | ||
|
|
2add43e71a | ||
|
|
0a493ac345 | ||
|
|
17bb2703d1 | ||
|
|
f0981bf709 | ||
|
|
99de554c18 | ||
|
|
f95a4d56d7 | ||
|
|
1df3c9d322 | ||
|
|
e0838cce6c | ||
|
|
e25d3201c2 | ||
|
|
5d14f14139 | ||
|
|
09e81f5ace | ||
|
|
8f57ef2de4 | ||
|
|
ea242960b3 | ||
|
|
35ac14a7de | ||
|
|
690a8b5c6e | ||
|
|
255b8b2865 | ||
|
|
e27ec63985 | ||
|
|
9f8be6551c | ||
|
|
f09cd687c7 | ||
|
|
686499f8dd | ||
|
|
a3bcc61892 | ||
|
|
faf70c9a39 | ||
|
|
2aa8d3a056 | ||
|
|
23df46ca33 | ||
|
|
8407f52777 | ||
|
|
b44dcaa9c2 | ||
|
|
ff0d823aff | ||
|
|
2e8bfa5373 | ||
|
|
87940ddd03 | ||
|
|
6208979ce9 | ||
|
|
9a27fb1320 | ||
|
|
53129328d0 | ||
|
|
2d79c5a0e9 | ||
|
|
74f5a92ce1 | ||
|
|
146930279c | ||
|
|
0c33579858 | ||
|
|
c9783d097b | ||
|
|
d3eafb8d06 | ||
|
|
09d44b51d6 | ||
|
|
cf357e71f5 | ||
|
|
122efacc52 | ||
|
|
7f536528d0 | ||
|
|
3982249ebf | ||
|
|
388bea2e72 | ||
|
|
921a760817 | ||
|
|
55bcec4dda | ||
|
|
bb08e8dc6a | ||
|
|
a82f950eb6 | ||
|
|
e2dbaab8ba | ||
|
|
3611bb5cc7 |
No files matched your search
+1
-1
@@ -10,7 +10,7 @@
|
||||
/pnpm-workspace.yaml @loucass003
|
||||
|
||||
# loucass003 and Erimel responsible for i18n
|
||||
/gui/public/i18n/ @loucass003 @Erimelowo
|
||||
/gui/public/i18n/ @loucass003 @Erimelowo @ImSapphire
|
||||
/gui/src/i18n/ @loucass003 @Erimelowo
|
||||
/l10n.toml @loucass003 @Erimelowo
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ jobs:
|
||||
|
||||
- if: startsWith(matrix.os, 'windows')
|
||||
name: Upload a Build Artifact (Windows)
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
# Artifact name
|
||||
name: ${{ format('SlimeVR-GUI-Windows-{0}', env.BUILD_ARCH) }}
|
||||
@@ -112,7 +112,7 @@ jobs:
|
||||
|
||||
- if: startsWith(matrix.os, 'ubuntu')
|
||||
name: Upload a Build Artifact (Linux)
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
# Artifact name
|
||||
name: ${{ format('SlimeVR-GUI-Linux-{0}', env.BUILD_ARCH) }}
|
||||
@@ -121,7 +121,7 @@ jobs:
|
||||
|
||||
- if: matrix.os == 'macos-latest'
|
||||
name: Upload a Build Artifact (macOS)
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
# Artifact name
|
||||
name: SlimeVR-GUI-macOS
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
run: |
|
||||
npx @slimevr/update-manifest-generator@latest
|
||||
|
||||
- uses: actions/upload-artifact@v5
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: "update-manifest.json"
|
||||
path: ./update-manifest.json
|
||||
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
run: ./gradlew :server:desktop:shadowJar
|
||||
|
||||
- name: Upload the Server JAR as a Build Artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
# Artifact name
|
||||
name: 'SlimeVR-Server' # optional, default is artifact
|
||||
@@ -127,7 +127,7 @@ jobs:
|
||||
ANDROID_KEY_PASSWD: ${{ secrets.ANDROID_KEY_PASSWD }}
|
||||
|
||||
- name: Upload the Android build artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
# Artifact name
|
||||
name: 'SlimeVR-Android' # optional, default is artifact
|
||||
@@ -158,7 +158,7 @@ jobs:
|
||||
ANDROID_KEY_PASSWD: ${{ secrets.ANDROID_GPLAY_KEY_PASSWD }}
|
||||
|
||||
- name: Upload the Google Play artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
# Artifact name
|
||||
@@ -181,7 +181,7 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/download-artifact@v6
|
||||
- uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: 'SlimeVR-Server'
|
||||
path: server/desktop/build/libs/
|
||||
@@ -230,23 +230,23 @@ jobs:
|
||||
run: |
|
||||
tar czf slimevr-gui-dist.tar.gz -C gui/dist/ .
|
||||
|
||||
- uses: actions/upload-artifact@v5
|
||||
- uses: actions/upload-artifact@v6
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
with:
|
||||
name: SlimeVR-GUI-Dist
|
||||
path: ./slimevr-gui-dist.tar.gz
|
||||
|
||||
- uses: actions/upload-artifact@v5
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ format('SlimeVR-GUI-Deb-{0}', env.BUILD_ARCH) }}
|
||||
path: target/release/bundle/deb/slimevr*.deb
|
||||
|
||||
- uses: actions/upload-artifact@v5
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ format('SlimeVR-GUI-AppImage-{0}', env.BUILD_ARCH) }}
|
||||
path: target/release/bundle/appimage/slimevr*.AppImage
|
||||
|
||||
- uses: actions/upload-artifact@v5
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ format('SlimeVR-GUI-RPM-{0}', env.BUILD_ARCH) }}
|
||||
path: target/release/bundle/rpm/slimevr*.rpm
|
||||
@@ -279,7 +279,7 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/download-artifact@v6
|
||||
- uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: 'SlimeVR-Server'
|
||||
path: server/desktop/build/libs/
|
||||
@@ -320,12 +320,12 @@ jobs:
|
||||
--volicon ../macos/SlimeVR.app/Contents/Resources/icon.icns --skip-jenkins \
|
||||
--eula ../../../../../LICENSE-MIT slimevr.dmg ../macos/SlimeVR.app
|
||||
|
||||
- uses: actions/upload-artifact@v5
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: SlimeVR-GUI-MacApp
|
||||
path: target/universal-apple-darwin/release/bundle/macos/SlimeVR*.app
|
||||
|
||||
- uses: actions/upload-artifact@v5
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: SlimeVR-GUI-MacDmg
|
||||
path: target/universal-apple-darwin/release/bundle/dmg/slimevr.dmg
|
||||
@@ -359,7 +359,7 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/download-artifact@v6
|
||||
- uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: 'SlimeVR-Server'
|
||||
path: server/desktop/build/libs/
|
||||
@@ -399,7 +399,7 @@ jobs:
|
||||
cp target/release/slimevr.exe ./SlimeVR/
|
||||
7z a -tzip "SlimeVR-$BUILD_ARCH.zip" ./SlimeVR/
|
||||
|
||||
- uses: actions/upload-artifact@v5
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ format('SlimeVR-GUI-Windows-{0}', env.BUILD_ARCH) }}
|
||||
path: ./SlimeVR*.zip
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
"browser-fs-access": "^0.35.0",
|
||||
"classnames": "^2.5.1",
|
||||
"convert": "^5.12.0",
|
||||
"flatbuffers": "22.10.26",
|
||||
"flatbuffers": "workspace:*",
|
||||
"intl-pluralrules": "^2.0.1",
|
||||
"ip-num": "^1.5.1",
|
||||
"jotai": "^2.12.2",
|
||||
|
||||
@@ -109,6 +109,11 @@ board_type-XIAO_ESP32C3 = Seeed Studio XIAO ESP32C3
|
||||
board_type-HARITORA = Haritora
|
||||
board_type-ESP32C6DEVKITC1 = Espressif ESP32-C6 DevKitC-1
|
||||
board_type-GLOVE_IMU_SLIMEVR_DEV = SlimeVR Dev IMU Glove
|
||||
board_type-GESTURES = Gestures
|
||||
board_type-ESP32S3_SUPERMINI = ESP32-S3 Supermini
|
||||
board_type-GENERIC_NRF = Generic nRF
|
||||
board_type-SLIMEVR_BUTTERFLY_DEV = SlimeVR Dev Butterfly
|
||||
board_type-SLIMEVR_BUTTERFLY = SlimeVR Butterfly
|
||||
|
||||
## Proportions
|
||||
skeleton_bone-NONE = None
|
||||
@@ -331,6 +336,7 @@ tracker-table-column-name = Name
|
||||
tracker-table-column-type = Type
|
||||
tracker-table-column-battery = Battery
|
||||
tracker-table-column-ping = Ping
|
||||
tracker-table-column-packet_loss = Packet Loss
|
||||
tracker-table-column-tps = TPS
|
||||
tracker-table-column-temperature = Temp. °C
|
||||
tracker-table-column-linear-acceleration = Accel. X/Y/Z
|
||||
@@ -370,6 +376,10 @@ tracker-infos-magnetometer-status-v1 = { $status ->
|
||||
[ENABLED] Enabled
|
||||
}
|
||||
|
||||
tracker-infos-packet_loss = Packet Loss
|
||||
tracker-infos-packets_lost = Packets Lost
|
||||
tracker-infos-packets_received = Packets Received
|
||||
|
||||
## Tracker settings
|
||||
tracker-settings-back = Go back to trackers list
|
||||
tracker-settings-title = Tracker settings
|
||||
@@ -407,6 +417,7 @@ tracker-settings-update = Update now
|
||||
tracker-settings-update-title = Firmware version
|
||||
tracker-settings-current-version = Current
|
||||
tracker-settings-latest-version = Latest
|
||||
tracker-settings-build-date = Build Date
|
||||
|
||||
|
||||
## Tracker part card info
|
||||
@@ -567,6 +578,10 @@ settings-general-tracker_mechanics-use_mag_on_all_trackers-description =
|
||||
Uses magnetometer on all trackers that have a compatible firmware for it, reducing drift in stable magnetic environments.
|
||||
Can be disabled per tracker in the tracker's settings. <b>Please don't shutdown any of the trackers while toggling this!</b>
|
||||
settings-general-tracker_mechanics-use_mag_on_all_trackers-label = Use magnetometer on trackers
|
||||
settings-general-tracker_mechanics-trackers_over_usb = Trackers over USB
|
||||
settings-general-tracker_mechanics-trackers_over_usb-description =
|
||||
Enables receiving HID tracker data over USB. Make sure connected trackers have <b>connection over HID</b> enabled!
|
||||
settings-general-tracker_mechanics-trackers_over_usb-enabled-label = Allow HID trackers to connect directly over USB
|
||||
|
||||
settings-stay_aligned = Stay Aligned
|
||||
settings-stay_aligned-description = Stay Aligned reduces drift by gradually adjusting your trackers to match your relaxed poses.
|
||||
@@ -1342,6 +1357,7 @@ onboarding-stay_aligned-previous_step = Previous
|
||||
onboarding-stay_aligned-next_step = Next
|
||||
onboarding-stay_aligned-restart = Restart
|
||||
onboarding-stay_aligned-done = Done
|
||||
onboarding-stay_aligned-manual_mounting-done = Done
|
||||
|
||||
## Home
|
||||
home-no_trackers = No trackers detected or assigned
|
||||
@@ -1393,6 +1409,9 @@ firmware_tool-select_source-firmware = Firmware Source
|
||||
firmware_tool-select_source-version = Firmware Version
|
||||
firmware_tool-select_source-official = Official
|
||||
firmware_tool-select_source-dev = Dev
|
||||
firmware_tool-select_source-not_selected = No source selected
|
||||
firmware_tool-select_source-no_boards = No available boards for this source
|
||||
firmware_tool-select_source-no_versions = No available versions for this source
|
||||
|
||||
firmware_tool-board_defaults = Configure your board
|
||||
firmware_tool-board_defaults-description = Set the pins or settings relative to your hardware
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -18,6 +18,8 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="7522", MODE="0660
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="7523", MODE="0660", TAG+="uaccess"
|
||||
# CH341
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="5523", MODE="0660", TAG+="uaccess"
|
||||
# CH343
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="55D3", MODE="0660", TAG+="uaccess"
|
||||
# CH9102x
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="55D4", MODE="0660", TAG+="uaccess"
|
||||
|
||||
@@ -26,8 +28,10 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="55D4", MODE="0660
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10C4", ATTRS{idProduct}=="EA60", MODE="0660", TAG+="uaccess"
|
||||
|
||||
## Espressif
|
||||
# ESP32-C3
|
||||
# ESP32-S3 / ESP32-C3 / ESP32-C5 / ESP32-C6 / ESP32-C61 / ESP32-H2 / ESP32-P4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="303A", ATTRS{idProduct}=="1001", MODE="0660", TAG+="uaccess"
|
||||
# ESP32-S2
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="303A", ATTRS{idProduct}=="0002", MODE="0660", TAG+="uaccess"
|
||||
|
||||
## FTDI
|
||||
# FT232BM/L/Q, FT245BM/L/Q
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Localized, useLocalization } from '@fluent/react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import {
|
||||
RpcMessage,
|
||||
RecordBVHRequestT,
|
||||
RecordBVHStatusT,
|
||||
RpcMessage,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { BigButton } from './commons/BigButton';
|
||||
import { RecordIcon } from './commons/icon/RecordIcon';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
LegTweaksTmpClearT,
|
||||
RpcMessage,
|
||||
SettingsRequestT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { Navbar } from './Navbar';
|
||||
import { TopBar } from './TopBar';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
NewSerialDeviceResponseT,
|
||||
RpcMessage,
|
||||
SerialDeviceT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useConfig } from '@/hooks/config';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { useWifiForm, WifiFormData } from '@/hooks/wifi-form';
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
RpcMessage,
|
||||
SkeletonConfigRequestT,
|
||||
SkeletonConfigResponseT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { Tooltip } from './commons/Tooltip';
|
||||
import { Vector3 } from 'three';
|
||||
import { RecordIcon } from './commons/icon/RecordIcon';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Typography } from './commons/Typography';
|
||||
import classNames from 'classnames';
|
||||
import { ResetType } from 'solarxr-protocol';
|
||||
import { ResetType } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import {
|
||||
BODY_PARTS_GROUPS,
|
||||
MountingResetGroup,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { ReactNode, useContext, useEffect, useState } from 'react';
|
||||
import { NavLink, useMatch } from 'react-router-dom';
|
||||
import { TrackerStatus } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import {
|
||||
RpcMessage,
|
||||
ServerInfosRequestT,
|
||||
ServerInfosResponseT,
|
||||
TrackerStatus,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { CloseIcon } from './commons/icon/CloseIcon';
|
||||
import { MaximiseIcon } from './commons/icon/MaximiseIcon';
|
||||
@@ -156,9 +156,9 @@ export function TopBar({
|
||||
<>
|
||||
<div className="flex gap-0 flex-col">
|
||||
<div className="h-[3px]" />
|
||||
<div data-tauri-drag-region className="flex gap-2 h-[38px] z-50">
|
||||
<div data-tauri-drag-region className="flex gap-2 h-[38px] z-49">
|
||||
<div
|
||||
className="flex px-2 py-2 justify-around z-50"
|
||||
className="flex px-2 py-2 justify-around z-49"
|
||||
data-tauri-drag-region
|
||||
>
|
||||
<div className="flex gap-2" data-tauri-drag-region>
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
RpcMessage,
|
||||
TrackingPauseStateResponseT,
|
||||
TrackingPauseStateRequestT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { BigButton } from './commons/BigButton';
|
||||
import { PlayIcon } from './commons/icon/PlayIcon';
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
AddUnknownDeviceRequestT,
|
||||
RpcMessage,
|
||||
UnknownDeviceHandshakeNotificationT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useDebouncedEffect } from '@/hooks/timeout';
|
||||
import { useAtom } from 'jotai';
|
||||
import { ignoredTrackersAtom } from '@/store/app-store';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import classNames from 'classnames';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { BodyPart, TrackerDataT } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { TrackerDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/tracker';
|
||||
import { useTracker } from '@/hooks/tracker';
|
||||
import { PersonFrontIcon } from './PersonFrontIcon';
|
||||
import { FlatDeviceTracker } from '@/store/app-store';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import classNames from 'classnames';
|
||||
import { ReactNode, useEffect, useRef, useState } from 'react';
|
||||
import { BodyPart } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { PersonFrontIcon } from './PersonFrontIcon';
|
||||
import { useBreakpoint } from '@/hooks/breakpoint';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BodyPart } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { useLocaleConfig } from '@/i18n/config';
|
||||
import { AnkleIcon } from './icon/AnkleIcon';
|
||||
import { ChestIcon } from './icon/ChestIcon';
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import {
|
||||
DeviceDataT,
|
||||
TrackerDataT,
|
||||
TrackerStatus as TrackerStatusEnum,
|
||||
} from 'solarxr-protocol';
|
||||
import { DeviceDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/device-data';
|
||||
import { TrackerDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/tracker';
|
||||
import { TrackerStatus as TrackerStatusEnum } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { Typography } from './Typography';
|
||||
import classNames from 'classnames';
|
||||
import { DownloadIcon } from './icon/DownloadIcon';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BodyPart } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
|
||||
export const SIDES = [
|
||||
{
|
||||
@@ -59,14 +59,14 @@ export function PersonFrontIcon({ mirror = true }: { mirror?: boolean }) {
|
||||
/>
|
||||
<circle
|
||||
className="body-part-circle"
|
||||
cx="81.5"
|
||||
cx="82"
|
||||
cy="80"
|
||||
r={CIRCLE_RADIUS}
|
||||
id={BodyPart[BodyPart.NECK]}
|
||||
/>
|
||||
<circle
|
||||
className="body-part-circle"
|
||||
cx="81.5"
|
||||
cx="82"
|
||||
cy="35"
|
||||
r={CIRCLE_RADIUS}
|
||||
id={BodyPart[BodyPart.HEAD]}
|
||||
|
||||
@@ -10,7 +10,7 @@ export function TipBox({
|
||||
whitespace = false,
|
||||
className,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
children?: ReactNode;
|
||||
hideIcon?: boolean;
|
||||
whitespace?: boolean;
|
||||
className?: string;
|
||||
|
||||
@@ -11,6 +11,9 @@ export function BatteryIcon({
|
||||
charging: boolean;
|
||||
}) {
|
||||
const col = useMemo(() => {
|
||||
if (disabled) return 'fill-background-40';
|
||||
else if (charging) return 'fill-status-success';
|
||||
|
||||
const colorsMap: { [key: number]: string } = {
|
||||
0.4: 'fill-status-success',
|
||||
0.2: 'fill-status-warning',
|
||||
@@ -20,10 +23,8 @@ export function BatteryIcon({
|
||||
const val = Object.keys(colorsMap)
|
||||
.filter((key) => +key < value)
|
||||
.sort((a, b) => +b - +a)[0];
|
||||
return disabled
|
||||
? 'fill-background-40'
|
||||
: colorsMap[+val] || 'fill-background-10';
|
||||
}, [value, disabled]);
|
||||
return colorsMap[+val] || 'fill-background-10';
|
||||
}, [value, disabled, charging]);
|
||||
|
||||
return (
|
||||
<svg
|
||||
@@ -59,13 +60,21 @@ export function BatteryIcon({
|
||||
/>
|
||||
</mask>
|
||||
<g mask="url(#mask0_4_39)" className={classNames(col, 'opacity-100')}>
|
||||
<rect width={value * 18} height="9" />
|
||||
<rect width={charging ? 18 : value * 18} height="9" />
|
||||
</g>
|
||||
{charging && (
|
||||
{charging && value <= 1 && (
|
||||
<path
|
||||
d="M 0.93561138,11.744353 2.4349252,6.1488377 H 0.0312815 L 3.5761014,0.00903018 2.2061799,5.1216451 h 2.4534885 z"
|
||||
d="M 7.7638355,8.4189633 8.0112251,4.9834646 5.7712838,4.9834645 8.5644084,0.07977871 8.3170195,3.5152773 H 10.55696 Z"
|
||||
fill="#081e30"
|
||||
transform="translate(5,-1)"
|
||||
/>
|
||||
)}
|
||||
{charging && value > 1 && (
|
||||
<path
|
||||
d="M 5.5342464,4.6225095 C 6.1777799,5.0106205 6.6131537,5.2516456 7.5253371,6.545223 8.4340868,4.4016445 8.7809738,3.661475 10.605195,1.5520288"
|
||||
fill="none"
|
||||
stroke="#081e30"
|
||||
strokeWidth={1.5}
|
||||
strokeLinecap="square"
|
||||
/>
|
||||
)}
|
||||
</svg>
|
||||
|
||||
@@ -8,10 +8,8 @@ import {
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import classNames from 'classnames';
|
||||
import { Control, Controller } from 'react-hook-form';
|
||||
import {
|
||||
FirmwareUpdateStatus,
|
||||
TrackerStatus as TrackerStatusEnum,
|
||||
} from 'solarxr-protocol';
|
||||
import { FirmwareUpdateStatus } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { TrackerStatus as TrackerStatusEnum } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { TrackerStatus } from '@/components/tracker/TrackerStatus';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import { SelectSourceSetep } from './steps/SelectSourceStep';
|
||||
import { BoardDefaultsStep } from './steps/BoardDefaultsStep';
|
||||
import { BuildStep } from './steps/BuildStep';
|
||||
import { FlashingMethodStep } from './steps/FlashingMethodStep';
|
||||
import { FirmwareUpdateMethod } from 'solarxr-protocol';
|
||||
import { FirmwareUpdateMethod } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { FlashBtnStep } from './steps/FlashBtnStep';
|
||||
import { FlashingStep } from './steps/FlashingStep';
|
||||
|
||||
|
||||
@@ -7,16 +7,16 @@ import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { useEffect, useLayoutEffect, useState } from 'react';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
|
||||
import { DeviceDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/device-data';
|
||||
import { TrackerStatus } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import {
|
||||
DeviceDataT,
|
||||
FirmwareUpdateMethod,
|
||||
NewSerialDeviceResponseT,
|
||||
RpcMessage,
|
||||
SerialDeviceT,
|
||||
SerialDevicesRequestT,
|
||||
SerialDevicesResponseT,
|
||||
TrackerStatus,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { Input } from '@/components/commons/Input';
|
||||
import { Dropdown } from '@/components/commons/Dropdown';
|
||||
@@ -231,7 +231,10 @@ function OTADevicesList({
|
||||
const allDevices = useAtomValue(devicesAtom);
|
||||
|
||||
const devices =
|
||||
allDevices.filter(({ trackers }) => {
|
||||
allDevices.filter(({ hardwareInfo, trackers }) => {
|
||||
// filter out devices we can't update
|
||||
if (!hardwareInfo?.officialBoardType) return false;
|
||||
|
||||
// if the device has no trackers it is prob misconfigured so we skip for safety
|
||||
if (trackers.length <= 0) return false;
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import {
|
||||
} from '@/hooks/firmware-tool';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { DeviceIdTableT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import {
|
||||
DeviceIdTableT,
|
||||
FirmwareUpdateMethod,
|
||||
FirmwareUpdateStatus,
|
||||
FirmwareUpdateStatusResponseT,
|
||||
FirmwareUpdateStopQueuesRequestT,
|
||||
RpcMessage,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useOnboarding } from '@/hooks/onboarding';
|
||||
import { WarningBox } from '@/components/commons/TipBox';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
|
||||
@@ -101,13 +101,10 @@ export function SelectSourceSetep({
|
||||
curr.push({
|
||||
name: source.source,
|
||||
official: source.official,
|
||||
disabled:
|
||||
!partialBoard?.board ||
|
||||
!source.availableBoards.includes(partialBoard.board),
|
||||
});
|
||||
return curr;
|
||||
},
|
||||
[] as { name: string; official: boolean; disabled: boolean }[]
|
||||
[] as { name: string; official: boolean }[]
|
||||
)
|
||||
.sort((a, b) => {
|
||||
if (a.official !== b.official) return a.official ? -1 : 1;
|
||||
@@ -115,6 +112,7 @@ export function SelectSourceSetep({
|
||||
}),
|
||||
possibleBoards: sources
|
||||
?.reduce((curr, source) => {
|
||||
if (source.source !== partialBoard?.source) return curr;
|
||||
const unknownBoards = source.availableBoards.filter(
|
||||
(b) => !curr.includes(b)
|
||||
);
|
||||
@@ -136,6 +134,7 @@ export function SelectSourceSetep({
|
||||
possibleVersions: sources
|
||||
?.reduce(
|
||||
(curr, source) => {
|
||||
if (source.source !== partialBoard?.source) return curr;
|
||||
if (!curr.find(({ name }) => source.version === name))
|
||||
curr.push({
|
||||
disabled:
|
||||
@@ -193,6 +192,25 @@ export function SelectSourceSetep({
|
||||
{!isFetching && !isError && (
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="grid md:grid-cols-3 gap-4">
|
||||
<div className="flex flex-col gap-1 w-full">
|
||||
<Localized id="firmware_tool-select_source-firmware">
|
||||
<Typography variant="section-title" />
|
||||
</Localized>
|
||||
<div className="flex flex-col gap-4 md:max-h-[305px] overflow-y-auto bg-background-80 rounded-lg p-4">
|
||||
{sourcesGroupped?.map(({ name, official }) => (
|
||||
<Selector
|
||||
active={partialBoard?.source === name}
|
||||
key={`${name}`}
|
||||
tag={official ? 'official' : undefined}
|
||||
onClick={() => {
|
||||
if (partialBoard?.source !== name)
|
||||
setPartialBoard({ source: name });
|
||||
}}
|
||||
text={formatSource(name, official)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-1 w-full">
|
||||
<Localized id="firmware_tool-select_source-board_type">
|
||||
<Typography variant="section-title" />
|
||||
@@ -203,7 +221,7 @@ export function SelectSourceSetep({
|
||||
active={partialBoard?.board === board}
|
||||
key={`${board}`}
|
||||
onClick={() => {
|
||||
setPartialBoard({ board });
|
||||
setPartialBoard((curr) => ({ ...curr, board }));
|
||||
}}
|
||||
tag={
|
||||
board.startsWith('BOARD_SLIMEVR')
|
||||
@@ -219,30 +237,15 @@ export function SelectSourceSetep({
|
||||
}
|
||||
/>
|
||||
))}
|
||||
{partialBoard?.source && possibleBoards?.length === 0 && (
|
||||
<Typography id="firmware_tool-select_source-no_boards" />
|
||||
)}
|
||||
{!partialBoard?.source && (
|
||||
<Typography id="firmware_tool-select_source-not_selected" />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-1 w-full">
|
||||
<Localized id="firmware_tool-select_source-firmware">
|
||||
<Typography variant="section-title" />
|
||||
</Localized>
|
||||
<div className="flex flex-col gap-4 md:max-h-[305px] overflow-y-auto bg-background-80 rounded-lg p-4">
|
||||
{sourcesGroupped?.map(({ name, official, disabled }) => (
|
||||
<Selector
|
||||
active={partialBoard?.source === name}
|
||||
disabled={disabled}
|
||||
key={`${name}`}
|
||||
tag={official ? 'official' : undefined}
|
||||
onClick={() => {
|
||||
setPartialBoard((curr) => ({
|
||||
...curr,
|
||||
source: name,
|
||||
}));
|
||||
}}
|
||||
text={formatSource(name, official)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-1 w-full">
|
||||
<Localized id="firmware_tool-select_source-version">
|
||||
<Typography variant="section-title" />
|
||||
@@ -268,6 +271,12 @@ export function SelectSourceSetep({
|
||||
text={name}
|
||||
/>
|
||||
))}
|
||||
{partialBoard?.source && possibleVersions?.length === 0 && (
|
||||
<Typography id="firmware_tool-select_source-no_versions" />
|
||||
)}
|
||||
{!partialBoard?.source && (
|
||||
<Typography id="firmware_tool-select_source-not_selected" />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,17 +2,19 @@ import { Localized, ReactLocalization, useLocalization } from '@fluent/react';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { getTrackerName } from '@/hooks/tracker';
|
||||
import { ComponentProps, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { BoardType } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes/hardware-info';
|
||||
import { DeviceDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/device-data';
|
||||
import {
|
||||
BoardType,
|
||||
DeviceDataT,
|
||||
DeviceIdTableT,
|
||||
TrackerStatus,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import {
|
||||
FirmwareUpdateMethod,
|
||||
FirmwareUpdateStatus,
|
||||
FirmwareUpdateStatusResponseT,
|
||||
FirmwareUpdateStopQueuesRequestT,
|
||||
RpcMessage,
|
||||
TrackerStatus,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import classNames from 'classnames';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import Markdown from 'react-markdown';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { NavLink, useNavigate } from 'react-router-dom';
|
||||
import { TrackerDataT } from 'solarxr-protocol';
|
||||
import { TrackerDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/tracker';
|
||||
import { useConfig } from '@/hooks/config';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { TrackerCard } from '@/components/tracker/TrackerCard';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Localized } from '@fluent/react';
|
||||
import { ResetType } from 'solarxr-protocol';
|
||||
import { ResetType } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import classNames from 'classnames';
|
||||
import { useReset, UseResetOptions } from '@/hooks/reset';
|
||||
@@ -28,18 +28,23 @@ export function ResetButtonIcon(options: UseResetOptions) {
|
||||
}
|
||||
|
||||
export function ResetButton({
|
||||
onClick,
|
||||
className,
|
||||
onReseted,
|
||||
children,
|
||||
onFailed,
|
||||
...options
|
||||
}: {
|
||||
onClick?: () => void;
|
||||
className?: string;
|
||||
children?: ReactNode;
|
||||
onReseted?: () => void;
|
||||
onFailed?: () => void;
|
||||
} & UseResetOptions) {
|
||||
const { triggerReset, status, timer, disabled, name, error } = useReset(
|
||||
options,
|
||||
onReseted
|
||||
onReseted,
|
||||
onFailed
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -60,7 +65,10 @@ export function ResetButton({
|
||||
>
|
||||
<Button
|
||||
icon={<ResetButtonIcon {...options} />}
|
||||
onClick={triggerReset}
|
||||
onClick={() => {
|
||||
if (onClick) onClick();
|
||||
triggerReset();
|
||||
}}
|
||||
className={classNames(
|
||||
'border-2 py-[5px]',
|
||||
status === 'finished'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { BodyPart } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { AssignMode } from '@/hooks/config';
|
||||
import { BodyInteractions } from '@/components/commons/BodyInteractions';
|
||||
import { TrackerPartCard } from '@/components/tracker/TrackerPartCard';
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
TrackingChecklistStepId,
|
||||
WifiProvisioningStatus,
|
||||
WifiProvisioningStatusResponseT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useOnboarding } from '@/hooks/onboarding';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { ArrowLink } from '@/components/commons/ArrowLink';
|
||||
|
||||
@@ -3,15 +3,15 @@ import { useOnboarding } from '@/hooks/onboarding';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { useState, useMemo, useEffect } from 'react';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import {
|
||||
BodyPart,
|
||||
ResetResponseT,
|
||||
ResetStatus,
|
||||
ResetType,
|
||||
RpcMessage,
|
||||
SettingsRequestT,
|
||||
SettingsResponseT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { BodyDisplay } from '@/components/commons/BodyDisplay';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import classNames from 'classnames';
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
SkeletonConfigRequestT,
|
||||
SkeletonConfigResponseT,
|
||||
SkeletonResetAllRequestT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useOnboarding } from '@/hooks/onboarding';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { BodyProportions } from './BodyProportions';
|
||||
|
||||
@@ -5,20 +5,22 @@ import { useAtomValue } from 'jotai';
|
||||
import { serverGuardsAtom } from '@/store/app-store';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { useEffect, useState } from 'react';
|
||||
import {
|
||||
ModelSettingsT,
|
||||
SkeletonHeightT,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc/settings';
|
||||
import {
|
||||
CancelUserHeightCalibrationT,
|
||||
ChangeSettingsRequestT,
|
||||
ModelSettingsT,
|
||||
ResetType,
|
||||
RpcMessage,
|
||||
SkeletonConfigRequestT,
|
||||
SkeletonConfigResponseT,
|
||||
SkeletonHeightT,
|
||||
SkeletonResetAllRequestT,
|
||||
StartUserHeightCalibrationT,
|
||||
UserHeightCalibrationStatus,
|
||||
UserHeightRecordingStatusResponseT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { HeightSelectionInput } from './HeightInput';
|
||||
import { Tooltip } from '@/components/commons/Tooltip';
|
||||
import classNames from 'classnames';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ResetType } from 'solarxr-protocol';
|
||||
import { ResetType } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { ResetButton } from '@/components/home/ResetButton';
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ export function VerifyResultsStep({
|
||||
hasRecording === ProcessStatus.FULFILLED && (
|
||||
<Typography>
|
||||
{l10n.getString(
|
||||
'onboarding-automatic-proportions-verify-results-processing'
|
||||
'onboarding-automatic_proportions-verify_results-processing'
|
||||
)}
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
import { AssignTrackerRequestT, BodyPart, RpcMessage } from 'solarxr-protocol';
|
||||
import { ReactNode, useCallback, useMemo, useState } from 'react';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import {
|
||||
AssignTrackerRequestT,
|
||||
RpcMessage,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useOnboarding } from '@/hooks/onboarding';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import {
|
||||
@@ -12,7 +16,7 @@ import { TipBox } from '@/components/commons/TipBox';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { BodyAssignment } from '@/components/onboarding/BodyAssignment';
|
||||
import { MountingSelectionMenu } from './MountingSelectionMenu';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { Localized } from '@fluent/react';
|
||||
import { useBreakpoint } from '@/hooks/breakpoint';
|
||||
import { Quaternion } from 'three';
|
||||
import { AssignMode, defaultConfig, useConfig } from '@/hooks/config';
|
||||
@@ -22,7 +26,6 @@ import * as Sentry from '@sentry/react';
|
||||
|
||||
export function ManualMountingPage() {
|
||||
const { isMobile } = useBreakpoint('mobile');
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
const { sendRPCPacket } = useWebsocketAPI();
|
||||
const { config } = useConfig();
|
||||
@@ -103,28 +106,26 @@ export function ManualMountingPage() {
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full xs:justify-center relative overflow-y-auto">
|
||||
<div className="flex xs:flex-row mobile:flex-col h-full px-8 xs:w-full xs:justify-center mobile:px-4 items-center">
|
||||
<div className="flex flex-col w-full xs:max-w-sm gap-3">
|
||||
<Typography variant="main-title">
|
||||
{l10n.getString('onboarding-manual_mounting')}
|
||||
</Typography>
|
||||
<Typography>
|
||||
{l10n.getString('onboarding-manual_mounting-description')}
|
||||
</Typography>
|
||||
<TipBox>{l10n.getString('tips-find_tracker')}</TipBox>
|
||||
<Typography variant="main-title" id="onboarding-manual_mounting" />
|
||||
<Typography id="onboarding-manual_mounting-description" />
|
||||
<Typography id="tips-find_tracker" />
|
||||
<Localized id="tips-find_tracker">
|
||||
<TipBox />
|
||||
</Localized>
|
||||
|
||||
<div className="flex flex-row gap-3 mt-auto">
|
||||
<Button
|
||||
variant="secondary"
|
||||
to="/onboarding/mounting/choose"
|
||||
state={state}
|
||||
>
|
||||
{l10n.getString('onboarding-previous_step')}
|
||||
</Button>
|
||||
id="onboarding-previous_step"
|
||||
/>
|
||||
{!state.alonePage && (
|
||||
<Button
|
||||
variant="primary"
|
||||
to="/onboarding/body-proportions/scaled"
|
||||
>
|
||||
{l10n.getString('onboarding-manual_mounting-next')}
|
||||
</Button>
|
||||
id="onboarding-manual_mounting-next"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -142,3 +143,109 @@ export function ManualMountingPage() {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export function ManualMountingPageStayAligned({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const { isMobile } = useBreakpoint('mobile');
|
||||
const { sendRPCPacket } = useWebsocketAPI();
|
||||
const { config } = useConfig();
|
||||
|
||||
const [selectedRole, setSelectRole] = useState<BodyPart>(BodyPart.NONE);
|
||||
|
||||
const assignedTrackers = useAtomValue(assignedTrackersAtom);
|
||||
|
||||
const trackerPartGrouped = useMemo(
|
||||
() =>
|
||||
assignedTrackers.reduce<{ [key: number]: FlatDeviceTracker[] }>(
|
||||
(curr, td) => {
|
||||
const key = td.tracker.info?.bodyPart || BodyPart.NONE;
|
||||
return {
|
||||
...curr,
|
||||
[key]: [...(curr[key] || []), td],
|
||||
};
|
||||
},
|
||||
{}
|
||||
),
|
||||
[assignedTrackers]
|
||||
);
|
||||
|
||||
const onDirectionSelected = (mountingOrientationDegrees: Quaternion) => {
|
||||
(trackerPartGrouped[selectedRole] || []).forEach((td) => {
|
||||
const assignreq = new AssignTrackerRequestT();
|
||||
|
||||
assignreq.bodyPosition = td.tracker.info?.bodyPart || BodyPart.NONE;
|
||||
assignreq.mountingOrientation = MountingOrientationDegreesToQuatT(
|
||||
mountingOrientationDegrees
|
||||
);
|
||||
assignreq.trackerId = td.tracker.trackerId;
|
||||
assignreq.allowDriftCompensation = false;
|
||||
|
||||
sendRPCPacket(RpcMessage.AssignTrackerRequest, assignreq);
|
||||
Sentry.metrics.count('manual_mounting_set', 1, {
|
||||
attributes: {
|
||||
part: BodyPart[assignreq.bodyPosition],
|
||||
direction: assignreq.mountingOrientation,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
setSelectRole(BodyPart.NONE);
|
||||
};
|
||||
|
||||
const getCurrRotation = useCallback(
|
||||
(role: BodyPart) => {
|
||||
if (role === BodyPart.NONE) return undefined;
|
||||
|
||||
const trackers = trackerPartGrouped[role] || [];
|
||||
const [mountingOrientation, ...orientation] = trackers
|
||||
.map((td) => td.tracker.info?.mountingOrientation)
|
||||
.filter((orientation) => !!orientation)
|
||||
.map((orientation) => QuaternionFromQuatT(orientation));
|
||||
|
||||
const identicalOrientations =
|
||||
mountingOrientation !== undefined &&
|
||||
orientation.every((quat) =>
|
||||
similarQuaternions(quat, mountingOrientation)
|
||||
);
|
||||
return identicalOrientations ? mountingOrientation : undefined;
|
||||
},
|
||||
[trackerPartGrouped]
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<MountingSelectionMenu
|
||||
bodyPart={selectedRole}
|
||||
currRotation={getCurrRotation(selectedRole)}
|
||||
isOpen={selectedRole !== BodyPart.NONE}
|
||||
onClose={() => setSelectRole(BodyPart.NONE)}
|
||||
onDirectionSelected={onDirectionSelected}
|
||||
/>
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full xs:justify-center relative overflow-y-auto">
|
||||
<div className="flex xs:flex-row mobile:flex-col h-full px-8 xs:w-full xs:justify-center mobile:px-4 items-center">
|
||||
<div className="flex flex-col w-full xs:max-w-sm gap-3">
|
||||
<Typography variant="main-title" id="onboarding-manual_mounting" />
|
||||
<Typography id="onboarding-manual_mounting-description" />
|
||||
<Typography id="tips-find_tracker" />
|
||||
<Localized id="tips-find_tracker">
|
||||
<TipBox />
|
||||
</Localized>
|
||||
{children}
|
||||
</div>
|
||||
<div className="flex flex-row justify-center">
|
||||
<BodyAssignment
|
||||
width={isMobile ? 160 : undefined}
|
||||
mirror={config?.mirrorView ?? defaultConfig.mirrorView}
|
||||
onlyAssigned={true}
|
||||
assignMode={AssignMode.All}
|
||||
onRoleSelected={setSelectRole}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import { FootIcon } from '@/components/commons/icon/FootIcon';
|
||||
import { rotationToQuatMap, similarQuaternions } from '@/maths/quaternion';
|
||||
import { Quaternion } from 'three';
|
||||
import { SlimeUpIcon } from '@/components/commons/icon/SlimeUpIcon';
|
||||
import { BodyPart } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { PawIcon } from '@/components/commons/icon/PawIcon';
|
||||
import { useLocaleConfig } from '@/i18n/config';
|
||||
import { FingersIcon } from '@/components/commons/icon/FingersIcon';
|
||||
@@ -238,7 +238,7 @@ export function MountingSelectionMenu({
|
||||
shouldCloseOnEsc
|
||||
onRequestClose={onClose}
|
||||
overlayClassName={classNames(
|
||||
'fixed top-0 right-0 left-0 bottom-0 flex flex-col items-center w-full h-full bg-background-90 bg-opacity-90 z-20'
|
||||
'fixed top-0 right-0 left-0 bottom-0 flex flex-col items-center w-full h-full bg-background-90 bg-opacity-90 z-50'
|
||||
)}
|
||||
className={classNames(
|
||||
'focus:ring-transparent focus:ring-offset-transparent focus:outline-transparent outline-none mt-20 z-10'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ResetType } from 'solarxr-protocol';
|
||||
import { ResetType } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { ResetButton } from '@/components/home/ResetButton';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ResetType } from 'solarxr-protocol';
|
||||
import { ResetType } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { ResetButton } from '@/components/home/ResetButton';
|
||||
|
||||
@@ -6,7 +6,10 @@ import {
|
||||
SittingRelaxedPoseStep,
|
||||
StandingRelaxedPoseStep,
|
||||
} from './stay-aligned-steps/RelaxedPoseSteps';
|
||||
import { EnableStayAlignedRequestT, RpcMessage } from 'solarxr-protocol';
|
||||
import {
|
||||
EnableStayAlignedRequestT,
|
||||
RpcMessage,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { RPCPacketType, useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import VerticalStepper from '@/components/commons/VerticalStepper';
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import { Typography } from '@/components/commons/Typography';
|
||||
import { VerticalStepComponentProps } from '@/components/commons/VerticalStepper';
|
||||
import { ResetButton } from '@/components/home/ResetButton';
|
||||
import { Localized } from '@fluent/react';
|
||||
import { ResetType } from 'solarxr-protocol';
|
||||
import { ResetType } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
|
||||
export function PreparationStep({
|
||||
nextStep,
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import {
|
||||
ResetRelaxedPoseButton,
|
||||
} from '@/components/stay-aligned/RelaxedPose';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { StayAlignedRelaxedPose } from 'solarxr-protocol';
|
||||
import { StayAlignedRelaxedPose } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { enableStayAligned } from '@/components/onboarding/pages/stay-aligned/StayAlignedSetup';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { VerticalStepComponentProps } from '@/components/commons/VerticalStepper';
|
||||
|
||||
+42
-18
@@ -1,32 +1,33 @@
|
||||
import { useState } from 'react';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { ResetType } from 'solarxr-protocol';
|
||||
import { ResetType } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { ResetButton } from '@/components/home/ResetButton';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { useBreakpoint } from '@/hooks/breakpoint';
|
||||
import { VerticalStepComponentProps } from '@/components/commons/VerticalStepper';
|
||||
|
||||
import { BaseModal } from '@/components/commons/BaseModal';
|
||||
import { ManualMountingPageStayAligned } from '@/components/onboarding/pages/mounting/ManualMounting';
|
||||
export function VerifyMountingStep({
|
||||
nextStep,
|
||||
prevStep,
|
||||
}: VerticalStepComponentProps) {
|
||||
const { isMobile } = useBreakpoint('mobile');
|
||||
const { l10n } = useLocalization();
|
||||
const [isOpen, setOpen] = useState(false);
|
||||
const [disableMounting, setDisableMounting] = useState(false);
|
||||
|
||||
const goNextStep = () => {
|
||||
setDisableMounting(false);
|
||||
setOpen(false);
|
||||
nextStep();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col flex-grow justify-between py-2 gap-2">
|
||||
<div className="flex flex-col flex-grow">
|
||||
<div className="flex flex-grow flex-col gap-4 max-w-sm">
|
||||
<div className="flex flex-col gap-2">
|
||||
<Typography>
|
||||
{l10n.getString(
|
||||
'onboarding-automatic_mounting-mounting_reset-step-0'
|
||||
)}
|
||||
</Typography>
|
||||
<Typography>
|
||||
{l10n.getString(
|
||||
'onboarding-automatic_mounting-mounting_reset-step-1'
|
||||
)}
|
||||
</Typography>
|
||||
<Typography id="onboarding-automatic_mounting-mounting_reset-step-0" />
|
||||
<Typography id="onboarding-automatic_mounting-mounting_reset-step-1" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -50,13 +51,36 @@ export function VerifyMountingStep({
|
||||
</div>
|
||||
)}
|
||||
<div className="flex gap-3 justify-between">
|
||||
<Button variant={'secondary'} onClick={prevStep}>
|
||||
{l10n.getString('onboarding-automatic_mounting-prev_step')}
|
||||
</Button>
|
||||
<Button
|
||||
variant={'secondary'}
|
||||
onClick={prevStep}
|
||||
id="onboarding-automatic_mounting-prev_step"
|
||||
/>
|
||||
<Button
|
||||
disabled={disableMounting}
|
||||
variant={'secondary'}
|
||||
className="self-start mt-auto"
|
||||
onClick={() => setOpen(true)}
|
||||
id="onboarding-automatic_mounting-manual_mounting"
|
||||
/>
|
||||
<BaseModal isOpen={isOpen} onRequestClose={() => setOpen(false)}>
|
||||
<ManualMountingPageStayAligned>
|
||||
<div className="flex flex-row gap-3 mt-auto">
|
||||
<Button
|
||||
variant="primary"
|
||||
onClick={goNextStep}
|
||||
id="onboarding-stay_aligned-manual_mounting-done"
|
||||
/>
|
||||
</div>
|
||||
</ManualMountingPageStayAligned>
|
||||
</BaseModal>
|
||||
|
||||
<ResetButton
|
||||
onClick={() => setDisableMounting(true)}
|
||||
type={ResetType.Mounting}
|
||||
group="default"
|
||||
onReseted={nextStep}
|
||||
onReseted={goNextStep}
|
||||
onFailed={() => setDisableMounting(false)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,17 +3,19 @@ import classNames from 'classnames';
|
||||
import { useMemo, useState, useEffect } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import {
|
||||
AssignTrackerRequestT,
|
||||
BodyPart,
|
||||
QuatT,
|
||||
RpcMessage,
|
||||
TrackerIdT,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { QuatT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes/math';
|
||||
import {
|
||||
AssignTrackerRequestT,
|
||||
RpcMessage,
|
||||
SettingsRequestT,
|
||||
SettingsResponseT,
|
||||
TapDetectionSettingsT,
|
||||
ChangeSettingsRequestT,
|
||||
TapDetectionSetupNotificationT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useChokerWarning } from '@/hooks/choker-warning';
|
||||
import { useOnboarding } from '@/hooks/onboarding';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import classNames from 'classnames';
|
||||
import ReactModal from 'react-modal';
|
||||
import { BodyPart } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { TipBox } from '@/components/commons/TipBox';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
|
||||
@@ -12,7 +12,10 @@ import { SettingsResetModal } from '@/components/settings/SettingsResetModal';
|
||||
import { error } from '@/utils/logging';
|
||||
import { defaultConfig as defaultGUIConfig, useConfig } from '@/hooks/config';
|
||||
import { defaultValues as defaultDevConfig } from '@/components/widgets/DeveloperModeWidget';
|
||||
import { RpcMessage, SettingsResetRequestT } from 'solarxr-protocol';
|
||||
import {
|
||||
RpcMessage,
|
||||
SettingsResetRequestT,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
import { Localized, useLocalization } from '@fluent/react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { DefaultValues, useForm } from 'react-hook-form';
|
||||
import { FilteringType } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import {
|
||||
ChangeSettingsRequestT,
|
||||
FilteringSettingsT,
|
||||
FilteringType,
|
||||
LegTweaksSettingsT,
|
||||
ModelRatiosT,
|
||||
ModelSettingsT,
|
||||
ModelTogglesT,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc/settings';
|
||||
import {
|
||||
ChangeSettingsRequestT,
|
||||
FilteringSettingsT,
|
||||
RpcMessage,
|
||||
SettingsRequestT,
|
||||
SettingsResponseT,
|
||||
SteamVRTrackersSettingT,
|
||||
TapDetectionSettingsT,
|
||||
} from 'solarxr-protocol';
|
||||
HIDSettingsT,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useConfig } from '@/hooks/config';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { useLocaleConfig } from '@/i18n/config';
|
||||
@@ -101,6 +104,9 @@ export type SettingsForm = {
|
||||
};
|
||||
resetsSettings: ResetSettingsForm;
|
||||
stayAligned: StayAlignedSettingsForm;
|
||||
hidSettings: {
|
||||
trackersOverHID: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
const defaultValues: SettingsForm = {
|
||||
@@ -156,6 +162,7 @@ const defaultValues: SettingsForm = {
|
||||
legTweaks: { correctionStrength: 0.3 },
|
||||
resetsSettings: defaultResetSettings,
|
||||
stayAligned: defaultStayAlignedSettings,
|
||||
hidSettings: { trackersOverHID: false },
|
||||
};
|
||||
|
||||
export function GeneralSettings() {
|
||||
@@ -277,6 +284,10 @@ export function GeneralSettings() {
|
||||
|
||||
settings.stayAligned = serializeStayAlignedSettings(values.stayAligned);
|
||||
|
||||
const hidSettings = new HIDSettingsT();
|
||||
hidSettings.trackersOverHid = values.hidSettings.trackersOverHID;
|
||||
settings.hidSettings = hidSettings;
|
||||
|
||||
if (values.resetsSettings) {
|
||||
settings.resetsSettings = loadResetSettings(values.resetsSettings);
|
||||
}
|
||||
@@ -392,6 +403,12 @@ export function GeneralSettings() {
|
||||
);
|
||||
}
|
||||
|
||||
if (settings.hidSettings) {
|
||||
formData.hidSettings = {
|
||||
trackersOverHID: settings.hidSettings.trackersOverHid,
|
||||
};
|
||||
}
|
||||
|
||||
reset({ ...getValues(), ...formData });
|
||||
});
|
||||
|
||||
@@ -689,6 +706,28 @@ export function GeneralSettings() {
|
||||
settingType="general"
|
||||
id="mechanics-magnetometer"
|
||||
/>
|
||||
<div className="flex flex-col pt-5 pb-3">
|
||||
<Typography variant="section-title">
|
||||
{l10n.getString(
|
||||
'settings-general-tracker_mechanics-trackers_over_usb'
|
||||
)}
|
||||
</Typography>
|
||||
<Localized
|
||||
id="settings-general-tracker_mechanics-trackers_over_usb-description"
|
||||
elems={{ b: <b /> }}
|
||||
>
|
||||
<Typography />
|
||||
</Localized>
|
||||
</div>
|
||||
<CheckBox
|
||||
variant="toggle"
|
||||
outlined
|
||||
control={control}
|
||||
name="hidSettings.trackersOverHID"
|
||||
label={l10n.getString(
|
||||
'settings-general-tracker_mechanics-trackers_over_usb-enabled-label'
|
||||
)}
|
||||
/>
|
||||
</>
|
||||
</SettingsPagePaneLayout>
|
||||
<SettingsPagePaneLayout icon={<WrenchIcon />} id="fksettings">
|
||||
|
||||
@@ -15,7 +15,7 @@ import { useLocalization } from '@fluent/react';
|
||||
import classNames from 'classnames';
|
||||
import { ReactNode, useEffect } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { TrackingChecklistStepId } from 'solarxr-protocol';
|
||||
import { TrackingChecklistStepId } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import * as Sentry from '@sentry/react';
|
||||
|
||||
type StepsForm = { steps: Record<TrackingChecklistStepId, boolean> };
|
||||
@@ -54,11 +54,11 @@ export function TrackingChecklistSettings({
|
||||
// doing it this way prevents calling ignore step for every step.
|
||||
// that prevent sending a packet for steps that didnt change
|
||||
if (!value && !ignoredSteps.includes(stepId)) {
|
||||
ignoreStep(stepId, true);
|
||||
ignoreStep(stepId, true, false);
|
||||
}
|
||||
|
||||
if (value && ignoredSteps.includes(stepId)) {
|
||||
ignoreStep(stepId, false);
|
||||
ignoreStep(stepId, false, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,13 +5,15 @@ import { Localized, useLocalization } from '@fluent/react';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import {
|
||||
ChangeMagToggleRequestT,
|
||||
DeviceIdT,
|
||||
TrackerIdT,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import {
|
||||
ChangeMagToggleRequestT,
|
||||
MagToggleRequestT,
|
||||
MagToggleResponseT,
|
||||
RpcMessage,
|
||||
TrackerIdT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
interface MagnetometerToggleForm {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
RpcMessage,
|
||||
SettingsRequestT,
|
||||
SettingsResponseT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { CheckBox } from '@/components/commons/Checkbox';
|
||||
import { RouterIcon } from '@/components/commons/icon/RouterIcon';
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
SerialUpdateResponseT,
|
||||
SerialTrackerGetWifiScanRequestT,
|
||||
SerialTrackerCustomCommandRequestT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { Dropdown } from '@/components/commons/Dropdown';
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
SettingsResponseT,
|
||||
OSCSettingsT,
|
||||
VMCOSCSettingsT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { CheckBox } from '@/components/commons/Checkbox';
|
||||
import { FileInput } from '@/components/commons/FileInput';
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
SettingsRequestT,
|
||||
SettingsResponseT,
|
||||
VRCOSCSettingsT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { CheckBox } from '@/components/commons/Checkbox';
|
||||
import { VRCIcon } from '@/components/commons/icon/VRCIcon';
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '@/components/stay-aligned/RelaxedPose';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
||||
import { StayAlignedRelaxedPose } from 'solarxr-protocol';
|
||||
import { StayAlignedRelaxedPose } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
|
||||
function StaAlignedPoseModal({
|
||||
open,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Control } from 'react-hook-form';
|
||||
import { StayAlignedSettingsT } from 'solarxr-protocol';
|
||||
import { StayAlignedSettingsT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { SettingsForm } from '@/components/settings/pages/GeneralSettings';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { CheckBox } from '@/components/commons/Checkbox';
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
DetectStayAlignedRelaxedPoseRequestT,
|
||||
RpcMessage,
|
||||
StayAlignedRelaxedPose,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { MouseEventHandler } from 'react';
|
||||
import { Button, ButtonProps } from '@/components/commons/Button';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { useLocaleConfig } from '@/i18n/config';
|
||||
import { TrackerDataT } from 'solarxr-protocol';
|
||||
import { TrackerDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/tracker';
|
||||
|
||||
export function StayAlignedInfo({
|
||||
color,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import classNames from 'classnames';
|
||||
import ReactModal from 'react-modal';
|
||||
import { BodyPart } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { BodyAssignment } from '@/components/onboarding/BodyAssignment';
|
||||
|
||||
@@ -2,11 +2,14 @@ import { useConfig } from '@/hooks/config';
|
||||
import { useLocaleConfig } from '@/i18n/config';
|
||||
import { BatteryIcon } from '@/components/commons/icon/BatteryIcon';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { Tooltip } from '@/components/commons/Tooltip';
|
||||
|
||||
export function TrackerBattery({
|
||||
value,
|
||||
voltage,
|
||||
runtime,
|
||||
disabled,
|
||||
moreInfo = false,
|
||||
textColor = 'primary',
|
||||
}: {
|
||||
/**
|
||||
@@ -14,7 +17,9 @@ export function TrackerBattery({
|
||||
*/
|
||||
value: number;
|
||||
voltage?: number | null;
|
||||
runtime?: bigint | null;
|
||||
disabled?: boolean;
|
||||
moreInfo?: boolean;
|
||||
textColor?: string;
|
||||
}) {
|
||||
const { currentLocales } = useLocaleConfig();
|
||||
@@ -28,31 +33,49 @@ export function TrackerBattery({
|
||||
});
|
||||
|
||||
const charging = (voltage || 0) > 4.3;
|
||||
const showVoltage = voltage && config?.debug;
|
||||
const debug = config?.debug || config?.devSettings.moreInfo;
|
||||
const showVoltage = moreInfo && voltage && debug;
|
||||
|
||||
return (
|
||||
<div className="flex gap-2">
|
||||
<div className="flex flex-col justify-around">
|
||||
<BatteryIcon value={value} disabled={disabled} charging={charging} />
|
||||
<Tooltip
|
||||
disabled={!charging && (!runtime || debug)}
|
||||
preferedDirection="left"
|
||||
content=<Typography>{percentFormatter.format(value)}</Typography>
|
||||
>
|
||||
<div className="flex gap-2">
|
||||
<div className="flex flex-col justify-around">
|
||||
<BatteryIcon value={value} disabled={disabled} charging={charging} />
|
||||
</div>
|
||||
{((!charging || showVoltage) && (
|
||||
<div className="w-15">
|
||||
{!charging && runtime != null && runtime > 0 && (
|
||||
<Typography color={textColor}>
|
||||
{(runtime / BigInt(3600000000)).toString() +
|
||||
'h ' +
|
||||
(
|
||||
(runtime % BigInt(3600000000)) /
|
||||
BigInt(60000000)
|
||||
).toString() +
|
||||
'min'}
|
||||
</Typography>
|
||||
)}
|
||||
{!charging && (!runtime || debug) && (
|
||||
<Typography color={textColor}>
|
||||
{percentFormatter.format(value)}
|
||||
</Typography>
|
||||
)}
|
||||
{showVoltage && (
|
||||
<Typography color={textColor}>
|
||||
{voltageFormatter.format(voltage)}V
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
)) || (
|
||||
<div className="flex flex-col justify-center w-15">
|
||||
<div className="w-5 h-1 bg-background-30 rounded-full" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{((!charging || showVoltage) && (
|
||||
<div className="w-10">
|
||||
{!charging && (
|
||||
<Typography color={textColor}>
|
||||
{percentFormatter.format(value)}
|
||||
</Typography>
|
||||
)}
|
||||
{showVoltage && (
|
||||
<Typography color={textColor}>
|
||||
{voltageFormatter.format(voltage)}V
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
)) || (
|
||||
<div className="flex flex-col justify-center w-10">
|
||||
<div className="w-5 h-1 bg-background-30 rounded-full" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
import { useConfig } from '@/hooks/config';
|
||||
import { MouseEventHandler } from 'react';
|
||||
import {
|
||||
DeviceDataT,
|
||||
TrackerDataT,
|
||||
TrackerStatus as TrackerStatusEnum,
|
||||
TrackingChecklistStepT,
|
||||
} from 'solarxr-protocol';
|
||||
import { DeviceDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/device-data';
|
||||
import { TrackerDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/tracker';
|
||||
import { TrackerStatus as TrackerStatusEnum } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { TrackingChecklistStepT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { TrackerBattery } from './TrackerBattery';
|
||||
import { TrackerWifi } from './TrackerWifi';
|
||||
@@ -51,7 +49,9 @@ function TrackerBig({
|
||||
<TrackerBattery
|
||||
voltage={device.hardwareStatus.batteryVoltage}
|
||||
value={device.hardwareStatus.batteryPctEstimate / 100}
|
||||
runtime={device.hardwareStatus.batteryRuntimeEstimate}
|
||||
disabled={tracker.status === TrackerStatusEnum.DISCONNECTED}
|
||||
moreInfo={true}
|
||||
/>
|
||||
)}
|
||||
<div className="flex gap-2">
|
||||
@@ -119,6 +119,7 @@ function TrackerSmol({
|
||||
<TrackerBattery
|
||||
voltage={device.hardwareStatus.batteryVoltage}
|
||||
value={device.hardwareStatus.batteryPctEstimate / 100}
|
||||
runtime={device.hardwareStatus.batteryRuntimeEstimate}
|
||||
disabled={tracker.status === TrackerStatusEnum.DISCONNECTED}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import classNames from 'classnames';
|
||||
import { MouseEventHandler, useEffect, useMemo, useState } from 'react';
|
||||
import { BodyPart, TrackerDataT } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { TrackerDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/tracker';
|
||||
import { useTracker } from '@/hooks/tracker';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
|
||||
@@ -5,15 +5,19 @@ import { useEffect, useMemo, useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import {
|
||||
AssignTrackerRequestT,
|
||||
BoardType,
|
||||
BodyPart,
|
||||
ForgetDeviceRequestT,
|
||||
ImuType,
|
||||
MagnetometerStatus,
|
||||
RpcMessage,
|
||||
TrackerDataType,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes/hardware-info';
|
||||
import {
|
||||
BodyPart,
|
||||
MagnetometerStatus,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import {
|
||||
AssignTrackerRequestT,
|
||||
ForgetDeviceRequestT,
|
||||
RpcMessage,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useDebouncedEffect } from '@/hooks/timeout';
|
||||
import { useTrackerFromId } from '@/hooks/tracker';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
@@ -208,6 +212,15 @@ export function TrackerSettingsPage() {
|
||||
Firmware version
|
||||
</Typography>
|
||||
<div className="flex gap-2 flex-col">
|
||||
<div className="flex justify-between gap-2">
|
||||
<Typography id="tracker-settings-build-date" />
|
||||
<Typography
|
||||
whitespace="whitespace-pre-wrap"
|
||||
textAlign="text-end"
|
||||
>
|
||||
{tracker?.device?.hardwareInfo?.firmwareDate || '--'}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="flex justify-between gap-2">
|
||||
<Typography id="tracker-settings-current-version" />
|
||||
<Typography
|
||||
@@ -367,6 +380,37 @@ export function TrackerSettingsPage() {
|
||||
{tracker?.device?.hardwareInfo?.networkProtocolVersion || '--'}
|
||||
</Typography>
|
||||
</div>
|
||||
{tracker?.device?.hardwareStatus?.packetsReceived !== null && (
|
||||
<>
|
||||
<div className="flex justify-between">
|
||||
<Typography>
|
||||
{l10n.getString('tracker-infos-packet_loss')}
|
||||
</Typography>
|
||||
<Typography>
|
||||
{(
|
||||
(tracker?.device?.hardwareStatus?.packetLoss ?? 0) * 100
|
||||
).toFixed(0)}
|
||||
%
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<Typography>
|
||||
{l10n.getString('tracker-infos-packets_lost')}
|
||||
</Typography>
|
||||
<Typography>
|
||||
{tracker?.device?.hardwareStatus?.packetsLost ?? '0'}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<Typography>
|
||||
{l10n.getString('tracker-infos-packets_received')}
|
||||
</Typography>
|
||||
<Typography>
|
||||
{tracker?.device?.hardwareStatus?.packetsReceived ?? '0'}
|
||||
</Typography>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{tracker?.tracker && (
|
||||
<IMUVisualizerWidget tracker={tracker?.tracker} />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import classNames from 'classnames';
|
||||
import { useMemo } from 'react';
|
||||
import { TrackerStatus as TrackerStatusEnum } from 'solarxr-protocol';
|
||||
import { TrackerStatus as TrackerStatusEnum } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
|
||||
|
||||
@@ -1,15 +1,24 @@
|
||||
import { WifiIcon } from '@/components/commons/icon/WifiIcon';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { Tooltip } from '@/components/commons/Tooltip';
|
||||
|
||||
export function TrackerWifi({
|
||||
rssi,
|
||||
ping,
|
||||
rssiShowNumeric,
|
||||
disabled,
|
||||
packetLoss,
|
||||
packetsLost,
|
||||
packetsReceived,
|
||||
showPacketLoss = false,
|
||||
textColor = 'primary',
|
||||
}: {
|
||||
rssi: number | null;
|
||||
ping: number | null;
|
||||
packetLoss?: number | null;
|
||||
packetsLost?: number | null;
|
||||
packetsReceived?: number | null;
|
||||
showPacketLoss?: boolean;
|
||||
rssiShowNumeric?: boolean;
|
||||
disabled?: boolean;
|
||||
textColor?: string;
|
||||
@@ -31,6 +40,17 @@ export function TrackerWifi({
|
||||
{rssi} dBm
|
||||
</Typography>
|
||||
)}
|
||||
{showPacketLoss && packetsReceived != null && (
|
||||
<Tooltip
|
||||
preferedDirection="top"
|
||||
content={<Typography id="tracker-infos-packet_loss" />}
|
||||
>
|
||||
<Typography
|
||||
color={textColor}
|
||||
whitespace="whitespace-nowrap"
|
||||
>{`${((packetLoss ?? 0) * 100).toFixed(0)}% (${packetsLost ?? 0} / ${packetsReceived})`}</Typography>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
)) || (
|
||||
<div className="flex flex-col justify-center w-12">
|
||||
|
||||
@@ -16,10 +16,10 @@ import { WarningIcon } from '@/components/commons/icon/WarningIcon';
|
||||
import { FirmwareIcon } from '@/components/commons/FirmwareIcon';
|
||||
import {
|
||||
BodyPart,
|
||||
TrackerDataT,
|
||||
TrackerStatus as TrackerStatusEnum,
|
||||
TrackingChecklistStepT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { TrackerDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/tracker';
|
||||
import { TrackingChecklistStepT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import {
|
||||
highlightedTrackers,
|
||||
trackingchecklistIdtoLabel,
|
||||
@@ -229,7 +229,9 @@ function Row({
|
||||
<TrackerBattery
|
||||
value={device.hardwareStatus.batteryPctEstimate / 100}
|
||||
voltage={device.hardwareStatus.batteryVoltage}
|
||||
runtime={device.hardwareStatus.batteryRuntimeEstimate}
|
||||
disabled={tracker.status === TrackerStatusEnum.DISCONNECTED}
|
||||
moreInfo={config?.devSettings.moreInfo}
|
||||
textColor={fontColor}
|
||||
/>
|
||||
)}
|
||||
@@ -243,6 +245,10 @@ function Row({
|
||||
ping={device?.hardwareStatus?.ping}
|
||||
disabled={tracker.status === TrackerStatusEnum.DISCONNECTED}
|
||||
textColor={fontColor}
|
||||
showPacketLoss
|
||||
packetLoss={device.hardwareStatus.packetLoss}
|
||||
packetsLost={device.hardwareStatus.packetsLost}
|
||||
packetsReceived={device.hardwareStatus.packetsReceived}
|
||||
/>
|
||||
)}
|
||||
</Cell>
|
||||
@@ -327,20 +333,20 @@ export function TrackersTable({
|
||||
|
||||
const gridTemplateColumns = useMemo(() => {
|
||||
const cols = [
|
||||
'minmax(150px, 1.5fr)', // Name
|
||||
'minmax(100px, 1fr)', // Type
|
||||
'minmax(60px, 1fr)', // Battery
|
||||
'6rem', // Ping (w-24)
|
||||
'minmax(60px, 1fr)', // TPS
|
||||
config?.devSettings?.preciseRotation ? '11rem' : '8rem', // Rotation
|
||||
'minmax(60px, 1fr)', // Temp
|
||||
'minmax(15rem, 1.5fr)', // Name
|
||||
'9rem', // Type
|
||||
'9rem', // Battery
|
||||
'9rem', // Ping (w-24)
|
||||
'5rem', // TPS
|
||||
config?.devSettings?.preciseRotation ? '11rem' : '9rem', // Rotation
|
||||
'9rem', // Temp
|
||||
];
|
||||
|
||||
if (moreInfo) {
|
||||
cols.push('9rem'); // Linear Acc
|
||||
cols.push('9rem'); // Position
|
||||
cols.push('9rem'); // Stay Aligned
|
||||
cols.push('minmax(150px, 1fr)'); // URL
|
||||
cols.push('11rem'); // URL
|
||||
}
|
||||
|
||||
return cols.join(' ');
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
ResetType,
|
||||
TrackingChecklistPublicNetworksT,
|
||||
TrackingChecklistStepId,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { ReactNode, useEffect, useMemo, useState } from 'react';
|
||||
import { openUrl } from '@tauri-apps/plugin-opener';
|
||||
import { CheckIcon } from '@/components/commons/icon/CheckIcon';
|
||||
@@ -109,7 +109,10 @@ const stepContentLookup: Record<
|
||||
context: TrackingChecklistContext
|
||||
) => JSX.Element
|
||||
> = {
|
||||
[TrackingChecklistStepId.TRACKERS_REST_CALIBRATION]: (step, { toggle }) => {
|
||||
[TrackingChecklistStepId.TRACKERS_REST_CALIBRATION]: (
|
||||
step,
|
||||
{ toggleSession }
|
||||
) => {
|
||||
return (
|
||||
<div className="space-y-2.5">
|
||||
<Typography id="tracking_checklist-TRACKERS_REST_CALIBRATION-desc" />
|
||||
@@ -118,7 +121,7 @@ const stepContentLookup: Record<
|
||||
<Button
|
||||
id="tracking_checklist-ignore"
|
||||
variant="secondary"
|
||||
onClick={() => toggle(step.id)}
|
||||
onClick={() => toggleSession(step.id)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
@@ -166,7 +169,7 @@ const stepContentLookup: Record<
|
||||
</div>
|
||||
);
|
||||
},
|
||||
[TrackingChecklistStepId.STEAMVR_DISCONNECTED]: (step, { toggle }) => {
|
||||
[TrackingChecklistStepId.STEAMVR_DISCONNECTED]: (step, { toggleSession }) => {
|
||||
return (
|
||||
<>
|
||||
<div className="space-y-2.5">
|
||||
@@ -181,7 +184,7 @@ const stepContentLookup: Record<
|
||||
<Button
|
||||
id="tracking_checklist-ignore"
|
||||
variant="secondary"
|
||||
onClick={() => toggle(step.id)}
|
||||
onClick={() => toggleSession(step.id)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
@@ -195,7 +198,10 @@ const stepContentLookup: Record<
|
||||
[TrackingChecklistStepId.UNASSIGNED_HMD]: () => {
|
||||
return <Typography id="tracking_checklist-UNASSIGNED_HMD-desc" />;
|
||||
},
|
||||
[TrackingChecklistStepId.NETWORK_PROFILE_PUBLIC]: (step, { toggle }) => {
|
||||
[TrackingChecklistStepId.NETWORK_PROFILE_PUBLIC]: (
|
||||
step,
|
||||
{ toggleSession }
|
||||
) => {
|
||||
const data = step.extraData as TrackingChecklistPublicNetworksT | null;
|
||||
return (
|
||||
<>
|
||||
@@ -226,7 +232,7 @@ const stepContentLookup: Record<
|
||||
<Button
|
||||
id="tracking_checklist-ignore"
|
||||
variant="secondary"
|
||||
onClick={() => toggle(step.id)}
|
||||
onClick={() => toggleSession(step.id)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
@@ -234,7 +240,7 @@ const stepContentLookup: Record<
|
||||
</>
|
||||
);
|
||||
},
|
||||
[TrackingChecklistStepId.VRCHAT_SETTINGS]: (step, { toggle }) => {
|
||||
[TrackingChecklistStepId.VRCHAT_SETTINGS]: (step, { toggleSession }) => {
|
||||
return (
|
||||
<>
|
||||
<div className="space-y-2.5">
|
||||
@@ -249,7 +255,7 @@ const stepContentLookup: Record<
|
||||
<Button
|
||||
id="tracking_checklist-ignore"
|
||||
variant="secondary"
|
||||
onClick={() => toggle(step.id)}
|
||||
onClick={() => toggleSession(step.id)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
@@ -257,7 +263,7 @@ const stepContentLookup: Record<
|
||||
</>
|
||||
);
|
||||
},
|
||||
[TrackingChecklistStepId.MOUNTING_CALIBRATION]: (step, { toggle }) => {
|
||||
[TrackingChecklistStepId.MOUNTING_CALIBRATION]: (step, { toggleSession }) => {
|
||||
return (
|
||||
<div className="space-y-2.5">
|
||||
<Typography id="onboarding-automatic_mounting-mounting_reset-step-0" />
|
||||
@@ -275,14 +281,17 @@ const stepContentLookup: Record<
|
||||
<Button
|
||||
id="tracking_checklist-ignore"
|
||||
variant="secondary"
|
||||
onClick={() => toggle(step.id)}
|
||||
onClick={() => toggleSession(step.id)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
[TrackingChecklistStepId.FEET_MOUNTING_CALIBRATION]: (step, { toggle }) => {
|
||||
[TrackingChecklistStepId.FEET_MOUNTING_CALIBRATION]: (
|
||||
step,
|
||||
{ toggleSession }
|
||||
) => {
|
||||
return (
|
||||
<div className="space-y-2.5">
|
||||
<Typography id="onboarding-automatic_mounting-mounting_reset-feet-step-0" />
|
||||
@@ -309,14 +318,17 @@ const stepContentLookup: Record<
|
||||
<Button
|
||||
id="tracking_checklist-ignore"
|
||||
variant="secondary"
|
||||
onClick={() => toggle(step.id)}
|
||||
onClick={() => toggleSession(step.id)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
[TrackingChecklistStepId.STAY_ALIGNED_CONFIGURED]: (step, { toggle }) => {
|
||||
[TrackingChecklistStepId.STAY_ALIGNED_CONFIGURED]: (
|
||||
step,
|
||||
{ toggleSession }
|
||||
) => {
|
||||
return (
|
||||
<>
|
||||
<div className="space-y-2.5">
|
||||
@@ -332,7 +344,7 @@ const stepContentLookup: Record<
|
||||
<Button
|
||||
id="tracking_checklist-ignore"
|
||||
variant="secondary"
|
||||
onClick={() => toggle(step.id)}
|
||||
onClick={() => toggleSession(step.id)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { TrackerDataT } from 'solarxr-protocol';
|
||||
import { TrackerDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/tracker';
|
||||
import { useTracker } from '@/hooks/tracker';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { formatVector3 } from '@/utils/formatting';
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { KeyValuesT, MessageT, Payload, Topic } from 'solarxr-protocol';
|
||||
import {
|
||||
KeyValuesT,
|
||||
MessageT,
|
||||
Payload,
|
||||
Topic,
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/pub-sub';
|
||||
import {
|
||||
OVERLAY_DISPLAY_SETTINGS_TOPIC,
|
||||
PayloadData,
|
||||
|
||||
@@ -7,7 +7,8 @@ import {
|
||||
BasedSkeletonHelper,
|
||||
} from '@/utils/skeletonHelper';
|
||||
import * as THREE from 'three';
|
||||
import { BodyPart, BoneT } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { BoneT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed';
|
||||
import { QuaternionFromQuatT, isIdentity } from '@/maths/quaternion';
|
||||
import classNames from 'classnames';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { createContext, useContext, useEffect, useLayoutEffect, useState } from 'react';
|
||||
import { DataFeedMessage, DataFeedUpdateT, StartDataFeedT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed';
|
||||
import {
|
||||
DataFeedMessage,
|
||||
DataFeedUpdateT,
|
||||
ResetResponseT,
|
||||
RpcMessage,
|
||||
StartDataFeedT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { handleResetSounds } from '@/sounds/sounds';
|
||||
import { useConfig } from './config';
|
||||
import { useBonesDataFeedConfig, useDataFeedConfig } from './datafeed-config';
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
RpcMessage,
|
||||
SkeletonBone,
|
||||
SkeletonPartT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from './websocket-api';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { log } from '@/utils/logging';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BodyPart } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
|
||||
export const ALL_BODY_PARTS = [
|
||||
BodyPart.NONE,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { isTauri } from '@tauri-apps/api/core';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { RecordBVHRequestT, RecordBVHStatusT, RpcMessage } from 'solarxr-protocol';
|
||||
import { RecordBVHRequestT, RecordBVHStatusT, RpcMessage } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from './websocket-api';
|
||||
import { useConfig } from './config';
|
||||
import { save } from '@tauri-apps/plugin-dialog';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from 'react';
|
||||
import { BodyPart } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
|
||||
/**
|
||||
* I dedicate this hook to @uriel ;)
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { DataFeedConfigT, DeviceDataMaskT, TrackerDataMaskT } from 'solarxr-protocol';
|
||||
import { DataFeedConfigT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed';
|
||||
import { DeviceDataMaskT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/device-data';
|
||||
import { TrackerDataMaskT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/tracker';
|
||||
import { useConfig } from './config';
|
||||
|
||||
export function useDataFeedConfig() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createContext, useContext, useMemo, useState } from 'react';
|
||||
import { DeviceIdT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import {
|
||||
DeviceIdT,
|
||||
FirmwarePartT,
|
||||
FirmwareUpdateMethod,
|
||||
FirmwareUpdateRequestT,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
OTAFirmwareUpdateT,
|
||||
SerialDevicePortT,
|
||||
SerialFirmwareUpdateT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { OnboardingContext } from './onboarding';
|
||||
import {
|
||||
BoardDefaults,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { BoardType, DeviceDataT } from 'solarxr-protocol';
|
||||
import { BoardType } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes/hardware-info';
|
||||
import { DeviceDataT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/device-data';
|
||||
import { fetch as tauriFetch } from '@tauri-apps/plugin-http';
|
||||
import { cacheWrap } from './cache';
|
||||
import semver from 'semver';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createContext, useContext, useEffect, useMemo, useState } from 'react';
|
||||
import { useWebsocketAPI } from './websocket-api';
|
||||
import { RpcMessage, SettingsRequestT, SettingsResponseT } from 'solarxr-protocol';
|
||||
import { RpcMessage, SettingsRequestT, SettingsResponseT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { MIN_HEIGHT } from './manual-proportions';
|
||||
|
||||
export interface HeightContext {
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
RpcMessage,
|
||||
SkeletonConfigRequestT,
|
||||
ChangeSkeletonConfigRequestT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from './websocket-api';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { useConfig } from './config';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
SetPauseTrackingRequestT,
|
||||
TrackingPauseStateRequestT,
|
||||
TrackingPauseStateResponseT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { restartAndPlay, trackingPauseSound, trackingPlaySound } from '@/sounds/sounds';
|
||||
import { useConfig } from './config';
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
TopicHandleT,
|
||||
TopicIdT,
|
||||
TopicMappingT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/pub-sub';
|
||||
import { useWebsocketAPI } from './websocket-api';
|
||||
|
||||
export type PayloadData = MessageT['payload'];
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
RpcMessage,
|
||||
SettingsResetRequestT,
|
||||
SettingsResponseT,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from './websocket-api';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import {
|
||||
BodyPart,
|
||||
ResetRequestT,
|
||||
ResetResponseT,
|
||||
ResetStatus,
|
||||
ResetType,
|
||||
RpcMessage,
|
||||
} from 'solarxr-protocol';
|
||||
} from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/rpc';
|
||||
import { useWebsocketAPI } from './websocket-api';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { assignedTrackersAtom, serverGuardsAtom } from '@/store/app-store';
|
||||
@@ -27,13 +27,16 @@ export const BODY_PARTS_GROUPS: Record<MountingResetGroup, BodyPart[]> = {
|
||||
fingers: FINGER_BODY_PARTS,
|
||||
};
|
||||
|
||||
export function useReset(options: UseResetOptions, onReseted?: () => void) {
|
||||
export function useReset(
|
||||
options: UseResetOptions,
|
||||
onReseted?: () => void,
|
||||
onFailed?: () => void
|
||||
) {
|
||||
if (options.type === ResetType.Mounting && !options.group) options.group = 'default';
|
||||
|
||||
const serverGuards = useAtomValue(serverGuardsAtom);
|
||||
const { currentLocales } = useLocaleConfig();
|
||||
const { sendRPCPacket, useRPCPacket } = useWebsocketAPI();
|
||||
|
||||
const finishedTimeoutRef = useRef<NodeJS.Timeout>();
|
||||
const [status, setStatus] = useState<ResetBtnStatus>('idle');
|
||||
const [progress, setProgress] = useState(0);
|
||||
@@ -62,6 +65,7 @@ export function useReset(options: UseResetOptions, onReseted?: () => void) {
|
||||
|
||||
const onResetCanceled = () => {
|
||||
if (status !== 'finished') setStatus('idle');
|
||||
if (onFailed) onFailed();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { BodyPart, TrackerDataT, TrackerInfoT } from 'solarxr-protocol';
|
||||
import { BodyPart } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/datatypes';
|
||||
import { TrackerDataT, TrackerInfoT } from 'solarxr-protocol/protocol/typescript/dist/solarxr-protocol/data-feed/tracker';
|
||||
import { QuaternionFromQuatT, QuaternionToEulerDegrees } from '@/maths/quaternion';
|
||||
import { ReactLocalization, useLocalization } from '@fluent/react';
|
||||
import { useDataFeedConfig } from './datafeed-config';
|
||||
|
||||
Loaded 100 of 165 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user