2025-03-17 03:26:29 +08:00

40 lines
1.3 KiB
C#

using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using Seyounth.Hyosung.Data.Models;
using Seyounth.Hyosung.Data.Models.Plc;
using Seyounth.Hyosung.Data.Services;
using Seyounth.Hyosung.Runtime;
using Seyounth.Hyosung.Runtime.Models;
namespace Seyounth.Hyosung.ViewModels;
public partial class HomeViewModel : ObservableObject
{
[ObservableProperty] private StackStationModel _stack1;
[ObservableProperty] private StackStationModel _stack2;
[ObservableProperty] private ObservableCollection<Variety> _varieties;
[ObservableProperty] private List<string> _yarnCarTypes;
[ObservableProperty] private Variety _selectedVariety;
[ObservableProperty] private PackLineOption _packLineOption;
private readonly IHyosungRuntime _runtime;
public HomeViewModel(IVarietyService varietyService, IHyosungRuntime runtime)
{
PackLineOption = runtime.PackLineOption;
_runtime = runtime;
_stack1 = _runtime.Stack1;
_stack2 = _runtime.Stack2;
_yarnCarTypes = new List<string>();
_yarnCarTypes.Add("A");
_yarnCarTypes.Add("B");
_yarnCarTypes.Add("C");
_yarnCarTypes.Add("D");
_varieties = new ObservableCollection<Variety>(varietyService.GetAll());
}
}