'CommFailed' flag in iPerl.WaterMeter, 'Disabled' not used for this purpose, all 40 meters displayed in results, version 1.5.109.
This commit is contained in:
+17
-20
@@ -17,7 +17,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
public enum CommErr
|
||||
{
|
||||
None = 0,
|
||||
Disabled,
|
||||
CommFailed,
|
||||
OpenPort,
|
||||
Read,
|
||||
Write,
|
||||
@@ -223,8 +223,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// <summary> Number of text boxes for serial numbers </summary>
|
||||
public readonly int WaterMetersCount;
|
||||
|
||||
readonly bool[] disabled;
|
||||
|
||||
int textBoxesCount;
|
||||
|
||||
Label[] labels;
|
||||
@@ -343,8 +341,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
|
||||
ShuffleTextBoxes(this.WaterMetersCount, Program.LineSize);
|
||||
|
||||
disabled = new bool[this.WaterMetersCount];
|
||||
|
||||
///
|
||||
/// Prepare worker threads, 'rfidPortNrs', 'lastGroup', etc..
|
||||
///
|
||||
@@ -369,6 +365,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
workerThreads.Add(thread);
|
||||
}
|
||||
}
|
||||
|
||||
if (iPerl.Group > lastGroup) lastGroup = iPerl.Group;
|
||||
}
|
||||
}
|
||||
@@ -449,11 +446,11 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
|
||||
for (int i = 0; i < textBoxesCount; i++)
|
||||
{
|
||||
if (disabled != null && i < disabled.Length && disabled[i])
|
||||
{
|
||||
labels[i].Visible = messages[i].Visible = false;
|
||||
}
|
||||
else
|
||||
//if (disabled != null && i < disabled.Length && disabled[i])
|
||||
//{
|
||||
// labels[i].Visible = messages[i].Visible = false;
|
||||
//}
|
||||
//else
|
||||
{
|
||||
labels[i].Visible = messages[i].Visible = true;
|
||||
messages[i].Text = "---";
|
||||
@@ -591,7 +588,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
{
|
||||
OnCommCompleted(null, new CommCompletedEventArgs(threadId, wmNr, resultStr));
|
||||
}
|
||||
else if (wm.Disabled || error == CommErr.Disabled)
|
||||
else if (wm.CommFailed || error == CommErr.CommFailed)
|
||||
{
|
||||
OnCommCompleted(null, new CommCompletedEventArgs(threadId, wmNr, "Watermeter is disabled"));
|
||||
}
|
||||
@@ -599,7 +596,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
{
|
||||
OnCommCompleted(null, new CommCompletedEventArgs(threadId, wmNr, string.Format("{0} failed ({1}) !!!", activity, error)));
|
||||
rfidDataLogger.ErrorFormat("Group={0}, Board={1}, {2} failed ({3}) !!!", currentGroup, wm.MuxBoardNr, activity, error);
|
||||
wm.Disabled = true;
|
||||
wm.CommFailed = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -635,10 +632,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
///
|
||||
if (!multiTestParams[currentActivityStep].Activity.ToLower().Contains(" if enabled"))
|
||||
{
|
||||
wm.Disabled = false;
|
||||
wm.CommFailed = false;
|
||||
}
|
||||
|
||||
if (wm.Disabled) return CommErr.Disabled;
|
||||
if (wm.CommFailed) return CommErr.CommFailed;
|
||||
|
||||
if (OpenPort(wm) != 0) return CommErr.OpenPort; /// Open RFID port
|
||||
|
||||
@@ -674,7 +671,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// <returns>true on success</returns>
|
||||
static CommErr SetTestMode(WaterMeters.iPerl.WaterMeter wm, ref string resultStr)
|
||||
{
|
||||
if (wm.Disabled) return CommErr.Disabled;
|
||||
if (wm.CommFailed) return CommErr.CommFailed;
|
||||
|
||||
Byte testModeConfig = 0xA0; /// Default value
|
||||
///
|
||||
@@ -774,7 +771,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// <returns>true on success</returns>
|
||||
static CommErr SetActiveMode(WaterMeters.iPerl.WaterMeter wm, ref string resultStr)
|
||||
{
|
||||
if (wm.Disabled) return CommErr.Disabled;
|
||||
if (wm.CommFailed) return CommErr.CommFailed;
|
||||
|
||||
if (OpenPort(wm) != 0) return CommErr.OpenPort; /// Open RFID port
|
||||
|
||||
@@ -822,7 +819,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// <returns>true on success</returns>
|
||||
static CommErr ReadCalibration(WaterMeters.iPerl.WaterMeter wm, ref string resultStr)
|
||||
{
|
||||
if (wm.Disabled) return CommErr.Disabled;
|
||||
if (wm.CommFailed) return CommErr.CommFailed;
|
||||
|
||||
if (OpenPort(wm) != 0) return CommErr.OpenPort; /// Open RFID port
|
||||
|
||||
@@ -856,7 +853,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// <returns>true on success</returns>
|
||||
static CommErr WriteCalibrationFactor(WaterMeters.iPerl.WaterMeter wm, ref string resultStr)
|
||||
{
|
||||
if (wm.Disabled) return CommErr.Disabled;
|
||||
if (wm.CommFailed) return CommErr.CommFailed;
|
||||
|
||||
if (OpenPort(wm) != 0) return CommErr.OpenPort; /// Open RFID port
|
||||
|
||||
@@ -926,7 +923,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// <returns>true on success</returns>
|
||||
static CommErr ResetQ2Correction(WaterMeters.iPerl.WaterMeter wm, ref string resultStr)
|
||||
{
|
||||
if (wm.Disabled) return CommErr.Disabled;
|
||||
if (wm.CommFailed) return CommErr.CommFailed;
|
||||
|
||||
if (OpenPort(wm) != 0) return CommErr.OpenPort; /// Open RFID port
|
||||
|
||||
@@ -975,7 +972,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// <returns>true on success</returns>
|
||||
static CommErr WriteQ2Correction(WaterMeters.iPerl.WaterMeter wm, ref string resultStr)
|
||||
{
|
||||
if (wm.Disabled) return CommErr.Disabled;
|
||||
if (wm.CommFailed) return CommErr.CommFailed;
|
||||
|
||||
if (OpenPort(wm) != 0) return CommErr.OpenPort; /// Open RFID port
|
||||
|
||||
|
||||
Reference in New Issue
Block a user