更新
This commit is contained in:
@@ -20,6 +20,18 @@ namespace TabletTester2025
|
||||
{
|
||||
await LoadHardnessPressureAsync();
|
||||
await LoadHardnessDamageThresholdAsync();
|
||||
|
||||
// 脆碎度
|
||||
await LoadPlcIntToTextBoxAsync(ResolveFriabilityRoundsRegister(), FriabilityRoundsBox);
|
||||
|
||||
// 崩解
|
||||
await LoadPlcFloatToTextBoxAsync(ResolveDisintegrationSpeedRegister(), DisintegrationSpeedBox);
|
||||
|
||||
// 溶出度
|
||||
await LoadPlcIntToTextBoxAsync(ResolveDissolution1TimeRegister(), Dissolution1TimeBox);
|
||||
await LoadPlcIntToTextBoxAsync(ResolveDissolution2TimeRegister(), Dissolution2TimeBox);
|
||||
await LoadPlcIntToTextBoxAsync(ResolveDissolution1IntervalRegister(), Dissolution1IntervalBox);
|
||||
await LoadPlcIntToTextBoxAsync(ResolveDissolution2IntervalRegister(), Dissolution2IntervalBox);
|
||||
}
|
||||
|
||||
private void LoadSettings()
|
||||
@@ -239,6 +251,64 @@ namespace TabletTester2025
|
||||
return App.PlcConfig.HardnessPoSun != 0 ? App.PlcConfig.HardnessPoSun : (ushort)400;
|
||||
}
|
||||
|
||||
private async Task LoadPlcFloatToTextBoxAsync(ushort address, TextBox textBox)
|
||||
{
|
||||
if (address == 0) return;
|
||||
try
|
||||
{
|
||||
float value = await App.PlcService.ReadFloatAsync(address);
|
||||
if (float.IsFinite(value))
|
||||
textBox.Text = value.ToString("0.###");
|
||||
}
|
||||
catch { textBox.Text = ""; }
|
||||
}
|
||||
|
||||
private async Task LoadPlcIntToTextBoxAsync(ushort address, TextBox textBox)
|
||||
{
|
||||
if (address == 0) return;
|
||||
try
|
||||
{
|
||||
int value = await App.PlcService.ReadIntAsync(address);
|
||||
if (value >= 0)
|
||||
textBox.Text = value.ToString();
|
||||
}
|
||||
catch { textBox.Text = ""; }
|
||||
}
|
||||
|
||||
private static ushort ResolveFriabilityRoundsRegister()
|
||||
{
|
||||
if (App.PlcConfig.FriabilityRounds != 0)
|
||||
return App.PlcConfig.FriabilityRounds;
|
||||
if (App.PlcConfig.FriabilityRoundsBox != 0)
|
||||
return App.PlcConfig.FriabilityRoundsBox;
|
||||
return App.PlcConfig.FriabilityTestTime != 0 ? App.PlcConfig.FriabilityTestTime : (ushort)410;
|
||||
}
|
||||
|
||||
private static ushort ResolveDisintegrationSpeedRegister()
|
||||
{
|
||||
return App.PlcConfig.DisintegrationSpeed != 0 ? App.PlcConfig.DisintegrationSpeed : (ushort)330;
|
||||
}
|
||||
|
||||
private static ushort ResolveDissolution1TimeRegister()
|
||||
{
|
||||
return App.PlcConfig.Dissolution1Time != 0 ? App.PlcConfig.Dissolution1Time : (ushort)430;
|
||||
}
|
||||
|
||||
private static ushort ResolveDissolution2TimeRegister()
|
||||
{
|
||||
return App.PlcConfig.Dissolution2Time != 0 ? App.PlcConfig.Dissolution2Time : (ushort)440;
|
||||
}
|
||||
|
||||
private static ushort ResolveDissolution1IntervalRegister()
|
||||
{
|
||||
return App.PlcConfig.Dissolution1SampleInterval != 0 ? App.PlcConfig.Dissolution1SampleInterval : (ushort)432;
|
||||
}
|
||||
|
||||
private static ushort ResolveDissolution2IntervalRegister()
|
||||
{
|
||||
return App.PlcConfig.Dissolution2SampleInterval != 0 ? App.PlcConfig.Dissolution2SampleInterval : (ushort)442;
|
||||
}
|
||||
|
||||
private static double ResolveFriabilityTargetTimeMin(PharmaParameters p)
|
||||
{
|
||||
if (p.FriabilityTargetTimeMin > 0)
|
||||
|
||||
Reference in New Issue
Block a user