|
@@ -1,63 +1,14 @@
|
|
|
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 partial class MainWindowViewModel(ICommonContainer commonContainer, ContainerManager containerManager) : 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; }
|
|
|
+ private readonly ICommonContainer _commonContainer = commonContainer;
|
|
|
+ public ContainerManager ContainerManager { get; } = containerManager;
|
|
|
|
|
|
[ObservableProperty]
|
|
|
private string? _CurrentModule;
|