更新
This commit is contained in:
@@ -854,7 +854,7 @@ namespace TabletTester2025.ViewModels
|
||||
if (_isLoadingDissolution1SampleInterval || _plcConfig.Dissolution1SampleInterval == 0 || value <= 0)
|
||||
return;
|
||||
|
||||
_ = WriteDissolutionFloatAsync(_plcConfig.Dissolution1SampleInterval, value);
|
||||
_ = WriteDissolutionSampleIntervalAsync(_plcConfig.Dissolution1SampleInterval, value);
|
||||
DissolutionSampleInterval = ToCompatibleSampleInterval(value);
|
||||
}
|
||||
|
||||
@@ -863,7 +863,7 @@ namespace TabletTester2025.ViewModels
|
||||
if (_isLoadingDissolution2SampleInterval || _plcConfig.Dissolution2SampleInterval == 0 || value <= 0)
|
||||
return;
|
||||
|
||||
_ = WriteDissolutionFloatAsync(_plcConfig.Dissolution2SampleInterval, value);
|
||||
_ = WriteDissolutionSampleIntervalAsync(_plcConfig.Dissolution2SampleInterval, value);
|
||||
}
|
||||
|
||||
private async Task LoadDissolutionTimesAsync()
|
||||
@@ -922,8 +922,8 @@ namespace TabletTester2025.ViewModels
|
||||
try
|
||||
{
|
||||
_isLoadingDissolution1SampleInterval = true;
|
||||
float value = await _plc.ReadFloatAsync(_plcConfig.Dissolution1SampleInterval);
|
||||
if (float.IsFinite(value) && value > 0)
|
||||
int value = await _plc.ReadIntAsync(_plcConfig.Dissolution1SampleInterval);
|
||||
if (value > 0)
|
||||
{
|
||||
Dissolution1SampleIntervalMin = value;
|
||||
DissolutionSampleInterval = ToCompatibleSampleInterval(value);
|
||||
@@ -941,8 +941,8 @@ namespace TabletTester2025.ViewModels
|
||||
try
|
||||
{
|
||||
_isLoadingDissolution2SampleInterval = true;
|
||||
float value = await _plc.ReadFloatAsync(_plcConfig.Dissolution2SampleInterval);
|
||||
if (float.IsFinite(value) && value > 0)
|
||||
int value = await _plc.ReadIntAsync(_plcConfig.Dissolution2SampleInterval);
|
||||
if (value > 0)
|
||||
Dissolution2SampleIntervalMin = value;
|
||||
}
|
||||
catch { }
|
||||
@@ -953,14 +953,14 @@ namespace TabletTester2025.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private async Task WriteDissolutionFloatAsync(ushort registerAddress, double value)
|
||||
private async Task WriteDissolutionSampleIntervalAsync(ushort registerAddress, double value)
|
||||
{
|
||||
if (registerAddress == 0 || value <= 0 || !double.IsFinite(value))
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
await _plc.WriteFloatAsync(registerAddress, (float)value);
|
||||
await _plc.WriteRegisterAsync(registerAddress, (ushort)Math.Clamp(ToCompatibleSampleInterval(value), 1, ushort.MaxValue));
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
@@ -1616,7 +1616,7 @@ namespace TabletTester2025.ViewModels
|
||||
_isDissolution1Running = true;
|
||||
DissolutionPlotModel.Title = "溶出曲线";
|
||||
await WriteDissolutionTimeAsync(_plcConfig.Dissolution1Time, Dissolution1TimeMin);
|
||||
await WriteDissolutionFloatAsync(_plcConfig.Dissolution1SampleInterval, Dissolution1SampleIntervalMin);
|
||||
await WriteDissolutionSampleIntervalAsync(_plcConfig.Dissolution1SampleInterval, Dissolution1SampleIntervalMin);
|
||||
await PulseCoilAsync(_plcConfig.Dissolution1StartCoil);
|
||||
}
|
||||
|
||||
@@ -1667,7 +1667,7 @@ namespace TabletTester2025.ViewModels
|
||||
_isDissolution2Running = true;
|
||||
DissolutionPlotModel.Title = "溶出曲线";
|
||||
await WriteDissolutionTimeAsync(_plcConfig.Dissolution2Time, Dissolution2TimeMin);
|
||||
await WriteDissolutionFloatAsync(_plcConfig.Dissolution2SampleInterval, Dissolution2SampleIntervalMin);
|
||||
await WriteDissolutionSampleIntervalAsync(_plcConfig.Dissolution2SampleInterval, Dissolution2SampleIntervalMin);
|
||||
await PulseCoilAsync(_plcConfig.Dissolution2StartCoil);
|
||||
}
|
||||
|
||||
|
||||
@@ -432,11 +432,11 @@
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ParamRow}">
|
||||
<TextBlock Text="溶出1间隔取样时间(min):" Style="{StaticResource ParamLabel}"/>
|
||||
<TextBlock Text="{Binding Dissolution1SampleIntervalMin, StringFormat=F1}" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Dissolution1SampleIntervalMin, StringFormat=F0}" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ParamRow}">
|
||||
<TextBlock Text="溶出2间隔取样时间(min):" Style="{StaticResource ParamLabel}"/>
|
||||
<TextBlock Text="{Binding Dissolution2SampleIntervalMin, StringFormat=F1}" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Dissolution2SampleIntervalMin, StringFormat=F0}" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ParamRow}">
|
||||
<TextBlock Text="30min最低溶出度Q(%):" Style="{StaticResource ParamLabel}"/>
|
||||
|
||||
@@ -178,11 +178,11 @@
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ParamRow}">
|
||||
<TextBlock Text="溶出1取样间隔(min):" Style="{StaticResource ParamLabel}"/>
|
||||
<TextBox x:Name="Dissolution1IntervalBox"/>
|
||||
<TextBox x:Name="Dissolution1IntervalBox" helpers:NumericInput.AllowDecimal="False"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ParamRow}">
|
||||
<TextBlock Text="溶出2取样间隔(min):" Style="{StaticResource ParamLabel}"/>
|
||||
<TextBox x:Name="Dissolution2IntervalBox"/>
|
||||
<TextBox x:Name="Dissolution2IntervalBox" helpers:NumericInput.AllowDecimal="False"/>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
<StackPanel Style="{StaticResource ParamRow}" Margin="0,8,0,0">
|
||||
|
||||
@@ -68,8 +68,8 @@ namespace TabletTester2025
|
||||
p.DissolutionTemperatureC = ParseFiniteDouble(DissolutionTempBox.Text, "溶出介质温度");
|
||||
p.Dissolution1TimeMin = int.Parse(Dissolution1TimeBox.Text);
|
||||
p.Dissolution2TimeMin = int.Parse(Dissolution2TimeBox.Text);
|
||||
p.Dissolution1SampleIntervalMin = ParseFiniteDouble(Dissolution1IntervalBox.Text, "溶出1取样间隔");
|
||||
p.Dissolution2SampleIntervalMin = ParseFiniteDouble(Dissolution2IntervalBox.Text, "溶出2取样间隔");
|
||||
p.Dissolution1SampleIntervalMin = ParsePositiveInt(Dissolution1IntervalBox.Text, "溶出1取样间隔");
|
||||
p.Dissolution2SampleIntervalMin = ParsePositiveInt(Dissolution2IntervalBox.Text, "溶出2取样间隔");
|
||||
p.DissolutionSampleTimes = SampleTimesBox.Text
|
||||
.Split(',', StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(s => int.Parse(s.Trim()))
|
||||
|
||||
@@ -158,8 +158,8 @@ namespace 片剂四用仪.Views
|
||||
new PlcParamMapping("txt_Dissolution2Speed", AddressOrDefault(plcConfig.Dissolution2Speed, 350), PlcParamType.Float),
|
||||
new PlcParamMapping("txt_DissolutionTime", AddressOrDefault(plcConfig.Dissolution1Time, 430), PlcParamType.Int),
|
||||
new PlcParamMapping("txt_Dissolution2Time", AddressOrDefault(plcConfig.Dissolution2Time, 440), PlcParamType.Int),
|
||||
new PlcParamMapping("txt_Dissolution1SamplingInterval", AddressOrDefault(plcConfig.Dissolution1SampleInterval, 432), PlcParamType.Float),
|
||||
new PlcParamMapping("txt_Dissolution2SamplingInterval", AddressOrDefault(plcConfig.Dissolution2SampleInterval, 442), PlcParamType.Float),
|
||||
new PlcParamMapping("txt_Dissolution1SamplingInterval", AddressOrDefault(plcConfig.Dissolution1SampleInterval, 432), PlcParamType.Int),
|
||||
new PlcParamMapping("txt_Dissolution2SamplingInterval", AddressOrDefault(plcConfig.Dissolution2SampleInterval, 442), PlcParamType.Int),
|
||||
|
||||
new PlcParamMapping("txt_ForceCoefficient", 1320, PlcParamType.Float),
|
||||
new PlcParamMapping("txt_ForceProtection", 1322, PlcParamType.Float),
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
"FriabilityWeightAfter": 414, // 脆碎后质量(g)
|
||||
"WeightBefore": 412,
|
||||
"WeightAfter": 414,
|
||||
"DisintegrationTemp": 1430,
|
||||
"DisintegrationTemp": 1430, // 所有温度显示D1430,float类型
|
||||
"DisintegrationMovingUpCoil": 30,
|
||||
"DisintegrationStartCoil": 50,
|
||||
"DisintegrationStopCoil": 53,
|
||||
@@ -66,8 +66,8 @@
|
||||
"Dissolution2SampleAckCoil": 34,
|
||||
"Dissolution1Time": 430,
|
||||
"Dissolution2Time": 440,
|
||||
"Dissolution1SampleInterval": 432,
|
||||
"Dissolution2SampleInterval": 442
|
||||
"Dissolution1SampleInterval": 432, // 溶出1取样间隔,int类型
|
||||
"Dissolution2SampleInterval": 442 // 溶出2取样间隔,int类型
|
||||
},
|
||||
"PharmaStandard": {
|
||||
"StandardVersion": "中国药典2025",
|
||||
|
||||
Reference in New Issue
Block a user