Newer
Older
using SDK.Contracts.Data;
using SDK.Models;
namespace Main
{
public static class TestData
{
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
{
X = 0,
Y = 0,
Z = 0,
Title = "sdk-test",
Active = true,
TypeId = 24,
Position = true,
Geofence = true,
GeofenceRange = 20,
Cluster = "c1",
UseGps = false,
};
}
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
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 GetSensor()
{
SensorDataContract data1 = new SensorDataContract
{
Quantity = "Temperature",
Value = "16",
Unit = "°C",
DataType = "Single"
};
SensorDataContract data2 = new SensorDataContract
{
Quantity = "Humidity",
Value = "31",
Unit = "%",
DataType = "Single"
};
SensorDataContract[] sensorDataContracts = new SensorDataContract[] { data1, data2 };
SensorContract sensor = new SensorContract
{
Id = 7351,
Login = "sdk-sensor2",
Title = "testtt",
SectorId = 2,
SensorData = sensorDataContracts,
AreaId = 19
};
return sensor;
}
public static SensorContract GetSensorUpdate()
{
SensorContract sensor = new SensorContract
{
Id = 7351,
Login = "sdk-sensor2",
Title = "tests",
SectorId = 2,
AreaId = 19
};
return sensor;
}
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
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;
}
}
}