diff --git a/Common/Common.sln b/Common/Common.sln index be29ee39..f1a68828 100644 --- a/Common/Common.sln +++ b/Common/Common.sln @@ -364,6 +364,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaaPackages.SqlClient", "La EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaaPackages.HttpClient", "LaaPackages\LaaPackages.HttpClient\LaaPackages.HttpClient.csproj", "{C9816412-7752-4F7A-8BD2-765DB6D58B3C}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MechanicalMeter", "MechanicalMeter", "{AABD04D6-E911-4B1A-9D0B-9D0DD7E4DDC5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MockFm2014", "MockFm2014", "{7E14CABB-8079-4943-8670-5259844DE2BA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FM2014", "FM2014", "{5DFED68B-2113-4E5A-98ED-9DC07D3D39C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FM2014Config", "Hardware\WaterMeter\MechanicalMeter\FM2014\FW2014Config\FM2014Config.csproj", "{3862D89C-E32D-4182-BB58-38777D43EDD9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution _MANUAL_CONTROL|Any CPU = _MANUAL_CONTROL|Any CPU @@ -6351,6 +6359,78 @@ Global {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.XP32bit|x64.Build.0 = Release|Any CPU {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.XP32bit|x86.ActiveCfg = Release|Any CPU {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.XP32bit|x86.Build.0 = Release|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}._MANUAL_CONTROL|Any CPU.ActiveCfg = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}._MANUAL_CONTROL|Any CPU.Build.0 = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}._MANUAL_CONTROL|Mixed Platforms.Build.0 = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}._MANUAL_CONTROL|x64.ActiveCfg = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}._MANUAL_CONTROL|x64.Build.0 = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}._MANUAL_CONTROL|x86.ActiveCfg = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}._MANUAL_CONTROL|x86.Build.0 = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.COM|Any CPU.ActiveCfg = Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.COM|Any CPU.Build.0 = Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.COM|Mixed Platforms.ActiveCfg = Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.COM|Mixed Platforms.Build.0 = Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.COM|x64.ActiveCfg = Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.COM|x64.Build.0 = Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.COM|x86.ActiveCfg = Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.COM|x86.Build.0 = Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Debug|Mixed Platforms.Build.0 = Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Debug|x64.ActiveCfg = Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Debug|x64.Build.0 = Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Debug|x86.ActiveCfg = Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Debug|x86.Build.0 = Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.GenesisDisplayTool_V01|Any CPU.Build.0 = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.GenesisDisplayTool_V01|x64.ActiveCfg = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.GenesisDisplayTool_V01|x64.Build.0 = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.GenesisDisplayTool_V01|x86.ActiveCfg = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.GenesisDisplayTool_V01|x86.Build.0 = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.PerformTest|Any CPU.ActiveCfg = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.PerformTest|Any CPU.Build.0 = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.PerformTest|Mixed Platforms.ActiveCfg = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.PerformTest|Mixed Platforms.Build.0 = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.PerformTest|x64.ActiveCfg = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.PerformTest|x64.Build.0 = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.PerformTest|x86.ActiveCfg = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.PerformTest|x86.Build.0 = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Release|Any CPU.Build.0 = Release|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Release|Mixed Platforms.Build.0 = Release|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Release|x64.ActiveCfg = Release|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Release|x64.Build.0 = Release|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Release|x86.ActiveCfg = Release|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Release|x86.Build.0 = Release|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.ReleaseTest|Any CPU.ActiveCfg = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.ReleaseTest|Any CPU.Build.0 = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.ReleaseTest|Mixed Platforms.ActiveCfg = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.ReleaseTest|Mixed Platforms.Build.0 = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.ReleaseTest|x64.ActiveCfg = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.ReleaseTest|x64.Build.0 = _MANUAL_CONTROL|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.ReleaseTest|x86.ActiveCfg = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.ReleaseTest|x86.Build.0 = _MANUAL_CONTROL|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.VPN_Debug|Any CPU.ActiveCfg = VPN_Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.VPN_Debug|Any CPU.Build.0 = VPN_Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.VPN_Debug|Mixed Platforms.ActiveCfg = VPN_Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.VPN_Debug|Mixed Platforms.Build.0 = VPN_Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.VPN_Debug|x64.ActiveCfg = VPN_Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.VPN_Debug|x64.Build.0 = VPN_Debug|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.VPN_Debug|x86.ActiveCfg = VPN_Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.VPN_Debug|x86.Build.0 = VPN_Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.XP32bit|Any CPU.Build.0 = Release|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.XP32bit|Mixed Platforms.ActiveCfg = Release|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.XP32bit|Mixed Platforms.Build.0 = Release|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.XP32bit|x64.ActiveCfg = Release|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.XP32bit|x64.Build.0 = Release|x64 + {3862D89C-E32D-4182-BB58-38777D43EDD9}.XP32bit|x86.ActiveCfg = Release|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.XP32bit|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -6499,6 +6579,10 @@ Global {15A06398-ECB6-49C9-ACB4-52A495A886A6} = {7B7EC9A1-2091-4CCD-9F01-C579ABD9241D} {F90B940C-9A83-496D-AAE0-11CD02CE0A22} = {7B7EC9A1-2091-4CCD-9F01-C579ABD9241D} {C9816412-7752-4F7A-8BD2-765DB6D58B3C} = {7B7EC9A1-2091-4CCD-9F01-C579ABD9241D} + {AABD04D6-E911-4B1A-9D0B-9D0DD7E4DDC5} = {5563DD3B-2287-4BED-97BF-F0389FF505AF} + {7E14CABB-8079-4943-8670-5259844DE2BA} = {AABD04D6-E911-4B1A-9D0B-9D0DD7E4DDC5} + {5DFED68B-2113-4E5A-98ED-9DC07D3D39C8} = {AABD04D6-E911-4B1A-9D0B-9D0DD7E4DDC5} + {3862D89C-E32D-4182-BB58-38777D43EDD9} = {5DFED68B-2113-4E5A-98ED-9DC07D3D39C8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4BCB7B69-696C-436A-86F7-C91EA5588164} diff --git a/Common/CommonCore/Consts/ProgramConfig.cs b/Common/CommonCore/Consts/ProgramConfig.cs index cd5a7a49..7af4aa2d 100644 --- a/Common/CommonCore/Consts/ProgramConfig.cs +++ b/Common/CommonCore/Consts/ProgramConfig.cs @@ -9,6 +9,11 @@ namespace Xylem.Common.CommonCore.Consts /// public const String RegisterDefinitionFileName = "configuration.json"; + /// + /// Name of serial configuration file + /// + public const String FM2014ConfigFileName = "FM2014Config.json"; + /// /// Name of serial configuration file /// diff --git a/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/FM2014Config.cs b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/FM2014Config.cs new file mode 100644 index 00000000..46048c5a --- /dev/null +++ b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/FM2014Config.cs @@ -0,0 +1,102 @@ +/****************************************************************************************/ +/*!@file FM2014Config.cs + * @brief Configuration of FM2014. + * + *=======================================================================================\n + * @copyright + * + *_______________________________________________________________________________________\n + * Copyright (c) 2025 SENSUS GmbH.\n + * All Rights Reserved.\n + * \n + * Confidential property of\n + * SENSUS GmbH,\n + * Meineckestr. 10, 30880 LAATZEN, GERMANY\n + * \n + * Design by\n + * Hard- und Softwareentwicklung Thomas Wiedebusch,\n + * Ostermarsch 17c, 31191 ALGERMISSEN/UMMELN, GERMANY\n + * \n + *=======================================================================================\n + * @authors + * + *_______________________________________________________________________________________\n + * Thomas Wiedebusch\n + * + * + *=======================================================================================\n + * @version + * + *_______________________________________________________________________________________\n + * V1.00 13-Nov-2025..13-Nov-2025 by Thomas Wiedebusch\n + * - Initial. + * + * + *=======================================================================================\n + */ + +using System; +using System.IO; +using Newtonsoft.Json; +using Xylem.Common.CommonCore.Consts; + +namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Config +{ + /// + /// Configuration of SIRT + /// + public class FM2014Config + { + /// + /// Load FM2014 configuration file from AppRoaming or working directory + /// + public Boolean ReadFM2014Config() + { + // Check for AppRoaming + var configFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), + nameof(FM2014), ProgramConfig.FM2014ConfigFileName); + + if (!File.Exists(configFile)) + { + // Take actual working directory + configFile = Path.Combine(ProgramConfig.FM2014ConfigFileName); + if (!File.Exists(configFile)) + { + FM2014ComPort = null; + return false; + } + } + + using (var tr = new StreamReader(configFile)) + { + var fm2014Setup = JsonConvert.DeserializeObject(tr.ReadToEnd()); + FM2014ComPort = fm2014Setup.FM2014ComPort; + } + + return true; + } + + /// + /// Write file to AppRoaming and backup it to actual working directory + /// + public void Update() + { + var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), + nameof(FM2014)); + + if (!Directory.Exists(path)) + Directory.CreateDirectory(path); + + var configFile = Path.Combine(path, ProgramConfig.FM2014ConfigFileName); + + File.WriteAllText(configFile, JsonConvert.SerializeObject(this)); + File.WriteAllText(ProgramConfig.FM2014ConfigFileName, JsonConvert.SerializeObject(this)); + } + + /// + /// Comport for SIRT interface with 433MHz radio frequency + /// + public String FM2014ComPort { get; set; } + + } +} diff --git a/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/FM2014Config.csproj b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/FM2014Config.csproj new file mode 100644 index 00000000..c601987b --- /dev/null +++ b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/FM2014Config.csproj @@ -0,0 +1,149 @@ + + + + + Debug + AnyCPU + {3862D89C-E32D-4182-BB58-38777D43EDD9} + Library + Properties + Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Config + Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Config + v4.8.1 + 512 + false + SAK + SAK + SAK + SAK + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + 7.0 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + 7.0 + false + + + true + bin\_MANUAL_CONTROL\ + DEBUG;TRACE + full + AnyCPU + 7.0 + prompt + MinimumRecommendedRules.ruleset + false + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + 7.0 + prompt + MinimumRecommendedRules.ruleset + false + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + 7.0 + prompt + MinimumRecommendedRules.ruleset + false + + + true + bin\x64\_MANUAL_CONTROL\ + DEBUG;TRACE + full + x64 + 7.0 + prompt + MinimumRecommendedRules.ruleset + false + + + bin\Debug-local IIS-CUST\ + false + + + bin\x64\Debug-local IIS-CUST\ + false + + + true + bin\VPN_Debug\ + DEBUG;TRACE + full + AnyCPU + 7.0 + prompt + false + + + true + bin\x64\VPN_Debug\ + DEBUG;TRACE + full + x64 + 7.0 + prompt + MinimumRecommendedRules.ruleset + false + + + + ..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll + + + ..\..\..\..\packages\NLog.5.2.2\lib\net35\NLog.dll + + + + + + + + + + + + + {1B02C79E-0B19-43E2-8F6B-71EF0C786C97} + CommonCore + + + {2E139F63-B6FE-4EA9-A098-85364FE9B26C} + PortCore + + + {63E0AC5E-B7C8-4363-A2FE-BE489E648FF0} + TransmitProtocol + + + + + + + \ No newline at end of file diff --git a/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/ProccessConfig.cs b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/ProccessConfig.cs new file mode 100644 index 00000000..dbc3e3e1 --- /dev/null +++ b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/ProccessConfig.cs @@ -0,0 +1,114 @@ +using System; +using System.ComponentModel; +using System.IO; +using Newtonsoft.Json; + +namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig +{ + /// + /// Configuration of meter + /// + public class ProccessConfig + { + /// + /// ctor + /// + public ProccessConfig() + { + UseRegisterWatchService = false; + UseErrorLogger = false; + AutoUpdateFiles = false; + ProductionMode = true; + } + + /// + public ProccessConfig(String file) + { + var configFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), nameof(Genesis), file); + + if (!File.Exists(configFile)) + { + configFile = Path.Combine(file); + if (!File.Exists(configFile)) + { + UseRegisterWatchService = false; + UseErrorLogger = false; + return; + } + } + + using (var tr = new StreamReader(configFile)) + { + var meterConfig = JsonConvert.DeserializeObject(tr.ReadToEnd()); + UseRegisterWatchService = meterConfig.UseRegisterWatchService; + RegisterWatchServiceUrl = meterConfig.RegisterWatchServiceUrl; + UseMinMaxCheck = meterConfig.UseMinMaxCheck; + UseErrorLogger = meterConfig.UseErrorLogger; + ErrorLoggerServiceUrl = meterConfig.ErrorLoggerServiceUrl; + UseCalibrationLogger = meterConfig.UseCalibrationLogger; + CalibrationLoggerServiceUrl = meterConfig.CalibrationLoggerServiceUrl; + AutoUpdateFiles = meterConfig.AutoUpdateFiles; + ProductionMode = meterConfig.ProductionMode; + + } + + } + + public void Update(String file) + { + var configFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), nameof(Genesis), file); + + if (!File.Exists(configFile)) + { + configFile = Path.Combine(file); + } + + File.WriteAllText(file, JsonConvert.SerializeObject(this)); + } + + /// + /// + /// + public Boolean UseRegisterWatchService { get; set; } + + /// + /// + /// + public String RegisterWatchServiceUrl { get; set; } + + /// + /// + /// + public Boolean UseMinMaxCheck { get; set; } + + /// + /// + /// + public Boolean UseErrorLogger { get; set; } + + /// + /// + /// + public String ErrorLoggerServiceUrl { get; set; } + + /// + /// + /// + public Boolean UseCalibrationLogger { get; set; } + + /// + /// + /// + public String CalibrationLoggerServiceUrl { get; set; } + + /// + /// + /// + public bool AutoUpdateFiles { get; set; } + + [DefaultValue(true)] + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + + public bool ProductionMode { get; set; } = true; + } +} diff --git a/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/Properties/AssemblyInfo.cs b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..3234809c --- /dev/null +++ b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Config")] +[assembly: AssemblyDescription("")] +//[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(true)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4FBC1BEE-D9E2-4326-A164-79340CD4090F")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +//[assembly: AssemblyVersion("1.0.0.0")] +//[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/packages.config b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/packages.config new file mode 100644 index 00000000..bf477414 --- /dev/null +++ b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FW2014Config/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/MiniPrf/MiniPrf.sln b/MiniPrf/MiniPrf.sln index 38ae6a9a..a7633efe 100644 --- a/MiniPrf/MiniPrf.sln +++ b/MiniPrf/MiniPrf.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.14.36310.24 d17.14 +VisualStudioVersion = 17.14.36310.24 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docu", "Docu", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" EndProject @@ -16,6 +16,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".shared", ".shared", "{EC37 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniPrf", "Ui\MiniPrf.csproj", "{09CBCD8A-C729-4AB6-9C39-1510774509D6}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Hardware", "Hardware", "{2C357743-AB88-48BF-805A-5DEED44934A3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WaterMeter", "WaterMeter", "{DDEB716C-3E3F-40E2-8466-EED50919D8A4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MechanicalMeter", "MechanicalMeter", "{B5F3ABFD-5AC3-45CB-8DF1-6E84CFA556B6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FM2014", "FM2014", "{02CE88CB-677E-45A7-9B33-5028110379E5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FM2014Config", "..\Common\Hardware\WaterMeter\MechanicalMeter\FM2014\FW2014Config\FM2014Config.csproj", "{3862D89C-E32D-4182-BB58-38777D43EDD9}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommonCore", "CommonCore", "{FC3ED941-1507-4149-B751-BB795E645459}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonCore", "..\Common\CommonCore\CommonCore.csproj", "{1B02C79E-0B19-43E2-8F6B-71EF0C786C97}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -26,12 +40,27 @@ Global {09CBCD8A-C729-4AB6-9C39-1510774509D6}.Debug|Any CPU.Build.0 = Debug|Any CPU {09CBCD8A-C729-4AB6-9C39-1510774509D6}.Release|Any CPU.ActiveCfg = Release|Any CPU {09CBCD8A-C729-4AB6-9C39-1510774509D6}.Release|Any CPU.Build.0 = Release|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3862D89C-E32D-4182-BB58-38777D43EDD9}.Release|Any CPU.Build.0 = Release|Any CPU + {1B02C79E-0B19-43E2-8F6B-71EF0C786C97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1B02C79E-0B19-43E2-8F6B-71EF0C786C97}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1B02C79E-0B19-43E2-8F6B-71EF0C786C97}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1B02C79E-0B19-43E2-8F6B-71EF0C786C97}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {09CBCD8A-C729-4AB6-9C39-1510774509D6} = {BDA40851-F353-416A-A6A8-6BA33ACB7371} + {2C357743-AB88-48BF-805A-5DEED44934A3} = {1C6D29D2-AC0D-48B2-932A-C9B94C3562F6} + {DDEB716C-3E3F-40E2-8466-EED50919D8A4} = {2C357743-AB88-48BF-805A-5DEED44934A3} + {B5F3ABFD-5AC3-45CB-8DF1-6E84CFA556B6} = {DDEB716C-3E3F-40E2-8466-EED50919D8A4} + {02CE88CB-677E-45A7-9B33-5028110379E5} = {B5F3ABFD-5AC3-45CB-8DF1-6E84CFA556B6} + {3862D89C-E32D-4182-BB58-38777D43EDD9} = {02CE88CB-677E-45A7-9B33-5028110379E5} + {FC3ED941-1507-4149-B751-BB795E645459} = {1C6D29D2-AC0D-48B2-932A-C9B94C3562F6} + {1B02C79E-0B19-43E2-8F6B-71EF0C786C97} = {FC3ED941-1507-4149-B751-BB795E645459} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B72A8444-29F9-4FA4-82BE-B6E230750911} diff --git a/MiniPrf/MiniPrf.sln.DotSettings b/MiniPrf/MiniPrf.sln.DotSettings index ec675a5b..dbb64996 100644 --- a/MiniPrf/MiniPrf.sln.DotSettings +++ b/MiniPrf/MiniPrf.sln.DotSettings @@ -1,2 +1,3 @@  - True \ No newline at end of file + True + True \ No newline at end of file diff --git a/MiniPrf/Ui/FrmMainMiniPrf.Designer.cs b/MiniPrf/Ui/FrmMainMiniPrf.Designer.cs index 59871fa8..3035399e 100644 --- a/MiniPrf/Ui/FrmMainMiniPrf.Designer.cs +++ b/MiniPrf/Ui/FrmMainMiniPrf.Designer.cs @@ -28,22 +28,556 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMainMiniPrf)); + this.gbxFM2014Setup = new System.Windows.Forms.GroupBox(); + this.btnConnect = new System.Windows.Forms.Button(); + this.cbxFM2014ComPort = new System.Windows.Forms.ComboBox(); + this.label3 = new System.Windows.Forms.Label(); + this.lblConnectPcb = new System.Windows.Forms.Label(); + this.tbxPcbId = new System.Windows.Forms.TextBox(); + this.grpBoxStatistic = new System.Windows.Forms.GroupBox(); + this.lblDrainedBatteryLoad = new System.Windows.Forms.Label(); + this.tbxStorageMonths = new System.Windows.Forms.TextBox(); + this.lblRemainingLifetimeFw = new System.Windows.Forms.Label(); + this.lblStorageMonths = new System.Windows.Forms.Label(); + this.lblRemainingLifeTimeSw = new System.Windows.Forms.Label(); + this.tbxDrainedBatteryLoad_percent = new System.Windows.Forms.TextBox(); + this.tbxRemainingLifeTimeFw = new System.Windows.Forms.TextBox(); + this.tbxRemainingLifeTimeSw = new System.Windows.Forms.TextBox(); + this.lblUpdateTime = new System.Windows.Forms.Label(); + this.tmrProgressUpdate = new System.Windows.Forms.Timer(this.components); + this.lblFwVersion = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.grpBoxCordonelReadout = new System.Windows.Forms.GroupBox(); + this.label5 = new System.Windows.Forms.Label(); + this.tbxMeterLutCrc = new System.Windows.Forms.TextBox(); + this.tbxInitialBatteryLoad = new System.Windows.Forms.TextBox(); + this.tbxMeterSize = new System.Windows.Forms.TextBox(); + this.tbxMeterFw = new System.Windows.Forms.TextBox(); + this.lblBatteryMilliAHrRating = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.tbxRegion = new System.Windows.Forms.TextBox(); + this.tbxExpiredLifeTime = new System.Windows.Forms.TextBox(); + this.tbxRadio = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.tbxBatteries = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.tbxDateTime = new System.Windows.Forms.TextBox(); + this.tbxDrainedLoad_uAs = new System.Windows.Forms.TextBox(); + this.lblTotalUsedSeconds = new System.Windows.Forms.Label(); + this.lblBatteryQuantity = new System.Windows.Forms.Label(); + this.lblTotalUsedCharge = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.lblWaitingForMeterResponse = new System.Windows.Forms.Label(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.lblFwUpdateInfo = new System.Windows.Forms.Label(); + this.barSingleProgressUpdate = new System.Windows.Forms.ProgressBar(); + this.lblActualProcess = new System.Windows.Forms.Label(); + this.btnLedOff = new System.Windows.Forms.Button(); + this.gbxFM2014Setup.SuspendLayout(); + this.grpBoxStatistic.SuspendLayout(); + this.grpBoxCordonelReadout.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // - // Form1 + // gbxFM2014Setup + // + this.gbxFM2014Setup.Controls.Add(this.btnConnect); + this.gbxFM2014Setup.Controls.Add(this.cbxFM2014ComPort); + this.gbxFM2014Setup.Controls.Add(this.label3); + this.gbxFM2014Setup.Controls.Add(this.lblConnectPcb); + this.gbxFM2014Setup.Controls.Add(this.tbxPcbId); + this.gbxFM2014Setup.Location = new System.Drawing.Point(1, 38); + this.gbxFM2014Setup.Name = "gbxFM2014Setup"; + this.gbxFM2014Setup.Size = new System.Drawing.Size(308, 136); + this.gbxFM2014Setup.TabIndex = 84; + this.gbxFM2014Setup.TabStop = false; + this.gbxFM2014Setup.Text = "FM2014"; + // + // btnConnect + // + this.btnConnect.Location = new System.Drawing.Point(141, 18); + this.btnConnect.Name = "btnConnect"; + this.btnConnect.Size = new System.Drawing.Size(146, 25); + this.btnConnect.TabIndex = 24; + this.btnConnect.Text = "Connect"; + this.btnConnect.UseVisualStyleBackColor = true; + // + // cbxFM2014ComPort + // + this.cbxFM2014ComPort.FormattingEnabled = true; + this.cbxFM2014ComPort.Location = new System.Drawing.Point(69, 21); + this.cbxFM2014ComPort.Name = "cbxFM2014ComPort"; + this.cbxFM2014ComPort.Size = new System.Drawing.Size(62, 21); + this.cbxFM2014ComPort.TabIndex = 5; + this.cbxFM2014ComPort.Text = "1"; + this.cbxFM2014ComPort.SelectedIndexChanged += new System.EventHandler(this.cbxFM2014ComPort_SelectedIndexChanged); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(8, 24); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(55, 13); + this.label3.TabIndex = 20; + this.label3.Text = "Serial Port"; + // + // lblConnectPcb + // + this.lblConnectPcb.AutoSize = true; + this.lblConnectPcb.Location = new System.Drawing.Point(9, 54); + this.lblConnectPcb.Name = "lblConnectPcb"; + this.lblConnectPcb.Size = new System.Drawing.Size(33, 13); + this.lblConnectPcb.TabIndex = 23; + this.lblConnectPcb.Text = "NOT "; + // + // tbxPcbId + // + this.tbxPcbId.Location = new System.Drawing.Point(141, 51); + this.tbxPcbId.Name = "tbxPcbId"; + this.tbxPcbId.ReadOnly = true; + this.tbxPcbId.Size = new System.Drawing.Size(146, 20); + this.tbxPcbId.TabIndex = 32; + // + // grpBoxStatistic + // + this.grpBoxStatistic.Controls.Add(this.lblDrainedBatteryLoad); + this.grpBoxStatistic.Controls.Add(this.tbxStorageMonths); + this.grpBoxStatistic.Controls.Add(this.lblRemainingLifetimeFw); + this.grpBoxStatistic.Controls.Add(this.lblStorageMonths); + this.grpBoxStatistic.Controls.Add(this.lblRemainingLifeTimeSw); + this.grpBoxStatistic.Controls.Add(this.tbxDrainedBatteryLoad_percent); + this.grpBoxStatistic.Controls.Add(this.tbxRemainingLifeTimeFw); + this.grpBoxStatistic.Controls.Add(this.tbxRemainingLifeTimeSw); + this.grpBoxStatistic.Location = new System.Drawing.Point(2, 225); + this.grpBoxStatistic.Name = "grpBoxStatistic"; + this.grpBoxStatistic.Size = new System.Drawing.Size(307, 136); + this.grpBoxStatistic.TabIndex = 82; + this.grpBoxStatistic.TabStop = false; + this.grpBoxStatistic.Text = "Statistic"; + // + // lblDrainedBatteryLoad + // + this.lblDrainedBatteryLoad.AutoSize = true; + this.lblDrainedBatteryLoad.Location = new System.Drawing.Point(15, 29); + this.lblDrainedBatteryLoad.Name = "lblDrainedBatteryLoad"; + this.lblDrainedBatteryLoad.Size = new System.Drawing.Size(127, 13); + this.lblDrainedBatteryLoad.TabIndex = 62; + this.lblDrainedBatteryLoad.Text = "Drained Battery Load [%]:"; + // + // tbxStorageMonths + // + this.tbxStorageMonths.Location = new System.Drawing.Point(170, 98); + this.tbxStorageMonths.Name = "tbxStorageMonths"; + this.tbxStorageMonths.ReadOnly = true; + this.tbxStorageMonths.Size = new System.Drawing.Size(116, 20); + this.tbxStorageMonths.TabIndex = 69; + // + // lblRemainingLifetimeFw + // + this.lblRemainingLifetimeFw.AutoSize = true; + this.lblRemainingLifetimeFw.Location = new System.Drawing.Point(15, 53); + this.lblRemainingLifetimeFw.Name = "lblRemainingLifetimeFw"; + this.lblRemainingLifetimeFw.Size = new System.Drawing.Size(153, 13); + this.lblRemainingLifetimeFw.TabIndex = 63; + this.lblRemainingLifetimeFw.Text = "Remaining Lifetime FW [years]:"; + // + // lblStorageMonths + // + this.lblStorageMonths.AutoSize = true; + this.lblStorageMonths.Location = new System.Drawing.Point(15, 101); + this.lblStorageMonths.Name = "lblStorageMonths"; + this.lblStorageMonths.Size = new System.Drawing.Size(128, 13); + this.lblStorageMonths.TabIndex = 68; + this.lblStorageMonths.Text = "Storage Months [months]:"; + // + // lblRemainingLifeTimeSw + // + this.lblRemainingLifeTimeSw.AutoSize = true; + this.lblRemainingLifeTimeSw.Location = new System.Drawing.Point(15, 78); + this.lblRemainingLifeTimeSw.Name = "lblRemainingLifeTimeSw"; + this.lblRemainingLifeTimeSw.Size = new System.Drawing.Size(154, 13); + this.lblRemainingLifeTimeSw.TabIndex = 64; + this.lblRemainingLifeTimeSw.Text = "Remaining Lifetime SW [years]:"; + // + // tbxDrainedBatteryLoad_percent + // + this.tbxDrainedBatteryLoad_percent.Location = new System.Drawing.Point(170, 25); + this.tbxDrainedBatteryLoad_percent.Name = "tbxDrainedBatteryLoad_percent"; + this.tbxDrainedBatteryLoad_percent.ReadOnly = true; + this.tbxDrainedBatteryLoad_percent.Size = new System.Drawing.Size(116, 20); + this.tbxDrainedBatteryLoad_percent.TabIndex = 67; + // + // tbxRemainingLifeTimeFw + // + this.tbxRemainingLifeTimeFw.Location = new System.Drawing.Point(170, 50); + this.tbxRemainingLifeTimeFw.Name = "tbxRemainingLifeTimeFw"; + this.tbxRemainingLifeTimeFw.ReadOnly = true; + this.tbxRemainingLifeTimeFw.Size = new System.Drawing.Size(116, 20); + this.tbxRemainingLifeTimeFw.TabIndex = 65; + // + // tbxRemainingLifeTimeSw + // + this.tbxRemainingLifeTimeSw.Location = new System.Drawing.Point(170, 75); + this.tbxRemainingLifeTimeSw.Name = "tbxRemainingLifeTimeSw"; + this.tbxRemainingLifeTimeSw.ReadOnly = true; + this.tbxRemainingLifeTimeSw.Size = new System.Drawing.Size(116, 20); + this.tbxRemainingLifeTimeSw.TabIndex = 66; + // + // lblUpdateTime + // + this.lblUpdateTime.AutoSize = true; + this.lblUpdateTime.Location = new System.Drawing.Point(342, 437); + this.lblUpdateTime.Name = "lblUpdateTime"; + this.lblUpdateTime.Size = new System.Drawing.Size(28, 13); + this.lblUpdateTime.TabIndex = 81; + this.lblUpdateTime.Text = "0:00"; + // + // tmrProgressUpdate + // + this.tmrProgressUpdate.Interval = 200; + // + // lblFwVersion + // + this.lblFwVersion.AutoSize = true; + this.lblFwVersion.Location = new System.Drawing.Point(8, 19); + this.lblFwVersion.Name = "lblFwVersion"; + this.lblFwVersion.Size = new System.Drawing.Size(57, 13); + this.lblFwVersion.TabIndex = 25; + this.lblFwVersion.Text = "Meter FW:"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(8, 44); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(86, 13); + this.label6.TabIndex = 27; + this.label6.Text = "Meter LUT CRC:"; + // + // grpBoxCordonelReadout + // + this.grpBoxCordonelReadout.Controls.Add(this.lblFwVersion); + this.grpBoxCordonelReadout.Controls.Add(this.label6); + this.grpBoxCordonelReadout.Controls.Add(this.label5); + this.grpBoxCordonelReadout.Controls.Add(this.tbxMeterLutCrc); + this.grpBoxCordonelReadout.Controls.Add(this.tbxInitialBatteryLoad); + this.grpBoxCordonelReadout.Controls.Add(this.tbxMeterSize); + this.grpBoxCordonelReadout.Controls.Add(this.tbxMeterFw); + this.grpBoxCordonelReadout.Controls.Add(this.lblBatteryMilliAHrRating); + this.grpBoxCordonelReadout.Controls.Add(this.label8); + this.grpBoxCordonelReadout.Controls.Add(this.tbxRegion); + this.grpBoxCordonelReadout.Controls.Add(this.tbxExpiredLifeTime); + this.grpBoxCordonelReadout.Controls.Add(this.tbxRadio); + this.grpBoxCordonelReadout.Controls.Add(this.label10); + this.grpBoxCordonelReadout.Controls.Add(this.tbxBatteries); + this.grpBoxCordonelReadout.Controls.Add(this.label2); + this.grpBoxCordonelReadout.Controls.Add(this.tbxDateTime); + this.grpBoxCordonelReadout.Controls.Add(this.tbxDrainedLoad_uAs); + this.grpBoxCordonelReadout.Controls.Add(this.lblTotalUsedSeconds); + this.grpBoxCordonelReadout.Controls.Add(this.lblBatteryQuantity); + this.grpBoxCordonelReadout.Controls.Add(this.lblTotalUsedCharge); + this.grpBoxCordonelReadout.Location = new System.Drawing.Point(315, 92); + this.grpBoxCordonelReadout.Name = "grpBoxCordonelReadout"; + this.grpBoxCordonelReadout.Size = new System.Drawing.Size(308, 269); + this.grpBoxCordonelReadout.TabIndex = 83; + this.grpBoxCordonelReadout.TabStop = false; + this.grpBoxCordonelReadout.Text = "Cordonel Read Out"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(8, 69); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(60, 13); + this.label5.TabIndex = 28; + this.label5.Text = "Meter Size:"; + // + // tbxMeterLutCrc + // + this.tbxMeterLutCrc.Location = new System.Drawing.Point(141, 41); + this.tbxMeterLutCrc.Name = "tbxMeterLutCrc"; + this.tbxMeterLutCrc.ReadOnly = true; + this.tbxMeterLutCrc.Size = new System.Drawing.Size(146, 20); + this.tbxMeterLutCrc.TabIndex = 29; + // + // tbxInitialBatteryLoad + // + this.tbxInitialBatteryLoad.Location = new System.Drawing.Point(140, 238); + this.tbxInitialBatteryLoad.Name = "tbxInitialBatteryLoad"; + this.tbxInitialBatteryLoad.ReadOnly = true; + this.tbxInitialBatteryLoad.Size = new System.Drawing.Size(146, 20); + this.tbxInitialBatteryLoad.TabIndex = 61; + // + // tbxMeterSize + // + this.tbxMeterSize.Location = new System.Drawing.Point(141, 66); + this.tbxMeterSize.Name = "tbxMeterSize"; + this.tbxMeterSize.ReadOnly = true; + this.tbxMeterSize.Size = new System.Drawing.Size(146, 20); + this.tbxMeterSize.TabIndex = 30; + // + // tbxMeterFw + // + this.tbxMeterFw.Location = new System.Drawing.Point(141, 16); + this.tbxMeterFw.Name = "tbxMeterFw"; + this.tbxMeterFw.ReadOnly = true; + this.tbxMeterFw.Size = new System.Drawing.Size(146, 20); + this.tbxMeterFw.TabIndex = 31; + // + // lblBatteryMilliAHrRating + // + this.lblBatteryMilliAHrRating.AutoSize = true; + this.lblBatteryMilliAHrRating.Location = new System.Drawing.Point(8, 241); + this.lblBatteryMilliAHrRating.Name = "lblBatteryMilliAHrRating"; + this.lblBatteryMilliAHrRating.Size = new System.Drawing.Size(127, 13); + this.lblBatteryMilliAHrRating.TabIndex = 60; + this.lblBatteryMilliAHrRating.Text = "Initial Battery Load [mAh]:"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(8, 94); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(44, 13); + this.label8.TabIndex = 33; + this.label8.Text = "Region:"; + // + // tbxRegion + // + this.tbxRegion.Location = new System.Drawing.Point(141, 91); + this.tbxRegion.Name = "tbxRegion"; + this.tbxRegion.ReadOnly = true; + this.tbxRegion.Size = new System.Drawing.Size(146, 20); + this.tbxRegion.TabIndex = 34; + // + // tbxExpiredLifeTime + // + this.tbxExpiredLifeTime.Location = new System.Drawing.Point(140, 165); + this.tbxExpiredLifeTime.Name = "tbxExpiredLifeTime"; + this.tbxExpiredLifeTime.ReadOnly = true; + this.tbxExpiredLifeTime.Size = new System.Drawing.Size(146, 20); + this.tbxExpiredLifeTime.TabIndex = 59; + // + // tbxRadio + // + this.tbxRadio.Location = new System.Drawing.Point(141, 116); + this.tbxRadio.Name = "tbxRadio"; + this.tbxRadio.ReadOnly = true; + this.tbxRadio.Size = new System.Drawing.Size(146, 20); + this.tbxRadio.TabIndex = 35; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(8, 119); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(116, 13); + this.label10.TabIndex = 36; + this.label10.Text = "Radio frequency[MHz]:"; + // + // tbxBatteries + // + this.tbxBatteries.Location = new System.Drawing.Point(140, 215); + this.tbxBatteries.Name = "tbxBatteries"; + this.tbxBatteries.ReadOnly = true; + this.tbxBatteries.Size = new System.Drawing.Size(146, 20); + this.tbxBatteries.TabIndex = 58; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(8, 144); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(104, 13); + this.label2.TabIndex = 37; + this.label2.Text = "Cordonel Date Time:"; + // + // tbxDateTime + // + this.tbxDateTime.Location = new System.Drawing.Point(141, 141); + this.tbxDateTime.Name = "tbxDateTime"; + this.tbxDateTime.ReadOnly = true; + this.tbxDateTime.Size = new System.Drawing.Size(146, 20); + this.tbxDateTime.TabIndex = 38; + // + // tbxDrainedLoad_uAs + // + this.tbxDrainedLoad_uAs.Location = new System.Drawing.Point(140, 190); + this.tbxDrainedLoad_uAs.Name = "tbxDrainedLoad_uAs"; + this.tbxDrainedLoad_uAs.ReadOnly = true; + this.tbxDrainedLoad_uAs.Size = new System.Drawing.Size(146, 20); + this.tbxDrainedLoad_uAs.TabIndex = 57; + // + // lblTotalUsedSeconds + // + this.lblTotalUsedSeconds.AutoSize = true; + this.lblTotalUsedSeconds.Location = new System.Drawing.Point(8, 169); + this.lblTotalUsedSeconds.Name = "lblTotalUsedSeconds"; + this.lblTotalUsedSeconds.Size = new System.Drawing.Size(98, 13); + this.lblTotalUsedSeconds.TabIndex = 54; + this.lblTotalUsedSeconds.Text = "Expired Lifetime [s]:"; + // + // lblBatteryQuantity + // + this.lblBatteryQuantity.AutoSize = true; + this.lblBatteryQuantity.Location = new System.Drawing.Point(8, 218); + this.lblBatteryQuantity.Name = "lblBatteryQuantity"; + this.lblBatteryQuantity.Size = new System.Drawing.Size(92, 13); + this.lblBatteryQuantity.TabIndex = 56; + this.lblBatteryQuantity.Text = "Batteries [Pieces]:"; + // + // lblTotalUsedCharge + // + this.lblTotalUsedCharge.AutoSize = true; + this.lblTotalUsedCharge.Location = new System.Drawing.Point(8, 193); + this.lblTotalUsedCharge.Name = "lblTotalUsedCharge"; + this.lblTotalUsedCharge.Size = new System.Drawing.Size(101, 13); + this.lblTotalUsedCharge.TabIndex = 55; + this.lblTotalUsedCharge.Text = "Drained Load [µAs]:"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(274, 437); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(66, 13); + this.label9.TabIndex = 79; + this.label9.Text = "Time [min:s]:"; + // + // lblWaitingForMeterResponse + // + this.lblWaitingForMeterResponse.AutoSize = true; + this.lblWaitingForMeterResponse.ForeColor = System.Drawing.Color.Red; + this.lblWaitingForMeterResponse.Location = new System.Drawing.Point(440, 437); + 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.Location = new System.Drawing.Point(520, 6); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(102, 54); + this.pictureBox1.TabIndex = 78; + this.pictureBox1.TabStop = false; + // + // lblFwUpdateInfo + // + this.lblFwUpdateInfo.AutoSize = true; + this.lblFwUpdateInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblFwUpdateInfo.Location = new System.Drawing.Point(7, 12); + this.lblFwUpdateInfo.Name = "lblFwUpdateInfo"; + this.lblFwUpdateInfo.Size = new System.Drawing.Size(72, 13); + this.lblFwUpdateInfo.TabIndex = 77; + this.lblFwUpdateInfo.Text = "Version: 0.0.0"; + // + // barSingleProgressUpdate + // + this.barSingleProgressUpdate.Location = new System.Drawing.Point(1, 453); + this.barSingleProgressUpdate.Name = "barSingleProgressUpdate"; + this.barSingleProgressUpdate.Size = new System.Drawing.Size(621, 18); + this.barSingleProgressUpdate.TabIndex = 75; + this.barSingleProgressUpdate.Visible = false; + // + // lblActualProcess + // + this.lblActualProcess.AutoSize = true; + this.lblActualProcess.Location = new System.Drawing.Point(10, 437); + this.lblActualProcess.Name = "lblActualProcess"; + this.lblActualProcess.Size = new System.Drawing.Size(76, 13); + this.lblActualProcess.TabIndex = 74; + this.lblActualProcess.Text = "Process status"; + // + // btnLedOff + // + this.btnLedOff.Location = new System.Drawing.Point(476, 401); + this.btnLedOff.Name = "btnLedOff"; + this.btnLedOff.Size = new System.Drawing.Size(146, 25); + this.btnLedOff.TabIndex = 73; + this.btnLedOff.Text = "Led Off"; + this.btnLedOff.UseVisualStyleBackColor = true; + // + // FrmMainMiniPrf // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); + this.ClientSize = new System.Drawing.Size(630, 476); + this.Controls.Add(this.gbxFM2014Setup); + this.Controls.Add(this.grpBoxStatistic); + this.Controls.Add(this.lblUpdateTime); + this.Controls.Add(this.grpBoxCordonelReadout); + this.Controls.Add(this.label9); + this.Controls.Add(this.lblWaitingForMeterResponse); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.lblFwUpdateInfo); + this.Controls.Add(this.barSingleProgressUpdate); + this.Controls.Add(this.lblActualProcess); + this.Controls.Add(this.btnLedOff); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "FrmMainMiniPrf"; this.Text = "MiniPrf"; + this.gbxFM2014Setup.ResumeLayout(false); + this.gbxFM2014Setup.PerformLayout(); + this.grpBoxStatistic.ResumeLayout(false); + this.grpBoxStatistic.PerformLayout(); + this.grpBoxCordonelReadout.ResumeLayout(false); + this.grpBoxCordonelReadout.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion + + private System.Windows.Forms.GroupBox gbxFM2014Setup; + private System.Windows.Forms.Button btnConnect; + private System.Windows.Forms.ComboBox cbxFM2014ComPort; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label lblConnectPcb; + private System.Windows.Forms.TextBox tbxPcbId; + private System.Windows.Forms.GroupBox grpBoxStatistic; + private System.Windows.Forms.Label lblDrainedBatteryLoad; + private System.Windows.Forms.TextBox tbxStorageMonths; + private System.Windows.Forms.Label lblRemainingLifetimeFw; + private System.Windows.Forms.Label lblStorageMonths; + private System.Windows.Forms.Label lblRemainingLifeTimeSw; + private System.Windows.Forms.TextBox tbxDrainedBatteryLoad_percent; + private System.Windows.Forms.TextBox tbxRemainingLifeTimeFw; + private System.Windows.Forms.TextBox tbxRemainingLifeTimeSw; + private System.Windows.Forms.Label lblUpdateTime; + private System.Windows.Forms.Timer tmrProgressUpdate; + private System.Windows.Forms.Label lblFwVersion; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.GroupBox grpBoxCordonelReadout; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox tbxMeterLutCrc; + private System.Windows.Forms.TextBox tbxInitialBatteryLoad; + private System.Windows.Forms.TextBox tbxMeterSize; + private System.Windows.Forms.TextBox tbxMeterFw; + private System.Windows.Forms.Label lblBatteryMilliAHrRating; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.TextBox tbxRegion; + private System.Windows.Forms.TextBox tbxExpiredLifeTime; + private System.Windows.Forms.TextBox tbxRadio; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.TextBox tbxBatteries; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox tbxDateTime; + private System.Windows.Forms.TextBox tbxDrainedLoad_uAs; + private System.Windows.Forms.Label lblTotalUsedSeconds; + private System.Windows.Forms.Label lblBatteryQuantity; + private System.Windows.Forms.Label lblTotalUsedCharge; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label lblWaitingForMeterResponse; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Label lblFwUpdateInfo; + private System.Windows.Forms.ProgressBar barSingleProgressUpdate; + private System.Windows.Forms.Label lblActualProcess; + private System.Windows.Forms.Button btnLedOff; } } diff --git a/MiniPrf/Ui/FrmMainMiniPrf.cs b/MiniPrf/Ui/FrmMainMiniPrf.cs index 1f361d04..e7938384 100644 --- a/MiniPrf/Ui/FrmMainMiniPrf.cs +++ b/MiniPrf/Ui/FrmMainMiniPrf.cs @@ -1,12 +1,90 @@ -using System.Windows.Forms; +/****************************************************************************************/ +/*!@file FrmMainMiniPrf.cs +* @brief Main form for 'MiniPrf' - Single FM2014 Manual Flow Test Station: +* - Used to regulate one mechanical flow meter - 'DUT - Device under test', +* - Can be used to calibrate the 'REF - Reference meter' +* +*=======================================================================================\n +* @copyright +* +*_______________________________________________________________________________________\n +* Copyright (c) 2025 SENSUS GmbH.\n +* All Rights Reserved.\n +* \n +* Confidential property of\n +* SENSUS GmbH,\n +* Meineckestr. 10, 30880 LAATZEN, GERMANY\n +* \n +* Design by\n +* Hard- und Softwareentwicklung Thomas Wiedebusch,\n +* Ostermarsch 17c, 31191 ALGERMISSEN/UMMELN, GERMANY\n +* \n +*=======================================================================================\n +* @authors +* +*_______________________________________________________________________________________\n +* Thomas Wiedebusch\n +* +* +*=======================================================================================\n +* @version +* +*_______________________________________________________________________________________\n +* V1.00 13-Nov-2025..13-Nov-2025 by Thomas Wiedebusch\n +* - Initial. +* +* +*=======================================================================================\n +*/ + +using System.IO.Ports; +using System.Linq; +using System.Windows.Forms; +using Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Config; namespace Sensus.MiniPrf.Ui { + /// + /// Main form for 'MiniPrf' + /// public partial class FrmMainMiniPrf : Form { + private readonly FM2014Config _fm2014Config = new FM2014Config(); + + /// + /// Ctor + /// public FrmMainMiniPrf() { InitializeComponent(); + + // Load the configuration + _fm2014Config.ReadFM2014Config(); + + // display actual com-port, if not assigned use the 'NA' + cbxFM2014ComPort.Items.Add(_fm2014Config.FM2014ComPort ?? "NA"); + + // collect all com-ports from device manager + var comPorts = SerialPort.GetPortNames().ToList(); + foreach (var comPort in comPorts.Where(comPort => !cbxFM2014ComPort.Items.Contains(comPort))) + { + cbxFM2014ComPort.Items.Add(comPort); + } + cbxFM2014ComPort.Text = cbxFM2014ComPort.Items[0].ToString(); + } + + /// + /// Store the settings adjusted by the UI + /// + private void StoreFM2014Settings() + { + _fm2014Config.FM2014ComPort = cbxFM2014ComPort.Text; + _fm2014Config.Update(); + } + + private void cbxFM2014ComPort_SelectedIndexChanged(object sender, System.EventArgs e) + { + StoreFM2014Settings(); } } } diff --git a/MiniPrf/Ui/FrmMainMiniPrf.resx b/MiniPrf/Ui/FrmMainMiniPrf.resx index 88366d96..a2892bf0 100644 --- a/MiniPrf/Ui/FrmMainMiniPrf.resx +++ b/MiniPrf/Ui/FrmMainMiniPrf.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 30 + diff --git a/MiniPrf/Ui/MiniPrf.csproj b/MiniPrf/Ui/MiniPrf.csproj index a075894e..0ce5cdb4 100644 --- a/MiniPrf/Ui/MiniPrf.csproj +++ b/MiniPrf/Ui/MiniPrf.csproj @@ -18,11 +18,11 @@ true full false - bin\Debug\Library\ + bin\Debug\ DEBUG;TRACE prompt 4 - bin\Debug\Library\MiniPrf.xml + bin\Debug\MiniPrf.xml On @@ -33,6 +33,7 @@ TRACE prompt 4 + bin\Release\Library\MiniPrf.xml @@ -87,23 +88,29 @@ Always + + + {3862D89C-E32D-4182-BB58-38777D43EDD9} + FM2014Config + + - erase "$(TargetDir)..\MiniPrf.*" -erase "$(TargetDir)..\Config\*.xml" -erase "$(TargetDir)..\Config\*.manifest" -erase "$(TargetDir)..\Config\*.application" -rmdir "$(TargetDir)..\Config\" + if $(ConfigurationName) == Release erase "$(TargetDir)..\MiniPrf.*" +if $(ConfigurationName) == Release erase "$(TargetDir)..\Config\*.xml" +if $(ConfigurationName) == Release erase "$(TargetDir)..\Config\*.manifest" +if $(ConfigurationName) == Release erase "$(TargetDir)..\Config\*.application" +if $(ConfigurationName) == Release rmdir "$(TargetDir)..\Config\" - mkdir "$(TargetDir)..\Config" -move "$(TargetDir)MiniPrf.application" "$(TargetDir)..\Config\" -move "$(TargetDir)MiniPrf.exe.manifest" "$(TargetDir)..\Config\" -move "$(TargetDir)*.xml" "$(TargetDir)..\Config\" + if $(ConfigurationName) == Release mkdir "$(TargetDir)..\Config" +if $(ConfigurationName) == Release move "$(TargetDir)MiniPrf.application" "$(TargetDir)..\Config\" +if $(ConfigurationName) == Release move "$(TargetDir)MiniPrf.exe.manifest" "$(TargetDir)..\Config\" +if $(ConfigurationName) == Release move "$(TargetDir)*.xml" "$(TargetDir)..\Config\" if $(ConfigurationName) == Release erase "$(TargetDir)*.pdb" -move "$(TargetDir)MiniPrf.exe" "$(TargetDir)..\" -move "$(TargetDir)MiniPrf.exe.config" "$(TargetDir)..\" +if $(ConfigurationName) == Release move "$(TargetDir)MiniPrf.exe" "$(TargetDir)..\" +if $(ConfigurationName) == Release move "$(TargetDir)MiniPrf.exe.config" "$(TargetDir)..\" \ No newline at end of file