Files
annotations/Azaion.Common/DTO/DetectionClass.cs
T
Alex Bezdieniezhnykh d1af7958f8 fix initialization, throttle operations
day/winter/night switcher fixes
2025-02-19 23:07:16 +02:00

51 lines
1012 B
C#

using System.Windows.Media;
using Azaion.Common.Extensions;
using Newtonsoft.Json;
namespace Azaion.Common.DTO;
public class DetectionClass
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public string ShortName { get; set; } = null!;
public string UIName
{
get
{
var mode = PhotoMode switch
{
PhotoMode.Night => "(ніч)",
PhotoMode.Winter => "(зим)",
PhotoMode.Regular => "",
_ => ""
};
return ShortName + mode;
}
}
[JsonIgnore]
public PhotoMode PhotoMode { get; set; }
[JsonIgnore]
public Color Color => Id.ToColor();
[JsonIgnore] //For UI
public int ClassNumber => Id + 1;
[JsonIgnore]
public int YoloId => (int)PhotoMode + Id;
[JsonIgnore]
public SolidColorBrush ColorBrush => new(Color);
}
public enum PhotoMode
{
Regular = 0,
Winter = 20,
Night = 40
}