|
|
@ -31,6 +31,7 @@ export default function Measure() { |
|
|
|
const measureState = useAppSelector((state) => state.measure); |
|
|
|
const contextState = useAppSelector((state) => state.context); |
|
|
|
const baseState = useAppSelector((state) => state.baseData); |
|
|
|
const device = useAppSelector((state) => state.context.device); |
|
|
|
const [railPickerVisible, setRailPickerVisible] = useState(false); |
|
|
|
const [railId, setRailId] = useState<(number | string | null)[]>([]); |
|
|
|
const canvasRef = useRef<MeasurementCanvasRef>(null); |
|
|
@ -54,6 +55,8 @@ export default function Measure() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 检查轨型有没有坐标,如果有,绘制轨型基准线,如果没,拉取再绘制其线
|
|
|
|
useEffect(() => { |
|
|
|
if (railId.length > 0) { |
|
|
@ -135,7 +138,22 @@ export default function Measure() { |
|
|
|
}; |
|
|
|
|
|
|
|
const [initStart, setInitStart] = useState(false); |
|
|
|
|
|
|
|
const [measurementCanvasKey, setMeasurementCanvasKey] = useState(0); |
|
|
|
|
|
|
|
|
|
|
|
const [state, setState] = useState({ |
|
|
|
left_ready: 'none', |
|
|
|
right_ready: 'none', |
|
|
|
left_begin: 'none', |
|
|
|
right_begin: 'none', |
|
|
|
left_end: 'none', |
|
|
|
right_end: 'none', |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const onStartClick = () => { |
|
|
|
setMeasurementCanvasKey(measurementCanvasKey+1) |
|
|
|
setshowCalibration(false); |
|
|
|
setShowMeasureFinish(false) |
|
|
|
dispatch(updateMeasureData([])); |
|
|
@ -201,14 +219,6 @@ export default function Measure() { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const [state, setState] = useState({ |
|
|
|
left_ready: 'none', |
|
|
|
right_ready: 'none', |
|
|
|
left_begin: 'none', |
|
|
|
right_begin: 'none', |
|
|
|
left_end: 'none', |
|
|
|
right_end: 'none', |
|
|
|
}); |
|
|
|
const [status, setStatus] = useState(0) |
|
|
|
useEffect(() => { |
|
|
|
console.log(measureState.taskState) |
|
|
@ -454,6 +464,7 @@ export default function Measure() { |
|
|
|
showCoordinates={false} |
|
|
|
showCalibration={showCalibration || showMeasureFinish} |
|
|
|
ref={canvasRef} |
|
|
|
key={measurementCanvasKey} |
|
|
|
/> |
|
|
|
|
|
|
|
{/**选择轨型区 */} |
|
|
|