Commit 1be38d7a authored by 徐生海's avatar 徐生海

Initial commit

parent 7f7685a6
......@@ -5,7 +5,7 @@ work.md
__pycache__/
*.py[cod]
$__pycache__$
logs/
Resource/
dist/
build/
\ No newline at end of file
/logs/
/Resource/
/dist/
/build/
\ No newline at end of file
......@@ -8,5 +8,4 @@
@Description:
"""
from AppBackEnd.BackEndBusiness.ChamberCheckBusiness import ChamberCheckBusiness
from AppBackEnd.AppScanningFlow import AppScanningFlow
\ No newline at end of file
This diff is collapsed.
......@@ -7,30 +7,29 @@
@Author : xsh
@Description:
"""
from PyQt5 import Qt
from abc import abstractmethod
from AppInterfaces.utils import *
from AppSettings.utils import *
from AppCore.Levels import *
from AppInterfaces.ImplInterfaces import *
from AppInterfaces.ReaderInterfaces import *
from AppCore.DBModels import *
from AppUtils.utils import *
from AppSettings.AppGlobalStatus import AppGlobalStatus
from AppSettings.AppGlobalAlgorithm import AppGlobalAlgorithm
from AppInterfaces.AlgorithmInterfaces import AlgorithmManagerInterface
from AppInterfaces.ConfigureInterfaces import IAppStatusSetting, ISystemSetting, IHitBotSetting, IAppSetting
from AppBackEnd.AppEventBusBusiness import *
class AppBusinessInterface(AdapterInterface):
ScanLevel : int #
FlowLocker : Qt.QMutex # 流程锁
Config : AppSetting # 参数配置文件
SystemConfig : SystemSetting # 系统配置
HitBotConfig : HitBotSetting # 机械臂配置
Config : IAppSetting # 参数配置文件
SystemConfig : ISystemSetting # 系统配置
HitBotConfig : IHitBotSetting # 机械臂配置
HardWare : HardWareManagerInterface # 硬件模块功能
GlobalStatus : AppGlobalStatus # 玻片状态
AppStatus : IAppStatusSetting # 玻片状态
Application : Qt.QApplication # 事件循环模块
Algorithm : AppGlobalAlgorithm # 数据算法
Algorithm : AlgorithmManagerInterface # 数据算法
EventBus : AppEventBusPool # 线程总线
Process : object # 进程总线
CheckBusiness : 'AppBusinessInterface' # 片仓检测玻片业务
PickBusiness : 'AppBusinessInterface' # 片仓获取玻片业务
DropBusiness : 'AppBusinessInterface' # 片仓放置玻片业务
......@@ -133,13 +132,10 @@ class AppBusinessInterface(AdapterInterface):
self.initSlideScanningBusiness()
return self.SlideScanningBusiness
@property
def asyncscanningbusiness(self) -> 'AppBusinessInterface':
if not self.hasAsyncScanningBusiness:
self.initAsyncScanningBusiness()
return self.AsyncScanningBusiness
@abstractmethod
def getBeginOilingSlide(self, chamber_number: int, row_number: int, tray_number: int, objective: int) -> SlideModel:
pass
def initCheckBusiness (self):
if not self.hasCheckBusiness:
......@@ -254,24 +250,18 @@ class AppBusinessInterface(AdapterInterface):
def hasAsyncScanningBusiness (self) -> bool:
return hasattr(self, 'AsyncScanningBusiness' ) and isinstance(self.AsyncScanningBusiness , AppBusinessInterface)
async def asynchrony_WaitDone(self, ChamberNumber: object, *args, **kwargs) -> int:
isWrong: int = RECODE_FAILURE
try:
isWrong = self.WaitDone(ChamberNumber, *args, **kwargs)
except Exception as e:
AppUtils.print_Exception(e)
return isWrong
@property
def config (self) -> AppSetting :
def config (self) -> IAppSetting :
return None if not self.hasConfig else self.Config
@property
def system (self) -> SystemSetting :
def system (self) -> ISystemSetting :
return None if not self.hasSystemConfig else self.SystemConfig
@property
def hitbotConfig(self) -> HitBotSetting:
def hitbotConfig(self) -> IHitBotSetting:
return None if not self.hasHitBotConfig else self.HitBotConfig
@property
......@@ -279,15 +269,15 @@ class AppBusinessInterface(AdapterInterface):
return None if not self.hasHardWare else self.HardWare
@property
def status (self) -> AppGlobalStatus :
return None if not self.hasGlobalStatus else self.GlobalStatus
def status (self) -> IAppStatusSetting :
return None if not self.hasAppStatus else self.AppStatus
@property
def application (self) -> Qt.QApplication :
return None if not self.hasApplication else self.Application
@property
def algorithm (self) -> AppGlobalAlgorithm :
def algorithm (self) -> AlgorithmManagerInterface :
return None if not self.hasAlgorithm else self.Algorithm
@property
......@@ -304,8 +294,7 @@ class AppBusinessInterface(AdapterInterface):
@abstractmethod
def initConfig (self):
if not self.hasConfig :
self.Config = AppSetting .GetInstance()
pass
@abstractmethod
def initSystemConfig (self):
......@@ -320,7 +309,7 @@ class AppBusinessInterface(AdapterInterface):
pass
@abstractmethod
def initGlobalStatus (self):
def initAppStatus (self):
pass
@abstractmethod
......@@ -356,7 +345,7 @@ class AppBusinessInterface(AdapterInterface):
def initFlowLocker(self):
if not self.hasFlowLocker:
self.FlowLocker = GlobalMutex
self.FlowLocker = Qt.QMutex()
def initDevices(self):
if not self.hasHardWare:
......@@ -408,15 +397,15 @@ class AppBusinessInterface(AdapterInterface):
@property
def hasConfig (self) -> bool:
return hasattr(self, 'Config' ) and isinstance(self.Config , AppSetting )
return hasattr(self, 'Config' ) and isinstance(self.Config , IAppSetting )
@property
def hasSystemConfig (self) -> bool:
return hasattr(self, 'SystemConfig' ) and isinstance(self.SystemConfig , SystemSetting )
return hasattr(self, 'SystemConfig' ) and isinstance(self.SystemConfig , ISystemSetting )
@property
def hasHitBotConfig (self) -> bool:
return hasattr(self, 'HitBotConfig' ) and isinstance(self.HitBotConfig , HitBotSetting )
return hasattr(self, 'HitBotConfig' ) and isinstance(self.HitBotConfig , IHitBotSetting )
@property
......@@ -428,8 +417,8 @@ class AppBusinessInterface(AdapterInterface):
return hasattr(self, 'HardWare') and isinstance(self.HardWare, HardWareManagerInterface)
@property
def hasGlobalStatus (self) -> bool:
return hasattr(self, 'GlobalStatus' ) and isinstance(self.GlobalStatus , AppGlobalStatus )
def hasAppStatus (self) -> bool:
return hasattr(self, 'AppStatus' ) and isinstance(self.AppStatus , IAppStatusSetting )
@property
def hasApplication (self) -> bool:
......@@ -437,7 +426,7 @@ class AppBusinessInterface(AdapterInterface):
@property
def hasAlgorithm (self) -> bool:
return hasattr(self, 'Algorithm' ) and isinstance(self.Algorithm , AppGlobalAlgorithm )
return hasattr(self, 'Algorithm' ) and isinstance(self.Algorithm , AlgorithmManagerInterface )
@property
def hasEventBus (self) -> bool:
......@@ -911,15 +900,3 @@ class AppBusinessInterface(AdapterInterface):
@abstractmethod
def waitForSlideScanning(self, chamber_number: int, row_number: int, tray_number: int, isSafe: bool = False) -> int:
pass
@classmethod
def isAberration(cls, classifier: str) -> bool:
return isinstance(classifier, str) and classifier == 'Aberration'
@classmethod
def isMicronucleus(cls, classifier: str) -> bool:
return isinstance(classifier, str) and classifier == 'Micronucleus'
@classmethod
def isKaryotyping(cls, classifier: str) -> bool:
return isinstance(classifier, str) and classifier == 'Karyotyping'
......@@ -14,6 +14,11 @@ from AppBackEnd.BackEndEventBus.DataWebSocketPool import DataWebSocket
from AppBackEnd.BackEndEventBus.SlideFocusingPool import SlideFocusingPool #
from AppBackEnd.BackEndEventBus.SlideScanningPool import SlideScanningPool #
from AppBackEnd.BackEndEventBus.CameraScanningPool import CameraScanningPool #
from AppBackEnd.BackEndEventBus.CameraFocusingPool import CameraFocusingPool #
from AppBackEnd.BackEndEventBus.GlobalWebServerPool import GlobalWebServerPool #
from AppBackEnd.BackEndEventBus.ProcessCellFocusingPool import ProcessCellFocusingPool #
from AppBackEnd.BackEndEventBus.AppTaskPool import AppTaskPool #
from AppBackEnd.BackEndEventBus.AppTaskController import AppTaskController #
from AppBackEnd.BackEndEventBus.ImageFilterPool import ImageFilterPool #
from AppBackEnd.BackEndEventBus.ImageStitchPool import ImageStitchPool #
from AppBackEnd.BackEndEventBus.AppEventBusPool import AppEventBusPool #
from AppBackEnd.BackEndEventBus.ProcessCellFocusingPool import ProcessCellFocusingPool #
\ No newline at end of file
......@@ -21,8 +21,8 @@ from AppUtils.utils import *
from AppCore.Events import *
from AppBackEnd.AppEventBusBusiness import *
from AppCore.ReaderInterfaces import *
from AppSettings.AppGlobalStatus import AppGlobalStatus, AppStatus
from AppSettings.AppGlobalAlgorithm import AppGlobalAlgorithm
from AppSettings.AppStatusSetting import AppStatusSetting, AppStatus
from AppSettings.AppAlgorithmSetting import AppAlgorithmSetting
from AppBackEnd.AppBusinessController import AppBusinessController, AppBusinessInterface
from AppBackEnd.BackEndBusiness.ChamberCheckBusiness import ChamberCheckBusiness # 玻片检测业务
from AppBackEnd.BackEndBusiness.ChamberPickBusiness import ChamberPickBusiness # 片仓取片业务
......@@ -36,18 +36,6 @@ from AppBackEnd.BackEndBusiness.SlideOilingBusiness import SlideOili
from AppBackEnd.BackEndBusiness.SlideCellFocusingBusiness import SlideCellFocusingBusiness # 核型畸变扫描业务
from AppBackEnd.BackEndBusiness.ChamberScanningBusiness import ChamberScanningBusiness # 全部玻片扫描业务
class AppScanningFlow(Qt.QObject, AppBusinessController, SingletonInterface):
Locker : Qt.QMutex = Qt.QMutex()
CheckBusiness : ChamberCheckBusiness # 玻片检测业务
PickBusiness : ChamberPickBusiness # 片仓取片业务
DropBusiness : ChamberDropBusiness # 片仓放片业务
TrayPickBusiness : SlideTablePickBusiness # 托盘取片业务
TrayDropBusiness : SlideTableDropBusiness # 托盘放片业务
ScanCodeBusiness : SlideScanCodeBusiness # 玻片扫码业务
FocusingBusiness : SlideFocusingBusiness # 低倍物镜定焦业务
ScanningBusiness : SlideScanningBusiness # 低倍物镜快扫业务
OilingBusiness : SlideOilingBusiness # 托盘玻片滴油业务
CellFocusingBusiness : SlideCellFocusingBusiness # 核型畸变扫描业务
@classmethod
def GetInstance(cls, *args, **kwargs) -> 'AppScanningFlow':
return super(AppScanningFlow, cls).GetInstance(*args, **kwargs)
......@@ -56,15 +44,13 @@ class AppScanningFlow(Qt.QObject, AppBusinessController, SingletonInterface):
super(AppScanningFlow, self).__init__(parent=parent)
self.initialize()
self.ScanLevel = ScanStatusLevel.Default_Status
# self.initModules()
def initModules(self, parent = None):
self.initProcess ()
self.initHardWare ()
self.initConfig ()
self.initSystemConfig ()
self.initHitBotConfig ()
self.initGlobalStatus ()
self.initAppStatus ()
self.initFlowLocker ()
self.initAlgorithm ()
self.initEventBus ()
......@@ -167,7 +153,7 @@ class AppScanningFlow(Qt.QObject, AppBusinessController, SingletonInterface):
"""如果当前不是停止状态 说明正在扫描 发送弹窗 直接退出"""
if not self.status.isExit:
message_string: str = '正在扫描'
if self.system.isEnglishMode():
if self.system.IsEnglishMode:
message_string = 'Scanning'
self.sendMessage(message_string)
self.eventBus.WebSocketTransmitFinishScanning()
......@@ -195,12 +181,12 @@ class AppScanningFlow(Qt.QObject, AppBusinessController, SingletonInterface):
self.eventBus.WebSocketTransmitFinishScanning()
self.eventBus.WebSocketPushScanningData()
if RECODE_SUCCEED != isWrong:
if self.system.isEnglishMode():
if self.system.IsEnglishMode:
self.sendMessage(EN_SCANNING_COMPLETE)
else:
self.sendMessage(SCANNING_ERROR)
else:
if self.system.isEnglishMode():
if self.system.IsEnglishMode:
self.sendMessage(EN_SCANNING_COMPLETE)
else:
self.sendMessage(SCANNING_COMPLETE)
......@@ -406,7 +392,7 @@ class AppScanningFlow(Qt.QObject, AppBusinessController, SingletonInterface):
isWrong, _ChamberNumber, RowNumber = self.waitForSucceedPickAvailable(chamber_number=ChamberNumber, row_number=int(RowNumber))
if RECODE_SUCCEED == isWrong and _ChamberNumber == ChamberNumber and RowNumber <= MaxRowNumber:
isWrong = self.ChamberToSlideTable(chamber_number=ChamberNumber, row_number=RowNumber, tray_number=TrayNumber, isSafe=isSafe)
if ScanStatusLevel.isHitBotAlarm(self.status.scanning_level) or not self.status.isHitBotAvailable():
if ScanStatusLevel.isHitBotAlarm(self.status.scanning_level) or not self.status.isHitBotAvailable:
break
if RECODE_SUCCEED != isWrong:
break
......@@ -418,7 +404,7 @@ class AppScanningFlow(Qt.QObject, AppBusinessController, SingletonInterface):
break
"""放玻片到托盘"""
isWrong = self.SlideTableToChamber(chamber_number=ChamberNumber, row_number=RowNumber, tray_number=TrayNumber, isSafe=ActionSafe)
if ScanStatusLevel.isHitBotAlarm(self.status.scanning_level) or not self.status.isHitBotAvailable():
if ScanStatusLevel.isHitBotAlarm(self.status.scanning_level) or not self.status.isHitBotAvailable:
break
if RECODE_SUCCEED != isWrong:
break
......@@ -432,7 +418,7 @@ class AppScanningFlow(Qt.QObject, AppBusinessController, SingletonInterface):
break
RowNumber += 1
"""如果不是机械臂错误"""
if not ScanStatusLevel.isHitBotAlarm(self.status.scanning_level) and self.status.isHitBotAvailable():
if not ScanStatusLevel.isHitBotAlarm(self.status.scanning_level) and self.status.isHitBotAvailable:
"""如果夹爪有玻片 再次判断夹爪状态 然后获取最后一次取片记录 返回最后一次取片位置"""
if self.hitbotConfig.hitbotIsClamp():
if not self.hitbot.IsGrab():
......@@ -444,7 +430,7 @@ class AppScanningFlow(Qt.QObject, AppBusinessController, SingletonInterface):
else:
self.waitForPickWarning()
if not ScanStatusLevel.isHitBotAlarm(self.status.scanning_level) and self.status.isHitBotAvailable():
if not ScanStatusLevel.isHitBotAlarm(self.status.scanning_level) and self.status.isHitBotAvailable:
for tray_number in [ModuleLevel.ModuleTraySlide1, ModuleLevel.ModuleTraySlide2]:
tray_status : int = self.status.getTrayStatus (tray_number)
tray_model : TraySlideModel = self.status.getTraySlideModel (tray_number)
......
......@@ -20,8 +20,8 @@ from AppUtils.utils import *
from AppCore.Events import *
from AppBackEnd.AppEventBusBusiness import *
from AppCore.Readers import *
from AppSettings.AppGlobalStatus import AppGlobalStatus, AppStatus
from AppSettings.AppGlobalAlgorithm import AppGlobalAlgorithm
from AppSettings.AppStatusSetting import AppStatusSetting, AppStatus
from AppSettings.AppAlgorithmSetting import AppAlgorithmSetting
from AppBackEnd.AppBusinessController import AppBusinessController, AppBusinessInterface
class ChamberDropBusiness(Qt.QObject, AppBusinessController):
......@@ -36,7 +36,7 @@ class ChamberDropBusiness(Qt.QObject, AppBusinessController):
self.Config = parent.config #
self.SystemConfig = parent.system #
self.HardWare = parent.devices #
self.GlobalStatus = parent.status #
self.AppStatus = parent.status #
self.Application = parent.application #
self.Algorithm = parent.algorithm #
self.EventBus = parent.eventBus #
......@@ -45,7 +45,7 @@ class ChamberDropBusiness(Qt.QObject, AppBusinessController):
def isValid(self) -> bool:
return self.hasHitBot and self.hasGlobalStatus and self.hasSystemConfig and self.hasConfig
return self.hasHitBot and self.hasAppStatus and self.hasSystemConfig and self.hasConfig
@property
def isAvailable(self) -> bool:
......@@ -65,8 +65,6 @@ class ChamberDropBusiness(Qt.QObject, AppBusinessController):
AppUtils.print_Exception(e)
if self.status.isExit:
self.status.setScanningStatus(ScanStatusLevel.FinishScanning_Status)
# elif self.status.isJumpScanning():
# self.status.setScanningStatus(ScanStatusLevel.JumpScanning_Status)
elif RECODE_SUCCEED == isWrong:
self.status.setScanningStatus(self.ScanLevel)
self.status.changedChamberScanningStatus(ChamberNumber, RowNumber, self.ScanLevel)
......@@ -88,8 +86,6 @@ class ChamberDropBusiness(Qt.QObject, AppBusinessController):
AppUtils.print_Exception(e)
if self.status.isExit:
self.status.setScanningStatus(ScanStatusLevel.FinishScanning_Status)
# elif self.status.isJumpScanning():
# self.status.setScanningStatus(ScanStatusLevel.JumpScanning_Status)
elif RECODE_SUCCEED == isWrong:
self.status.setScanningStatus(self.ScanLevel)
self.status.changedChamberScanningStatus(ChamberNumber, RowNumber, self.ScanLevel)
......@@ -112,11 +108,15 @@ class ChamberDropBusiness(Qt.QObject, AppBusinessController):
"""处理片仓安装状态"""
while not self.waitForChamberAvailable():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
if self.system.IsBuzzerMode:
while not self.waitForCloseTheDoor():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
"""处理暂停 退出"""
while self.status.waitForPauseRunning():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
SCAN_STATUS: int = self.process_scanning_status()
if isExit:
if self.status.waitForExitRunning():
if SCAN_STATUS == RECODE_CHANGED:
if isSafe:
self.hitbot.moveToSafePosition()
return RECODE_SUCCEED
isWrong = self.waitForChamberDropSlide(chamber_number, row_number)
"""如果所有动作完成 把玻片状态改为1 """
......@@ -129,11 +129,18 @@ class ChamberDropBusiness(Qt.QObject, AppBusinessController):
if isSafe and RECODE_SUCCEED == isWrong:
self.hitbot.moveToSafePosition()
"""处理暂停 退出"""
while self.status.waitForPauseRunning():
"""处理片仓安装状态"""
while not self.waitForChamberAvailable():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
if self.system.IsBuzzerMode:
while not self.waitForCloseTheDoor():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
"""处理暂停 退出"""
SCAN_STATUS: int = self.process_scanning_status()
if isExit:
if self.status.waitForExitRunning():
if SCAN_STATUS == RECODE_CHANGED:
if isSafe:
self.hitbot.moveToSafePosition()
return RECODE_SUCCEED
return isWrong
......@@ -153,8 +160,8 @@ class ChamberDropBusiness(Qt.QObject, AppBusinessController):
MinChamberNumber, MaxChamberNumber = self.system.getChamberRange ()
if MinChamberNumber <= chamber_number <= MaxChamberNumber and MinRowNumber <= row_number <= MaxRowNumber:
"""如果当前玻片不能取 直接退出"""
if not ChamberStatusModel.IsPickAvailable(chamber_number, row_number):
return RECODE_FAILURE
# if not ChamberStatusModel.IsPickAvailable(chamber_number, row_number):
# return RECODE_FAILURE
if not self.isValid():
return RECODE_FAILURE
if not self.isAvailable:
......
......@@ -23,8 +23,8 @@ from AppUtils.utils import *
from AppCore.Events import *
from AppBackEnd.AppEventBusBusiness import *
from AppCore.Readers import *
from AppSettings.AppGlobalStatus import AppGlobalStatus, AppStatus
from AppSettings.AppGlobalAlgorithm import AppGlobalAlgorithm
from AppSettings.AppStatusSetting import AppStatusSetting, AppStatus
from AppSettings.AppAlgorithmSetting import AppAlgorithmSetting
from AppBackEnd.AppBusinessController import AppBusinessController, AppBusinessInterface
class ChamberLowScanningBusiness(Qt.QObject, AppBusinessController):
......@@ -43,7 +43,7 @@ class ChamberLowScanningBusiness(Qt.QObject, AppBusinessController):
self.Config = parent.config #
self.SystemConfig = parent.system #
self.HardWare = parent.devices #
self.GlobalStatus = parent.status #
self.AppStatus = parent.status #
self.Application = parent.application #
self.Algorithm = parent.algorithm #
self.EventBus = parent.eventBus #
......@@ -104,7 +104,7 @@ class ChamberLowScanningBusiness(Qt.QObject, AppBusinessController):
self.AsyncResults.append(result)
def isValid(self) -> bool:
return self.hasHitBot and self.hasGlobalStatus and self.hasSystemConfig and self.hasConfig
return self.hasHitBot and self.hasAppStatus and self.hasSystemConfig and self.hasConfig
@property
def isAvailable(self) -> bool:
......
......@@ -20,8 +20,8 @@ from AppUtils.utils import *
from AppCore.Events import *
from AppBackEnd.AppEventBusBusiness import *
from AppCore.Readers import *
from AppSettings.AppGlobalStatus import AppGlobalStatus, AppStatus
from AppSettings.AppGlobalAlgorithm import AppGlobalAlgorithm
from AppSettings.AppStatusSetting import AppStatusSetting, AppStatus
from AppSettings.AppAlgorithmSetting import AppAlgorithmSetting
from AppBackEnd.AppBusinessController import AppBusinessController, AppBusinessInterface
class ChamberPickBusiness(Qt.QObject, AppBusinessController):
Locker : Qt.QMutex = Qt.QMutex()
......@@ -38,7 +38,7 @@ class ChamberPickBusiness(Qt.QObject, AppBusinessController):
self.Config = parent.config #
self.SystemConfig = parent.system #
self.HardWare = parent.devices #
self.GlobalStatus = parent.status #
self.AppStatus = parent.status #
self.Application = parent.application #
self.Algorithm = parent.algorithm #
self.EventBus = parent.eventBus #
......@@ -47,7 +47,7 @@ class ChamberPickBusiness(Qt.QObject, AppBusinessController):
def isValid(self) -> bool:
return self.hasHitBot and self.hasGlobalStatus and self.hasSystemConfig and self.hasConfig and self.hasHitBotConfig
return self.hasHitBot and self.hasAppStatus and self.hasSystemConfig and self.hasConfig and self.hasHitBotConfig
@property
def isAvailable(self) -> bool:
......@@ -109,12 +109,13 @@ class ChamberPickBusiness(Qt.QObject, AppBusinessController):
"""处理片仓安装状态"""
while not self.waitForChamberAvailable():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
if isExit:
"""处理暂停 退出"""
while self.status.waitForPauseRunning():
if self.system.IsBuzzerMode:
while not self.waitForCloseTheDoor():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
if self.status.waitForExitRunning():
"""处理暂停 退出"""
SCAN_STATUS: int = self.process_scanning_status()
if isExit:
if SCAN_STATUS == RECODE_CHANGED:
if isSafe:
self.hitbot.moveToSafePosition()
return RECODE_SUCCEED
......@@ -139,11 +140,12 @@ class ChamberPickBusiness(Qt.QObject, AppBusinessController):
if isSafe and RECODE_SUCCEED == isWrong:
self.hitbot.moveToSafePosition()
"""处理暂停 退出"""
SCAN_STATUS: int = self.process_scanning_status()
if isExit:
"""处理暂停 退出"""
while self.status.waitForPauseRunning():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
if self.status.waitForExitRunning():
if SCAN_STATUS == RECODE_CHANGED:
if isSafe:
self.hitbot.moveToSafePosition()
return RECODE_SUCCEED
return isWrong
......
......@@ -20,8 +20,8 @@ from AppUtils.utils import *
from AppCore.Events import *
from AppBackEnd.AppEventBusBusiness import *
from AppCore.Readers import *
from AppSettings.AppGlobalStatus import AppGlobalStatus, AppStatus
from AppSettings.AppGlobalAlgorithm import AppGlobalAlgorithm
from AppSettings.AppStatusSetting import AppStatusSetting, AppStatus
from AppSettings.AppAlgorithmSetting import AppAlgorithmSetting
from AppBackEnd.AppBusinessController import AppBusinessController, AppBusinessInterface
class SlideScanCodeBusiness(Qt.QObject, AppBusinessController):
......@@ -36,7 +36,7 @@ class SlideScanCodeBusiness(Qt.QObject, AppBusinessController):
self.Config = parent.config #
self.SystemConfig = parent.system #
self.HardWare = parent.devices #
self.GlobalStatus = parent.status #
self.AppStatus = parent.status #
self.Application = parent.application #
self.Algorithm = parent.algorithm #
self.EventBus = parent.eventBus #
......@@ -45,7 +45,7 @@ class SlideScanCodeBusiness(Qt.QObject, AppBusinessController):
def isValid(self) -> bool:
return self.hasHitBot and self.hasGlobalStatus and self.hasSystemConfig and self.hasConfig
return self.hasHitBot and self.hasAppStatus and self.hasSystemConfig and self.hasConfig
@property
def isAvailable(self) -> bool:
......@@ -105,19 +105,20 @@ class SlideScanCodeBusiness(Qt.QObject, AppBusinessController):
if len(ScanCodeActions) <= 0:
return RECODE_FAILURE
if self.system.IsBuzzerMode:
while not self.waitForCloseTheDoor():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
"""处理暂停 退出"""
while self.status.waitForPauseRunning():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
if self.status.waitForExitRunning():
return RECODE_SUCCEED
self.process_scanning_status()
CodeString = None
SpecimenNumber = None
SlideNumber = None
if chamber_number == 5 or chamber_number == 10:
ScanCodeActions[0].speed = self.system.HitBotSpeed5
ScanCodeActions[0].speed = self.hitbotConfig.getHitBotSpeed5
elif chamber_number == 4 or chamber_number == 9:
ScanCodeActions[0].speed = self.system.HitBotSpeed4
ScanCodeActions[0].speed = self.hitbotConfig.getHitBotSpeed4
isWrong = self.waitForScanCodeOpen()
if RECODE_SUCCEED == isWrong:
......@@ -128,6 +129,11 @@ class SlideScanCodeBusiness(Qt.QObject, AppBusinessController):
if RECODE_SUCCEED == isWrong:
CodeString = CodeString.replace('\r\n', '')
break
if self.system.IsBuzzerMode:
while not self.waitForCloseTheDoor():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
"""处理暂停 退出"""
self.process_scanning_status()
isWrong = RECODE_SUCCEED if isinstance(CodeString, str) and len(CodeString) > 0 else RECODE_FAILURE
if RECODE_SUCCEED != isWrong:
CodeString = self.scancode.ReadScanningCode()
......
......@@ -20,8 +20,8 @@ from AppUtils.utils import *
from AppCore.Events import *
from AppBackEnd.AppEventBusBusiness import *
from AppCore.Readers import *
from AppSettings.AppGlobalStatus import AppGlobalStatus, AppStatus
from AppSettings.AppGlobalAlgorithm import AppGlobalAlgorithm
from AppSettings.AppStatusSetting import AppStatusSetting, AppStatus
from AppSettings.AppAlgorithmSetting import AppAlgorithmSetting
from AppCore.AppAlgorithms.ImageAlgorithm import ImageAlgorithm
from AppBackEnd.AppBusinessController import AppBusinessController, AppBusinessInterface
class SlideTableDropBusiness(Qt.QObject, AppBusinessController, SingletonInterface):
......@@ -40,7 +40,7 @@ class SlideTableDropBusiness(Qt.QObject, AppBusinessController, SingletonInterfa
self.Config = parent.config #
self.SystemConfig = parent.system #
self.HardWare = parent.devices #
self.GlobalStatus = parent.status #
self.AppStatus = parent.status #
self.Application = parent.application #
self.Algorithm = parent.algorithm #
self.EventBus = parent.eventBus #
......@@ -49,7 +49,7 @@ class SlideTableDropBusiness(Qt.QObject, AppBusinessController, SingletonInterfa
def isValid(self) -> bool:
return self.hasHitBot and self.hasGlobalStatus and self.hasSystemConfig and self.hasConfig
return self.hasHitBot and self.hasAppStatus and self.hasSystemConfig and self.hasConfig
@property
def isAvailable(self) -> bool:
return self.hasHitBot and self.hitbot.isAvailable
......@@ -113,11 +113,16 @@ class SlideTableDropBusiness(Qt.QObject, AppBusinessController, SingletonInterfa
if isSafe:
self.hitbot.moveToSafePosition()
"""处理暂停 退出"""
while self.status.waitForPauseRunning():
"""处理片仓安装状态"""
while not self.waitForChamberAvailable():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
if self.system.IsBuzzerMode:
while not self.waitForCloseTheDoor():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
"""处理暂停 退出"""
ScanStatus = self.process_scanning_status()
if isExit:
if self.status.waitForExitRunning():
if ScanStatus == RECODE_CHANGED:
if isSafe:
self.hitbot.moveToSafePosition()
return RECODE_SUCCEED
......@@ -140,11 +145,18 @@ class SlideTableDropBusiness(Qt.QObject, AppBusinessController, SingletonInterfa
return RECODE_FAILURE
if isSafe and RECODE_SUCCEED == isWrong:
self.hitbot.moveToSafePosition()
"""处理暂停 退出"""
while self.status.waitForPauseRunning():
"""处理片仓安装状态"""
while not self.waitForChamberAvailable():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
if self.system.IsBuzzerMode:
while not self.waitForCloseTheDoor():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
"""处理暂停 退出"""
ScanStatus = self.process_scanning_status()
if isExit:
if self.status.waitForExitRunning():
if ScanStatus == RECODE_CHANGED:
if isSafe:
self.hitbot.moveToSafePosition()
return RECODE_SUCCEED
return isWrong
......
......@@ -20,8 +20,8 @@ from AppUtils.utils import *
from AppCore.Events import *
from AppBackEnd.AppEventBusBusiness import *
from AppCore.Readers import *
from AppSettings.AppGlobalStatus import AppGlobalStatus, AppStatus
from AppSettings.AppGlobalAlgorithm import AppGlobalAlgorithm
from AppSettings.AppStatusSetting import AppStatusSetting, AppStatus
from AppSettings.AppAlgorithmSetting import AppAlgorithmSetting
from AppCore.AppAlgorithms.ImageAlgorithm import ImageAlgorithm
from AppBackEnd.AppBusinessController import AppBusinessController, AppBusinessInterface
class SlideTablePickBusiness(Qt.QObject, AppBusinessController, SingletonInterface):
......@@ -40,7 +40,7 @@ class SlideTablePickBusiness(Qt.QObject, AppBusinessController, SingletonInterfa
self.Config = parent.config #
self.SystemConfig = parent.system #
self.HardWare = parent.devices #
self.GlobalStatus = parent.status #
self.AppStatus = parent.status #
self.Application = parent.application #
self.Algorithm = parent.algorithm #
self.EventBus = parent.eventBus #
......@@ -48,7 +48,7 @@ class SlideTablePickBusiness(Qt.QObject, AppBusinessController, SingletonInterfa
self.HitBotConfig = parent.hitbotConfig #
def isValid(self) -> bool:
return self.hasHitBot and self.hasGlobalStatus and self.hasSystemConfig and self.hasConfig
return self.hasHitBot and self.hasAppStatus and self.hasSystemConfig and self.hasConfig
@property
def isAvailable(self) -> bool:
......@@ -113,11 +113,16 @@ class SlideTablePickBusiness(Qt.QObject, AppBusinessController, SingletonInterfa
return isWrong
if isSafe:
self.hitbot.moveToSafePosition()
"""处理暂停 退出"""
while self.status.waitForPauseRunning():
"""处理片仓安装状态"""
while not self.waitForChamberAvailable():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
if self.system.IsBuzzerMode:
while not self.waitForCloseTheDoor():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
"""处理暂停 退出"""
ScanStatus = self.process_scanning_status()
if isExit:
if self.status.waitForExitRunning():
if ScanStatus == RECODE_CHANGED:
return RECODE_SUCCEED
......@@ -139,11 +144,16 @@ class SlideTablePickBusiness(Qt.QObject, AppBusinessController, SingletonInterfa
if isSafe and RECODE_SUCCEED == isWrong:
self.hitbot.moveToSafePosition()
"""处理暂停 退出"""
while self.status.waitForPauseRunning():
"""处理片仓安装状态"""
while not self.waitForChamberAvailable():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
if self.system.IsBuzzerMode:
while not self.waitForCloseTheDoor():
AppTimeLoop.processEvents(self.system.WarningWaitTimes())
"""处理暂停 退出"""
ScanStatus = self.process_scanning_status()
if isExit:
if self.status.waitForExitRunning():
if ScanStatus == RECODE_CHANGED:
return RECODE_SUCCEED
return isWrong
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment