👍️[Update] Model : Overlayの起動タイミングを修正

This commit is contained in:
misyaguziya
2024-11-16 10:19:38 +09:00
parent 59f544396c
commit 2e54648ee6
2 changed files with 10 additions and 5 deletions

View File

@@ -71,6 +71,7 @@ class Overlay:
self.system = None
self.overlay = None
self.handle = None
self.init_process = False
self.initialized = False
self.loop = True
self.thread_overlay = None
@@ -109,6 +110,7 @@ class Overlay:
size
)
self.initialized = True
self.init_process = False
except Exception as e:
printLog("error:Could not initialise OpenVR", e)
@@ -243,12 +245,15 @@ class Overlay:
time.sleep(sleepTime)
def main(self):
while self.checkSteamvrRunning() is False:
time.sleep(10)
self.init()
if self.initialized is True:
self.mainloop()
def startOverlay(self):
if self.checkSteamvrRunning() and self.initialized is False:
if self.initialized is False and self.init_process is False:
self.init_process = True
self.thread_overlay = Thread(target=self.main)
self.thread_overlay.daemon = True
self.thread_overlay.start()

View File

@@ -1354,8 +1354,6 @@ class Controller:
def setEnableTranscriptionSend(self, *args, **kwargs) -> dict:
self.startThreadingTranscriptionSendMessage()
config.ENABLE_TRANSCRIPTION_SEND = True
if config.OVERLAY_LARGE_LOG is True:
model.startOverlay()
return {"status":200, "result":config.ENABLE_TRANSCRIPTION_SEND}
def setDisableTranscriptionSend(self, *args, **kwargs) -> dict:
@@ -1365,8 +1363,6 @@ class Controller:
def setEnableTranscriptionReceive(self, *args, **kwargs) -> dict:
self.startThreadingTranscriptionReceiveMessage()
if (config.OVERLAY_SMALL_LOG is True or config.OVERLAY_LARGE_LOG is True):
model.startOverlay()
config.ENABLE_TRANSCRIPTION_RECEIVE = True
return {"status":200, "result":config.ENABLE_TRANSCRIPTION_RECEIVE}
@@ -1763,6 +1759,10 @@ class Controller:
if config.AUTO_SPEAKER_SELECT is True:
self.setEnableAutoSpeakerSelect()
printLog("Init Overlay")
if (config.OVERLAY_SMALL_LOG is True or config.OVERLAY_LARGE_LOG is True):
model.startOverlay()
self.updateConfigSettings()
printLog("End Initialization")