-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeatherPoint.cs
115 lines (101 loc) · 3.19 KB
/
WeatherPoint.cs
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
using System;
public class Metadata
{
public DateTime UTCTimeStamp { get; set; }
public string DeviceID { get; set; }
public string ApplicationID { get; set; }
public string GatewayID { get; set; }
public Metadata(DateTime timestamp, string deviceID, string applicationID, string gatewayID)
{
UTCTimeStamp = timestamp;
DeviceID = deviceID;
ApplicationID = applicationID;
GatewayID = gatewayID;
}
}
public class Positional
{
public double Latitude { get; set; }
public double Longitude { get; set; }
public double? Altitude { get; set; }
public Positional(double latitude, double longitude, double altitude)
{
Latitude = latitude;
Longitude = longitude;
Altitude = altitude;
}
public Positional(double latitude, double longitude)
{
Latitude = latitude;
Longitude = longitude;
}
}
public class SensorData
{
public int? LightLogscale { get; set; }
public int? LightLux { get; set; }
public float Temperature { get; set; }
public float? Humidity { get; set; }
public float? Pressure { get; set; }
public int? BatteryStatus { get; set; }
public float? BatteryVoltage { get; set; }
public string? WorkMode { get; set; }
public SensorData(float temperature, float humidity, int lightLux, int batteryStatus,
float batteryVoltage, string workMode)
{
LightLux = lightLux;
Temperature = temperature;
Humidity = humidity;
BatteryStatus = batteryStatus;
BatteryVoltage = batteryVoltage;
WorkMode = workMode;
}
public SensorData(float temperature, float pressure, int lightLog)
{
Temperature = temperature;
Pressure = pressure;
LightLogscale = lightLog;
}
}
public class TransmissionalData
{
public int Rssi { get; set; }
public float? Snr { get; set; }
public int SpreadingFactor { get; set; }
public float ConsumedAirtime { get; set; }
public int Bandwidth { get; set; }
public int Frequency { get; set; }
public TransmissionalData(int rssi, float snr, int spreadingFactor,
float consumedAirtime, int bandwidth, int frequency)
{
Rssi = rssi;
Snr = snr;
SpreadingFactor = spreadingFactor;
ConsumedAirtime = consumedAirtime;
Bandwidth = bandwidth;
Frequency = frequency;
}
public TransmissionalData(int rssi, int spreadingFactor,
float consumedAirtime, int bandwidth, int frequency)
{
Rssi = rssi;
SpreadingFactor = spreadingFactor;
ConsumedAirtime = consumedAirtime;
Bandwidth = bandwidth;
Frequency = frequency;
}
}
public class WeatherPoint
{
public Metadata Metadata { get; set; }
public Positional Positional { get; set; }
public SensorData SensorData { get; set; }
public TransmissionalData TransmissionalData { get; set; }
public WeatherPoint(Metadata metadata, Positional positional, SensorData sensorData, TransmissionalData transmissionalData)
{
Metadata = metadata;
Positional = positional;
SensorData = sensorData;
TransmissionalData = transmissionalData;
}
}