mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 09:36:30 +00:00
d1af7958f8
day/winter/night switcher fixes
51 lines
1012 B
C#
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
|
|
} |