pile_nav_new/lib/models/pilePoint/hyrecorditem.dart

59 lines
1.4 KiB
Dart
Raw Normal View History

2024-08-23 17:54:57 +08:00
class HyRecordItem {
final int id;
final String startTime;
final String endTime;
final int tid;
final int tpId;
final String name;
final double lat;
final double lng;
final double alt;
final double x;
final double y;
final int times;
final double strongDrop;
final int layer;
final int qualified;
double dx;
double dy;
HyRecordItem({
this.alt = 0,
this.endTime = "",
required this.id,
this.lat = 0,
this.lng = 0,
this.layer = 1,
this.name = "",
this.qualified = 1,
this.startTime = "",
this.strongDrop = 0,
required this.tid,
this.times = 1,
required this.tpId,
this.x = 0,
this.y = 0,
this.dx = 0,
this.dy = 0,
});
factory HyRecordItem.fromJson(Map<String, dynamic> json) {
return HyRecordItem(
alt: json['ALT'].toDouble() ?? 0,
endTime: json['end_time'],
id: json['id'],
lat: json['LAT'].toDouble() ?? 0,
lng: json['LNG'].toDouble() ?? 0,
layer: json['layer'],
name: json['name'] ?? "",
qualified: json['is_qualified'],
startTime: json['start_time'],
strongDrop: json['strong_drop'].toDouble() ?? 0,
tid: json['tid'],
times: json['times'],
tpId: json['tp_id'],
x: json['x'].toDouble() ?? 0,
y: json['y'].toDouble() ?? 0,
dx: 0,
dy: 0);
}
}