添加S7后台服务和添加PLC所需要的属性
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using PMSWPF.Models;
|
||||
using S7.Net; // Add this using directive
|
||||
|
||||
namespace PMSWPF.ViewModels.Dialogs;
|
||||
|
||||
@@ -8,6 +9,13 @@ public partial class DeviceDialogViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private Device _device;
|
||||
partial void OnDeviceChanged(Device value)
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"Device ProtocolType changed to: {value.ProtocolType}");
|
||||
}
|
||||
}
|
||||
|
||||
[ObservableProperty] private string title ;
|
||||
[ObservableProperty] private string primaryButContent ;
|
||||
@@ -17,6 +25,9 @@ public partial class DeviceDialogViewModel : ObservableObject
|
||||
_device = device;
|
||||
}
|
||||
|
||||
// Add a property to expose CpuType enum values for ComboBox
|
||||
public Array CpuTypes => Enum.GetValues(typeof(CpuType));
|
||||
|
||||
|
||||
[RelayCommand]
|
||||
public void AddDevice()
|
||||
|
||||
Reference in New Issue
Block a user