You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.6 KiB
C#

namespace Haoliang.Models.Device
{
public enum DeviceState
{
Unknown = 0,
Offline = 1,
Idle = 2,
Running = 3,
Alarm = 4,
Maintenance = 5
}
public class DeviceStateTransitionResult
{
public bool Success { get; set; }
public DeviceState PreviousState { get; set; }
public DeviceState CurrentState { get; set; }
public string Message { get; set; }
public DateTime TransitionTime { get; set; }
}
public class DeviceEvent
{
public int EventId { get; set; }
public int DeviceId { get; set; }
public string EventType { get; set; }
public string EventDescription { get; set; }
public DateTime EventTime { get; set; }
}
public class DeviceStateHistory
{
public int Id { get; set; }
public int DeviceId { get; set; }
public DeviceState State { get; set; }
public DateTime StartTime { get; set; }
public DateTime? EndTime { get; set; }
public string Reason { get; set; }
}
public class DeviceStateStatistics
{
public int DeviceId { get; set; }
public TimeSpan TotalRunningTime { get; set; }
public TimeSpan TotalIdleTime { get; set; }
public TimeSpan TotalOfflineTime { get; set; }
public TimeSpan TotalAlarmTime { get; set; }
public DateTime CalculatedAt { get; set; }
}
public enum StateAction
{
None = 0,
Start = 1,
Stop = 2,
Pause = 3,
Resume = 4,
Reset = 5,
Alarm = 6
}
}