MiniPrf: - verbose output

This commit is contained in:
Thomas Wiedebusch
2026-01-19 17:18:53 +01:00
parent f021a11b4f
commit 123e4a119a
17 changed files with 490 additions and 202 deletions
@@ -48,6 +48,10 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Co
/// </summary>
public enum CmdName
{
/// <summary>
///
/// </summary>
CMD_CONNECT,
/// <summary>
///
/// </summary>
@@ -216,6 +220,10 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Co
/// <summary>
///
/// </summary>
CMD_CAL_FLOW_RATE,
/// <summary>
///
/// </summary>
CMD_COR_CURRENT,
/// <summary>
///
@@ -353,6 +361,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Co
public static List<Cmd> CmdTbl = new List<Cmd>
{
// FM2014 control and information
new Cmd(CmdName.CMD_CONNECT, "", CmdType.INDIVIDUAL_WA, Resources.StrCmdMsgConnect),
new Cmd(CmdName.CMD_UNLOCK_SETUP, "&U@", CmdType.INDIVIDUAL_WA, Resources.StrCmdMsgUnlock),
new Cmd(CmdName.CMD_ERASE_SETUP, "&E@", CmdType.INDIVIDUAL_WA, Resources.StrCmdMsgErase),
new Cmd(CmdName.CMD_READ_EEP_MEAS_SETUP, "%D@", CmdType.INDIVIDUAL_WA, Resources.StrCmdMsgReadDefMeasSetup),
@@ -400,6 +409,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Co
new Cmd(CmdName.CMD_GET_REF_PERIOD, UNICODE_DLE, CmdType.INDIVIDUAL_WA, Resources.StrCmdMsgGetRefPeriod),
new Cmd(CmdName.CMD_GET_DUT_PERIOD, UNICODE_DC1, CmdType.INDIVIDUAL_WA, Resources.StrCmdMsgGetDutPeriod),
new Cmd(CmdName.CMD_GET_REF_FREQU, UNICODE_DC2, CmdType.INDIVIDUAL_WA, Resources.StrCmdMsgGetRefFrequ),
new Cmd(CmdName.CMD_CAL_FLOW_RATE, "", CmdType.INDIVIDUAL_WA, Resources.StrCalFlowRate),
// Adjustment, place here Ids which may represent digital numbers from A to F
new Cmd(CmdName.CMD_COR_CURRENT, "C", CmdType.BROADCAST, Resources.StrCmdMsgCorCurrent),
new Cmd(CmdName.CMD_SET_XTR_MAX, "+", CmdType.BROADCAST, Resources.StrCmdMsgSetXtrMax),
@@ -33,7 +33,6 @@
//using NLog;
using Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Consts;
using Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Properties;
using System;
using System.Collections.Generic;
@@ -173,12 +172,13 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
get => _ref_pulse_per_cm;
set
{
if (_ref_pulse_per_cm != value)
{
_ref_pulse_per_cm = value;
if (_dut_pulse_per_cm != 0)
RefToDutScale_norm = (Single)_ref_pulse_per_cm / _dut_pulse_per_cm;
}
// Check limits and equality
if (value < 1 || value > 9999 || _ref_pulse_per_cm == value)
return;
_ref_pulse_per_cm = value;
if (_dut_pulse_per_cm != 0)
RefToDutScale_norm = (Single)_ref_pulse_per_cm / _dut_pulse_per_cm;
}
}
@@ -189,12 +189,13 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
get => _dut_pulse_per_cm;
set
{
if (_dut_pulse_per_cm != value)
{
_dut_pulse_per_cm = value;
if (_dut_pulse_per_cm != 0)
RefToDutScale_norm = (Single)_ref_pulse_per_cm / _dut_pulse_per_cm;
}
// Check limits and equality
if (value < 1 || value > 9999 || _dut_pulse_per_cm == value)
return;
_dut_pulse_per_cm = value;
if (_dut_pulse_per_cm != 0)
RefToDutScale_norm = (Single)_ref_pulse_per_cm / _dut_pulse_per_cm;
}
}
@@ -218,6 +219,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
// Max value is "9999K+3" = 999.9f; Min value is "1000K-3" = 0.0001f
if (value > 999.9f || value < 0.0001f)
return;
_refToDutScale_norm = value;
var exponent = 4;
var number = _refToDutScale_norm;
@@ -241,6 +243,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
{
if (value < 1 || value > 9)
return;
_attenuation = value;
}
}
@@ -253,6 +256,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
internal set;
get;
}
/// <inheritdoc/>
public Boolean IsLoggedOn
{
@@ -355,7 +359,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
}
var cmdName = CmdName.CMD_NA;
var measurementInfoStr = "";
String measurementInfoStr;
// Prepare REF and/or DUT pulse counter measurement
try
@@ -544,13 +548,33 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
// {
// // Convert to m³/h (3600 s/h) and save the value
// RefFlowRate_cm_per_h = 3600.0f / (refPeriod * TMR_RESOLUTION_s) / Ref_pulse_per_cm;
// var response = new CmdResponse(cmdName, info, doubleValue: RefFlowRate_cm_per_h,
// siUnit: SiUnits.GetInfo(SiUnits.SiUnitName.FLOW_RATE_NON_SI));
// //var response = new CmdResponse(cmdName, info,
// // doubleValue: TMR_RESOLUTION_s * 1000.0f * refPeriod,
// // siUnit: SiUnits.GetInfo(SiUnits.SiUnitName.TIME));
// //OnRawRecordReceived?.Invoke(this,
// // new ProcessExecEventArgs("", actualProcessMessage: measurementInfo,
// // specificInfoObj: response));
// cmdName = CmdName.CMD_GET_REF_FREQU;
// var response = new CmdResponse(cmdName, info,
// doubleValue: 1.0f /(TMR_RESOLUTION_s * refPeriod),
// siUnit: SiUnits.GetInfo(SiUnits.SiUnitName.FREQUENCY));
// OnRawRecordReceived?.Invoke(this,
// new ProcessExecEventArgs("", actualProcessMessage: measurementInfo,
// specificInfoObj: response));
// // Transmit additionally the calculated flow rate
// cmdName = CmdName.CMD_CAL_FLOW_RATE;
// info = GetCmdInfo(cmdName);
// response = new CmdResponse(cmdName, info, doubleValue: RefFlowRate_cm_per_h,
// siUnit: "m" + SiUnits.GetInfo(SiUnits.SiUnitName.FLOW_RATE_NON_SI));
// OnRawRecordReceived?.Invoke(this,
// new ProcessExecEventArgs("", actualProcessMessage: measurementInfo,
// specificInfoObj: response));
// }
//}
cmdName = CmdName.CMD_GET_REF_FREQU;
info = GetCmdInfo(cmdName);
if (Write(cmdName))
@@ -560,7 +584,16 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
{
// Convert to m³/h (3600 s/h) and save the value
RefFlowRate_cm_per_h = 3600.0f * refFrequency / Ref_pulse_per_cm;
var response = new CmdResponse(cmdName, info, doubleValue: RefFlowRate_cm_per_h,
var response = new CmdResponse(cmdName, info, refFrequency,
siUnit: SiUnits.GetInfo(SiUnits.SiUnitName.FREQUENCY));
OnRawRecordReceived?.Invoke(this, new ProcessExecEventArgs("", actualProcessMessage: measurementInfo,
specificInfoObj: response));
// Transmit additionally the calculated flow rate
cmdName = CmdName.CMD_CAL_FLOW_RATE;
info = GetCmdInfo(cmdName);
response = new CmdResponse(cmdName, info, doubleValue: RefFlowRate_cm_per_h,
siUnit: SiUnits.GetInfo(SiUnits.SiUnitName.FLOW_RATE_NON_SI));
OnRawRecordReceived?.Invoke(this,
new ProcessExecEventArgs("", actualProcessMessage: measurementInfo,
@@ -628,6 +661,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
}
return false;
}
/// <summary>
/// Handle the standalone measurement which will be executed after BOOT of the FM2014:
/// - Read the setup stored to nonvolatile memory (EEPROM),
@@ -699,7 +733,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
if (str.Contains(StandAlonePartSearchScaleStr))
{
var strFields = str.Split(':');
var strCleaned = strFields[1].Replace(" ","");
var strCleaned = strFields[1].Replace(" ", "");
if (double.TryParse(strCleaned, NumberStyles.Float, new CultureInfo("en"), out var value))
{
cmdName = CmdName.CMD_REF_SET_SCALE;
@@ -805,10 +839,19 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
/// <summary>
/// Initiate the broadcast communication
/// </summary>
/// <remarks date="2026-Jan-08..19" author="Thomas Wiedebusch">
/// - Initial.
/// </remarks>
private Boolean InitiateBroadcastComm()
{
if (SerialPort == null)
{
var response = new CmdResponse(CmdName.CMD_ADDR_PC,
$"{Resources.StrCmdRespErrorBroadcast}");
OnRawRecordReceived?.Invoke(this, new ProcessExecEventArgs(Resources.StrError,
specificInfoObj: response,
statusReturn: StatusReturn.Failed));
BroadcastCommIsActive = false;
return false;
}
@@ -817,6 +860,12 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
SerialPort.Open();
if (!SerialPort.IsOpen)
{
var response = new CmdResponse(CmdName.CMD_ADDR_PC,
$"{Resources.StrCmdRespErrorBroadcast}");
OnRawRecordReceived?.Invoke(this, new ProcessExecEventArgs(Resources.StrError,
specificInfoObj: response,
statusReturn: StatusReturn.Failed));
BroadcastCommIsActive = false;
return false;
}
}
@@ -832,6 +881,10 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
// Establish connection to all FM2014s with broadcast address
// The direct write has to be used as this is being called from the 'Write' routine!!!!
SerialPort.Write(BROADCAST_ADDRESS + END_OF_STR);
var cmdName = CmdName.CMD_CONNECT;
var info = GetCmdInfo(cmdName) + ": " + BROADCAST_ADDRESS;
var response = new CmdResponse(cmdName, info);
OnRawRecordReceived?.Invoke(this, new ProcessExecEventArgs("", specificInfoObj: response));
BroadcastCommIsActive = true;
return true;
}
@@ -850,10 +903,18 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
/// Initiate communication to individual node
/// </summary>
/// <returns></returns>
/// <remarks date="2026-Jan-08..19" author="Thomas Wiedebusch">
/// - Initial.
/// </remarks>
private Boolean InitiateIndividualComm()
{
CmdResponse response;
if (SerialPort == null)
{
response = new CmdResponse(CmdName.CMD_ADDR_PC, $"{Resources.StrCmdRespErrorIndividual}");
OnRawRecordReceived?.Invoke(this, new ProcessExecEventArgs(Resources.StrError,
specificInfoObj: response,
statusReturn: StatusReturn.Failed));
return false;
}
@@ -862,6 +923,10 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
SerialPort.Open();
if (!SerialPort.IsOpen)
{
response = new CmdResponse(CmdName.CMD_ADDR_PC, $"{Resources.StrCmdRespErrorIndividual}");
OnRawRecordReceived?.Invoke(this, new ProcessExecEventArgs(Resources.StrError,
specificInfoObj: response,
statusReturn: StatusReturn.Failed));
return false;
}
}
@@ -876,6 +941,10 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
if (!string.IsNullOrEmpty(FullId))
{
var cmdName = CmdName.CMD_CONNECT;
var info = GetCmdInfo(cmdName) + ": " + AddressStr;
response = new CmdResponse(cmdName, info);
OnRawRecordReceived?.Invoke(this, new ProcessExecEventArgs("", specificInfoObj: response));
FullId = FullId.Replace(ADDR_RECORD_STR, "");
var fields = FullId.Split('.');
FwVersion = fields[1];
@@ -885,12 +954,16 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
}
catch (Exception e)
{
var response = new CmdResponse(CmdName.CMD_ADDR_PC,
$"{Resources.StrCmdRespErrorIndividual} - {e.Message}");
OnRawRecordReceived?.Invoke(this, new ProcessExecEventArgs(Resources.StrError, specificInfoObj: response,
statusReturn: StatusReturn.Failed));
response = new CmdResponse(CmdName.CMD_ADDR_PC,
$"{Resources.StrCmdRespErrorIndividual} - {e.Message}");
OnRawRecordReceived?.Invoke(this, new ProcessExecEventArgs(Resources.StrError,
specificInfoObj: response, statusReturn: StatusReturn.Failed));
}
response = new CmdResponse(CmdName.CMD_ADDR_PC,
$"{Resources.StrCmdRespErrorIndividual}");
OnRawRecordReceived?.Invoke(this, new ProcessExecEventArgs(Resources.StrError,
specificInfoObj: response, statusReturn: StatusReturn.Failed));
return false;
}
@@ -935,31 +1008,43 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
}
}
if (retVal)
if (!retVal)
{
var cmdCodeStr = GetCmdStr(cmdName);
// Without data the command alone needs to be sent
if (dataObj == null)
{
SerialPort.Write($"{cmdCodeStr}{END_OF_STR}");
}
else
{
// A string has to be entire assembled, only the string delimiter will to be added here
if (dataObj is String)
{
SerialPort.Write($"{dataObj}{END_OF_STR}");
}
// The data contains the preceding setup, the command code and string delimiter will be added here
if (dataObj is UInt16 || dataObj is Byte)
{
SerialPort.Write($"{dataObj}{cmdCodeStr}{END_OF_STR}");
}
}
return false;
}
return retVal;
var cmdCodeStr = GetCmdStr(cmdName);
var info = GetCmdInfo(cmdName);
var response = new CmdResponse();
// Without data the command alone needs to be sent
if (dataObj == null)
{
SerialPort.Write($"{cmdCodeStr}{END_OF_STR}");
var additionalInfo = GetCmdCmdType(cmdName) == CmdType.BROADCAST
? Resources.StrCommDirectionSetup
: Resources.StrCommDirectionRequest;
response = new CmdResponse(cmdName, additionalInfo + ": " + info);
}
else
{
// A string has to be entire assembled, only the string delimiter will to be added here
if (dataObj is String)
{
SerialPort.Write($"{dataObj}{END_OF_STR}");
response = new CmdResponse(cmdName, Resources.StrCommDirectionSetup + ": " + info + ": " + dataObj);
}
// The data contains the preceding setup, the command code and string delimiter will be added here
if (dataObj is UInt16 || dataObj is Byte)
{
SerialPort.Write($"{dataObj}{cmdCodeStr}{END_OF_STR}");
response = new CmdResponse(cmdName, Resources.StrCommDirectionSetup + ": " + info +
$": {dataObj}{cmdCodeStr}");
}
}
OnRawRecordReceived?.Invoke(this, new ProcessExecEventArgs("", specificInfoObj: response));
return true;
}
/// <summary>
@@ -62,7 +62,16 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Actuel regulation measurement.
/// Looks up a localized string similar to Flow rate.
/// </summary>
internal static string StrCalFlowRate {
get {
return ResourceManager.GetString("StrCalFlowRate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Actual regulation setup.
/// </summary>
internal static string StrCmdMsgActualDefMeasSetup {
get {
@@ -97,6 +106,15 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
}
/// <summary>
/// Looks up a localized string similar to Connect to address.
/// </summary>
internal static string StrCmdMsgConnect {
get {
return ResourceManager.GetString("StrCmdMsgConnect", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Start current offset correction.
/// </summary>
@@ -161,7 +179,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Set DUT pulses per m³.
/// Looks up a localized string similar to DUT pulses per m³.
/// </summary>
internal static string StrCmdMsgDutLppScale {
get {
@@ -251,7 +269,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Read value from virtual EEPROM address.
/// Looks up a localized string similar to Virtual EEPROM address.
/// </summary>
internal static string StrCmdMsgGetVirtualAddress {
get {
@@ -260,7 +278,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Set REF to DUT filter value.
/// Looks up a localized string similar to REF to DUT attenuation.
/// </summary>
internal static string StrCmdMsgMeasSetAttn {
get {
@@ -296,7 +314,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Read regulation measurement setup.
/// Looks up a localized string similar to Stored regulation measurement.
/// </summary>
internal static string StrCmdMsgReadDefMeasSetup {
get {
@@ -359,7 +377,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Set REF pulses per m³.
/// Looks up a localized string similar to REF pulses per m³.
/// </summary>
internal static string StrCmdMsgRefLppScale {
get {
@@ -377,7 +395,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Adjust REF to DUT pulse ratio.
/// Looks up a localized string similar to REF to DUT pulse ratio.
/// </summary>
internal static string StrCmdMsgRefSetScale {
get {
@@ -395,7 +413,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Stop measurement.
/// Looks up a localized string similar to Measurement STOP &amp; RESET.
/// </summary>
internal static string StrCmdMsgRstMeas {
get {
@@ -413,7 +431,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Double pulse detection switched off.
/// Looks up a localized string similar to Switching off the double pulse detection.
/// </summary>
internal static string StrCmdMsgSetDbplUnlock {
get {
@@ -422,7 +440,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Set value to virtual EEPROM address.
/// Looks up a localized string similar to Set virtual EEPROM address.
/// </summary>
internal static string StrCmdMsgSetVirtualAddress {
get {
@@ -449,7 +467,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Store actual regulation measurement as default.
/// Looks up a localized string similar to Store regulation settings as default.
/// </summary>
internal static string StrCmdMsgStoreDefMeasSetup {
get {
@@ -538,6 +556,24 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
}
/// <summary>
/// Looks up a localized string similar to Request.
/// </summary>
internal static string StrCommDirectionRequest {
get {
return ResourceManager.GetString("StrCommDirectionRequest", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Setup.
/// </summary>
internal static string StrCommDirectionSetup {
get {
return ResourceManager.GetString("StrCommDirectionSetup", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ERROR.
/// </summary>
@@ -584,7 +620,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.Pr
}
/// <summary>
/// Looks up a localized string similar to Default meaurement setup.
/// Looks up a localized string similar to Default measurement setup.
/// </summary>
internal static string StrMeasMsgStanaloneRegulation {
get {
@@ -124,7 +124,7 @@
<value>Start REF Impulszähler</value>
</data>
<data name="StrCmdMsgSetDbplUnlock" xml:space="preserve">
<value>Doppelimpulserkennung ausgeschaltet</value>
<value>Ausschaltung der Doppelimpulserkennung</value>
</data>
<data name="StrCmdMsgDutSetPls" xml:space="preserve">
<value>Einstellung zu zählende DUT Impulse</value>
@@ -157,10 +157,10 @@
<value>Zwischengespeicherte DUT Impulse</value>
</data>
<data name="StrCmdMsgRstMeas" xml:space="preserve">
<value>Stoppe Messung</value>
<value>Messung STOPP &amp; RESET</value>
</data>
<data name="StrCmdMsgRefSetScale" xml:space="preserve">
<value>Skaliere REF zu DUT Impulsverhältnis</value>
<value>REF zu DUT Impulsverhältnis</value>
</data>
<data name="StrCmdMsgDplsLockTmr" xml:space="preserve">
<value>Einstellung Doppelimpulstotzeitmillisekunden</value>
@@ -169,13 +169,13 @@
<value>Einstellung Doppelimpulstotzeitmultiplikator</value>
</data>
<data name="StrCmdMsgMeasSetAttn" xml:space="preserve">
<value>Einstellung REF zu DUT Filterwert </value>
<value>REF zu DUT Dämpfung</value>
</data>
<data name="StrCmdMsgDutLppScale" xml:space="preserve">
<value>Einstellung DUT Impulse pro m³</value>
<value>DUT Impulse pro m³</value>
</data>
<data name="StrCmdMsgRefLppScale" xml:space="preserve">
<value>Einstellung REF Impulse pro m³</value>
<value>REF Impulse pro m³</value>
</data>
<data name="StrCmdRespErrorParamOutOfRange" xml:space="preserve">
<value>Parameterbereichsüberschreitung</value>
@@ -225,14 +225,11 @@
<data name="StrCmdMsgSetXtrMin" xml:space="preserve">
<value>Toleranzanzeige auf Miniimum stellen</value>
</data>
<data name="StrCmdMsgAddrPc" xml:space="preserve">
<value>Adresse</value>
</data>
<data name="StrCmdMsgUnlock" xml:space="preserve">
<value>Löschverriegelung aufheben</value>
</data>
<data name="StrCmdMsgReadDefMeasSetup" xml:space="preserve">
<value>Auslesen Regulierungsmessungseinstellungen</value>
<value>Gespeicherte Regulierungseinstellungen</value>
</data>
<data name="StrCmdMsgBootMode" xml:space="preserve">
<value>Starte Bootcode</value>
@@ -244,7 +241,7 @@
<value>Baudrate</value>
</data>
<data name="StrCmdMsgGetVirtualAddress" xml:space="preserve">
<value>Wert von virtuelle EEPROM Adresse auslesen</value>
<value>Virtuelle EEPROM Adresse auslesen</value>
</data>
<data name="StrCmdMsgSerial" xml:space="preserve">
<value>Seriennummer</value>
@@ -253,7 +250,7 @@
<value>Statuscode</value>
</data>
<data name="StrCmdMsgSetVirtualAddress" xml:space="preserve">
<value>Wert an virtuelle EEPROM Adresse schreiben</value>
<value>Virtuelle EEPROM Adresse schreiben</value>
</data>
<data name="StrCmdMsgPrintStatistics" xml:space="preserve">
<value>Ermittelte Laufzeit in Stunden</value>
@@ -265,10 +262,10 @@
<value>Löschen von Einstellungen</value>
</data>
<data name="StrCmdMsgActualDefMeasSetup" xml:space="preserve">
<value>Aktuelle Regulierungsmessung</value>
<value>Aktuelle Regulierungseinstellungen</value>
</data>
<data name="StrCmdMsgStoreDefMeasSetup" xml:space="preserve">
<value>Aktuelle Regulierungsmessung als Standard speichern</value>
<value>Regulierungseinstellungen als Standard speichern</value>
</data>
<data name="StrCmdMsgPrintBootInfo" xml:space="preserve">
<value>Bootcodeinformation</value>
@@ -294,4 +291,19 @@
<data name="StrMeasMsgStanaloneRegulation" xml:space="preserve">
<value>Standardmessungseinstellungen</value>
</data>
<data name="StrCmdMsgAddrPc" xml:space="preserve">
<value>Adresse</value>
</data>
<data name="StrCmdMsgConnect" xml:space="preserve">
<value>Verbinde mit Adresse</value>
</data>
<data name="StrCommDirectionSetup" xml:space="preserve">
<value>Einstellung</value>
</data>
<data name="StrCommDirectionRequest" xml:space="preserve">
<value>Abfrage</value>
</data>
<data name="StrCalFlowRate" xml:space="preserve">
<value>Durchflußrate</value>
</data>
</root>
@@ -124,7 +124,7 @@
<value>Start REF pulse counter</value>
</data>
<data name="StrCmdMsgSetDbplUnlock" xml:space="preserve">
<value>Double pulse detection switched off</value>
<value>Switching off the double pulse detection</value>
</data>
<data name="StrCmdMsgDutSetPls" xml:space="preserve">
<value>Required DUT pulse setup</value>
@@ -157,10 +157,10 @@
<value>Backup counted DUT pulses</value>
</data>
<data name="StrCmdMsgRstMeas" xml:space="preserve">
<value>Stop measurement</value>
<value>Measurement STOP &amp; RESET</value>
</data>
<data name="StrCmdMsgRefSetScale" xml:space="preserve">
<value>Adjust REF to DUT pulse ratio</value>
<value>REF to DUT pulse ratio</value>
</data>
<data name="StrCmdMsgDplsLockTmr" xml:space="preserve">
<value>Set double pulse dead time milliseconds</value>
@@ -169,13 +169,13 @@
<value>Set double pulse dead time multiplier</value>
</data>
<data name="StrCmdMsgMeasSetAttn" xml:space="preserve">
<value>Set REF to DUT filter value</value>
<value>REF to DUT attenuation</value>
</data>
<data name="StrCmdMsgDutLppScale" xml:space="preserve">
<value>Set DUT pulses per m³</value>
<value>DUT pulses per m³</value>
</data>
<data name="StrCmdMsgRefLppScale" xml:space="preserve">
<value>Set REF pulses per m³</value>
<value>REF pulses per m³</value>
</data>
<data name="StrCmdRespErrorParamOutOfRange" xml:space="preserve">
<value>Parameter is out of range</value>
@@ -225,14 +225,11 @@
<data name="StrCmdMsgSetXtrMin" xml:space="preserve">
<value>Set tolerance display to minimum</value>
</data>
<data name="StrCmdMsgAddrPc" xml:space="preserve">
<value>Address</value>
</data>
<data name="StrCmdMsgUnlock" xml:space="preserve">
<value>Unlock erase critical settings</value>
</data>
<data name="StrCmdMsgReadDefMeasSetup" xml:space="preserve">
<value>Read regulation measurement setup</value>
<value>Stored regulation measurement</value>
</data>
<data name="StrCmdMsgBootMode" xml:space="preserve">
<value>Start boot code</value>
@@ -244,7 +241,7 @@
<value>Baudrate</value>
</data>
<data name="StrCmdMsgGetVirtualAddress" xml:space="preserve">
<value>Read value from virtual EEPROM address</value>
<value>Virtual EEPROM address</value>
</data>
<data name="StrCmdMsgSerial" xml:space="preserve">
<value>Serial number</value>
@@ -253,7 +250,7 @@
<value>Status code</value>
</data>
<data name="StrCmdMsgSetVirtualAddress" xml:space="preserve">
<value>Set value to virtual EEPROM address</value>
<value>Set virtual EEPROM address</value>
</data>
<data name="StrCmdMsgPrintStatistics" xml:space="preserve">
<value>Readout lifetime in hours</value>
@@ -265,10 +262,10 @@
<value>Erase critical settings</value>
</data>
<data name="StrCmdMsgActualDefMeasSetup" xml:space="preserve">
<value>Actuel regulation measurement</value>
<value>Actual regulation setup</value>
</data>
<data name="StrCmdMsgStoreDefMeasSetup" xml:space="preserve">
<value>Store actual regulation measurement as default</value>
<value>Store regulation settings as default</value>
</data>
<data name="StrCmdMsgPrintBootInfo" xml:space="preserve">
<value>Boot code information</value>
@@ -292,6 +289,21 @@
<value>Regulation DUT to REF</value>
</data>
<data name="StrMeasMsgStanaloneRegulation" xml:space="preserve">
<value>Default meaurement setup</value>
<value>Default measurement setup</value>
</data>
<data name="StrCmdMsgAddrPc" xml:space="preserve">
<value>Address</value>
</data>
<data name="StrCmdMsgConnect" xml:space="preserve">
<value>Connect to address</value>
</data>
<data name="StrCommDirectionSetup" xml:space="preserve">
<value>Setup</value>
</data>
<data name="StrCommDirectionRequest" xml:space="preserve">
<value>Request</value>
</data>
<data name="StrCalFlowRate" xml:space="preserve">
<value>Flow rate</value>
</data>
</root>
@@ -100,7 +100,12 @@ namespace Xylem.Common.Metrology.Measurements.Consts
/// <summary>
///
/// </summary>
PRESSURE
PRESSURE,
/// <summary>
///
/// </summary>
FREQUENCY
}
@@ -147,6 +152,7 @@ namespace Xylem.Common.Metrology.Measurements.Consts
new SiUnit(SiUnitName.TEMPERATURE, "°C"),
new SiUnit(SiUnitName.TIME, "s"),
new SiUnit(SiUnitName.PRESSURE, "Pa"),
new SiUnit(SiUnitName.FREQUENCY, "Hz"),
};
/// <summary>
+92 -39
View File
@@ -58,7 +58,6 @@
this.tmrProgressUpdate = new System.Windows.Forms.Timer(this.components);
this.lblTimeText = new System.Windows.Forms.Label();
this.lblWaitingForMeterResponse = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.barSingleProgressUpdate = new System.Windows.Forms.ProgressBar();
this.lblActualProcess = new System.Windows.Forms.Label();
this.btnDutToRefRegulation = new System.Windows.Forms.Button();
@@ -71,16 +70,22 @@
this.tbxMeasuredRefPulses = new System.Windows.Forms.TextBox();
this.btnManualRefCalibration = new System.Windows.Forms.Button();
this.gbxDutToRefRegulation = new System.Windows.Forms.GroupBox();
this.lblRefFrequencyHz = new System.Windows.Forms.Label();
this.tbxRefFrequencyHz = new System.Windows.Forms.TextBox();
this.chkUseDampedTolerance = new System.Windows.Forms.CheckBox();
this.lblActualMeasuredTolerance = new System.Windows.Forms.Label();
this.tbxActualMeasuredToleranceDutToRef = new System.Windows.Forms.TextBox();
this.lblActualFlowRateCmPerHour = new System.Windows.Forms.Label();
this.tbxActualFlowRateCmPerHour = new System.Windows.Forms.TextBox();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.picFM2014 = new System.Windows.Forms.PictureBox();
this.gbxFM2014Setup.SuspendLayout();
this.gbxRegulationSetup.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.gbxManualRefCalibration.SuspendLayout();
this.gbxDutToRefRegulation.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picFM2014)).BeginInit();
this.SuspendLayout();
//
// gbxFM2014Setup
@@ -98,9 +103,9 @@
this.gbxFM2014Setup.Controls.Add(this.lblConnectFM2014);
this.gbxFM2014Setup.Controls.Add(this.tbxFM2014FullId);
this.gbxFM2014Setup.Controls.Add(this.tbxFM2014ApplicationFwVersion);
this.gbxFM2014Setup.Location = new System.Drawing.Point(8, 6);
this.gbxFM2014Setup.Location = new System.Drawing.Point(78, 27);
this.gbxFM2014Setup.Name = "gbxFM2014Setup";
this.gbxFM2014Setup.Size = new System.Drawing.Size(275, 210);
this.gbxFM2014Setup.Size = new System.Drawing.Size(260, 210);
this.gbxFM2014Setup.TabIndex = 84;
this.gbxFM2014Setup.TabStop = false;
this.gbxFM2014Setup.Text = "FM2014";
@@ -193,9 +198,9 @@
//
// btnFM2014Connect
//
this.btnFM2014Connect.Location = new System.Drawing.Point(150, 175);
this.btnFM2014Connect.Location = new System.Drawing.Point(10, 179);
this.btnFM2014Connect.Name = "btnFM2014Connect";
this.btnFM2014Connect.Size = new System.Drawing.Size(100, 25);
this.btnFM2014Connect.Size = new System.Drawing.Size(110, 25);
this.btnFM2014Connect.TabIndex = 0;
this.btnFM2014Connect.Text = "Connect";
this.btnFM2014Connect.UseVisualStyleBackColor = true;
@@ -258,18 +263,18 @@
this.gbxRegulationSetup.Controls.Add(this.tbxRefPulsePerCm);
this.gbxRegulationSetup.Controls.Add(this.tbxDutPulsePerCm);
this.gbxRegulationSetup.Controls.Add(this.tbxScaleRefToDut);
this.gbxRegulationSetup.Location = new System.Drawing.Point(8, 222);
this.gbxRegulationSetup.Location = new System.Drawing.Point(77, 243);
this.gbxRegulationSetup.Name = "gbxRegulationSetup";
this.gbxRegulationSetup.Size = new System.Drawing.Size(275, 161);
this.gbxRegulationSetup.Size = new System.Drawing.Size(260, 161);
this.gbxRegulationSetup.TabIndex = 82;
this.gbxRegulationSetup.TabStop = false;
this.gbxRegulationSetup.Text = "Regulation Setup";
//
// btnSaveRegulationSetup
//
this.btnSaveRegulationSetup.Location = new System.Drawing.Point(150, 126);
this.btnSaveRegulationSetup.Location = new System.Drawing.Point(11, 130);
this.btnSaveRegulationSetup.Name = "btnSaveRegulationSetup";
this.btnSaveRegulationSetup.Size = new System.Drawing.Size(100, 25);
this.btnSaveRegulationSetup.Size = new System.Drawing.Size(110, 25);
this.btnSaveRegulationSetup.TabIndex = 7;
this.btnSaveRegulationSetup.Text = "Save";
this.btnSaveRegulationSetup.UseVisualStyleBackColor = true;
@@ -363,7 +368,7 @@
// lblUpdateTimeValue
//
this.lblUpdateTimeValue.AutoSize = true;
this.lblUpdateTimeValue.Location = new System.Drawing.Point(290, 393);
this.lblUpdateTimeValue.Location = new System.Drawing.Point(331, 413);
this.lblUpdateTimeValue.Name = "lblUpdateTimeValue";
this.lblUpdateTimeValue.Size = new System.Drawing.Size(28, 13);
this.lblUpdateTimeValue.TabIndex = 81;
@@ -377,7 +382,7 @@
// lblTimeText
//
this.lblTimeText.AutoSize = true;
this.lblTimeText.Location = new System.Drawing.Point(218, 393);
this.lblTimeText.Location = new System.Drawing.Point(259, 413);
this.lblTimeText.Name = "lblTimeText";
this.lblTimeText.Size = new System.Drawing.Size(66, 13);
this.lblTimeText.TabIndex = 79;
@@ -387,34 +392,24 @@
//
this.lblWaitingForMeterResponse.AutoSize = true;
this.lblWaitingForMeterResponse.ForeColor = System.Drawing.Color.Red;
this.lblWaitingForMeterResponse.Location = new System.Drawing.Point(381, 393);
this.lblWaitingForMeterResponse.Location = new System.Drawing.Point(421, 413);
this.lblWaitingForMeterResponse.Name = "lblWaitingForMeterResponse";
this.lblWaitingForMeterResponse.Size = new System.Drawing.Size(183, 13);
this.lblWaitingForMeterResponse.TabIndex = 76;
this.lblWaitingForMeterResponse.Text = "WAITING FOR FM2014 RESPONSE";
//
// pictureBox1
//
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox1.Image = global::Sensus.MiniPrf.Ui.Properties.Resources.Sensus_Logo;
this.pictureBox1.Location = new System.Drawing.Point(395, 6);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(170, 54);
this.pictureBox1.TabIndex = 78;
this.pictureBox1.TabStop = false;
//
// barSingleProgressUpdate
//
this.barSingleProgressUpdate.Location = new System.Drawing.Point(7, 409);
this.barSingleProgressUpdate.Location = new System.Drawing.Point(7, 429);
this.barSingleProgressUpdate.Name = "barSingleProgressUpdate";
this.barSingleProgressUpdate.Size = new System.Drawing.Size(558, 18);
this.barSingleProgressUpdate.Size = new System.Drawing.Size(597, 18);
this.barSingleProgressUpdate.TabIndex = 75;
this.barSingleProgressUpdate.Visible = false;
//
// lblActualProcess
//
this.lblActualProcess.AutoSize = true;
this.lblActualProcess.Location = new System.Drawing.Point(5, 393);
this.lblActualProcess.Location = new System.Drawing.Point(5, 413);
this.lblActualProcess.Name = "lblActualProcess";
this.lblActualProcess.Size = new System.Drawing.Size(76, 13);
this.lblActualProcess.TabIndex = 74;
@@ -422,9 +417,9 @@
//
// btnDutToRefRegulation
//
this.btnDutToRefRegulation.Location = new System.Drawing.Point(150, 75);
this.btnDutToRefRegulation.Location = new System.Drawing.Point(10, 129);
this.btnDutToRefRegulation.Name = "btnDutToRefRegulation";
this.btnDutToRefRegulation.Size = new System.Drawing.Size(100, 25);
this.btnDutToRefRegulation.Size = new System.Drawing.Size(110, 25);
this.btnDutToRefRegulation.TabIndex = 11;
this.btnDutToRefRegulation.Text = "Start Regulation";
this.btnDutToRefRegulation.UseVisualStyleBackColor = true;
@@ -439,9 +434,9 @@
this.gbxManualRefCalibration.Controls.Add(this.lblMeasuredRefPulses);
this.gbxManualRefCalibration.Controls.Add(this.tbxMeasuredRefPulses);
this.gbxManualRefCalibration.Controls.Add(this.btnManualRefCalibration);
this.gbxManualRefCalibration.Location = new System.Drawing.Point(293, 66);
this.gbxManualRefCalibration.Location = new System.Drawing.Point(344, 87);
this.gbxManualRefCalibration.Name = "gbxManualRefCalibration";
this.gbxManualRefCalibration.Size = new System.Drawing.Size(275, 150);
this.gbxManualRefCalibration.Size = new System.Drawing.Size(260, 150);
this.gbxManualRefCalibration.TabIndex = 83;
this.gbxManualRefCalibration.TabStop = false;
this.gbxManualRefCalibration.Text = "Manual REF Calibration";
@@ -503,9 +498,9 @@
//
// btnManualRefCalibration
//
this.btnManualRefCalibration.Location = new System.Drawing.Point(150, 115);
this.btnManualRefCalibration.Location = new System.Drawing.Point(10, 119);
this.btnManualRefCalibration.Name = "btnManualRefCalibration";
this.btnManualRefCalibration.Size = new System.Drawing.Size(100, 25);
this.btnManualRefCalibration.Size = new System.Drawing.Size(110, 25);
this.btnManualRefCalibration.TabIndex = 9;
this.btnManualRefCalibration.Text = "Start Calibration";
this.btnManualRefCalibration.UseVisualStyleBackColor = true;
@@ -513,23 +508,43 @@
//
// gbxDutToRefRegulation
//
this.gbxDutToRefRegulation.Controls.Add(this.lblRefFrequencyHz);
this.gbxDutToRefRegulation.Controls.Add(this.tbxRefFrequencyHz);
this.gbxDutToRefRegulation.Controls.Add(this.chkUseDampedTolerance);
this.gbxDutToRefRegulation.Controls.Add(this.lblActualMeasuredTolerance);
this.gbxDutToRefRegulation.Controls.Add(this.tbxActualMeasuredToleranceDutToRef);
this.gbxDutToRefRegulation.Controls.Add(this.lblActualFlowRateCmPerHour);
this.gbxDutToRefRegulation.Controls.Add(this.tbxActualFlowRateCmPerHour);
this.gbxDutToRefRegulation.Controls.Add(this.btnDutToRefRegulation);
this.gbxDutToRefRegulation.Location = new System.Drawing.Point(290, 222);
this.gbxDutToRefRegulation.Location = new System.Drawing.Point(344, 244);
this.gbxDutToRefRegulation.Name = "gbxDutToRefRegulation";
this.gbxDutToRefRegulation.Size = new System.Drawing.Size(275, 161);
this.gbxDutToRefRegulation.Size = new System.Drawing.Size(260, 161);
this.gbxDutToRefRegulation.TabIndex = 84;
this.gbxDutToRefRegulation.TabStop = false;
this.gbxDutToRefRegulation.Text = "DUT to REF Regulation";
//
// lblRefFrequencyHz
//
this.lblRefFrequencyHz.AutoSize = true;
this.lblRefFrequencyHz.Location = new System.Drawing.Point(10, 76);
this.lblRefFrequencyHz.Name = "lblRefFrequencyHz";
this.lblRefFrequencyHz.Size = new System.Drawing.Size(106, 13);
this.lblRefFrequencyHz.TabIndex = 79;
this.lblRefFrequencyHz.Text = "REF Frequency [Hz]:";
//
// tbxRefFrequencyHz
//
this.tbxRefFrequencyHz.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefFrequencyHz.Location = new System.Drawing.Point(150, 74);
this.tbxRefFrequencyHz.Name = "tbxRefFrequencyHz";
this.tbxRefFrequencyHz.ReadOnly = true;
this.tbxRefFrequencyHz.Size = new System.Drawing.Size(100, 20);
this.tbxRefFrequencyHz.TabIndex = 78;
//
// chkUseDampedTolerance
//
this.chkUseDampedTolerance.AutoSize = true;
this.chkUseDampedTolerance.Location = new System.Drawing.Point(13, 131);
this.chkUseDampedTolerance.Location = new System.Drawing.Point(9, 100);
this.chkUseDampedTolerance.Name = "chkUseDampedTolerance";
this.chkUseDampedTolerance.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.chkUseDampedTolerance.Size = new System.Drawing.Size(134, 17);
@@ -574,11 +589,41 @@
this.tbxActualFlowRateCmPerHour.Size = new System.Drawing.Size(100, 20);
this.tbxActualFlowRateCmPerHour.TabIndex = 75;
//
// menuStrip1
//
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(610, 24);
this.menuStrip1.TabIndex = 85;
this.menuStrip1.Text = "menuStrip1";
//
// pictureBox1
//
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pictureBox1.Image = global::Sensus.MiniPrf.Ui.Properties.Resources.Sensus_A;
this.pictureBox1.Location = new System.Drawing.Point(455, 32);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(149, 46);
this.pictureBox1.TabIndex = 86;
this.pictureBox1.TabStop = false;
//
// picFM2014
//
this.picFM2014.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.picFM2014.Image = global::Sensus.MiniPrf.Ui.Properties.Resources.FM2014_58x172;
this.picFM2014.Location = new System.Drawing.Point(7, 32);
this.picFM2014.Name = "picFM2014";
this.picFM2014.Size = new System.Drawing.Size(60, 176);
this.picFM2014.TabIndex = 87;
this.picFM2014.TabStop = false;
//
// FrmMainMiniPrf
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(573, 443);
this.ClientSize = new System.Drawing.Size(610, 464);
this.Controls.Add(this.picFM2014);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.gbxDutToRefRegulation);
this.Controls.Add(this.gbxFM2014Setup);
this.Controls.Add(this.gbxRegulationSetup);
@@ -586,10 +631,13 @@
this.Controls.Add(this.gbxManualRefCalibration);
this.Controls.Add(this.lblTimeText);
this.Controls.Add(this.lblWaitingForMeterResponse);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.barSingleProgressUpdate);
this.Controls.Add(this.lblActualProcess);
this.Controls.Add(this.menuStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.MaximumSize = new System.Drawing.Size(626, 503);
this.MinimumSize = new System.Drawing.Size(626, 503);
this.Name = "FrmMainMiniPrf";
this.Text = "MiniPrf";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FrmMainMiniPrf_FormClosed);
@@ -598,11 +646,12 @@
this.gbxFM2014Setup.PerformLayout();
this.gbxRegulationSetup.ResumeLayout(false);
this.gbxRegulationSetup.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.gbxManualRefCalibration.ResumeLayout(false);
this.gbxManualRefCalibration.PerformLayout();
this.gbxDutToRefRegulation.ResumeLayout(false);
this.gbxDutToRefRegulation.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picFM2014)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -632,7 +681,6 @@
private System.Windows.Forms.TextBox tbxFM2014ApplicationFwVersion;
private System.Windows.Forms.Label lblTimeText;
private System.Windows.Forms.Label lblWaitingForMeterResponse;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.ProgressBar barSingleProgressUpdate;
private System.Windows.Forms.Label lblActualProcess;
private System.Windows.Forms.ComboBox cbxFM2014TolerancePercent;
@@ -656,6 +704,11 @@
private System.Windows.Forms.TextBox tbxActualFlowRateCmPerHour;
private System.Windows.Forms.CheckBox chkUseDampedTolerance;
private System.Windows.Forms.Button btnSaveRegulationSetup;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.PictureBox picFM2014;
private System.Windows.Forms.TextBox tbxRefFrequencyHz;
private System.Windows.Forms.Label lblRefFrequencyHz;
}
}
+107 -64
View File
@@ -225,6 +225,7 @@ namespace Sensus.MiniPrf.Ui
tbxActualMeasuredToleranceDutToRef.Text = "";
chkUseDampedTolerance.Text = Resources.StrChkUseDampedTolerance;
btnDutToRefRegulation.Text = Resources.StrBtnStartRegulation;
tbxRefFrequencyHz.Text = "";
// Process status
lblActualProcess.Text = Resources.StrLblProcessStatus;
@@ -473,15 +474,15 @@ namespace Sensus.MiniPrf.Ui
tbxFM2014FullId.Visible = true;
tbxFM2014ApplicationFwVersion.Text = Fm2014.FwVersion;
tbxFM2014SerialNumber.Text = Fm2014.SerialNumber;
// Logging to history window
LogText("FM2014 ID:\t\t" + Fm2014.FullId);
LogText("FM2014 Firmware Version:\t" + Fm2014.FwVersion);
LogText($"FM2014 {Resources.StrLblFM2014SerialNumber}\t" + Fm2014.SerialNumber);
LogText($"FW2014 {Resources.StrLblFM2014Address}\t\t" + Fm2014.Address);
LogText("FM2014 ID: " + Fm2014.FullId);
LogText("FM2014 Firmware Version: " + Fm2014.FwVersion);
LogText($"FM2014 {Resources.StrLblFM2014SerialNumber} " + Fm2014.SerialNumber);
LogText($"FW2014 {Resources.StrLblFM2014Address} " + Fm2014.Address);
var dt = DateTime.UtcNow;
var msg = $"{dt:yyyy-MM-dd HH:mm:ss} UTC";
LogText($"{Resources.StrMsgPcDateTime}\t{msg}");
LogText($"{Resources.StrMsgPcDateTime} {msg}");
CheckUpdateEnabled();
}));
@@ -708,6 +709,7 @@ namespace Sensus.MiniPrf.Ui
tbxRefCalibrationResultPulsePerCm.Text = "";
tbxActualFlowRateCmPerHour.Text = "";
tbxActualMeasuredToleranceDutToRef.Text = "";
tbxRefFrequencyHz.Text = "";
_backupMeasuredRefPulsesStr = "";
_backupRefCalibrationResultPulsePerCmStr = "";
@@ -820,6 +822,19 @@ namespace Sensus.MiniPrf.Ui
tbxRefPulsesPerCm_Leave(this, null);
}
}
/// <summary>
/// Common method to prepare for changed setup.
/// </summary>
private void SetupHasChanged()
{
_regulationSetupHasChanged = true;
btnSaveRegulationSetup.Enabled = true;
tbxActualFlowRateCmPerHour.Text = "";
tbxActualMeasuredToleranceDutToRef.Text = "";
tbxRefFrequencyHz.Text = "";
}
/// <summary>
/// After manual input of the REF pulses per cubic meter the scale REF to DUT has to be recalculated
/// </summary>
@@ -831,40 +846,44 @@ namespace Sensus.MiniPrf.Ui
private void tbxRefPulsesPerCm_Leave(Object sender, EventArgs e)
{
// Setup FM2014
if (Fm2014 != null && int.TryParse(tbxRefPulsePerCm.Text, out var pulses_per_cm))
if (Fm2014 != null && ushort.TryParse(tbxRefPulsePerCm.Text, out var pulses_per_cm))
{
if (pulses_per_cm != Fm2014.Ref_pulse_per_cm)
//Backup the actual setting to detect changes
var backupPulses_per_cm = Fm2014.Ref_pulse_per_cm;
Fm2014.Ref_pulse_per_cm = pulses_per_cm;
// Output the Fm2014 setting to avoid wrong display of invalid ranges as this will be
// limited during the setup of the FM2014 property!
tbxRefPulsePerCm.Text = $@"{Fm2014.Ref_pulse_per_cm:D}";
// During setup of the 'Ref_pulse_per_cm' the 'RefToDutScaleStr' will be generated
tbxScaleRefToDut.Text = $@"{Fm2014.RefToDutScale_norm:F3}";
// Check if values have changed and need to be updated in the standalone setup
if (backupPulses_per_cm != Fm2014.Ref_pulse_per_cm)
{
_regulationSetupHasChanged = true;
btnSaveRegulationSetup.Enabled = true;
tbxActualFlowRateCmPerHour.Text = "";
tbxActualMeasuredToleranceDutToRef.Text = "";
SetupHasChanged();
}
Fm2014.Ref_pulse_per_cm = (UInt16)pulses_per_cm;
// During setup of the 'Ref_pulse_per_cm' the 'RefToDutScaleStr' will be generated
tbxScaleRefToDut.Text = $@"{Fm2014.RefToDutScale_norm:F3}";
// SPECIAL BACKUP AND RESTORE FOR REF CALIBRATION
// SPECIAL BACKUP AND RESTORE FOR REF CALIBRATION
// If the REF pulses per cubic meter have been changed manually, the 'Manual REF Calibration'
// fields have to be cleared if those are different. A backup to restore it may be useful.
if (!tbxRefPulsePerCm.Text.Equals(tbxRefCalibrationResultPulsePerCm.Text) &&
!string.IsNullOrEmpty(tbxRefCalibrationResultPulsePerCm.Text))
{
_backupMeasuredRefPulsesStr = tbxMeasuredRefPulses.Text;
tbxMeasuredRefPulses.Text = "";
_backupRefCalibrationResultPulsePerCmStr = tbxRefCalibrationResultPulsePerCm.Text;
tbxRefCalibrationResultPulsePerCm.Text = "";
_backupWeightScaleVolumeLitersStr = tbxManualInputVolumeLiters.Text;
tbxManualInputVolumeLiters.Text = "";
}
// Restore values if REF pulses per cubic meters is back to the calibrated one
else if (tbxRefPulsePerCm.Text.Equals(_backupRefCalibrationResultPulsePerCmStr))
{
tbxMeasuredRefPulses.Text = _backupMeasuredRefPulsesStr;
tbxRefCalibrationResultPulsePerCm.Text = _backupRefCalibrationResultPulsePerCmStr;
tbxManualInputVolumeLiters.Text = _backupWeightScaleVolumeLitersStr;
}
// If the REF pulses per cubic meter have been changed manually, the 'Manual REF Calibration'
// fields have to be cleared if those are different. A backup to restore it may be useful.
if (!tbxRefPulsePerCm.Text.Equals(tbxRefCalibrationResultPulsePerCm.Text) &&
!string.IsNullOrEmpty(tbxRefCalibrationResultPulsePerCm.Text))
{
_backupMeasuredRefPulsesStr = tbxMeasuredRefPulses.Text;
tbxMeasuredRefPulses.Text = "";
_backupRefCalibrationResultPulsePerCmStr = tbxRefCalibrationResultPulsePerCm.Text;
tbxRefCalibrationResultPulsePerCm.Text = "";
_backupWeightScaleVolumeLitersStr = tbxManualInputVolumeLiters.Text;
tbxManualInputVolumeLiters.Text = "";
}
// Restore values if REF pulses per cubic meters is back to the calibrated one
else if (tbxRefPulsePerCm.Text.Equals(_backupRefCalibrationResultPulsePerCmStr))
{
tbxMeasuredRefPulses.Text = _backupMeasuredRefPulsesStr;
tbxRefCalibrationResultPulsePerCm.Text = _backupRefCalibrationResultPulsePerCmStr;
tbxManualInputVolumeLiters.Text = _backupWeightScaleVolumeLitersStr;
}
}
}
@@ -888,23 +907,27 @@ namespace Sensus.MiniPrf.Ui
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks date="2023-Jan-14..17" author="Thomas Wiedebusch">
/// <remarks date="2023-Jan-14..19" author="Thomas Wiedebusch">
/// - Initial.
/// </remarks>
private void tbxDutPulsesPerCm_Leave(Object sender, EventArgs e)
{
// Setup FM2014
if (Fm2014 != null && int.TryParse(tbxDutPulsePerCm.Text, out var pulses_per_cm))
if (Fm2014 != null && ushort.TryParse(tbxDutPulsePerCm.Text, out var pulses_per_cm))
{
if (pulses_per_cm != Fm2014.Dut_pulse_per_cm)
//Backup the actual setting to detect changes
var backupPulses_per_cm = Fm2014.Dut_pulse_per_cm;
// Try to set the new calculated REF pulses limited by the property setter
Fm2014.Dut_pulse_per_cm = pulses_per_cm;
// Output the Fm2014 setting to avoid wrong display of invalid ranges as this will be
// limited during the setup of the FM2014 property!
tbxDutPulsePerCm.Text = $@"{Fm2014.Dut_pulse_per_cm:D}";
// During setup of the 'Dut_pulse_per_cm' the 'RefToDutScaleStr' will be generated
tbxScaleRefToDut.Text = $@"{Fm2014.RefToDutScale_norm:F3}";
// Check if values have changed and need to be updated in the standalone setup
if (backupPulses_per_cm != Fm2014.Dut_pulse_per_cm)
{
_regulationSetupHasChanged = true;
btnSaveRegulationSetup.Enabled = true;
tbxActualFlowRateCmPerHour.Text = "";
tbxActualMeasuredToleranceDutToRef.Text = "";
Fm2014.Dut_pulse_per_cm = (UInt16)pulses_per_cm;
tbxScaleRefToDut.Text = $@"{Fm2014.RefToDutScale_norm:F3}";
SetupHasChanged();
}
}
}
@@ -931,32 +954,41 @@ namespace Sensus.MiniPrf.Ui
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks date="2023-Jan-15..18" author="Thomas Wiedebusch">
/// <remarks date="2023-Jan-15..19" author="Thomas Wiedebusch">
/// - Initial.
/// </remarks>
private void tbxManualInputVolumeLiters_Leave(Object sender, EventArgs e)
{
// Calculate REF pulses per cubic meter
if (int.TryParse(tbxMeasuredRefPulses.Text, out var pulses) && pulses > 0 &&
int.TryParse(tbxManualInputVolumeLiters.Text, out var liters) && liters > 0)
if (ushort.TryParse(tbxMeasuredRefPulses.Text, out var pulses) && pulses > 0 &&
ushort.TryParse(tbxManualInputVolumeLiters.Text, out var liters) && liters > 0)
{
tbxRefCalibrationResultPulsePerCm.Text = $@"{(UInt16)(pulses / (liters / 1000.0f))}";
// Copy from REF pulses per cubic meter in 'Manual REF Calibration' to 'Regulation Setup'
if (!tbxRefCalibrationResultPulsePerCm.Text.Equals(tbxRefPulsePerCm.Text))
{
_regulationSetupHasChanged = true;
btnSaveRegulationSetup.Enabled = true;
tbxActualFlowRateCmPerHour.Text = "";
tbxActualMeasuredToleranceDutToRef.Text = "";
//Backup the actual setting to detect changes
var backupPulses_per_cm = Fm2014.Ref_pulse_per_cm;
tbxRefPulsePerCm.Text = tbxRefCalibrationResultPulsePerCm.Text;
// Setup FM2014
if (Fm2014 != null && int.TryParse(tbxRefCalibrationResultPulsePerCm.Text, out var pulses_per_cm))
// Calculate the new pulse ratio based on the manual calibration
var pulses_per_cm = (UInt16)(pulses / (liters / 1000.0f));
// Try to set the new calculated REF pulses limited by the property setter
Fm2014.Ref_pulse_per_cm = pulses_per_cm;
// If this succeeded, then update the new manual calibrated value
if (pulses_per_cm == Fm2014.Ref_pulse_per_cm)
{
tbxRefCalibrationResultPulsePerCm.Text = $@"{Fm2014.Ref_pulse_per_cm:D}";
tbxRefPulsePerCm.Text = $@"{Fm2014.Ref_pulse_per_cm:D}";
tbxScaleRefToDut.Text = $@"{Fm2014.RefToDutScale_norm:F3}";
// Check if values have changed and need to be updated in the standalone setup
if (backupPulses_per_cm != Fm2014.Ref_pulse_per_cm)
{
Fm2014.Ref_pulse_per_cm = (UInt16)pulses_per_cm;
tbxScaleRefToDut.Text = $@"{Fm2014.RefToDutScale_norm:F2}";
SetupHasChanged();
}
}
else
{
tbxRefCalibrationResultPulsePerCm.Text = Resources.StrError;
}
}
}
#endregion Buttons and Controls
@@ -966,7 +998,7 @@ namespace Sensus.MiniPrf.Ui
/// <summary>
/// Feedback from FM2014being parsed to GUI
/// </summary>
/// <remarks date="2023-Jan-04..18" author="Thomas Wiedebusch">
/// <remarks date="2023-Jan-04..19" author="Thomas Wiedebusch">
/// - Initial.
/// </remarks>
private void DataReceived_Handler(Object sender, ProcessExecEventArgs e)
@@ -983,6 +1015,10 @@ namespace Sensus.MiniPrf.Ui
// Data dispatcher
var resp = (FM2014CmdDef.CmdResponse)e.SpecificInfoObj;
if (resp.IntValue == null && resp.DoubleValue == null)
{
LogText(resp.AnswerStr);
}
if (resp.IntValue != null)
{
LogText($"{resp.AnswerStr}: {resp.IntValue:D} {resp.SiUnit}");
@@ -1001,6 +1037,9 @@ namespace Sensus.MiniPrf.Ui
var idx = cbxAttenuation.FindString($@"{resp.IntValue}");
cbxAttenuation.SelectedIndex = idx;
break;
case FM2014CmdDef.CmdName.CMD_GET_REF_FREQU:
tbxRefFrequencyHz.Text = $@"{resp.IntValue:D}";
break;
}
}
if (resp.DoubleValue != null)
@@ -1012,13 +1051,17 @@ namespace Sensus.MiniPrf.Ui
case FM2014CmdDef.CmdName.CMD_GET_DTLC:
tbxActualMeasuredToleranceDutToRef.Text = $@"{resp.DoubleValue:F2}";
break;
case FM2014CmdDef.CmdName.CMD_GET_REF_PERIOD:
case FM2014CmdDef.CmdName.CMD_GET_REF_FREQU:
case FM2014CmdDef.CmdName.CMD_CAL_FLOW_RATE:
tbxActualFlowRateCmPerHour.Text = $@"{resp.DoubleValue:F3}";
break;
case FM2014CmdDef.CmdName.CMD_REF_SET_SCALE:
tbxScaleRefToDut.Text = $@"{resp.DoubleValue:F2}";
break;
case FM2014CmdDef.CmdName.CMD_GET_REF_PERIOD:
case FM2014CmdDef.CmdName.CMD_GET_REF_FREQU:
tbxRefFrequencyHz.Text = $@"{resp.DoubleValue:F6}";
break;
}
}
// Catch the latest information
+3
View File
@@ -120,6 +120,9 @@
<metadata name="tmrProgressUpdate.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 30</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>173, 30</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
+4
View File
@@ -106,6 +106,10 @@
<Content Include="NlogConfig.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="Resources\FM2014 58x172.jpg" />
<None Include="Resources\FM2014 117x344.jpg" />
<None Include="Resources\FM2014_small.jpg" />
<None Include="Resources\Sensus_A.jpg" />
<None Include="Resources\Sensus Logo.JPG" />
</ItemGroup>
<ItemGroup>
+22 -3
View File
@@ -63,9 +63,19 @@ namespace Sensus.MiniPrf.Ui.Properties {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Sensus_Logo {
internal static System.Drawing.Bitmap FM2014_58x172 {
get {
object obj = ResourceManager.GetObject("Sensus Logo", resourceCulture);
object obj = ResourceManager.GetObject("FM2014 58x172", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Sensus_A {
get {
object obj = ResourceManager.GetObject("Sensus_A", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -322,6 +332,15 @@ namespace Sensus.MiniPrf.Ui.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to REF Frequency [Hz].
/// </summary>
internal static string StrLblRefFrequencyHz {
get {
return ResourceManager.GetString("StrLblRefFrequencyHz", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to REF [pulses/m³]:.
/// </summary>
@@ -368,7 +387,7 @@ namespace Sensus.MiniPrf.Ui.Properties {
}
/// <summary>
/// Looks up a localized string similar to Date and Time [min:s]:.
/// Looks up a localized string similar to PC Date and Time [min:s]:.
/// </summary>
internal static string StrMsgPcDateTime {
get {
+4 -5
View File
@@ -117,10 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Sensus Logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Sensus Logo.JPG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="StrError" xml:space="preserve">
<value>FEHLER</value>
</data>
@@ -221,6 +217,9 @@
<value>Zeit [min:s]:</value>
</data>
<data name="StrMsgPcDateTime" xml:space="preserve">
<value>Datum und Zeit [min:s]:</value>
<value>PC Datum und Zeit [min:s]:</value>
</data>
<data name="StrLblRefFrequencyHz" xml:space="preserve">
<value>REF Frequenz [Hz]</value>
</data>
</root>
+11 -5
View File
@@ -117,10 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Sensus Logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Sensus Logo.JPG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="StrError" xml:space="preserve">
<value>ERROR</value>
</data>
@@ -221,6 +217,16 @@
<value>Time [min:s]:</value>
</data>
<data name="StrMsgPcDateTime" xml:space="preserve">
<value>Date and Time [min:s]:</value>
<value>PC Date and Time [min:s]:</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Sensus_A" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Sensus_A.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FM2014 58x172" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\FM2014 58x172.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="StrLblRefFrequencyHz" xml:space="preserve">
<value>REF Frequency [Hz]</value>
</data>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB