pile_nav_new/lib/pages/real/process.dart

135 lines
3.6 KiB
Dart
Raw Normal View History

2024-08-27 18:08:05 +08:00
import 'dart:core';
2024-11-18 14:48:54 +08:00
// class ProcessEntity {
// double speed;
// double depth;
// double tiltX;
// double tiltY;
// double current1;
// double current2;
// double toatalFlow2;
// double toatalFlow1;
// double subtotalFlow2;
// double subtotalFlow1;
// String recvTime;
// // double? azimuth;
// double alt = 0;
// double lng = 0;
// double lat = 0;
// String pileId;
// int utc;
// int tid;
// int? id;
// ProcessEntity(
// {this.speed = 0,
// this.depth = 0,
// this.tiltX = 0,
// this.tiltY = 0,
// this.current1 = 0,
// this.current2 = 0,
// this.toatalFlow2 = 0,
// this.toatalFlow1 = 0,
// this.subtotalFlow2 = 0,
// this.subtotalFlow1 = 0,
// required this.recvTime,
// // this.azimuth,
// this.alt = 0,
// this.lng = 0,
// this.lat = 0,
// required this.pileId,
// required this.utc,
// required this.tid,
// this.id});
// factory ProcessEntity.fromJson(Map<String, dynamic> json) {
// return ProcessEntity(
// speed: (json["speed"] ?? "0").toDouble(),
// depth: (json["depth"] ?? "0").toDouble(),
// tiltX: (json["tilt_x"] ?? "0").toDouble(),
// tiltY: (json["tilt_y"] ?? "0").toDouble(),
// current1: (json["current1"] ?? "0").toDouble(),
// current2: (json["current2"] ?? "0").toDouble(),
// toatalFlow2: (json["toatal_flow2"] ?? "0").toDouble(),
// toatalFlow1: (json["toatal_flow1"] ?? "0").toDouble(),
// subtotalFlow2: (json["subtotal_flow2"] ?? "0").toDouble(),
// subtotalFlow1: (json["subtotal_flow1"] ?? "0").toDouble(),
// recvTime: json["recv_time"] ?? DateTime.now(),
// // azimuth: (json["azimuth"] ?? "0").toDouble(),
// alt: (json["ALT"] ?? "0").toDouble(),
// lng: (json["LNG"] ?? "0").toDouble(),
// lat: (json["LAT"] ?? "0").toDouble(),
// pileId: json["pile_id"].toString(),
// utc: json["UTC"],
// tid: json['tid'],
// id: json["id"],
// );
// }
// }
2024-08-27 18:08:05 +08:00
class ProcessEntity {
2024-11-18 14:48:54 +08:00
// String recvTime;
double? azimuth;
2024-08-27 18:08:05 +08:00
double alt = 0;
double lng = 0;
double lat = 0;
2024-11-18 14:48:54 +08:00
int tp_id;
2024-08-27 18:08:05 +08:00
int utc;
int tid;
int? id;
2024-11-18 14:48:54 +08:00
int times;
double height;
double speed;
// double impact_force;
List<double> impact_force;
// distance;
// pith
2024-08-27 18:08:05 +08:00
ProcessEntity(
2024-11-18 14:48:54 +08:00
{this.times = 0,
// required this.recvTime,
this.azimuth,
2024-08-27 18:08:05 +08:00
this.alt = 0,
this.lng = 0,
this.lat = 0,
2024-11-18 14:48:54 +08:00
this.height = 0,
this.speed = 0,
required this.impact_force,
required this.tp_id,
2024-08-27 18:08:05 +08:00
required this.utc,
required this.tid,
this.id});
factory ProcessEntity.fromJson(Map<String, dynamic> json) {
return ProcessEntity(
2024-11-18 14:48:54 +08:00
// recvTime: json["recv_time"] ?? DateTime.now(),
2024-08-27 18:08:05 +08:00
// azimuth: (json["azimuth"] ?? "0").toDouble(),
alt: (json["ALT"] ?? "0").toDouble(),
lng: (json["LNG"] ?? "0").toDouble(),
lat: (json["LAT"] ?? "0").toDouble(),
2024-11-18 14:48:54 +08:00
tp_id: json["tp_id"],
2024-08-27 18:08:05 +08:00
utc: json["UTC"],
tid: json['tid'],
id: json["id"],
2024-11-18 14:48:54 +08:00
times: json["times"],
impact_force: json["impact_force"].cast<double>(),
2024-08-27 18:08:05 +08:00
);
}
2024-11-15 17:42:52 +08:00
2024-11-18 18:02:15 +08:00
factory ProcessEntity.fromList(List<String> list) {
2024-11-18 14:48:54 +08:00
return ProcessEntity(
utc:int.parse( list[2]),
lat: double.parse(list[3]),
lng: double.parse(list[4]),
height: double.parse(list[5]),
speed: double.parse(list[6]),
tp_id: 0, tid: 0,
impact_force: []
// impact_force: double.parse(list[7]),
// recvTime: json["recv_time"] ?? DateTime.now(),
// tp_id: ,
);
}
}