-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDeviceModel.cs
More file actions
70 lines (60 loc) · 2.2 KB
/
Copy pathDeviceModel.cs
File metadata and controls
70 lines (60 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System.Drawing;
namespace DeviceStatusCheckerService.Models
{
public enum DeviceActiveStatus
{
UNKNOWN = 0,
ONLINE = 1,
OFFLINE = 2,
}
public enum StreamStatus
{
UNKNOWN = 0,
OK = 1,
ERROR = 2,
}
public class StreamSetup
{
public string Name { get; set; } = "";
public StreamStatus Status { get; set; } = StreamStatus.UNKNOWN;
public string URI { get; set; } = "";
public string CodecType { get; set; } = "";
public Size Resolution { get; set; } = new Size(0, 0);
public string SnapshotUri { get; set; } = "";
}
public class DeviceModel
{
public string UUID { get; set; } = "";
public string IP { get; set; } = "";
public string Hostname { get; set; } = "";
public string FriendlyName { get; set; } = "";
public string Model { get; set; } = "";
public string SerialNumber { get; set; } = "";
public string Manufacturer { get; set; } = "";
public string User { get; set; } = "";
public string Password { get; set; } = "";
public string DescriptionLocation { get; set; } = "";
public string PresentationURL { get; set; } = "";
public DeviceActiveStatus DeviceActiveStatus { get; set; } = DeviceActiveStatus.UNKNOWN;
public string Notes { get; set; } = "";
public long UTCDateTime { get; set; } = 0;
public long LocalDateTime { get; set; } = 0;
public string DateTimeType { get; set; } = "";
public string TimeZone { get; set; } = "";
public bool DaylightSavings { get; set; } = false;
public string LastCheckTime
{
get
{
return DateTimeOffset.FromUnixTimeMilliseconds(LastCheckTimeMs).ToString("MM/dd/yyyy HH:mm:ss.fff");
}
}
public long LastCheckTimeMs { get; set; } = 0;
public DeviceModel? Clone()
{
var obj = System.Text.Json.JsonSerializer.Serialize(this);
return System.Text.Json.JsonSerializer.Deserialize<DeviceModel>(obj);
}
public List<StreamSetup> Streams { get; set; } = new List<StreamSetup>();
}
}