pile_nav_new/lib/pages/real/process.dart
2024-08-29 17:45:39 +08:00

68 lines
1.8 KiB
Dart

import 'dart:core';
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"],
);
}
}