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 {
///
/// 비전 레시피 메뉴 뷰 모델 베이스(생성자)
///
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().ToList();
SubSysIdList = Enum.GetValues(typeof(eSubSysId)).Cast().ToList();
SubSysTypeList = Enum.GetValues(typeof(eSubSysType)).Cast().ToList();
FovIdList = Enum.GetValues(typeof(eFovId)).Cast().ToList();
FovUiPosList = Enum.GetValues(typeof(eFovUiPos)).Cast().ToList();
CamIdList = Enum.GetValues(typeof(eCamId)).Cast().ToList();
LightIdList = Enum.GetValues(typeof(eLightId)).Cast().ToList();
DirectionList = Enum.GetValues(typeof(eDirection)).Cast().ToList();
DisplayTypeList = Enum.GetValues(typeof(eDisplayType)).Cast().ToList();
SubsystemPropertyNameList = new List();
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
}
}