using Aurora;
using System.Reactive.Linq;
using System;
using System.Windows;
using Aurora.Api;
using System.Collections.ObjectModel;
using System.Windows.Input;
using Aurora.View;
using VisionCommon;
using VisionSequence.Setup;
using VisionCommonUI;
using VisionCommonUI.Resources;
using Aurora.Util.HislogPlus;
using System.Collections.Generic;
namespace VisionUI.Setup {
///
/// 오토 포커스 뷰 모델
///
public class AutoFocusViewModel : Aurora.View.NotifyPropertyChangedBase, IUpdateRecipe {
private Logger _Logger;
private ISequence _Seq;
private FovInfo _FovInfo;
private FovRecipe _FovRecipe;
private CsvManager _CsvManager = new CsvManager();
#region Binding Properties
/// 오토포커스 로그 아이템 컬렉션
public ObservableCollection AutoFocusLogItems { get; set; } = new ObservableCollection();
/// 오토포커스 로그 아이템 컬렉션(Roughly)
public ObservableCollection AutoFocusLogItems_Roughly { get; set; } = new ObservableCollection();
/// 오토포커스 로그 아이템 컬렉션(Delicately)
public ObservableCollection AutoFocusLogItems_Delicately { get; set; } = new ObservableCollection();
private AutoFocusRecipe _AutoFocusRecipe;
/// 오토포커스 레시피
public AutoFocusRecipe AutoFocusRecipe { get => _AutoFocusRecipe; set => SetProperty(ref _AutoFocusRecipe, value); }
private DateTime selectedDate;
/// 선택된 날짜
public DateTime SelectedDate { get => selectedDate; set { SetProperty(ref selectedDate, value); CalendarChanged(value); } }
#endregion
#region Button Commands
public ICommand ButtonCommandSetFindRoi { get; set; }
public ICommand ButtonCommandStart { get; set; }
public ICommand ButtonCommandCancel { get; set; }
public ICommand ButtonCommandSaveParams { get; set; }
#endregion
///
/// 생성자
///
/// Fov 정보
public AutoFocusViewModel(FovInfo fovInfo) {
_FovInfo = fovInfo;
_FovRecipe = VisionRecipeManager.GetFovRecipe(_FovInfo);
_Logger = new Logger(string.Format("AutoFocusViewModel[{0}]", fovInfo.SubSysName));
ButtonCommandSetFindRoi = new DelegateCommand(new Action