It is not possible to fix a production tracing error if previous step record is still missing : last step is verified once again when fixing, ver. 2.18.1272

This commit is contained in:
Milan Hanajik
2019-07-24 15:15:09 +02:00
parent 98a3730fa3
commit 156cec5596
2 changed files with 50 additions and 22 deletions
+48 -20
View File
@@ -498,33 +498,19 @@ namespace TBF.BenchControl.Sequences
}
else if (selection == Selection.RestoreAndFixBatch)
{
///
/// Restore and fix a batch - part 1 (fix "Previous workstep is missing" error)
///
BatchRslts = CreateNewBatchResults(newBatchNr, StateMachine.Procedure);
RestoreBatchResults(TBF.UiBridge.Bridge.BatchNr, ref BatchRslts); /// pass the original batch number of the batch to be restored
///
/// Fix "Previous workstep is missing" error in this batch
///
for (int i = 0; i < BatchRslts.WaterMeters.Length; i++)
{
WaterMeter wm = BatchRslts.WaterMeters[i];
if (wm != null)
if (wm != null && wm.Passed)
{
if (wm.Passed)
{
wm.Disabled = true;
}
else if (!wm.Disabled)
{
wm.ErrorFlags = wm.ErrorFlags & (~(int)ErrorFlagMask.E28);
foreach (var mtr in wm.MeterTestRslts)
{
if (mtr.TestData().Evaluate && (mtr.TestData().Name == "Kontrola montaze") && (mtr.TestData().Method == "iPerlCommunication"))
{
mtr.TestDone = true;
mtr.Passed = true;
}
}
}
/// Water meter passed and was already saved to Oracle, do not reload & fix it now
wm.Disabled = true;
}
}
}
@@ -695,6 +681,48 @@ namespace TBF.BenchControl.Sequences
log.ErrorFormat("StartInfoReader failed to read data from the database");
/// TODO: Message for an operator? Error?
}
else if (selection == Selection.RestoreAndFixBatch)
{
/// Restore and fix a batch - part 2
for (int i = 0; i < BatchRslts.WaterMeters.Length; i++)
{
WaterMeter wm = BatchRslts.WaterMeters[i];
if (wm != null && !wm.Disabled)
{
/// Water meter did not pass
foreach (var mtr in wm.MeterTestRslts)
{
/// Find test entitled 'Kontrola montaze'
if (mtr.TestData().Evaluate && (mtr.TestData().Name == "Kontrola montaze") && (mtr.TestData().Method == "iPerlCommunication"))
{
/// This meter test result (mtr) is 'Kontrola montaze'
if (wm.LastRecordIsNok)
{
/// There is still a production tracing error, last record is missing
wm.ErrorFlags |= (int)Config.Entities.ErrorFlagMask.E28; /// Set E28
}
else
{
/// No production tracing error, last record is OK
wm.ErrorFlags &= ~(int)Config.Entities.ErrorFlagMask.E28; /// Clear E28
}
if ((wm.ErrorFlags & (int)Config.Entities.ErrorFlagMask.E28) != 0)
{
/// Previous workstep missing or NOK (production tracing error)
mtr.ErrorIndicators |= (int)ErrorFlagMask.E28;
mtr.Passed = false;
}
else
{
/// Previous step is OK
mtr.Passed = true;
}
}
}
}
}
}
/// Redraw on-screen results
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(string.Empty, null));
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.18.1271.0")]
[assembly: AssemblyFileVersion("2.18.1271.0")]
[assembly: AssemblyVersion("2.18.1272.0")]
[assembly: AssemblyFileVersion("2.18.1272.0")]