[Update] Config Page: VR Tab. Connect to the backend and save the data.
This commit is contained in:
@@ -31,6 +31,9 @@ export { useSpeakerRecordTimeout } from "./transcription/useSpeakerRecordTimeout
|
||||
export { useSpeakerPhraseTimeout } from "./transcription/useSpeakerPhraseTimeout";
|
||||
export { useSpeakerMaxWords } from "./transcription/useSpeakerMaxWords";
|
||||
|
||||
export { useOverlaySettings } from "./vr/useOverlaySettings";
|
||||
export { useOverlaySmallLogSettings } from "./vr/useOverlaySmallLogSettings";
|
||||
|
||||
export { useOscIpAddress } from "./advanced_settings/useOscIpAddress";
|
||||
export { useOscPort } from "./advanced_settings/useOscPort";
|
||||
|
||||
|
||||
24
src-ui/logics/configs/vr/useOverlaySettings.js
Normal file
24
src-ui/logics/configs/vr/useOverlaySettings.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_OverlaySettings } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useOverlaySettings = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentOverlaySettings, updateOverlaySettings, pendingOverlaySettings } = useStore_OverlaySettings();
|
||||
|
||||
const getOverlaySettings = () => {
|
||||
// pendingOverlaySettings();
|
||||
asyncStdoutToPython("/get/data/overlay_settings");
|
||||
};
|
||||
|
||||
const setOverlaySettings = (overlay_settings) => {
|
||||
// pendingOverlaySettings();
|
||||
asyncStdoutToPython("/set/data/overlay_settings", overlay_settings);
|
||||
};
|
||||
|
||||
return {
|
||||
currentOverlaySettings,
|
||||
getOverlaySettings,
|
||||
updateOverlaySettings,
|
||||
setOverlaySettings,
|
||||
};
|
||||
};
|
||||
24
src-ui/logics/configs/vr/useOverlaySmallLogSettings.js
Normal file
24
src-ui/logics/configs/vr/useOverlaySmallLogSettings.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_OverlaySmallLogSettings } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useOverlaySmallLogSettings = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentOverlaySmallLogSettings, updateOverlaySmallLogSettings, pendingOverlaySmallLogSettings } = useStore_OverlaySmallLogSettings();
|
||||
|
||||
const getOverlaySmallLogSettings = () => {
|
||||
// pendingOverlaySmallLogSettings();
|
||||
asyncStdoutToPython("/get/data/overlay_small_log_settings");
|
||||
};
|
||||
|
||||
const setOverlaySmallLogSettings = (overlay_small_log_settings) => {
|
||||
// pendingOverlaySmallLogSettings();
|
||||
asyncStdoutToPython("/set/data/overlay_small_log_settings", overlay_small_log_settings);
|
||||
};
|
||||
|
||||
return {
|
||||
currentOverlaySmallLogSettings,
|
||||
getOverlaySmallLogSettings,
|
||||
updateOverlaySmallLogSettings,
|
||||
setOverlaySmallLogSettings,
|
||||
};
|
||||
};
|
||||
@@ -45,6 +45,8 @@ import {
|
||||
useSpeakerRecordTimeout,
|
||||
useSpeakerPhraseTimeout,
|
||||
useSpeakerMaxWords,
|
||||
useOverlaySettings,
|
||||
useOverlaySmallLogSettings,
|
||||
useOscIpAddress,
|
||||
useOscPort,
|
||||
} from "@logics_configs";
|
||||
@@ -113,6 +115,9 @@ export const useReceiveRoutes = () => {
|
||||
const { updateSpeakerPhraseTimeout } = useSpeakerPhraseTimeout();
|
||||
const { updateSpeakerMaxWords } = useSpeakerMaxWords();
|
||||
|
||||
const { updateOverlaySettings } = useOverlaySettings();
|
||||
const { updateOverlaySmallLogSettings } = useOverlaySmallLogSettings();
|
||||
|
||||
const { updateOscIpAddress } = useOscIpAddress();
|
||||
const { updateOscPort } = useOscPort();
|
||||
|
||||
@@ -311,6 +316,13 @@ export const useReceiveRoutes = () => {
|
||||
"/get/data/speaker_max_phrases": updateSpeakerMaxWords,
|
||||
"/set/data/speaker_max_phrases": updateSpeakerMaxWords,
|
||||
|
||||
// VR
|
||||
"/get/data/overlay_settings": updateOverlaySettings,
|
||||
"/set/data/overlay_settings": updateOverlaySettings,
|
||||
|
||||
"/get/data/overlay_small_log_settings": updateOverlaySmallLogSettings,
|
||||
"/set/data/overlay_small_log_settings": updateOverlaySmallLogSettings,
|
||||
|
||||
// Others Tab
|
||||
"/get/data/auto_clear_message_box": updateEnableAutoClearMessageInputBox,
|
||||
"/set/enable/auto_clear_message_box": updateEnableAutoClearMessageInputBox,
|
||||
|
||||
Reference in New Issue
Block a user