using System;
namespace ZB.MOM.WW.LmxProxy.Client.Domain;
///
/// Value, Timestamp, and Quality structure for SCADA data.
///
/// The value.
/// The timestamp when the value was read.
/// The quality of the value.
public readonly record struct Vtq(object? Value, DateTime Timestamp, Quality Quality)
{
/// Creates a new VTQ with the specified value and quality, using the current UTC timestamp.
public static Vtq New(object? value, Quality quality) => new(value, DateTime.UtcNow, quality);
/// Creates a new VTQ with the specified value, timestamp, and quality.
public static Vtq New(object? value, DateTime timestamp, Quality quality) => new(value, timestamp, quality);
/// Creates a Good-quality VTQ with the current UTC time.
public static Vtq Good(object? value) => new(value, DateTime.UtcNow, Quality.Good);
/// Creates a Bad-quality VTQ with the current UTC time.
public static Vtq Bad(object? value = null) => new(value, DateTime.UtcNow, Quality.Bad);
/// Creates an Uncertain-quality VTQ with the current UTC time.
public static Vtq Uncertain(object? value) => new(value, DateTime.UtcNow, Quality.Uncertain);
}