|
@@ -25,13 +25,13 @@ public partial class WorkAreaViewModel : ObservableObject, IDisposable
|
|
|
|
|
|
#region ObservableProperty
|
|
|
[ObservableProperty]
|
|
|
- private bool _isConnected=false;
|
|
|
+ private bool _isConnected = false;
|
|
|
|
|
|
[ObservableProperty]
|
|
|
private string _readSymbolName = string.Empty;
|
|
|
|
|
|
[ObservableProperty]
|
|
|
- private string _readValue=string.Empty;
|
|
|
+ private string _readValue = string.Empty;
|
|
|
|
|
|
[ObservableProperty]
|
|
|
private string _readValueType = string.Empty;
|
|
@@ -49,7 +49,7 @@ public partial class WorkAreaViewModel : ObservableObject, IDisposable
|
|
|
private int _dataTypeId = -1;
|
|
|
#endregion
|
|
|
|
|
|
- public WorkAreaViewModel(ILogService logService,IClientService clientService)
|
|
|
+ public WorkAreaViewModel(ILogService logService, IClientService clientService)
|
|
|
{
|
|
|
_logService = logService;
|
|
|
_clientService = clientService;
|
|
@@ -77,6 +77,12 @@ public partial class WorkAreaViewModel : ObservableObject, IDisposable
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
+ if (DataTypeId < 0 || string.IsNullOrWhiteSpace(WriteValue))
|
|
|
+ {
|
|
|
+ _logService.Warning($"Input parameters before writing");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
var dataType = (DataType)DataTypeId;
|
|
|
object value = dataType switch
|
|
|
{
|