|
@@ -11,7 +11,7 @@ import {
|
|
|
GeneratorStatus,
|
|
GeneratorStatus,
|
|
|
} from '@/states/exam/deviceAreaSlice';
|
|
} from '@/states/exam/deviceAreaSlice';
|
|
|
import triggerInspection from '../../API/exam/triggerInspection';
|
|
import triggerInspection from '../../API/exam/triggerInspection';
|
|
|
-
|
|
|
|
|
|
|
+import { SYSTEM_MODE_OPTIONS } from '@/domain/systemModel';
|
|
|
const DeviceArea = ({ className }: { className?: string }) => {
|
|
const DeviceArea = ({ className }: { className?: string }) => {
|
|
|
const generatorStatus = useSelector(
|
|
const generatorStatus = useSelector(
|
|
|
(state: RootState) => state.deviceArea.generatorStatus
|
|
(state: RootState) => state.deviceArea.generatorStatus
|
|
@@ -32,7 +32,10 @@ const DeviceArea = ({ className }: { className?: string }) => {
|
|
|
|
|
|
|
|
// 读取 FPD 状态,判断是否为模拟器模式
|
|
// 读取 FPD 状态,判断是否为模拟器模式
|
|
|
const fpd = useSelector((state: RootState) => state.product.fpd);
|
|
const fpd = useSelector((state: RootState) => state.product.fpd);
|
|
|
- const isSimulator = fpd === 'Simulator';
|
|
|
|
|
|
|
+ const gen = useSelector((state: RootState) => state.product.gen);
|
|
|
|
|
+ const systemMode = SYSTEM_MODE_OPTIONS.find(
|
|
|
|
|
+ (option) => option.gen === gen && option.fpd === fpd
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
const btnStyle = { width: '1.5rem', height: '1.5rem' };
|
|
const btnStyle = { width: '1.5rem', height: '1.5rem' };
|
|
|
const classValue = 'mr-1';
|
|
const classValue = 'mr-1';
|
|
@@ -44,23 +47,22 @@ const DeviceArea = ({ className }: { className?: string }) => {
|
|
|
className={classValue}
|
|
className={classValue}
|
|
|
icon={
|
|
icon={
|
|
|
<ToolOutlined
|
|
<ToolOutlined
|
|
|
- className={
|
|
|
|
|
- generatorReady ? 'text-green-500' : 'text-yellow-500'
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ className={generatorReady ? 'text-green-500' : 'text-yellow-500'}
|
|
|
/>
|
|
/>
|
|
|
}
|
|
}
|
|
|
title={`手闸状态指示器: ${generatorStatus}`}
|
|
title={`手闸状态指示器: ${generatorStatus}`}
|
|
|
/>
|
|
/>
|
|
|
- <Badge count={isSimulator ? 'S' : 'R'} offset={[-15, 10]} color="orange">
|
|
|
|
|
|
|
+ <Badge count={systemMode?.value} offset={[-15, 10]} color="orange">
|
|
|
<Button
|
|
<Button
|
|
|
style={btnStyle}
|
|
style={btnStyle}
|
|
|
data-testid="device-all-ready"
|
|
data-testid="device-all-ready"
|
|
|
- className={`${classValue} ${exposureStatus === 'ready'
|
|
|
|
|
|
|
+ className={`${classValue} ${
|
|
|
|
|
+ exposureStatus === 'ready'
|
|
|
? 'text-green-500'
|
|
? 'text-green-500'
|
|
|
: exposureStatus === 'not_ready'
|
|
: exposureStatus === 'not_ready'
|
|
|
? ''
|
|
? ''
|
|
|
: ''
|
|
: ''
|
|
|
- }`}
|
|
|
|
|
|
|
+ }`}
|
|
|
icon={
|
|
icon={
|
|
|
<CameraOutlined
|
|
<CameraOutlined
|
|
|
// className={
|
|
// className={
|
|
@@ -73,7 +75,7 @@ const DeviceArea = ({ className }: { className?: string }) => {
|
|
|
/>
|
|
/>
|
|
|
}
|
|
}
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
- if (!isSimulator) {
|
|
|
|
|
|
|
+ if (systemMode?.value === 'R') {
|
|
|
// 真实环境下禁止点击
|
|
// 真实环境下禁止点击
|
|
|
console.warn('真实环境下,曝光操作需要通过硬件触发');
|
|
console.warn('真实环境下,曝光操作需要通过硬件触发');
|
|
|
return;
|
|
return;
|
|
@@ -81,19 +83,20 @@ const DeviceArea = ({ className }: { className?: string }) => {
|
|
|
// 模拟环境下允许点击
|
|
// 模拟环境下允许点击
|
|
|
triggerInspection();
|
|
triggerInspection();
|
|
|
}}
|
|
}}
|
|
|
- title={`曝光指示器: ${exposureStatus}${isSimulator ? ' (模拟模式)' : ' (真实模式)'}`}
|
|
|
|
|
|
|
+ title={`曝光指示器: ${exposureStatus}${systemMode?.desc}`}
|
|
|
/>
|
|
/>
|
|
|
</Badge>
|
|
</Badge>
|
|
|
<Button
|
|
<Button
|
|
|
style={btnStyle}
|
|
style={btnStyle}
|
|
|
- className={`${classValue} ${tabletStatus === 'exposing'
|
|
|
|
|
|
|
+ className={`${classValue} ${
|
|
|
|
|
+ tabletStatus === 'exposing'
|
|
|
? 'text-yellow-500'
|
|
? 'text-yellow-500'
|
|
|
: tabletStatus === 'ready'
|
|
: tabletStatus === 'ready'
|
|
|
? 'text-green-500'
|
|
? 'text-green-500'
|
|
|
: tabletStatus === 'error'
|
|
: tabletStatus === 'error'
|
|
|
? 'text-red-500'
|
|
? 'text-red-500'
|
|
|
: ''
|
|
: ''
|
|
|
- }`}
|
|
|
|
|
|
|
+ }`}
|
|
|
icon={
|
|
icon={
|
|
|
<TabletOutlined
|
|
<TabletOutlined
|
|
|
// className={
|
|
// className={
|