FM2014: - prepared specific event args

This commit is contained in:
Thomas Wiedebusch 2026-01-08 11:25:58 +01:00
parent 397d616bea
commit 82b0675f83
3 changed files with 103 additions and 1 deletions

View File

@ -0,0 +1,101 @@
/****************************************************************************************/
/*!@file FM2014AnswerEventArgs.cs
* @brief The answer from the FM2014.
*
*=======================================================================================\n
* @copyright
*
*_______________________________________________________________________________________\n
* Copyright (c) 2026 SENSUS GmbH.\n
* All Rights Reserved.\n
* \n
* Confidential property of\n
* SENSUS GmbH,\n
* Meineckestr. 10, 30880 LAATZEN, GERMANY\n
* \n
*=======================================================================================\n
* @authors
*
*_______________________________________________________________________________________\n
* Thomas Wiedebusch\n
*
*
*=======================================================================================\n
* @version
*
*_______________________________________________________________________________________\n
* V1.00 08-Jan-2026 by Thomas Wiedebusch\n
* - Initial.
*
*
*=======================================================================================\n
*/
using System;
namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core.EventArgs
{
/// <summary>
/// Process progress to feed the progress bar.
/// </summary>
public class FM2014AnswerEventArgs : System.EventArgs
{
/// <summary>
/// The process progress shall feed the GUI progress bars with values
/// </summary>
public enum ProcessProgressType
{
/// <summary>
/// Overall progress max limit for a bunch of processes
/// </summary>
MaxOverallProcessSteps,
/// <summary>
/// Progress of a bunch of processes meaning single process finished
/// </summary>
OverallProcessesSteps,
/// <summary>
/// Actual progress max limit for subordinated process
/// </summary>
MaxActualProcessSteps,
/// <summary>
/// Actual progress step of subordinated process
/// </summary>
ActualProcessSteps,
/// <summary>
/// Just passing a value and answer without progress information
/// </summary>
WithoutProcess
}
/// <summary>
/// FM2014 command code
/// </summary>
public String CmdCharCode { get; private set; }
/// <summary>
/// Optional raw answer from FM2014
/// </summary>
public String AnswerStr { get; private set; }
/// <summary>
/// Optional integer value
/// </summary>
public Int32? IntValue { get; private set; }
/// <summary>
/// Setup of progress type for progress bar
/// </summary>
public ProcessProgressType ProgressType { get; private set; }
/// <summary>
/// Event arguments delivering answer code and message and optional a value and progress type
/// </summary>
/// <param name="cmdCharCode">FM2014 command code</param>
/// <param name="answerStr">Optional raw answer from FM2014</param>
/// <param name="intValue">Optional integer value</param>
/// <param name="progressType">Setup of progress type for progress bar</param>
public FM2014AnswerEventArgs(String cmdCharCode, String answerStr = null, Int32? intValue = null,
ProcessProgressType progressType = ProcessProgressType.WithoutProcess)
{
CmdCharCode = cmdCharCode;
AnswerStr = answerStr;
IntValue = intValue;
ProgressType = progressType;
}
}
}

View File

@ -283,6 +283,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="Consts\FM2014CmdDef.cs" />
<Compile Include="EventArgs\FM2014AnswerEventArgs.cs" />
<Compile Include="IFM2014.cs" />
<Compile Include="FM2014.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

View File

@ -8,7 +8,7 @@
* @copyright
*
*_______________________________________________________________________________________\n
* Copyright (c) 2025 SENSUS GmbH.\n
* Copyright (c) 2025..2026 SENSUS GmbH.\n
* All Rights Reserved.\n
* \n
* Confidential property of\n