Zixuan 1 week ago
parent
commit
9592a1c546

+ 0 - 29
Data_ViewModel/GlobalData/DeviceCollection.cs

@@ -9,33 +9,4 @@ public partial class DeviceCollection : ObservableObject
     public ObservableDictionary<Guid, DeviceInfo_VM> DeviceList { get; } = [];
 }
 
-public partial class DeviceInfo_VM : ObservableObject
-{
-    [ObservableProperty]
-    private DeviceModel _DeviceModel;
-    [ObservableProperty]
-    private string? _DeviceSubModel;
-    [ObservableProperty]
-    private string? _DeviceName;
-    [ObservableProperty]
-    private string? _Position;
-    [ObservableProperty]
-    private string? _SoftwareVersion;
-    [ObservableProperty]
-    private Guid? _Guid;
-    [ObservableProperty]
-    private string? _IP;
-    [ObservableProperty]
-    private ushort _Port;
-    [ObservableProperty]
-    private string? _DBConnectionString;
-
-    [ObservableProperty]
-    private bool _ConfigUpdating;
 
-    [ObservableProperty]
-    private DateTime _UpdateTime;
-
-    [ObservableProperty]
-    private bool _IsConnected;
-}

+ 92 - 0
Data_ViewModel/GlobalData/DeviceData.cs

@@ -0,0 +1,92 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+
+namespace GlobalData;
+
+public partial class DeviceData_VM : ObservableObject
+{
+    public Guid DeviceId { get; set; }
+
+    [ObservableProperty]
+    private DeviceStatus _DeviceStatus;
+
+    [ObservableProperty]
+    private PMCMode _PMCMode;
+
+    [ObservableProperty]
+    private RecipeInfo_VM? _RecipeInfo;
+}
+
+
+public enum PMCMode
+{
+    Undefined,
+}
+
+public enum DeviceStatus
+{
+    Init = 0,
+    Initializing,
+    Idle,
+    Transfer,
+    AutoRinning,
+    AutoIdel = 5,
+    ReturnAllWafer,
+    Error,
+    Loading,
+    Unloading,
+    ChargeProcessDischarging = 10,
+    LoadProcessStockering,
+    LoadProcessUnloading,
+    ReutrnWafer
+}
+
+public enum TubeStatus
+{
+    NotInstall,
+    NotConnected,
+    Init,
+    Idle,
+    Homing,
+    OpenSlitValve,
+    CloseSlitValve,
+    Error,
+    PrepareTransfer,
+    PostTransfer,
+    PreProcess,
+    PostProcess,
+    Process,
+    LeakCheck,
+    MFCCali,
+    Pauded,
+    InTransfer
+}
+
+public partial class Alarm_VM : ObservableObject
+{
+    public Guid DeviceId { get; set; }
+
+    [ObservableProperty]
+    private DateTime _AlarmTime;
+    [ObservableProperty]
+    private string? _AlarmName;
+}
+
+public partial class RecipeInfo_VM : ObservableObject
+{
+    public Guid DeviceId { get; set; }
+
+    [ObservableProperty]
+    private string? _CurrentStepName;
+    [ObservableProperty]
+    private string? _NextStepName;
+
+    [ObservableProperty]
+    private TimeSpan? _CurrentStepRemainTime;
+    [ObservableProperty]
+    private TimeSpan? _CurrentStepTotalTime;
+
+    [ObservableProperty]
+    private TimeSpan? _TotalTime;
+    [ObservableProperty]
+    private TimeSpan? _TotalRemainTime;
+}

+ 35 - 0
Data_ViewModel/GlobalData/DeviceInfo.cs

@@ -0,0 +1,35 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+using GeneralData;
+
+namespace GlobalData;
+
+public partial class DeviceInfo_VM : ObservableObject
+{
+    [ObservableProperty]
+    private DeviceModel _DeviceModel;
+    [ObservableProperty]
+    private string? _DeviceSubModel;
+    [ObservableProperty]
+    private string? _DeviceName;
+    [ObservableProperty]
+    private string? _Position;
+    [ObservableProperty]
+    private string? _SoftwareVersion;
+    [ObservableProperty]
+    private Guid? _Guid;
+    [ObservableProperty]
+    private string? _IP;
+    [ObservableProperty]
+    private ushort _Port;
+    [ObservableProperty]
+    private string? _DBConnectionString;
+
+    [ObservableProperty]
+    private bool _ConfigUpdating;
+
+    [ObservableProperty]
+    private DateTime _UpdateTime;
+
+    [ObservableProperty]
+    private bool _IsConnected;
+}

+ 0 - 2
Module/DashBoard/DashBoardModule.cs

@@ -7,7 +7,6 @@ public class DashBoardModule : IModule
     {
         commonContainer.AddModule("DashBoard");
         ImageSource source = new BitmapImage(new Uri("/DashBoard;component/dashboard.png", UriKind.Relative));
-
         commonContainer.AddNavigation(new(4, "实时监控", "DashBoard", false, source));
     }
 
@@ -22,6 +21,5 @@ public class DashBoardModule : IModule
     void IModule.RegisterTypes(IContainerRegistry containerRegistry)
     {
         containerRegistry.RegisterForNavigation<DashBoardMain, DashBoardMainViewModel>("DashBoard");
-        //containerRegistry.RegisterDialog<EditDevice, EditDeviceViewModel>("EditDevice");
     }
 }

+ 2 - 2
Module/DashBoard/ViewModel/DashBoardMainViewModel.cs

@@ -9,6 +9,7 @@ internal partial class DashBoardMainViewModel : ObservableObject
         deviceCollection.DeviceList.CollectionChanged += DeviceList_CollectionChanged;
         this.DeviceList_CollectionChanged(deviceCollection.DeviceList, null);
     }
+
     private void DeviceList_CollectionChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs? e)
     {
         if (sender is not ObservableDictionary<Guid, DeviceInfo_VM> deviceList)
@@ -28,5 +29,4 @@ internal partial class DashBoardMainViewModel : ObservableObject
 
     [ObservableProperty]
     private ObservableDictionary<DeviceModel, ObservableCollection<DeviceInfo_VM>> _Devices = [];
-
-}
+}

+ 0 - 11
Module/DeviceScanner/ViewModels/ScannerViewModel.cs

@@ -4,14 +4,6 @@ public partial class ScannerViewModel : ObservableObject
 {
     public ScannerViewModel(DeviceCollection deviceCollection, IDialogService dialogService)
     {
-        this.DeviceInfo = new()
-        {
-            DeviceModel = DeviceModel.JetKepler,
-            DeviceSubModel = KeplerSubModel.JetKepler_2300.ToString(),
-            SoftwareVersion = "1.0.0.12",
-            IP = "192.168.250.122",
-            Port = 50003,
-        };
         this._DialogService = dialogService;
         this.ScanningDevices = [];
         this.EnableShader = false;
@@ -25,9 +17,6 @@ public partial class ScannerViewModel : ObservableObject
     private ObservableDictionary<string, DeviceInfo_VM> _ScanningDevices;
 
     [ObservableProperty]
-    private DeviceInfo_VM _DeviceInfo;
-
-    [ObservableProperty]
     private bool _EnableShader;
 
     [ObservableProperty]

+ 2 - 2
UICommon/CommonContainer/ContainerInfo.cs

@@ -1,9 +1,9 @@
 namespace UICommon.CommonContainer;
 
-public class ContainerInfo(int index, string name, string moduleName, bool isDefault, ImageSource imageSource, bool isHidden = false)
+public class ContainerInfo(int index, string? name, string moduleName, bool isDefault, ImageSource imageSource, bool isHidden = false)
 {
     public int Index { get; } = index;
-    public string Name { get; } = name;
+    public string? Name { get; } = name;
     public string ModuleName { get; } = moduleName;
     public bool IsDefault { get; } = isDefault;
     public ImageSource Icon { get; } = imageSource;