common/Logic.PrdoctionToProductMapper/Cordonel/CalibrationResult.cs
2026-04-23 17:50:07 +02:00

171 lines
5.6 KiB
C#

using System;
using System.Collections.Generic;
namespace Logic.ProductionToProductMapper.Cordonel
{
/// <summary>
/// Container for calibration results
/// </summary>
public class CalibrationResult
{
/// <summary>
/// The meter size code.
/// </summary>
public UInt16 MeterSize { get; set; }
/// <summary>
/// Calibration factor of path 1.
/// </summary>
public UInt32 CalFactor1 { get; set; }
/// <summary>
/// Calibration factor of path 2.
/// </summary>
public UInt32 CalFactor2 { get; set; }
/// <summary>
/// Calibration factor of path 3.
/// </summary>
public UInt32 CalFactor3 { get; set; }
/// <summary>
/// Zero flow offset value of path 1.
/// </summary>
public Int32 ZeroOffset1 { get; set; }
/// <summary>
/// Zero flow offset value of path 2.
/// </summary>
public Int32 ZeroOffset2 { get; set; }
/// <summary>
/// Zero flow offset value of path 3.
/// </summary>
public Int32 ZeroOffset3 { get; set; }
/// <summary>
/// First hit level update period.
/// </summary>
public UInt16 FirstHitUpdatePeriod { get; set; }
/// <summary>
/// First hit level shift value.
/// </summary>
public UInt16 FirstHitShift { get; set; }
/// <summary>
/// First hit level percentage of path 1.
/// </summary>
public UInt16 FirstHitPercent1 { get; set; }
/// <summary>
/// First hit level percentage of path 2.
/// </summary>
public UInt16 FirstHitPercent2 { get; set; }
/// <summary>
/// First hit level percentage of path 3.
/// </summary>
public UInt16 FirstHitPercent3 { get; set; }
/// <summary>
/// Time of flight temperature offset of path 1.
/// </summary>
public Int32 ToFTempOffset1 { get; set; }
/// <summary>
/// Time of flight temperature offset of path 2.
/// </summary>
public Int32 ToFTempOffset2 { get; set; }
/// <summary>
/// Time of flight temperature offset of path 3.
/// </summary>
public Int32 ToFTempOffset3 { get; set; }
/// <summary>
/// Time and date of this record.
/// </summary>
public DateTimeOffset Date { get; set; }
/// <summary>
/// Data base entry.
/// </summary>
public Int32 DbId { get; set; }
public Boolean Succesfull { get; set; }
/// <summary>
/// Dictionary of additional logging information.
/// </summary>
public Dictionary<String, String> AdditionalLogInfos;
/// <summary>
/// ctor.
/// </summary>
public CalibrationResult()
{
AdditionalLogInfos = new Dictionary<String, String>();
}
/// <summary>
/// Calibration results
/// </summary>
/// <param name="roCalFactor1"></param>
/// <param name="roCalFactor2"></param>
/// <param name="roCalFactor3"></param>
/// <param name="roZeroOffset1"></param>
/// <param name="roZeroOffset2"></param>
/// <param name="roZeroOffset3"></param>
/// <param name="roFirstHitUpdatePeriod"></param>
/// <param name="roFirstHitShift"></param>
/// <param name="roFirstHitPercent1"></param>
/// <param name="roFirstHitPercent2"></param>
/// <param name="roFirstHitPercent3"></param>
/// <param name="roToFTempOffset1"></param>
/// <param name="roToFTempOffset2"></param>
/// <param name="roToFTempOffset3"></param>
/// <param name="roMeterSize"></param>
public CalibrationResult(UInt32 roCalFactor1, UInt32 roCalFactor2, UInt32 roCalFactor3,
Int32 roZeroOffset1, Int32 roZeroOffset2, Int32 roZeroOffset3,
UInt16 roFirstHitUpdatePeriod, UInt16 roFirstHitShift,
UInt16 roFirstHitPercent1, UInt16 roFirstHitPercent2, UInt16 roFirstHitPercent3,
Int32 roToFTempOffset1, Int32 roToFTempOffset2, Int32 roToFTempOffset3,
UInt16 roMeterSize)
{
CalFactor1 = roCalFactor1;
CalFactor2 = roCalFactor2;
CalFactor3 = roCalFactor3;
ZeroOffset1 = roZeroOffset1;
ZeroOffset2 = roZeroOffset2;
ZeroOffset3 = roZeroOffset3;
FirstHitUpdatePeriod = roFirstHitUpdatePeriod;
FirstHitShift = roFirstHitShift;
FirstHitPercent1 = roFirstHitPercent1;
FirstHitPercent2 = roFirstHitPercent2;
FirstHitPercent3 = roFirstHitPercent3;
ToFTempOffset1 = roToFTempOffset1;
ToFTempOffset2 = roToFTempOffset2;
ToFTempOffset3 = roToFTempOffset3;
MeterSize = roMeterSize;
AdditionalLogInfos = new Dictionary<String, String>();
}
/// <summary>
/// Additional logging information
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
public void AddAdditionalLog(String key, String value)
{
if (AdditionalLogInfos.ContainsKey(key))
{
AdditionalLogInfos[key] = $"{ AdditionalLogInfos[key]} {Environment.NewLine} {value}";
}
else
{
AdditionalLogInfos.Add(key, value);
}
}
}
}