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