62 lines
2.1 KiB
C#
62 lines
2.1 KiB
C#
/*
|
|
* Copyright (c) 2025 LG Electronics Inc.
|
|
* SPDX-License-Identifier: LicenseRef-LGE-Proprietary
|
|
*/
|
|
using Aurora;
|
|
using Aurora.Api;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using VisionCommon;
|
|
|
|
namespace VisionUI.RecipeMenu {
|
|
/// <summary>
|
|
/// VisionDef Ingredient 사용
|
|
/// </summary>
|
|
public class UCVisionRecipeMenuIngredient : UCVisionRecipeMenuViewModelBase, IIngredientViewModel {
|
|
/// <summary>
|
|
/// 생성자
|
|
/// </summary>
|
|
/// <param name="aurora">오로라 환경</param>
|
|
/// <param name="onlyPropertyGrid">프로퍼티 그리드만 사용할지 여부</param>
|
|
public UCVisionRecipeMenuIngredient(IAuroraEnvironment aurora, bool onlyPropertyGrid = false) : base(aurora, onlyPropertyGrid) {
|
|
|
|
}
|
|
|
|
#region IModelViewModel Interface
|
|
public bool IsIngredientInUse(string itemName) {
|
|
return false;
|
|
}
|
|
|
|
public void OnChanged(string itemName) {
|
|
_Aurora.IngredientsManager.Ingredient(VisionKeys.VisionRecipeKey).ReloadIngredient(itemName);
|
|
SelectedVisionDef = _Aurora.IngredientsManager.Ingredient(VisionKeys.VisionRecipeKey).IngredientItem(itemName) as VisionDef;
|
|
ShowInitZeroIndexValue();
|
|
}
|
|
|
|
public void OnSaved(string itemName) {
|
|
}
|
|
|
|
public bool PreSaved(string itemName) {
|
|
foreach (var unitRecipe in SelectedVisionDef.UnitRecipes) {
|
|
foreach (var subSysRecipe in unitRecipe.SubSysRecipes) {
|
|
CalculateCoordSystem(subSysRecipe);
|
|
}
|
|
}
|
|
if (StaticCoordSettingVM != null) {
|
|
return StaticCoordSettingVM.SaveRecipe();
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public void Reloaded(string itemName) {
|
|
_Aurora.IngredientsManager.Ingredient(VisionKeys.VisionRecipeKey).ReloadIngredient(itemName);
|
|
SelectedVisionDef = _Aurora.IngredientsManager.Ingredient(VisionKeys.VisionRecipeKey).IngredientItem(itemName) as VisionDef;
|
|
ShowInitZeroIndexValue();
|
|
}
|
|
#endregion
|
|
}
|
|
}
|