40 lines
1.3 KiB
C#
Raw Normal View History

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