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