Files
xinzhu.yin c157e774e5 1.1.0版本
2026-04-16 16:51:05 +08:00

101 lines
3.5 KiB
Python

from enum import IntEnum
class CaptureStatus(IntEnum):
Unknown = -1
Stop = 0
Running = 1
def __str__(self):
if self.value == CaptureStatus.Unknown:
return f"Capture status: {self.value}"
elif self.value == CaptureStatus.Stop:
return f"Capture status: is not working"
elif self.value == CaptureStatus.Running:
return f"Capture status: working"
else:
return f"Capture status: Unknown state"
class BulkCaptureStatus(IntEnum):
Unknown = -1
Idle = 0
Waiting = 1
Capturing = 2
Transferring = 3
def __str__(self):
if self.value == BulkCaptureStatus.Unknown:
return f"Bulk capture status: {self.value}"
elif self.value == BulkCaptureStatus.Idle:
return f"Bulk capture status: Doing nothing"
elif self.value == BulkCaptureStatus.Waiting:
return f"Bulk capture status: Waiting"
elif self.value == BulkCaptureStatus.Capturing:
return f"Bulk capture status: Capturing in progress"
elif self.value == BulkCaptureStatus.Transferring:
return f"Bulk capture status: Transferring"
else:
return f"Bulk capture status: Unknown state"
class AudioCaptureStatus(IntEnum):
Unknown = -1
Stop = 0
Running = 1
def __str__(self):
if self.value == AudioCaptureStatus.Unknown:
return f"Audio capture status: {self.value}"
elif self.value == AudioCaptureStatus.Stop:
return f"Audio capture status: is not working"
elif self.value == AudioCaptureStatus.Running:
return f"Audio capture status: working"
else:
return f"Video capture status: Unknown state"
class VideoCaptureStatus(IntEnum):
Unknown = -1
Idle = 0 # Doing nothing
Capturing = 1 # Capturing in progress
Transferring = 2 # Transferring in progress
LiveModeActive = 3 # Live mode active
Malfunction = 4 # Malfunction (requires restart)
Done = 7 # Capturing and transferring done
def __str__(self):
if self.value == VideoCaptureStatus.Unknown:
return f"Video capture status: {self.value}"
elif self.value == VideoCaptureStatus.Idle:
return f"Video capture status: Doing nothing"
elif self.value == VideoCaptureStatus.Capturing:
return f"Video capture status: Capturing in progress"
elif self.value == VideoCaptureStatus.Transferring:
return f"Video capture status: Transferring in progress"
elif self.value == VideoCaptureStatus.LiveModeActive:
return f"Video capture status: Live mode active"
elif self.value == VideoCaptureStatus.Malfunction:
return f"Video capture status: Malfunction (requires restart)"
elif self.value == VideoCaptureStatus.Done:
return f"Video capture status: Capturing and transferring done"
else:
return f"Video capture status: Unknown state"
class EventCaptureStatus(IntEnum):
Unknown = -1
Stop = 0
Running = 1
Invalid = 0xFF
def __str__(self):
if self.value == EventCaptureStatus.Unknown:
return f"Event capture status: {self.value}"
elif self.value == EventCaptureStatus.Stop:
return f"Event capture status: is not working"
elif self.value == EventCaptureStatus.Running:
return f"Event capture status: working"
else:
return f"Video capture status: Unknown state"