| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using CommunityToolkit.Mvvm.ComponentModel;
- using CommunityToolkit.Mvvm.Input;
- using Device;
- using EEMSMain.Data;
- using GlobalData;
- using System.Net.NetworkInformation;
- using UICommon.CommonContainer;
- using UICommon.DataType;
- namespace EEMSMain.ViewModels;
- public partial class MainWindowViewModel : ObservableObject
- {
- public MainWindowViewModel(ICommonContainer commonContainer, DeviceCollection deviceCollection, ContainerManager containerManager)
- {
- this._commonContainer = commonContainer;
- this._deviceCollection = deviceCollection;
- this.ContainerManager = containerManager;
- //this.Containers = containerManager.Containers;
- FakeData();
- }
- void FakeData()
- {
- _deviceCollection.Devices ??= [];
- _deviceCollection.Devices[DeviceModel.JetKepler] = [];
- for (int i = 1; i <= 3; i++)
- {
- DeviceInfo device = new()
- {
- DeviceModel = DeviceModel.JetKepler,
- DeviceSubModel = "2200A",
- DeviceName = $"Device {i}",
- Position = $"position-{i}"
- };
- _deviceCollection.Devices[DeviceModel.JetKepler].Add(device);
- }
- _deviceCollection.Devices[DeviceModel.JetFurnace] = [];
- for (int i = 1; i <= 3; i++)
- {
- DeviceInfo device = new()
- {
- DeviceModel = DeviceModel.JetFurnace,
- DeviceSubModel = "ELK",
- DeviceName = $"Device {i}",
- Position = $"position-{i}"
- };
- _deviceCollection.Devices[DeviceModel.JetFurnace].Add(device);
- }
- }
- private readonly ICommonContainer _commonContainer;
- private readonly DeviceCollection _deviceCollection;
- public ContainerManager ContainerManager { get; set; }
- [ObservableProperty]
- private string? _CurrentModule;
- [RelayCommand]
- private void Open(ContainerInfo para)
- {
- try
- {
- _commonContainer.RequestNavigation(para.ModuleName);
- this.CurrentModule = para.Name;
- }
- catch
- {
- }
- }
- }
|