iPerlCommunicationForm : Better try/catch, more logging, ver. 2.18.1152

This commit is contained in:
Milan Hanajik 2019-02-25 16:15:26 +01:00
parent 138e436645
commit 5586f58c6e
3 changed files with 108 additions and 89 deletions

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
/// Copyright (c) 2015-2019 Sensus Metering Systems
/// Author: Milan Hanajík
///
using System;
@ -24,5 +24,16 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
this.CommMessage = commMessage;
this.CommErr = commErr;
}
public override string ToString()
{
return string.Format("Thread={0} WMNr0={1} IHead={2} WM={3} CommMsg={4} CommErr={5}",
ThreadId,
WMNr0,
(Ihead != null) ? Ihead.Name : "null",
Wm.WMPosition,
(CommMessage != null) ? CommMessage : "null",
CommErr);
}
}
}

View File

@ -2186,6 +2186,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
public static event EventHandler<CommCompletedEventArgs> CommCompletedHandler;
void DoOnCommCompleted(object sender, CommCompletedEventArgs data)
{
try
{
///
/// Update the text message
@ -2257,7 +2259,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
if (currentGroup < lastGroup)
{
/// Go to the next step / next group
if (cfg.UseMuxBoards && (quido != null))
if (quido != null)
{
quido.SetOutputs((ushort)(16 - currentGroup - 1));
Thread.Sleep(2000);
@ -2269,7 +2271,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
currentGroup = 0;
currentActivityStep++;
activityLabel.Text = multiTestParams[currentActivityStep].Activity;
if (cfg.UseMuxBoards && (quido != null))
if (quido != null)
{
quido.SetOutputs((ushort)(16 - currentGroup - 1));
Thread.Sleep(2000);
@ -2283,6 +2285,12 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
NormalClose();
}
}
catch (Exception e)
{
log.ErrorFormat("DoOnCommCompleted({0}) failed: {1}", data, e.Message);
log.FatalFormat("StackTrace : {0}{1}", Environment.NewLine, e.StackTrace);
}
}
/// <summary>

View File

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