FM2014: - timestamp to messages, - verbose output
This commit is contained in:
parent
2da5fd6f10
commit
59f2fbfcf3
@ -19,6 +19,11 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Co
|
||||
/// </summary>
|
||||
public struct CmdResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// UTC timestamp
|
||||
/// </summary>
|
||||
public DateTime TimestampUtc { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// FM2014 command identifier
|
||||
/// </summary>
|
||||
@ -45,7 +50,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Co
|
||||
public String Unit { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Ctor
|
||||
/// Ctor including automatically generated timestamp
|
||||
/// </summary>
|
||||
/// <param name="cmdName"></param>
|
||||
/// <param name="answerStr"></param>
|
||||
@ -55,6 +60,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Co
|
||||
public CmdResponse(CmdName cmdName, String answerStr, UInt32? intValue = null, Double? doubleValue = null,
|
||||
String unit = "")
|
||||
{
|
||||
TimestampUtc = DateTime.UtcNow;
|
||||
CmdName = cmdName;
|
||||
AnswerStr = answerStr;
|
||||
IntValue = intValue;
|
||||
|
||||
@ -286,6 +286,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
|
||||
/// <summary>
|
||||
/// The broadcast FM2014 will be used to dispatch the address 0 on the <see cref="OnRawRecordReceived"/>
|
||||
/// of the 'firstActiveFm2014'.
|
||||
/// </summary>
|
||||
private static FM2014 BroadcastFm2014 { get; set; }
|
||||
|
||||
@ -832,7 +833,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
/// <param name="cmdResponse"></param>
|
||||
/// <param name="statusReturn"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks date="2026-Feb-13" author="Thomas Wiedebusch">
|
||||
/// <remarks date="2026-Feb-13..Feb-21" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
private static void ResponseEvent(FM2014 fm2014, CmdResponse cmdResponse,
|
||||
@ -843,7 +844,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
actualProcessPercent: ActualProcessProgress_percent,
|
||||
statusReturn: statusReturn,
|
||||
specificInfoObj: cmdResponse);
|
||||
fm2014?.OnRawRecordReceived?.Invoke(fm2014, processExecEventArgs);
|
||||
fm2014.OnRawRecordReceived?.Invoke(fm2014, processExecEventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -860,6 +861,52 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
fm2014?.OnRawRecordReceived?.Invoke(fm2014, processExecEventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Common method to check and dispatch the double impulse deadtime to the FM2014.
|
||||
/// The commands will be dispatched as broadcast.
|
||||
/// </summary>
|
||||
/// <param name="fm2014"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks date="2026-Feb-21" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
private static Boolean BuildAndWriteDoubleImpulseDeadtime(FM2014 fm2014)
|
||||
{
|
||||
|
||||
var cmdName = CmdName.CmdSwitchDoublePulseDeadtimeOff;
|
||||
var actualFm2014 = CmdType.broadcast == GetCmdType(cmdName) ? BroadcastFm2014 : fm2014;
|
||||
|
||||
// Check if double pulse deadtime has been set or si switched off
|
||||
if (DOUBLE_PULSE_DEADTIME_MIN_ms == fm2014.DoublePulseDeadtime_ms)
|
||||
{
|
||||
// This is a command without parameter
|
||||
if (!Write(cmdName, fm2014))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cmdName = CmdName.CmdSetDoublePulseDeadtimeBase;
|
||||
if (!Write(cmdName, fm2014, fm2014.DoublePulseBaseDeadTime_ms))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cmdName = CmdName.CmdSetDoublePulseDeadtimeMultiplier;
|
||||
if (!Write(cmdName, fm2014, fm2014.DoublePulseMultiplier))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Dispatch human-readable result
|
||||
var info = Resources.StrInputMsgDoublePulseDeadTime;
|
||||
var response = new CmdResponse(cmdName, info,
|
||||
doubleValue: fm2014.DoublePulseDeadtime_ms * 0.001,
|
||||
unit: Units.GetInfo(Units.Name.TIME_s));
|
||||
ResponseEvent(actualFm2014, response);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pulse counter measurement for all FM2014s which are connected and logged in:
|
||||
/// - REF counter,
|
||||
@ -1082,7 +1129,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
/// <param name="doublePulseDeadtime_ms"></param>
|
||||
/// <param name="currentOutputAttenuation"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks date="2026-Jan-14..Feb-18" author="Thomas Wiedebusch">
|
||||
/// <remarks date="2026-Jan-14..Feb-21" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
public static Boolean RegulationMeasurement(UInt32 refPulses_per_cm, UInt16 dutPulses_per_cm,
|
||||
@ -1131,11 +1178,8 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
// Prepare regulation measurement
|
||||
try
|
||||
{
|
||||
cmdName = CmdName.CmdSwitchDoublePulseDeadtimeOff;
|
||||
if (!Write(cmdName, firstActiveFm2014))
|
||||
{
|
||||
if (!BuildAndWriteDoubleImpulseDeadtime(firstActiveFm2014))
|
||||
return false;
|
||||
}
|
||||
|
||||
cmdName = CmdName.CmdSetCurrentOutputAttenuation;
|
||||
if (!Write(cmdName, firstActiveFm2014, firstActiveFm2014.CurrentOutputAttenuation))
|
||||
@ -1351,7 +1395,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
/// <param name="doublePulseDeadtime_ms">0 if double impulse deadtime detection is off</param>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <remarks date="2026-Jan-14..Feb-19" author="Thomas Wiedebusch">
|
||||
/// <remarks date="2026-Jan-14..Feb-21" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
public static Boolean PulseTimeMeasurement(UInt16? refPulsesRequired = null, UInt16? dutPulsesRequired = null,
|
||||
@ -1399,29 +1443,8 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
// Prepare pulse time measurement with all broadcast command - avoid read
|
||||
try
|
||||
{
|
||||
// Check if double pulse deadtime has been set or si switched off
|
||||
if (DOUBLE_PULSE_DEADTIME_MIN_ms == firstActiveFm2014.DoublePulseDeadtime_ms)
|
||||
{
|
||||
// This is a command without parameter
|
||||
cmdName = CmdName.CmdSwitchDoublePulseDeadtimeOff;
|
||||
if (!Write(cmdName, firstActiveFm2014))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cmdName = CmdName.CmdSetDoublePulseDeadtimeBase;
|
||||
if (!Write(cmdName, firstActiveFm2014, firstActiveFm2014.DoublePulseBaseDeadTime_ms))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cmdName = CmdName.CmdSetDoublePulseDeadtimeMultiplier;
|
||||
if (!Write(cmdName, firstActiveFm2014, firstActiveFm2014.DoublePulseMultiplier))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!BuildAndWriteDoubleImpulseDeadtime(firstActiveFm2014))
|
||||
return false;
|
||||
|
||||
if (refPulsesRequired != null)
|
||||
{
|
||||
@ -1430,6 +1453,11 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// Dispatch human-readable result
|
||||
var info = Resources.StrCmdMsgRefSetPls;
|
||||
var response = new CmdResponse(cmdName, info,
|
||||
intValue: firstActiveFm2014.RefPulsesRequired);
|
||||
ResponseEvent(BroadcastFm2014, response);
|
||||
}
|
||||
|
||||
if (dutPulsesRequired != null)
|
||||
@ -1439,6 +1467,11 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// Dispatch human-readable result
|
||||
var info = Resources.StrCmdMsgDutSetPls;
|
||||
var response = new CmdResponse(cmdName, info,
|
||||
intValue: firstActiveFm2014.DutPulsesRequired);
|
||||
ResponseEvent(BroadcastFm2014, response);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -1872,7 +1905,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
/// </summary>
|
||||
/// <param name="fm2014"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks date="2026-Jan-08..28" author="Thomas Wiedebusch">
|
||||
/// <remarks date="2026-Jan-08..Feb-21" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
private static Boolean InitiateBroadcastComm(FM2014 fm2014)
|
||||
@ -1890,7 +1923,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
{
|
||||
response = new CmdResponse(CmdName.CmdAddress,
|
||||
$"{Resources.StrCmdRespErrorBroadcast}");
|
||||
PublishResponse(fm2014, new ProcessExecEventArgs(Resources.StrError,
|
||||
PublishResponse(BroadcastFm2014, new ProcessExecEventArgs(Resources.StrError,
|
||||
specificInfoObj: response,
|
||||
statusReturn: StatusReturn.Failed));
|
||||
SharedCmdTypeReminderLastCmd = CmdType.uninitialized;
|
||||
@ -1909,7 +1942,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
var cmdName = CmdName.CmdConnect;
|
||||
var info = GetCmdInfo(cmdName) + ": " + BROADCAST_ADDRESS;
|
||||
response = new CmdResponse(cmdName, info);
|
||||
PublishResponse(fm2014, new ProcessExecEventArgs("", specificInfoObj: response));
|
||||
PublishResponse(BroadcastFm2014, new ProcessExecEventArgs("", specificInfoObj: response));
|
||||
SharedCmdTypeReminderLastCmd = CmdType.broadcast;
|
||||
return true;
|
||||
}
|
||||
@ -1917,7 +1950,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
{
|
||||
response = new CmdResponse(CmdName.CmdAddress,
|
||||
$"{Resources.StrCmdRespErrorBroadcast} - {e.Message}");
|
||||
PublishResponse(fm2014, new ProcessExecEventArgs(Resources.StrError,
|
||||
PublishResponse(BroadcastFm2014, new ProcessExecEventArgs(Resources.StrError,
|
||||
specificInfoObj: response, statusReturn: StatusReturn.Failed));
|
||||
SharedCmdTypeReminderLastCmd = CmdType.uninitialized;
|
||||
return false;
|
||||
@ -1994,6 +2027,27 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Forcing to reset all measurements before the start of a new one:
|
||||
/// - This will enable to keep the measurements and NOT clear those in the reset method,
|
||||
/// <see cref="ResetHardwareAllDevices"/> as this should be used to prepare the hardware for
|
||||
/// the new measurement after it being able to start the new measurement immediately!
|
||||
/// </summary>
|
||||
/// <remarks date="2026-Feb-05" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
private static void ClearMeasurementResultsForAllDevices()
|
||||
{
|
||||
foreach (var fm2014 in RegisteredFm2014s.Where(fm2014 => fm2014.IsLoggedOn))
|
||||
{
|
||||
fm2014.RefTimeMeasured_s = 0;
|
||||
fm2014.DutTimeMeasured_s = 0;
|
||||
fm2014.DutToRefToleranceMeasured_percent = null;
|
||||
fm2014.RefFlowRate_cm_per_h = 0;
|
||||
fm2014.DutFlowRate_cm_per_h = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose FM2014
|
||||
/// </summary>
|
||||
@ -2019,6 +2073,38 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
|
||||
#endregion ---------------------------------------- static methods --------------------------------------------
|
||||
#region ------------------------------------------- object methods --------------------------------------------
|
||||
/// <summary>
|
||||
/// Logout from FM2014
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <remarks date="2026-Jan-28" author="Thomas Wiedebusch">
|
||||
/// - Support for multiple FM2014s.
|
||||
/// </remarks>
|
||||
public Boolean Logout()
|
||||
{
|
||||
IsLoggedOn = false;
|
||||
if (RegisteredFm2014s == null || RegisteredFm2014s.Count == 0)
|
||||
SharedSerialPort?.Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Login to individual address.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <remarks date="2026-Jan-08..Feb-05" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
public Boolean Login()
|
||||
{
|
||||
// If the cyclic task has already been started the login isn't allowed anymore
|
||||
// until this has been finished
|
||||
if (SharedCyclicMeasSequ != CyclicMeasSequ.idle)
|
||||
return false;
|
||||
|
||||
return InitiateIndividualComm(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transfer all standalone settings to FM2014 RAM and safe those to nonvolatile EEPROM
|
||||
/// </summary>
|
||||
@ -2191,23 +2277,6 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Login to individual address.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <remarks date="2026-Jan-08..Feb-05" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
public Boolean Login()
|
||||
{
|
||||
// If the cyclic task has already been started the login isn't allowed anymore
|
||||
// until this has been finished
|
||||
if (SharedCyclicMeasSequ != CyclicMeasSequ.idle)
|
||||
return false;
|
||||
|
||||
return InitiateIndividualComm(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Common routine for reboot being able to override this routine which will be called in
|
||||
/// to simulate a reboot.
|
||||
@ -2221,27 +2290,6 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
return StatusReturn.Failed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Forcing to reset all measurements before the start of a new one:
|
||||
/// - This will enable to keep the measurements and NOT clear those in the reset method,
|
||||
/// <see cref="ResetHardwareAllDevices"/> as this should be used to prepare the hardware for
|
||||
/// the new measurement after it being able to start the new measurement immediately!
|
||||
/// </summary>
|
||||
/// <remarks date="2026-Feb-05" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
private static void ClearMeasurementResultsForAllDevices()
|
||||
{
|
||||
foreach (var fm2014 in RegisteredFm2014s.Where(fm2014 => fm2014.IsLoggedOn))
|
||||
{
|
||||
fm2014.RefTimeMeasured_s = 0;
|
||||
fm2014.DutTimeMeasured_s = 0;
|
||||
fm2014.DutToRefToleranceMeasured_percent = null;
|
||||
fm2014.RefFlowRate_cm_per_h = 0;
|
||||
fm2014.DutFlowRate_cm_per_h = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Connect to individual FM2014:
|
||||
/// - This is initially used to assign and set up the SharedSerialPort which will be shared upon
|
||||
@ -2272,7 +2320,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
SharedSerialPort.WriteTimeout = 1000;
|
||||
}
|
||||
|
||||
// The brodcast FM2014 is used to deliver a message to the GUI
|
||||
// The brodcast FM2014 is used to deliver a message to the GUI with address 0
|
||||
if (BroadcastFm2014 == null)
|
||||
{
|
||||
BroadcastFm2014 = new FM2014
|
||||
@ -2351,20 +2399,6 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
return IsLoggedOn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logout from FM2014
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <remarks date="2026-Jan-28" author="Thomas Wiedebusch">
|
||||
/// - Support for multiple FM2014s.
|
||||
/// </remarks>
|
||||
public Boolean Logout()
|
||||
{
|
||||
IsLoggedOn = false;
|
||||
if (RegisteredFm2014s == null || RegisteredFm2014s.Count == 0)
|
||||
SharedSerialPort?.Close();
|
||||
return true;
|
||||
}
|
||||
#endregion ---------------------------------------- object methods --------------------------------------------
|
||||
}
|
||||
}
|
||||
@ -233,7 +233,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Required DUT pulse setup.
|
||||
/// Looks up a localized string similar to DUT pulses required.
|
||||
/// </summary>
|
||||
internal static string StrCmdMsgDutSetPls {
|
||||
get {
|
||||
@ -431,7 +431,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Required REF pulses setup.
|
||||
/// Looks up a localized string similar to REF pulses required.
|
||||
/// </summary>
|
||||
internal static string StrCmdMsgRefSetPls {
|
||||
get {
|
||||
@ -476,7 +476,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Switching off the double pulse detection.
|
||||
/// Looks up a localized string similar to Deactivation of the double pulse deadtime.
|
||||
/// </summary>
|
||||
internal static string StrCmdMsgSetDbplUnlock {
|
||||
get {
|
||||
@ -646,6 +646,15 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Double pulse daedtime.
|
||||
/// </summary>
|
||||
internal static string StrInputMsgDoublePulseDeadTime {
|
||||
get {
|
||||
return ResourceManager.GetString("StrInputMsgDoublePulseDeadTime", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Calibration DUT to REF.
|
||||
/// </summary>
|
||||
|
||||
@ -118,16 +118,16 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="StrCmdMsgRefSetPls" xml:space="preserve">
|
||||
<value>Geforderte REF Impulse</value>
|
||||
<value>REF Impulse gefordert</value>
|
||||
</data>
|
||||
<data name="StrCmdMsgRefStrPlsCtr" xml:space="preserve">
|
||||
<value>Start REF Impulszähler</value>
|
||||
</data>
|
||||
<data name="StrCmdMsgSetDbplUnlock" xml:space="preserve">
|
||||
<value>Ausschaltung der Doppelimpulserkennung</value>
|
||||
<value>Abschaltung der Doppelimpulstotzeit</value>
|
||||
</data>
|
||||
<data name="StrCmdMsgDutSetPls" xml:space="preserve">
|
||||
<value>Einstellung zu zählende DUT Impulse</value>
|
||||
<value>DUT Impulse gefordert</value>
|
||||
</data>
|
||||
<data name="StrCmdMsgDutStrPlsCtr" xml:space="preserve">
|
||||
<value>Start DUT Impulszähler</value>
|
||||
@ -330,4 +330,7 @@
|
||||
<data name="StrMeasMsgCalibration" xml:space="preserve">
|
||||
<value>Kalibrierung DUT zu REF</value>
|
||||
</data>
|
||||
<data name="StrInputMsgDoublePulseDeadTime" xml:space="preserve">
|
||||
<value>Doppelimpulstotzeit</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -118,16 +118,16 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="StrCmdMsgRefSetPls" xml:space="preserve">
|
||||
<value>Required REF pulses setup</value>
|
||||
<value>REF pulses required</value>
|
||||
</data>
|
||||
<data name="StrCmdMsgRefStrPlsCtr" xml:space="preserve">
|
||||
<value>Start REF pulse counter</value>
|
||||
</data>
|
||||
<data name="StrCmdMsgSetDbplUnlock" xml:space="preserve">
|
||||
<value>Switching off the double pulse detection</value>
|
||||
<value>Deactivation of the double pulse deadtime</value>
|
||||
</data>
|
||||
<data name="StrCmdMsgDutSetPls" xml:space="preserve">
|
||||
<value>Required DUT pulse setup</value>
|
||||
<value>DUT pulses required</value>
|
||||
</data>
|
||||
<data name="StrCmdMsgDutStrPlsCtr" xml:space="preserve">
|
||||
<value>Start DUT pulse counter</value>
|
||||
@ -330,4 +330,7 @@
|
||||
<data name="StrMeasMsgCalibration" xml:space="preserve">
|
||||
<value>Calibration DUT to REF</value>
|
||||
</data>
|
||||
<data name="StrInputMsgDoublePulseDeadTime" xml:space="preserve">
|
||||
<value>Double pulse daedtime</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -266,7 +266,7 @@
|
||||
|
||||
<!--Process Information-->
|
||||
<GroupBox Header="Info" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="1,1,1,0" Grid.Row="2" Grid.RowSpan="23" Grid.Column="26" Grid.ColumnSpan="14" >
|
||||
<RichTextBox x:Name="rtbLog" Margin="0,0,0,0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" AcceptsTab="True" Width="Auto" UseLayoutRounding="False" HorizontalAlignment="Left" >
|
||||
<RichTextBox x:Name="rtbLog" Margin="0,0,0,0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" AcceptsTab="True" Width="Auto" UseLayoutRounding="False" HorizontalAlignment="Left" FontSize="9" >
|
||||
<FlowDocument PageWidth="1000"/>
|
||||
</RichTextBox>
|
||||
</GroupBox>
|
||||
|
||||
@ -763,14 +763,9 @@ namespace Sensus.Ui.FM2014TestBench
|
||||
{
|
||||
// Logging to history window
|
||||
LogText(StrSeparator);
|
||||
LogText($"{StrLblFM2014Address} {fm2014.Address} - FM2014 ID: {fm2014.ConnectResponse}");
|
||||
LogText($"{StrLblFM2014Address} {fm2014.Address} - FM2014 Firmware Version: {fm2014.FwVersion}");
|
||||
LogText($"{StrLblFM2014Address} {fm2014.Address} - FM2014 {StrLblFM2014SerialNumber} " +
|
||||
$"{fm2014.SerialNumber}");
|
||||
LogText($"{StrLblFM2014Address} {fm2014.Address} - FW2014 {StrLblFM2014Address} {fm2014.Address}");
|
||||
var dt = DateTime.UtcNow;
|
||||
var msg = $"{dt:yyyy-MM-dd HH:mm:ss} UTC";
|
||||
LogText($"{StrMsgPcDateTime} {msg}");
|
||||
LogText($"Ad: {fm2014.Address} - FM2014 ID: {fm2014.ConnectResponse}");
|
||||
LogText($"Ad: {fm2014.Address} - FM2014 Firmware Version: {fm2014.FwVersion}");
|
||||
LogText($"Ad: {fm2014.Address} - FM2014 {StrLblFM2014SerialNumber} {fm2014.SerialNumber}");
|
||||
LogText(StrSeparator);
|
||||
}
|
||||
}
|
||||
@ -1214,18 +1209,19 @@ namespace Sensus.Ui.FM2014TestBench
|
||||
else if (e.StatusReturn == StatusReturn.MeasurementInRange)
|
||||
statusColor = ColorSuccess;
|
||||
|
||||
var timeUtcStr = $"{resp.TimestampUtc:yyyy-MM-dd HH:mm:ss} UTC";
|
||||
if (e.StatusReturn == StatusReturn.Failed)
|
||||
{
|
||||
LogErrorText($"{StrLblFM2014Address} {fm2014.Address} - {resp.AnswerStr}");
|
||||
LogErrorText($"{timeUtcStr} - Ad: {fm2014.Address} - {resp.AnswerStr}");
|
||||
//ErrorHandler(resp.CmdName);
|
||||
}
|
||||
else if (resp.IntValue == null && resp.DoubleValue == null)
|
||||
{
|
||||
LogText($"{StrLblFM2014Address} {fm2014.Address} - {resp.AnswerStr}");
|
||||
LogText($"{timeUtcStr} - Ad: {fm2014.Address} - {resp.AnswerStr}");
|
||||
}
|
||||
else if (resp.IntValue != null)
|
||||
{
|
||||
LogText($"{StrLblFM2014Address} {fm2014.Address} - {resp.AnswerStr}: {resp.IntValue:D} {resp.Unit}");
|
||||
LogText($"{timeUtcStr} - Ad: {fm2014.Address} - {resp.AnswerStr}: {resp.IntValue:D} {resp.Unit}");
|
||||
switch (resp.CmdName)
|
||||
{
|
||||
case CmdName.CmdGetRefPulsesRemaining:
|
||||
@ -1287,7 +1283,7 @@ namespace Sensus.Ui.FM2014TestBench
|
||||
}
|
||||
else if (resp.DoubleValue != null)
|
||||
{
|
||||
LogText($"{StrLblFM2014Address} {fm2014.Address} - {resp.AnswerStr}: {resp.DoubleValue:F4} {resp.Unit}");
|
||||
LogText($"{timeUtcStr} - Ad: {fm2014.Address} - {resp.AnswerStr}: {resp.DoubleValue:F4} {resp.Unit}");
|
||||
switch (resp.CmdName)
|
||||
{
|
||||
case CmdName.CmdGetRefTimerTicks:
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
@ -48,5 +46,5 @@ using System.Windows;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("1.0.1.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.1.0")]
|
||||
|
||||
@ -556,7 +556,7 @@ namespace Sensus.Ui.Fm2014TestBench.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to PC Date and Time [min:s]:.
|
||||
/// Looks up a localized string similar to Timestamp:.
|
||||
/// </summary>
|
||||
internal static string StrMsgPcDateTime {
|
||||
get {
|
||||
|
||||
@ -217,7 +217,7 @@
|
||||
<value>Zeit [min:s]:</value>
|
||||
</data>
|
||||
<data name="StrMsgPcDateTime" xml:space="preserve">
|
||||
<value>PC Datum und Zeit [min:s]:</value>
|
||||
<value>Zeitstempel:</value>
|
||||
</data>
|
||||
<data name="StrLblRefFrequencyHz" xml:space="preserve">
|
||||
<value>REF Frequenz [Hz]:</value>
|
||||
|
||||
@ -217,7 +217,7 @@
|
||||
<value>Time [min:s]:</value>
|
||||
</data>
|
||||
<data name="StrMsgPcDateTime" xml:space="preserve">
|
||||
<value>PC Date and Time [min:s]:</value>
|
||||
<value>Timestamp:</value>
|
||||
</data>
|
||||
<data name="StrLblRefFrequencyHz" xml:space="preserve">
|
||||
<value>REF Frequency [Hz]:</value>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user