common/Logic/ProductionOrderCore/ProgrammingParameters.cs
2026-04-23 17:50:07 +02:00

60 lines
1.8 KiB
C#

using System;
namespace Xylem.Common.Logic.ProductionOrderCore
{
/// <summary>
/// Source for final properties of Cordonel
/// </summary>
public enum ProgrammingSource
{
Vako,
Csd,
Order,
ProgramInternal
}
/// <summary>
/// Values for single registers
/// </summary>
public class ProgrammingParameters
{
/// <summary>
/// Single register setup value assignment
/// </summary>
/// <param name="registerName"></param>
/// <param name="registerValue"></param>
/// <param name="programmingSource"></param>
public ProgrammingParameters(String registerName, Byte[] registerValue,
ProgrammingSource programmingSource = ProgrammingSource.Vako)
{
RegisterName = registerName;
RegisterValue = registerValue;
Source = programmingSource;
}
/// <summary>
/// The register name
/// </summary>
public String RegisterName { get; }
/// <summary>
/// The register value converted to raw bytes by register converter
/// </summary>
public Byte[] RegisterValue { get; }
/// <summary>
/// The data source either VAKO, CSD or order based with priorities:
/// - lowest: VAKO
/// - middle: CSD
/// - highest: Order
///
/// ATTENTION: DO NOT REMOVE setter as the Json.Serialize will NOT operate and always set the
/// default (ProgrammingSource.Vako) causing malfunction!!!!!
///
/// </summary>
// ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global
// ATTENTION: DO NOT REMOVE (see comment in description)
public ProgrammingSource Source { get; set; }
}
}