mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-28 21:06:31 -08:00
Some more random improvements (#695)
This commit is contained in:
1 parent
1f2fbfc101
commit
309e78e47c
9 files changed
+127
-22
No files matched your search
@@ -13,6 +13,7 @@
|
||||
"browserslist": "^4.18.1",
|
||||
"classnames": "^2.3.1",
|
||||
"eslint-config-react-app": "^7.0.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"flatbuffers": "^22.10.26",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"intl-pluralrules": "^1.3.1",
|
||||
@@ -64,6 +65,7 @@
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.0",
|
||||
"@tauri-apps/cli": "^1.2.3",
|
||||
"@types/file-saver": "^2.0.5",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "^18.0.5",
|
||||
"@types/react-modal": "3.13.1",
|
||||
|
||||
@@ -11,7 +11,7 @@ websocket-connection_lost = Connection lost to the server. Trying to reconnect..
|
||||
|
||||
## Update notification
|
||||
version_update-title = New version available: { $version }
|
||||
version_update-description = Clicking "Update" will download the SlimeVR installer for you.
|
||||
version_update-description = Clicking "{ version_update-update }" will download the SlimeVR installer for you.
|
||||
version_update-update = Update
|
||||
version_update-close = Close
|
||||
|
||||
@@ -539,7 +539,7 @@ onboarding-connect_tracker-next = I connected all my trackers
|
||||
## Tracker calibration tutorial
|
||||
onboarding-calibration_tutorial = IMU Calibration Tutorial
|
||||
onboarding-calibration_tutorial-subtitle = This will help reduce tracker drifting!
|
||||
onboarding-calibration_tutorial-description = Every time you turn on your trackers, they need to rest for a moment on a flat surface to calibrate. Let's do the same thing by clicking the "Calibrate" button, <b>do not move them!</b>
|
||||
onboarding-calibration_tutorial-description = Every time you turn on your trackers, they need to rest for a moment on a flat surface to calibrate. Let's do the same thing by clicking the "{ onboarding-calibration_tutorial-calibrate }" button, <b>do not move them!</b>
|
||||
onboarding-calibration_tutorial-calibrate = I placed my trackers on the table
|
||||
onboarding-calibration_tutorial-status-waiting = Waiting for you
|
||||
onboarding-calibration_tutorial-status-calibrating = Calibrating
|
||||
@@ -668,6 +668,8 @@ onboarding-choose_proportions-manual_proportions = Manual proportions
|
||||
# Italized text
|
||||
onboarding-choose_proportions-manual_proportions-subtitle = For small touches
|
||||
onboarding-choose_proportions-manual_proportions-description = This will let you adjust your proportions manually by modifying them directly
|
||||
onboarding-choose_proportions-save = Save proportions
|
||||
onboarding-choose_proportions-file_type = Body proportions file
|
||||
|
||||
## Tracker manual proportions setup
|
||||
onboarding-manual_proportions-back = Go Back to Reset tutorial
|
||||
|
||||
@@ -28,7 +28,7 @@ shadow-rs = "0.21"
|
||||
[dependencies]
|
||||
serde_json = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tauri = { version = "1.2", features = ["devtools", "dialog", "fs-all", "os-all", "path-all", "shell-execute", "shell-open", "window-close", "window-maximize", "window-minimize", "window-set-resizable", "window-set-size", "window-set-title", "window-start-dragging", "window-unmaximize", "window-unminimize"] }
|
||||
tauri = { version = "1.2", features = ["devtools", "dialog", "dialog-save", "fs-all", "os-all", "path-all", "shell-execute", "shell-open", "window-close", "window-maximize", "window-minimize", "window-set-resizable", "window-set-size", "window-set-title", "window-start-dragging", "window-unmaximize", "window-unminimize"] }
|
||||
tauri-runtime = "0.12.1"
|
||||
tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }
|
||||
pretty_env_logger = "0.4"
|
||||
|
||||
@@ -54,6 +54,10 @@
|
||||
"active": false
|
||||
},
|
||||
"allowlist": {
|
||||
"dialog": {
|
||||
"all": false,
|
||||
"save": true
|
||||
},
|
||||
"shell": {
|
||||
"all": false,
|
||||
"execute": true,
|
||||
|
||||
@@ -6,12 +6,48 @@ import { SkipSetupButton } from '../../SkipSetupButton';
|
||||
import classNames from 'classnames';
|
||||
import { Typography } from '../../../commons/Typography';
|
||||
import { Button } from '../../../commons/Button';
|
||||
import {
|
||||
SkeletonConfigResponseT,
|
||||
RpcMessage,
|
||||
SkeletonConfigRequestT,
|
||||
} from 'solarxr-protocol';
|
||||
import { useWebsocketAPI } from '../../../../hooks/websocket-api';
|
||||
import saveAs from 'file-saver';
|
||||
import { save } from '@tauri-apps/api/dialog';
|
||||
import { writeTextFile } from '@tauri-apps/api/fs';
|
||||
|
||||
export function ProportionsChoose() {
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, skipSetup, state } = useOnboarding();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
const { useRPCPacket, sendRPCPacket } = useWebsocketAPI();
|
||||
const [animated, setAnimated] = useState(false);
|
||||
|
||||
useRPCPacket(
|
||||
RpcMessage.SkeletonConfigResponse,
|
||||
(data: SkeletonConfigResponseT) => {
|
||||
const blob = new Blob([JSON.stringify(data)], {
|
||||
type: 'application/json',
|
||||
});
|
||||
save({
|
||||
filters: [
|
||||
{
|
||||
name: l10n.getString('onboarding-choose_proportions-file_type'),
|
||||
extensions: ['json'],
|
||||
},
|
||||
],
|
||||
defaultPath: 'body-proportions.json',
|
||||
})
|
||||
.then((path) =>
|
||||
path ? writeTextFile(path, JSON.stringify(data)) : undefined
|
||||
)
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
saveAs(blob, 'body-proportions.json');
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
applyProgress(0.65);
|
||||
|
||||
return (
|
||||
@@ -120,15 +156,29 @@ export function ProportionsChoose() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!state.alonePage && (
|
||||
<div className="flex flex-row">
|
||||
{!state.alonePage && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
className="ml-4"
|
||||
to="/onboarding/reset-tutorial"
|
||||
>
|
||||
{l10n.getString('onboarding-previous_step')}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
variant="secondary"
|
||||
className="self-start ml-4"
|
||||
to="/onboarding/reset-tutorial"
|
||||
variant={!state.alonePage ? 'secondary' : 'tertiary'}
|
||||
className="ml-auto mr-4"
|
||||
onClick={() =>
|
||||
sendRPCPacket(
|
||||
RpcMessage.SkeletonConfigRequest,
|
||||
new SkeletonConfigRequestT()
|
||||
)
|
||||
}
|
||||
>
|
||||
{l10n.getString('onboarding-previous_step')}
|
||||
{l10n.getString('onboarding-choose_proportions-save')}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
|
||||
Generated
+26
@@ -31,6 +31,7 @@
|
||||
"browserslist": "^4.18.1",
|
||||
"classnames": "^2.3.1",
|
||||
"eslint-config-react-app": "^7.0.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"flatbuffers": "^22.10.26",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"intl-pluralrules": "^1.3.1",
|
||||
@@ -53,6 +54,7 @@
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.0",
|
||||
"@tauri-apps/cli": "^1.2.3",
|
||||
"@types/file-saver": "^2.0.5",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "^18.0.5",
|
||||
"@types/react-modal": "3.13.1",
|
||||
@@ -3198,6 +3200,12 @@
|
||||
"integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@types/file-saver": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/file-saver/-/file-saver-2.0.5.tgz",
|
||||
"integrity": "sha512-zv9kNf3keYegP5oThGLaPk8E081DFDuwfqjtiTzm6PoxChdJ1raSuADf2YGCVIyrSynLrgc8JWv296s7Q7pQSQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
"version": "7.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
|
||||
@@ -5754,6 +5762,11 @@
|
||||
"node": "^10.12.0 || >=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/file-saver": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz",
|
||||
"integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA=="
|
||||
},
|
||||
"node_modules/filesize": {
|
||||
"version": "8.0.7",
|
||||
"resolved": "https://registry.npmjs.org/filesize/-/filesize-8.0.7.tgz",
|
||||
@@ -11971,6 +11984,12 @@
|
||||
"integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==",
|
||||
"peer": true
|
||||
},
|
||||
"@types/file-saver": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/file-saver/-/file-saver-2.0.5.tgz",
|
||||
"integrity": "sha512-zv9kNf3keYegP5oThGLaPk8E081DFDuwfqjtiTzm6PoxChdJ1raSuADf2YGCVIyrSynLrgc8JWv296s7Q7pQSQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/json-schema": {
|
||||
"version": "7.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
|
||||
@@ -13815,6 +13834,11 @@
|
||||
"flat-cache": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"file-saver": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz",
|
||||
"integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA=="
|
||||
},
|
||||
"filesize": {
|
||||
"version": "8.0.7",
|
||||
"resolved": "https://registry.npmjs.org/filesize/-/filesize-8.0.7.tgz",
|
||||
@@ -15969,6 +15993,7 @@
|
||||
"@tailwindcss/forms": "^0.5.0",
|
||||
"@tauri-apps/api": "^1.2.0",
|
||||
"@tauri-apps/cli": "^1.2.3",
|
||||
"@types/file-saver": "^2.0.5",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "^18.0.5",
|
||||
"@types/react-modal": "3.13.1",
|
||||
@@ -15988,6 +16013,7 @@
|
||||
"eslint-plugin-jsx-a11y": "^6.6.0",
|
||||
"eslint-plugin-react": "^7.30.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"flatbuffers": "^22.10.26",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"intl-pluralrules": "^1.3.1",
|
||||
|
||||
@@ -14,18 +14,18 @@ import dev.slimevr.protocol.rpc.serial.RPCProvisioningHandler;
|
||||
import dev.slimevr.protocol.rpc.serial.RPCSerialHandler;
|
||||
import dev.slimevr.protocol.rpc.settings.RPCSettingsHandler;
|
||||
import dev.slimevr.protocol.rpc.setup.RPCTapSetupHandler;
|
||||
import dev.slimevr.protocol.rpc.setup.RPCUtil;
|
||||
import dev.slimevr.protocol.rpc.status.RPCStatusHandler;
|
||||
import dev.slimevr.tracking.processor.config.SkeletonConfigOffsets;
|
||||
import dev.slimevr.tracking.trackers.Tracker;
|
||||
import dev.slimevr.tracking.trackers.TrackerPosition;
|
||||
import dev.slimevr.tracking.trackers.TrackerUtils;
|
||||
import io.eiren.util.logging.LogManager;
|
||||
import io.github.axisangles.ktmath.Quaternion;
|
||||
import solarxr_protocol.MessageBundle;
|
||||
import solarxr_protocol.datatypes.TransactionId;
|
||||
import solarxr_protocol.rpc.*;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.function.BiConsumer;
|
||||
@@ -98,16 +98,12 @@ public class RPCHandler extends ProtocolHandler<RpcMessageHeader>
|
||||
) {
|
||||
FlatBufferBuilder fbb = new FlatBufferBuilder(32);
|
||||
|
||||
try {
|
||||
String localIp = InetAddress.getLocalHost().getHostAddress();
|
||||
int response = ServerInfosResponse
|
||||
.createServerInfosResponse(fbb, fbb.createString(localIp));
|
||||
int outbound = this.createRPCMessage(fbb, RpcMessage.ServerInfosResponse, response);
|
||||
fbb.finish(outbound);
|
||||
conn.send(fbb.dataBuffer());
|
||||
} catch (UnknownHostException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
String localIp = RPCUtil.getLocalIp();
|
||||
int response = ServerInfosResponse
|
||||
.createServerInfosResponse(fbb, fbb.createString(localIp));
|
||||
int outbound = this.createRPCMessage(fbb, RpcMessage.ServerInfosResponse, response);
|
||||
fbb.finish(outbound);
|
||||
conn.send(fbb.dataBuffer());
|
||||
}
|
||||
|
||||
private void onOverlayDisplayModeRequest(
|
||||
@@ -229,7 +225,16 @@ public class RPCHandler extends ProtocolHandler<RpcMessageHeader>
|
||||
if (tracker == null)
|
||||
return;
|
||||
|
||||
|
||||
TrackerPosition pos = TrackerPosition.getByBodyPart(req.bodyPosition());
|
||||
Tracker previousTracker = pos != null
|
||||
? TrackerUtils
|
||||
.getNonInternalTrackerForBodyPosition(this.api.server.getAllTrackers(), pos)
|
||||
: null;
|
||||
if (previousTracker != null) {
|
||||
previousTracker.setTrackerPosition(null);
|
||||
this.api.server.trackerUpdated(previousTracker);
|
||||
}
|
||||
tracker.setTrackerPosition(pos);
|
||||
|
||||
if (req.mountingOrientation() != null) {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package dev.slimevr.protocol.rpc.setup
|
||||
|
||||
import java.net.NetworkInterface
|
||||
|
||||
object RPCUtil {
|
||||
@JvmStatic
|
||||
fun getLocalIp(): String =
|
||||
NetworkInterface.getNetworkInterfaces().asSequence().first {
|
||||
it.isUp && !it.isLoopback && !it.isVirtual
|
||||
}.interfaceAddresses.first {
|
||||
it.broadcast != null
|
||||
}.address.hostAddress
|
||||
}
|
||||
@@ -13,7 +13,10 @@ object TrackerUtils {
|
||||
allTrackers: List<Tracker>,
|
||||
position: TrackerPosition,
|
||||
): Tracker? = allTrackers.firstOrNull {
|
||||
it.trackerPosition === position && !it.isInternal && it.status != TrackerStatus.DISCONNECTED && it.status != TrackerStatus.ERROR
|
||||
it.trackerPosition === position &&
|
||||
!it.isInternal &&
|
||||
it.status != TrackerStatus.DISCONNECTED &&
|
||||
it.status != TrackerStatus.ERROR
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user