namespace RobotNet10.RobotApp.Client.Shared.Devices;
///
/// Mô tả một property của thiết bị (dùng để hiển thị trên web UI)
///
public class PropertyDescription
{
///
/// Tên key của property (phải khớp với key trong Properties dictionary)
///
public string Key { get; set; } = string.Empty;
///
/// Tên hiển thị trên UI
///
public string DisplayName { get; set; } = string.Empty;
///
/// Mô tả chi tiết về property
///
public string? Description { get; set; }
///
/// Loại dữ liệu (ví dụ: "string", "number", "boolean", "date", "url", etc.)
///
public string DataType { get; set; } = "string";
///
/// Đơn vị đo (ví dụ: "V", "A", "Hz", "°C", "m/s", etc.) - null nếu không có
///
public string? Unit { get; set; }
///
/// Giá trị mặc định
///
public string? DefaultValue { get; set; }
///
/// Có thể chỉnh sửa trên UI hay không
///
public bool IsReadOnly { get; set; } = false;
///
/// Thứ tự hiển thị trên UI (số nhỏ hơn hiển thị trước)
///
public int DisplayOrder { get; set; } = 0;
///
/// Nhóm/category của property (để nhóm các properties lại với nhau trên UI)
///
public string? Category { get; set; }
///
/// Format string để hiển thị giá trị (ví dụ: "{0:F2}", "{0:yyyy-MM-dd}", etc.)
///
public string? Format { get; set; }
public PropertyDescription()
{
}
public PropertyDescription(string key, string displayName, string? description = null)
{
Key = key ?? throw new ArgumentNullException(nameof(key));
DisplayName = displayName ?? throw new ArgumentNullException(nameof(displayName));
Description = description;
}
}