👍️[Update] Controller : フラグのON/OFFタイミングを修正
This commit is contained in:
@@ -449,9 +449,9 @@ class Controller:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def setEnableTranslation(*args, **kwargs) -> dict:
|
def setEnableTranslation(*args, **kwargs) -> dict:
|
||||||
config.ENABLE_TRANSLATION = True
|
|
||||||
if model.isLoadedCTranslate2Model() is False:
|
if model.isLoadedCTranslate2Model() is False:
|
||||||
model.changeTranslatorCTranslate2Model()
|
model.changeTranslatorCTranslate2Model()
|
||||||
|
config.ENABLE_TRANSLATION = True
|
||||||
return {"status":200, "result":config.ENABLE_TRANSLATION}
|
return {"status":200, "result":config.ENABLE_TRANSLATION}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -1087,6 +1087,7 @@ class Controller:
|
|||||||
th_callback = Thread(target=callback)
|
th_callback = Thread(target=callback)
|
||||||
th_callback.daemon = True
|
th_callback.daemon = True
|
||||||
th_callback.start()
|
th_callback.start()
|
||||||
|
th_callback.join()
|
||||||
return {"status":200, "result":config.CTRANSLATE2_WEIGHT_TYPE}
|
return {"status":200, "result":config.CTRANSLATE2_WEIGHT_TYPE}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -1149,10 +1150,9 @@ class Controller:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def setDisableOverlaySmallLog(*args, **kwargs) -> dict:
|
def setDisableOverlaySmallLog(*args, **kwargs) -> dict:
|
||||||
config.OVERLAY_SMALL_LOG = False
|
config.OVERLAY_SMALL_LOG = False
|
||||||
if config.OVERLAY_SMALL_LOG is False:
|
model.clearOverlayImageSmallLog()
|
||||||
model.clearOverlayImageSmallLog()
|
if config.OVERLAY_LARGE_LOG is False:
|
||||||
if config.OVERLAY_LARGE_LOG is False:
|
model.shutdownOverlay()
|
||||||
model.shutdownOverlay()
|
|
||||||
return {"status":200, "result":config.OVERLAY_SMALL_LOG}
|
return {"status":200, "result":config.OVERLAY_SMALL_LOG}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -1179,10 +1179,9 @@ class Controller:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def setDisableOverlayLargeLog(*args, **kwargs) -> dict:
|
def setDisableOverlayLargeLog(*args, **kwargs) -> dict:
|
||||||
config.OVERLAY_LARGE_LOG = False
|
config.OVERLAY_LARGE_LOG = False
|
||||||
if config.OVERLAY_LARGE_LOG is False:
|
model.clearOverlayImageLargeLog()
|
||||||
model.clearOverlayImageLargeLog()
|
if config.OVERLAY_SMALL_LOG is False:
|
||||||
if config.OVERLAY_SMALL_LOG is False:
|
model.shutdownOverlay()
|
||||||
model.shutdownOverlay()
|
|
||||||
return {"status":200, "result":config.OVERLAY_LARGE_LOG}
|
return {"status":200, "result":config.OVERLAY_LARGE_LOG}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user