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 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"], // ); // } // } class ProcessEntity { // String recvTime; double? azimuth; double alt = 0; double lng = 0; double lat = 0; int tp_id; int utc; int tid; int? id; int times; double height; double speed; // double impact_force; List impact_force; // distance; // pith ProcessEntity( {this.times = 0, // required this.recvTime, this.azimuth, this.alt = 0, this.lng = 0, this.lat = 0, this.height = 0, this.speed = 0, required this.impact_force, required this.tp_id, required this.utc, required this.tid, this.id}); factory ProcessEntity.fromJson(Map json) { return ProcessEntity( // 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(), tp_id: json["tp_id"], utc: json["UTC"], tid: json['tid'], id: json["id"], times: json["times"], impact_force: json["impact_force"].cast(), ); } factory ProcessEntity.fromList(List list) { 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: , ); } }