2025-03-16 03:17:36 +08:00
|
|
|
|
using System.Windows;
|
2025-03-16 23:38:23 +08:00
|
|
|
|
using Seyounth.Hyosung.Data.Models;
|
|
|
|
|
using Seyounth.Hyosung.Data.Services;
|
|
|
|
|
using Seyounth.Hyosung.Runtime;
|
2025-03-16 03:17:36 +08:00
|
|
|
|
using Seyounth.Hyosung.ViewModels;
|
|
|
|
|
using Seyounth.Hyosung.Views.Pages;
|
|
|
|
|
|
|
|
|
|
namespace Seyounth.Hyosung.Views;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for MainWindow.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class MainWindow
|
|
|
|
|
{
|
|
|
|
|
public MainWindowViewModel ViewModel { get; }
|
|
|
|
|
|
2025-03-16 23:38:23 +08:00
|
|
|
|
private readonly IHyosungRuntime hyosungRuntime;
|
|
|
|
|
|
|
|
|
|
public MainWindow(MainWindowViewModel viewModel, VarietyPage varietyPage,IHyosungRuntime hyosung)
|
2025-03-16 03:17:36 +08:00
|
|
|
|
{
|
|
|
|
|
ViewModel = viewModel;
|
|
|
|
|
DataContext = this;
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
VarietyFrame.Content = varietyPage;
|
2025-03-16 23:38:23 +08:00
|
|
|
|
hyosungRuntime = hyosung;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async void Button_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var variety = VarietyCombox.SelectedItem as Variety;
|
|
|
|
|
variety.YarnCarSide = 1;
|
|
|
|
|
variety.YarnCarType = YarnCarCombox.SelectedIndex + 1;
|
|
|
|
|
await hyosungRuntime.SendVarietyToPlcAsync(variety);
|
2025-03-16 03:17:36 +08:00
|
|
|
|
}
|
|
|
|
|
}
|