-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeviceModels.cs
More file actions
285 lines (248 loc) · 10.1 KB
/
Copy pathDeviceModels.cs
File metadata and controls
285 lines (248 loc) · 10.1 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
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
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace dji_cloud_tool
{
public class DeviceItem : INotifyPropertyChanged
{
private string _sn = "";
private string _name = "";
private string _type = "网关"; // "设备", "网关", or "无人机"
private bool _isOnline = false;
private DateTime _lastActive = DateTime.MinValue;
public string Sn
{
get => _sn;
set { _sn = value; OnPropertyChanged(); }
}
public string Name
{
get => _name;
set { _name = value; OnPropertyChanged(); }
}
public string Type
{
get => _type;
set { _type = value; OnPropertyChanged(); }
}
public bool IsOnline
{
get => _isOnline;
set { _isOnline = value; OnPropertyChanged(); }
}
public DateTime LastActive
{
get => _lastActive;
set { _lastActive = value; OnPropertyChanged(); }
}
public ObservableCollection<DeviceItem> SubDevices { get; set; } = new();
public event PropertyChangedEventHandler? PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string? name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
public class MqttTopicItem : INotifyPropertyChanged
{
private string _topic = "";
private bool _isEnabled = true;
private bool _isSystem = false;
public string Topic
{
get => _topic;
set { _topic = value; OnPropertyChanged(); }
}
public bool IsEnabled
{
get => _isEnabled;
set { _isEnabled = value; OnPropertyChanged(); }
}
public bool IsSystem
{
get => _isSystem;
set { _isSystem = value; OnPropertyChanged(); }
}
public event PropertyChangedEventHandler? PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string? name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
public class OsdTelemetryItem : INotifyPropertyChanged
{
private string _key = "";
private string _label = "";
private string _value = "";
private string _category = "";
public string Key
{
get => _key;
set { _key = value; OnPropertyChanged(); }
}
public string Label
{
get => _label;
set { _label = value; OnPropertyChanged(); }
}
public string Value
{
get => _value;
set { _value = value; OnPropertyChanged(); }
}
public string Category
{
get => _category;
set { _category = value; OnPropertyChanged(); }
}
public event PropertyChangedEventHandler? PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string? name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
public class MqttMessageItem
{
public string Timestamp { get; set; } = "";
public string Topic { get; set; } = "";
public string Payload { get; set; } = "";
}
public class DockDebugLogItem : INotifyPropertyChanged
{
private string _timestamp = "";
private string _method = "";
private string _methodNameCn = "";
private string _topic = "";
private string _status = "已发送";
private string _statusColor = "#38BDF8";
private string _progressPercent = "-";
private string _payload = "";
public string Timestamp
{
get => _timestamp;
set { _timestamp = value; OnPropertyChanged(); }
}
public string Method
{
get => _method;
set { _method = value; OnPropertyChanged(); }
}
public string MethodNameCn
{
get => _methodNameCn;
set { _methodNameCn = value; OnPropertyChanged(); }
}
public string Topic
{
get => _topic;
set { _topic = value; OnPropertyChanged(); }
}
public string Status
{
get => _status;
set { _status = value; OnPropertyChanged(); }
}
public string StatusColor
{
get => _statusColor;
set { _statusColor = value; OnPropertyChanged(); }
}
public string ProgressPercent
{
get => _progressPercent;
set { _progressPercent = value; OnPropertyChanged(); }
}
public string Payload
{
get => _payload;
set { _payload = value; OnPropertyChanged(); }
}
public event PropertyChangedEventHandler? PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string? name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
public class TelemetryDashboardViewModel : INotifyPropertyChanged
{
// Dock Telemetry
private string _coverState = "未知";
private string _airConditionerState = "未知";
private string _droneInDock = "未知";
private string _chargingState = "未知";
private string _droneBatteryPercent = "未知";
private string _environmentTemp = "未知";
private string _cabinTemp = "未知";
private string _humidity = "未知";
private string _windSpeed = "未知";
private string _rainfall = "未知";
private string _gpsCount = "未知";
private string _rtkStatus = "未知";
private string _workingVoltage = "未知";
private string _workingCurrent = "未知";
private string _emergencyStop = "未知";
private string _dockState = "未知";
// Drone Telemetry
private string _dronePosition = "未知";
private string _droneAttitude = "未知";
private string _droneSpeeds = "未知";
private string _droneBattery = "未知";
private string _droneSats = "未知";
private string _droneState = "未知";
private string _droneStateReason = "未知";
public string CoverState { get => _coverState; set { _coverState = value; OnPropertyChanged(); } }
public string AirConditionerState { get => _airConditionerState; set { _airConditionerState = value; OnPropertyChanged(); } }
public string DroneInDock { get => _droneInDock; set { _droneInDock = value; OnPropertyChanged(); } }
public string ChargingState { get => _chargingState; set { _chargingState = value; OnPropertyChanged(); } }
public string DroneBatteryPercent { get => _droneBatteryPercent; set { _droneBatteryPercent = value; OnPropertyChanged(); } }
public string EnvironmentTemp { get => _environmentTemp; set { _environmentTemp = value; OnPropertyChanged(); } }
public string CabinTemp { get => _cabinTemp; set { _cabinTemp = value; OnPropertyChanged(); } }
public string Humidity { get => _humidity; set { _humidity = value; OnPropertyChanged(); } }
public string WindSpeed { get => _windSpeed; set { _windSpeed = value; OnPropertyChanged(); } }
public string Rainfall { get => _rainfall; set { _rainfall = value; OnPropertyChanged(); } }
public string GpsCount { get => _gpsCount; set { _gpsCount = value; OnPropertyChanged(); } }
public string RtkStatus { get => _rtkStatus; set { _rtkStatus = value; OnPropertyChanged(); } }
public string WorkingVoltage { get => _workingVoltage; set { _workingVoltage = value; OnPropertyChanged(); } }
public string WorkingCurrent { get => _workingCurrent; set { _workingCurrent = value; OnPropertyChanged(); } }
public string EmergencyStop { get => _emergencyStop; set { _emergencyStop = value; OnPropertyChanged(); } }
public string DockState { get => _dockState; set { _dockState = value; OnPropertyChanged(); } }
public string DronePosition { get => _dronePosition; set { _dronePosition = value; OnPropertyChanged(); } }
public string DroneAttitude { get => _droneAttitude; set { _droneAttitude = value; OnPropertyChanged(); } }
public string DroneSpeeds { get => _droneSpeeds; set { _droneSpeeds = value; OnPropertyChanged(); } }
public string DroneBattery { get => _droneBattery; set { _droneBattery = value; OnPropertyChanged(); } }
public string DroneSats { get => _droneSats; set { _droneSats = value; OnPropertyChanged(); } }
public string DroneState { get => _droneState; set { _droneState = value; OnPropertyChanged(); } }
public string DroneStateReason { get => _droneStateReason; set { _droneStateReason = value; OnPropertyChanged(); } }
public void Reset()
{
CoverState = "未知";
AirConditionerState = "未知";
DroneInDock = "未知";
ChargingState = "未知";
DroneBatteryPercent = "未知";
EnvironmentTemp = "未知";
CabinTemp = "未知";
Humidity = "未知";
WindSpeed = "未知";
Rainfall = "未知";
GpsCount = "未知";
RtkStatus = "未知";
WorkingVoltage = "未知";
WorkingCurrent = "未知";
EmergencyStop = "未知";
DockState = "未知";
DronePosition = "未知";
DroneAttitude = "未知";
DroneSpeeds = "未知";
DroneBattery = "未知";
DroneSats = "未知";
DroneState = "未知";
DroneStateReason = "未知";
}
public event PropertyChangedEventHandler? PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string? name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
}