28 lines
893 B
TypeScript
28 lines
893 B
TypeScript
import type { ImageAnalyzeResult } from '@interfaces/prediction/PredictionInterface';
|
|
|
|
/**
|
|
* 항공탐색(유출유면적분석) → 유출유 확산예측 탭 간 데이터 전달용 모듈 레벨 시그널.
|
|
* registerMainTabSwitcher / navigateToTab 패턴과 동일한 방식으로 구현된다.
|
|
*/
|
|
|
|
interface PendingImageAnalysis extends ImageAnalyzeResult {
|
|
autoRun: boolean;
|
|
}
|
|
|
|
let _pending: PendingImageAnalysis | null = null;
|
|
|
|
/** 분석 결과를 시그널에 저장한다. navigateToTab 호출 직전에 사용한다. */
|
|
export function setPendingImageAnalysis(data: PendingImageAnalysis): void {
|
|
_pending = data;
|
|
}
|
|
|
|
/**
|
|
* 시그널에서 분석 결과를 꺼내고 초기화한다.
|
|
* OilSpillView 마운트 시 1회 호출한다.
|
|
*/
|
|
export function consumePendingImageAnalysis(): PendingImageAnalysis | null {
|
|
const value = _pending;
|
|
_pending = null;
|
|
return value;
|
|
}
|