54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
/*
|
|
* Copyright (c) 2025 LG Electronics Inc.
|
|
* SPDX-License-Identifier: LicenseRef-LGE-Proprietary
|
|
*/
|
|
using Aurora.Api;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace VisionCommon {
|
|
public class CameraDisplayManager {
|
|
private static Logger _Logger = new Logger(typeof(CameraDisplayManager).Name);
|
|
private static readonly object _Lock = new object();
|
|
|
|
private static Dictionary<eDisplayType, Dictionary<FovInfo, ICameraDisplay>> _CameraDisplays =
|
|
new Dictionary<eDisplayType, Dictionary<FovInfo, ICameraDisplay>>();
|
|
|
|
public static void SetDisplay(
|
|
eDisplayType displayType,
|
|
FovInfo fovInfo,
|
|
ICameraDisplay cameraDisplay) {
|
|
|
|
try {
|
|
if (!_CameraDisplays.ContainsKey(displayType)) {
|
|
_CameraDisplays.Add(displayType, new Dictionary<FovInfo, ICameraDisplay>());
|
|
}
|
|
|
|
lock (_Lock) {
|
|
_CameraDisplays[displayType][fovInfo] = cameraDisplay;
|
|
}
|
|
}
|
|
catch (Exception e) {
|
|
_Logger.FuncE(e.Message);
|
|
}
|
|
}
|
|
|
|
public static ICameraDisplay GetDisplay(
|
|
FovInfo fovInfo,
|
|
eDisplayType displayType = eDisplayType.Main_1) {
|
|
|
|
try {
|
|
if (_CameraDisplays.ContainsKey(displayType)) {
|
|
if (_CameraDisplays[displayType].ContainsKey(fovInfo)) {
|
|
return _CameraDisplays[displayType][fovInfo];
|
|
}
|
|
}
|
|
}
|
|
catch (Exception e) {
|
|
_Logger.FuncE(e.Message);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
} |