|
@@ -18,7 +18,6 @@ public partial class MainWindowViewModel : ObservableObject
|
|
private readonly string _settingsFolder = $"{Environment.CurrentDirectory}/Settings";
|
|
private readonly string _settingsFolder = $"{Environment.CurrentDirectory}/Settings";
|
|
private readonly string _ipAddressFileName = "IpAddressInformation.json";
|
|
private readonly string _ipAddressFileName = "IpAddressInformation.json";
|
|
private readonly string _deviceInfoFileName = "DeviceInformation.json";
|
|
private readonly string _deviceInfoFileName = "DeviceInformation.json";
|
|
- private bool _isInitialized = false;
|
|
|
|
|
|
|
|
[ObservableProperty]
|
|
[ObservableProperty]
|
|
private string _ipAddress = string.Empty;
|
|
private string _ipAddress = string.Empty;
|
|
@@ -152,13 +151,14 @@ public partial class MainWindowViewModel : ObservableObject
|
|
try
|
|
try
|
|
{
|
|
{
|
|
_ = Enum.TryParse<DeviceModel>(DeviceModel, out var deviceModel);
|
|
_ = Enum.TryParse<DeviceModel>(DeviceModel, out var deviceModel);
|
|
|
|
+ var rst=Guid.TryParse(GuidStr, out var guidRst);
|
|
var deviceInfo = new Models.DeviceInfo
|
|
var deviceInfo = new Models.DeviceInfo
|
|
{
|
|
{
|
|
DeviceModel = deviceModel,
|
|
DeviceModel = deviceModel,
|
|
DeviceSubModel = DeviceSubModel,
|
|
DeviceSubModel = DeviceSubModel,
|
|
DeviceName = DeviceName,
|
|
DeviceName = DeviceName,
|
|
Position = Position,
|
|
Position = Position,
|
|
- Guid = _isInitialized ? Guid.Parse(GuidStr) : null,
|
|
|
|
|
|
+ Guid = rst ? guidRst : null,
|
|
SoftwareVersion = SoftwareVersion,
|
|
SoftwareVersion = SoftwareVersion,
|
|
DBConnectionString = DBConnectionString
|
|
DBConnectionString = DBConnectionString
|
|
};
|
|
};
|
|
@@ -217,8 +217,6 @@ public partial class MainWindowViewModel : ObservableObject
|
|
SoftwareVersion = deserializedDeviceInfo.SoftwareVersion ?? string.Empty;
|
|
SoftwareVersion = deserializedDeviceInfo.SoftwareVersion ?? string.Empty;
|
|
GuidStr = deserializedDeviceInfo.Guid.ToString() ?? string.Empty;
|
|
GuidStr = deserializedDeviceInfo.Guid.ToString() ?? string.Empty;
|
|
DBConnectionString = deserializedDeviceInfo.DBConnectionString ?? string.Empty;
|
|
DBConnectionString = deserializedDeviceInfo.DBConnectionString ?? string.Empty;
|
|
-
|
|
|
|
- _isInitialized = true;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|