更新
This commit is contained in:
@@ -417,13 +417,17 @@ namespace TabletTester2025.ViewModels
|
||||
|
||||
if (_isDissolution1Running)
|
||||
{
|
||||
await ReadDissolutionChannelAsync(1);
|
||||
if (ResolveDissolution1PercentAddress() != 0)
|
||||
await ReadDissolutionChannelAsync(1);
|
||||
|
||||
await CheckDissolutionSampleAsync(1);
|
||||
}
|
||||
|
||||
if (_isDissolution2Running)
|
||||
{
|
||||
await ReadDissolutionChannelAsync(2);
|
||||
if (_plcConfig.Dissolution2Percent != 0)
|
||||
await ReadDissolutionChannelAsync(2);
|
||||
|
||||
await CheckDissolutionSampleAsync(2);
|
||||
}
|
||||
|
||||
@@ -432,12 +436,6 @@ namespace TabletTester2025.ViewModels
|
||||
|
||||
private async Task CheckDissolutionSampleAsync(int channel)
|
||||
{
|
||||
if (channel == 2 && _plcConfig.Dissolution2Percent == 0)
|
||||
{
|
||||
DissolutionCurveStatus = "溶出2溶出度寄存器未配置,未启用取样计算";
|
||||
return;
|
||||
}
|
||||
|
||||
ushort coilAddress = channel == 1
|
||||
? _plcConfig.Dissolution1SampleAckCoil
|
||||
: _plcConfig.Dissolution2SampleAckCoil;
|
||||
@@ -448,8 +446,8 @@ namespace TabletTester2025.ViewModels
|
||||
return;
|
||||
}
|
||||
|
||||
bool sampleConfirmed = await _plc.ReadCoilAsync(coilAddress);
|
||||
if (sampleConfirmed)
|
||||
bool sampleRequested = await _plc.ReadCoilAsync(coilAddress);
|
||||
if (!sampleRequested)
|
||||
{
|
||||
SetDissolutionSampleRequestActive(channel, false);
|
||||
return;
|
||||
@@ -458,13 +456,6 @@ namespace TabletTester2025.ViewModels
|
||||
if (IsDissolutionSampleRequestActive(channel) || IsDissolutionSamplePromptOpen(channel))
|
||||
return;
|
||||
|
||||
if (GetNextPendingDissolutionSample(channel) == null)
|
||||
{
|
||||
await _plc.WriteCoilAsync(coilAddress, true);
|
||||
DissolutionCurveStatus = $"溶出{channel}已完成全部取样点";
|
||||
return;
|
||||
}
|
||||
|
||||
SetDissolutionSampleRequestActive(channel, true);
|
||||
SetDissolutionSamplePromptOpen(channel, true);
|
||||
|
||||
@@ -472,7 +463,8 @@ namespace TabletTester2025.ViewModels
|
||||
{
|
||||
double percent = await ShowDissolutionSampleDialogAsync(channel);
|
||||
RecordDissolutionSample(channel, percent);
|
||||
await _plc.WriteCoilAsync(coilAddress, true);
|
||||
await _plc.WriteCoilAsync(coilAddress, false);
|
||||
SetDissolutionSampleRequestActive(channel, false);
|
||||
LocalAlarm = $"溶出{channel}已记录取样结果";
|
||||
DissolutionCurveStatus = "";
|
||||
}
|
||||
@@ -1611,6 +1603,9 @@ namespace TabletTester2025.ViewModels
|
||||
|
||||
private async Task StartDissolution1Async()
|
||||
{
|
||||
if (_isDissolution1Running)
|
||||
return;
|
||||
|
||||
CurrentTest = TestType.Dissolution;
|
||||
Phase = TestPhase.Running;
|
||||
DissolutionPass = false;
|
||||
@@ -1659,15 +1654,15 @@ namespace TabletTester2025.ViewModels
|
||||
|
||||
private async Task StartDissolution2Async()
|
||||
{
|
||||
if (_isDissolution2Running)
|
||||
return;
|
||||
|
||||
CurrentTest = TestType.Dissolution;
|
||||
Phase = TestPhase.Running;
|
||||
DissolutionPass = false;
|
||||
ResetDissolutionChannel(2);
|
||||
ResetDissolutionSampleState(2);
|
||||
if (_plcConfig.Dissolution2Percent != 0)
|
||||
CreateDissolutionSampleSchedule(2);
|
||||
else
|
||||
DissolutionCurveStatus = "溶出2溶出度寄存器未配置,仅执行设备控制,不保存计算结果";
|
||||
CreateDissolutionSampleSchedule(2);
|
||||
_dissolution2StartTime = DateTime.Now;
|
||||
_isDissolution2Running = true;
|
||||
DissolutionPlotModel.Title = "溶出曲线";
|
||||
|
||||
Reference in New Issue
Block a user