54 lines
2.0 KiB
C#
54 lines
2.0 KiB
C#
/*
|
|
* Copyright (c) 2025 LG Electronics Inc.
|
|
* SPDX-License-Identifier: LicenseRef-LGE-Proprietary
|
|
*/
|
|
using Aurora.Api;
|
|
using VisionCommon;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Windows;
|
|
|
|
namespace VisionCommon {
|
|
public class FovCameraViewWindowParam {
|
|
public FovInfo fovInfo { get; set; }
|
|
public eDisplayType displayType { get; set; }
|
|
}
|
|
public class CamViewWindowUtil {
|
|
public static Dictionary<eFovUiPos, bool> _IsFovCamViewWindowActivateds = new Dictionary<eFovUiPos, bool>();
|
|
|
|
public static void SetFovCamViewWindowActivated(FovInfo fovInfo, eDisplayType displayType, bool isActivated) {
|
|
var fovRecipe = VisionRecipeManager.GetFovRecipe(fovInfo);
|
|
var fovUiPos = VisionRecipeManager.GetFovUiPos(fovRecipe, displayType);
|
|
|
|
if (!_IsFovCamViewWindowActivateds.ContainsKey(fovUiPos)) {
|
|
_IsFovCamViewWindowActivateds.Add(fovUiPos, isActivated);
|
|
}
|
|
else {
|
|
_IsFovCamViewWindowActivateds[fovUiPos] = isActivated;
|
|
}
|
|
}
|
|
|
|
public static bool IsFovCamViewWindowActivated(FovInfo fovInfo, eDisplayType displayType) {
|
|
var fovRecipe = VisionRecipeManager.GetFovRecipe(fovInfo);
|
|
var fovUiPos = VisionRecipeManager.GetFovUiPos(fovRecipe, displayType);
|
|
|
|
if (_IsFovCamViewWindowActivateds.ContainsKey(fovUiPos)) {
|
|
return _IsFovCamViewWindowActivateds[fovUiPos];
|
|
}
|
|
else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static string GetFovCamViewWindowTitle(FovInfo fovInfo, eDisplayType displayType) {
|
|
var fovRecipe = VisionRecipeManager.GetFovRecipe(fovInfo);
|
|
var fovUiPos = VisionRecipeManager.GetFovUiPos(fovRecipe, displayType);
|
|
|
|
if (IsFovCamViewWindowActivated(fovInfo, displayType)) {
|
|
return VisionKeys.Title_FovCameraViewWindow + " " + $"[{fovUiPos}]";
|
|
}
|
|
return VisionKeys.Title_FovCameraViewWindow;
|
|
}
|
|
}
|
|
} |