using VisionCommon;
using System;
using System.Collections.Generic;
namespace VisionCalibrator {
///
/// 켈리브레이터를 관리하는 매니저
///
public static class CalibratorManager {
private static object _lock = new object();
private static Dictionary _calibrators = new Dictionary();
///
/// 켈리브레이터를 Set한다.
///
/// FovInfo
/// Calibrator
public static void SetCalibrator(FovInfo fovInfo, Calibrator calibrationAgent) {
lock (_lock) {
if (!_calibrators.ContainsKey(fovInfo)) {
_calibrators.Add(fovInfo, calibrationAgent);
if (CalAdapter.Instance.CalManager == null) {
CalAdapter.Instance.CalManager = new CalManager();
}
}
}
}
[Obsolete]
public static Calibrator GetCalibrator(SubSysInfo subSysInfo, eFovId fovId) {
return GetCalibrator(new FovInfo(subSysInfo, fovId, string.Empty));
}
///
/// 켈리브레이터를 Get한다.
///
/// FovInfo
/// Calibrator
public static Calibrator GetCalibrator(FovInfo fovInfo) {
lock (_lock) {
if (_calibrators.ContainsKey(fovInfo)) {
return _calibrators[fovInfo];
}
}
return null;
}
///
/// 모든 켈리브레이터를 Get한다.
///
/// 캘리브레이터 딕셔너리
public static Dictionary GetCalibrators() {
lock (_lock) {
return new Dictionary(_calibrators);
}
}
}
}