DEWA rework R-L / DEWA rework L-R, ver. 2.26.1767

This commit is contained in:
Milan Hanajik 2021-10-04 14:30:27 +02:00
parent 21408a962e
commit 0b8d51daba
3 changed files with 13 additions and 8 deletions

View File

@ -89,7 +89,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
public const string ConditnlUpdateQ2CorrLRStr = "Conditional update of Q2 correction L-R"; /// Arguments: L-R_test_name
public const string Reset2HzCorrectionStr = "Reset 2Hz correction";
public const string Write2HzCorrectionStr = "Write 2Hz correction";
public const string DewaReworkStr = "DEWA rework";
public const string DewaReworkRLStr = "DEWA rework R-L";
public const string DewaReworkLRStr = "DEWA rework L-R";
public static Color DisabledColor = Color.DarkGray;
public static Color OptoAndDirOKColor = Color.Green;
@ -1202,7 +1203,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
else if (currentActivity.ToLower() == Reset2HzCorrectionStr.ToLower()) error = Reset2HzCorrection(threadID, ihead, wm, ref resultStr);
else if (currentActivity.ToLower() == Write2HzCorrectionStr.ToLower()) error = Write2HzCorrection(threadID, ihead, wm, ref resultStr);
else if (currentActivity.ToLower() == GetDefaultQ2CorrectionsStr.ToLower()) error = GetQ2PreCorrectionsFormRest(threadID, ihead, wm, ref resultStr);
else if (currentActivity.ToLower() == DewaReworkStr.ToLower()) error = DewaRework(ihead, wm, ref resultStr);
else if (currentActivity.ToLower() == DewaReworkRLStr.ToLower()) error = DewaRework(ihead, wm, FlowDir.R_L, ref resultStr);
else if (currentActivity.ToLower() == DewaReworkLRStr.ToLower()) error = DewaRework(ihead, wm, FlowDir.L_R, ref resultStr);
#endif
else
@ -2929,17 +2931,19 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
/// <param name="wm">Water meter object</param>
/// <param name="resultStr">String passed to caller</param>
/// <returns>true on success</returns>
static CommErr DewaRework(IperlHead ihead, Results.Entities.WaterMeter wm, ref string resultStr)
static CommErr DewaRework(IperlHead ihead, Results.Entities.WaterMeter wm, FlowDir flowDir, ref string resultStr)
{
if (ihead.CommFailed) return CommErr.CommFailed;
if (OpenPort(ihead) != 0) return CommErr.OpenPort; /// Open RFID port
if (OpenPort(ihead) != 0) return CommErr.OpenPort; /// Open RFID port
byte arrow = (flowDir == FlowDir.L_R) ? (byte)1 : (byte)2; /// L-R is reverse flow (=1), R-L is forward flow (=2)(default)
iPerlDataWrite[] dataToBeWritten = new iPerlDataWrite[]
{
new iPerlDataWrite(MessageID.MetrologyMemory, 0x19A1, new byte[] { (byte)0xA5 }, "Open Sealing"),
new iPerlDataWrite(MessageID.RadioPassthrough, 0x1804, new byte[] { (byte)1 }, "System Status"),
new iPerlDataWrite(MessageID.MetrologyMemory, 0x1985, new byte[] { (byte)2 }, "Arrow"),
new iPerlDataWrite(MessageID.MetrologyMemory, 0x1985, new byte[] { arrow }, "Arrow"),
new iPerlDataWrite(MessageID.MetrologyMemory, 0x199C, new byte[5], "Clear S/N"),
new iPerlDataWrite(MessageID.Command, 0x0000, new byte[] { (byte)Command.SetActiveMode }, "Set active mode"),
new iPerlDataWrite(MessageID.Configuration, 0x0015, new byte[] { (byte)0xA0 }, "Test mode config = A0"),

View File

@ -80,7 +80,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
retVal.Add("---");
retVal.Add(iPerlCommunicationForm.Reset2HzCorrectionStr);
retVal.Add(iPerlCommunicationForm.Write2HzCorrectionStr);
retVal.Add(iPerlCommunicationForm.DewaReworkStr);
retVal.Add(iPerlCommunicationForm.DewaReworkRLStr);
retVal.Add(iPerlCommunicationForm.DewaReworkLRStr);
retVal.Add(string.Format("{0} if enabled", iPerlCommunicationForm.ReadConfigurationStr));
retVal.Add(string.Format("{0} 80", iPerlCommunicationForm.SetTestModeStr));
retVal.Add("iPerl_check prevWorkStep direction q2factors");

View File

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