Newer
Older
using SDK.Contracts.Data;
using SDK.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Main
{
public static class TestData
{
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
public static BeaconContract GetBeacon()
{
return new BeaconContract
{
SectorId = 1,
BranchId = 1,
Mac = "aa:aa:aa:aa:aa:aa",
X = 0,
Y = 0,
Z = 0,
Title = "sdk-test",
Active = true,
TypeId = 23,
Position = true,
Geofence = true,
GeofenceRange = 20,
Cluster = "c1",
UseGps = false,
};
}
public static BeaconContract GetBeaconPatch()
{
return new BeaconContract
{
Id = 139,
SectorId = 1,
BranchId = 1,
Mac = "aa:aa:aa:aa:aa:aa",
X = 0,
Y = 0,
Z = 0,
Title = "sdk-test",
Active = true,
TypeId = 24,
Position = true,
Geofence = true,
GeofenceRange = 20,
Cluster = "c1",
UseGps = false,
};
}
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
public static DeviceLocationContract[] GetLocalizationDataBatch()
{
DistanceContract[] distanceContract1 = new DistanceContract[]
{
new DistanceContract {BeaconId = 34, RSSI= -56},
new DistanceContract {BeaconId = 34, RSSI= -56},
new DistanceContract {BeaconId = 34, RSSI= -56},
};
LocationContract[] locationContract = new LocationContract[]
{
new LocationContract {SectorId = 1, Battery = 100, IsMoving = true, Timestamp = 1599644652178,
X = 0, Y = 0, Z = 0, Interval = 300, Distances = distanceContract1 },
new LocationContract {SectorId = 2, Battery = 100, IsMoving = true, Timestamp = 1599644652178,
X = 0, Y = 0, Z = 0, Interval = 300, Distances = distanceContract1 },
new LocationContract {SectorId = 3, Battery = 100, IsMoving = true, Timestamp = 1599644652178,
X = 0, Y = 0, Z = 0, Interval = 300, Distances = distanceContract1 },
new LocationContract {SectorId = 4, Battery = 100, IsMoving = true, Timestamp = 1599644652178,
X = 0, Y = 0, Z = 0, Interval = 300, Distances = distanceContract1 },
};
return new DeviceLocationContract[] { new DeviceLocationContract { Login = "sdk-device", Locations = locationContract } };
}
public static LocationContract[] GetLocalizationData()
{
DistanceContract[] distanceContract1 = new DistanceContract[]
{
new DistanceContract {BeaconId = 34, RSSI= -56},
new DistanceContract {BeaconId = 34, RSSI= -56},
new DistanceContract {BeaconId = 34, RSSI= -56},
};
return new LocationContract[]
{
new LocationContract {SectorId = 1, Battery = 100, IsMoving = true, Timestamp = 1599644652178,
X = 0, Y = 0, Z = 0, Interval = 300, Distances = distanceContract1 },
new LocationContract {SectorId = 2, Battery = 100, IsMoving = true, Timestamp = 1599644652178,
X = 0, Y = 0, Z = 0, Interval = 300, Distances = distanceContract1 },
new LocationContract {SectorId = 3, Battery = 100, IsMoving = true, Timestamp = 1599644652178,
X = 0, Y = 0, Z = 0, Interval = 300, Distances = distanceContract1 },
new LocationContract {SectorId = 4, Battery = 100, IsMoving = true, Timestamp = 1599644652178,
X = 0, Y = 0, Z = 0, Interval = 300, Distances = distanceContract1 },
};
}
public static SensorContract[] GetSensorDataBatch()
{
SensorDataContract data1 = new SensorDataContract
{
Quantity = "Temperature",
Value = "16",
Unit = "°C",
DataType = "Single"
};
SensorDataContract data2 = new SensorDataContract
{
Quantity = "Humidity",
Value = "31",
Unit = "%",
DataType = "Single"
};
SensorDataContract data3 = new SensorDataContract
{
Quantity = "CO2",
Timestamp = 1614599484673,
Value = "800",
DataType = "Int32",
Unit = "unit"
};
SensorDataContract[] sensorDataContracts = new SensorDataContract[] { data1, data2, data3 };
SensorContract sensor = new SensorContract
{
Login = "sdk-sensor",
SectorId = 2,
SensorData = sensorDataContracts,
AreaId = 24
};
SensorContract[] sensorContracts = new SensorContract[] { sensor };
return sensorContracts;
}
public static SensorDataContract[] GetSensorData()
{
SensorDataContract data1 = new SensorDataContract
{
Quantity = "Temperature",
Value = "16",
Unit = "°C",
DataType = "Single"
};
SensorDataContract data2 = new SensorDataContract
{
Quantity = "Humidity",
Value = "31",
Unit = "%",
DataType = "Single"
};
SensorDataContract data3 = new SensorDataContract
{
Quantity = "CO2",
Timestamp = 1614599484673,
Value = "800",
DataType = "Int32",
Unit = "unit"
};
SensorDataContract[] sensorDataContracts = new SensorDataContract[] { data1, data2, data3 };
return sensorDataContracts;
}
}
}