2026-01-26 18:56:53 +09:00

65 lines
2.8 KiB
C#

/*
* Copyright (c) 2025 LG Electronics Inc.
* SPDX-License-Identifier: LicenseRef-LGE-Proprietary
*/
using Aurora;
using Aurora.View;
using DevExpress.Office.Utils;
using Hermes.Functional;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VisionCommon;
namespace VisionUI.RecipeMenu {
/// <summary>
/// 비전 레시피 메뉴 뷰 모델 베이스(생성자)
/// </summary>
public partial class UCVisionRecipeMenuViewModelBase {
#region constructor
public UCVisionRecipeMenuViewModelBase(IAuroraEnvironment aurora, bool onlyPropertyGrid = false) {
_Aurora = aurora;
CMD_OpenPropertyGrid = new DelegateCommand(OpenPropertyGrid);
CMD_AddUnit = new DelegateCommand(AddUnit);
CMD_DeleteUnit = new DelegateCommand(DeleteUnit);
CMD_AddSubSysRecipe = new DelegateCommand(AddSubSysRecipe);
CMD_DeleteSubSysRecipe = new DelegateCommand(DeleteSubSysRecipe);
CMD_AddRecipe = new DelegateCommand(AddRecipe);
UnitIdList = Enum.GetValues(typeof(eUnitId)).Cast<eUnitId>().ToList();
SubSysIdList = Enum.GetValues(typeof(eSubSysId)).Cast<eSubSysId>().ToList();
SubSysTypeList = Enum.GetValues(typeof(eSubSysType)).Cast<eSubSysType>().ToList();
FovIdList = Enum.GetValues(typeof(eFovId)).Cast<eFovId>().ToList();
FovUiPosList = Enum.GetValues(typeof(eFovUiPos)).Cast<eFovUiPos>().ToList();
CamIdList = Enum.GetValues(typeof(eCamId)).Cast<eCamId>().ToList();
LightIdList = Enum.GetValues(typeof(eLightId)).Cast<eLightId>().ToList();
DirectionList = Enum.GetValues(typeof(eDirection)).Cast<eDirection>().ToList();
DisplayTypeList = Enum.GetValues(typeof(eDisplayType)).Cast<eDisplayType>().ToList();
SubsystemPropertyNameList = new List<string>();
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(typeof(SubSysRecipe))) {
if (property.Attributes.Contains(BrowsableAttribute.No)) {
//continue; // Skip properties where Browsable is false
}
if (property.Name != "SubSysId" && property.Name != "SubSysName" && property.Name != "SubSysType" && property.Name != "CoordConvRecipe" && property.Name != "TeachingDirectorRecipe" && property.Name != "AlignDirectorRecipe" && property.Name != "CalRecipe" && property.Name != "LayoutRecipe") {
SubsystemPropertyNameList.Add(property.Name);
}
}
SubsystemPropertyNameList.Add("Layout");
// Selected.cs
OnlyPropertyGrid = onlyPropertyGrid;
CMD_SelectProperty = new DelegateCommand(SelectProperty);
}
#endregion
}
}