Creado apartir del commit b888de6c92056de294456f581a56e25e734d4ab7 de develop
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using adas_core.Domain.Enums;
|
||||
|
||||
namespace adas_core.Domain.Models.MongoModels;
|
||||
|
||||
public class AlarmItem
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
public int StartBefore { get; set; } // seconds
|
||||
public int EndAfter { get; set; } // seconds overrides
|
||||
|
||||
public string? Color
|
||||
{
|
||||
get => BeaconColor.ToString();
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value) && Enum.TryParse(value, out AlarmEnum.BeaconColor color))
|
||||
BeaconColor = color;
|
||||
}
|
||||
}
|
||||
|
||||
public AlarmEnum.Severity Severity { get; set; } = AlarmEnum.Severity.None;
|
||||
public AlarmEnum.BeaconColor BeaconColor { get; set; } = AlarmEnum.BeaconColor.None;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
List<string> items =
|
||||
[
|
||||
$"Enabled: {Enabled}",
|
||||
$"StartBefore: {StartBefore}",
|
||||
$"EndAfter: {EndAfter}",
|
||||
$"Severity: {Severity}",
|
||||
$"BeaconColorEnum: {BeaconColor}"
|
||||
];
|
||||
if (!string.IsNullOrEmpty(Color)) items.Add($"Color: {Color}");
|
||||
|
||||
|
||||
return "AlarmItem[" + string.Join(", ", items) + "]";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user