'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:
Milan Hanajik 2015-09-11 14:15:32 +02:00
parent 2a0fbca1e0
commit e230ce02bf
3 changed files with 26 additions and 22 deletions

View File

@ -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

View File

@ -74,6 +74,13 @@ namespace TBF.BenchControl.WaterMeters.iPerl
}
bool disabled;
public bool CommFailed
{
get { return commFailed; }
set { commFailed = value; }
}
bool commFailed;
/// <summary> ConfigStruct of the water meter obtained or updated by iPerlCommunication </summary>
public ConfigStruct ConfigStruct
{

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.5.108.1")]
[assembly: AssemblyFileVersion("1.5.108.1")]
[assembly: AssemblyVersion("1.5.109.1")]
[assembly: AssemblyFileVersion("1.5.109.1")]