播放器

This commit is contained in:
tanlinxing 2024-09-06 09:11:06 +08:00
parent 9e2e3cec42
commit 2bd17c166b
14 changed files with 2109 additions and 345 deletions

View File

@ -1,7 +1,7 @@
# This is a generated file; do not edit or check into version control.
pass_track=G:\\workplace\\cpnav\\plugins\\pass_track\\
path_provider=C:\\Users\\Adminis\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider-2.1.4\\
path_provider_android=C:\\Users\\Adminis\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_android-2.2.10\\
path_provider_foundation=C:\\Users\\Adminis\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_foundation-2.4.0\\
path_provider_linux=C:\\Users\\Adminis\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_linux-2.2.1\\
path_provider_windows=C:\\Users\\Adminis\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_windows-2.3.0\\
pass_track=D:\\workspace\\cpnav_new\\cpnav\\plugins\\pass_track\\
path_provider=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider-2.1.4\\
path_provider_android=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_android-2.2.10\\
path_provider_foundation=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_foundation-2.4.0\\
path_provider_linux=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_linux-2.2.1\\
path_provider_windows=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_windows-2.3.0\\

View File

@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Adminis\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"pass_track","path":"G:\\\\workplace\\\\cpnav\\\\plugins\\\\pass_track\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"C:\\\\Users\\\\Adminis\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_android-2.2.10\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Adminis\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\Adminis\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"pass_track","path":"G:\\\\workplace\\\\cpnav\\\\plugins\\\\pass_track\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\Adminis\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_windows-2.3.0\\\\","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"pass_track","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2024-09-05 16:17:49.022296","version":"3.24.2","swift_package_manager_enabled":false}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"pass_track","path":"D:\\\\workspace\\\\cpnav_new\\\\cpnav\\\\plugins\\\\pass_track\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.10\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"pass_track","path":"D:\\\\workspace\\\\cpnav_new\\\\cpnav\\\\plugins\\\\pass_track\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.3.0\\\\","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"pass_track","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2024-09-06 08:42:07.937977","version":"3.24.0","swift_package_manager_enabled":false}

View File

@ -1,63 +0,0 @@
class CoordTrans {
int id;
// ignore: non_constant_identifier_names
double L0;
String belt;
String? calibs;
String dstEllipsoid;
double dx;
double dy;
double dz;
double wx;
double wy;
double wz;
double k;
double elevation;
int isMain;
String name;
double rota;
String srcEllipsoid;
CoordTrans({
required this.name,
// ignore: non_constant_identifier_names
required this.L0,
required this.belt,
this.calibs,
required this.dstEllipsoid,
required this.dx,
required this.dy,
required this.dz,
required this.id,
required this.wx,
required this.wy,
required this.wz,
required this.k,
required this.elevation,
required this.isMain,
required this.rota,
required this.srcEllipsoid,
});
factory CoordTrans.fromJson(Map<dynamic, dynamic> data) {
return CoordTrans(
name: data['name'],
id: data['id'],
L0: data['L0'].toDouble(),
belt: data['belt'],
calibs: data['calibs'],
dstEllipsoid: data['dstEllipsoid'],
dx: data['dx'].toDouble(),
dy: data['dy'].toDouble(),
dz: data['dz'].toDouble(),
wx: data['wx'].toDouble(),
wy: data['wy'].toDouble(),
wz: data['wz'].toDouble(),
rota: data['rota'].toDouble(),
k: data['k'].toDouble(),
isMain: data['is_main'],
elevation: data['elevation'].toDouble(),
srcEllipsoid: data['srcEllipsoid'],
);
}
void forEach(Null Function(dynamic key, dynamic value) param0) {}
}

View File

@ -4,7 +4,12 @@ import 'package:get/get.dart';
import 'package:scence_map/controller.dart';
import 'package:cpnav/service/base.dart';
import 'sevice/file_handle.dart';
FileHandle fileHandle = FileHandle();
class PassTrackController extends GetxController {
var allLen = 0.0;
final mapController = Get.put(ScenceMapController());
String projCode;
@ -20,6 +25,7 @@ class PassTrackController extends GetxController {
loadProject();
loadSideLine();
loadBindDevice();
getHisFileList();
}
loadBindDevice() async {
@ -71,4 +77,18 @@ class PassTrackController extends GetxController {
mapController.centerXY = Offset((maxX + minX) / 2, (maxY + minY) / 2);
}
}
getHisFileList() async {
Map textlist = await GetServices().getHisFileList();
List fileList = textlist['list'];
for (var i = 0; i < fileList.length; i++) {
var file = fileList[i];
var jsData = await GetServices().getHisFile(file);
int len = fileHandle.resolveJson(jsData, passTrackPlugin);
allLen += len;
// print("$pointList");
// var totalList =fileHandle.allPointData;
}
print("allLen: $allLen");
}
}

View File

@ -0,0 +1,682 @@
// ignore_for_file: non_constant_identifier_names
import 'dart:math';
class CoordGPS {
double LAT; //
double LNG; //
double? ALT; //
CoordGPS({this.ALT, required this.LAT, required this.LNG});
}
class CoordXYH {
double X;
double Y;
double H;
CoordXYH({required this.X, required this.Y, required this.H});
}
class CoordBLH {
double B;
double L;
double H;
CoordBLH({required this.B, required this.H, required this.L});
}
class CoordXYZ {
double X;
double Y;
double Z;
CoordXYZ({required this.X, required this.Y, required this.Z});
}
class PointXY {
double X;
double Y;
PointXY({required this.X, required this.Y});
}
class Region {
double X;
double Y;
double? width;
double? heigth;
double? D;
Region({this.D, required this.X, required this.Y, this.heigth, this.width});
}
class Ellipsoid {
late double A;
late double F;
late double B;
late double E12;
late double E22;
Ellipsoid(String name) {
const Map<String, Map<String, double>> datums = {
'BJ54': {'a': 6378245, 'f': 1 / 298.3},
'XA80': {'a': 6378140, 'f': 1 / 298.257},
'WGS84': {'a': 6378137, 'f': 1 / 298.257223563},
'WGS2000': {'a': 6378137, 'f': 1 / 298.257222101}
};
var Datum = datums[name];
if (Datum != null) {
double a = Datum['a']!;
double f = Datum['f']!;
double b = a - f * a;
double e12 = (a * a - b * b) / (a * a); //
double e22 = (a * a - b * b) / (b * b); //
A = a;
F = f;
B = b;
E12 = e12;
E22 = e22;
}
}
}
class TransParm {
late double dx;
late double dy;
late double dz;
late double rx;
late double ry;
late double rz;
late double rota;
late double k;
TransParm(TransOptions options) {
dx = options.dx ?? 0;
dy = options.dy ?? 0;
dz = options.dz ?? 0;
rx = options.rx ?? 0;
ry = options.ry ?? 0;
rz = options.rz ?? 0;
k = options.k ?? 0;
rota = options.rota ?? 0;
}
}
class TransOptions {
double? dx; //X平移(M)
double? dy; //Y平移(M)
double? dz; //z平移(M)
double? rx; //X旋转(°)
double? ry; //Y旋转(°)
double? rz; //Z旋转(°)
double? rota; //4
double? k; //(ppm)
double? L0; //线()
String? srcEllipsoid; //
String? dstEllipsoid; //
double? zoneWidth; //线
double? elevation; //
TransOptions({
this.L0,
this.dstEllipsoid,
this.dx,
this.dy,
this.dz,
this.elevation,
this.k,
this.rota,
this.rx,
this.ry,
this.rz,
this.srcEllipsoid,
});
}
class CoordTrans {
late double L0; //线
late double zoneWidth; //
late double elevation; //
late double rota; //4
late Ellipsoid srcEllipsoid; //
late Ellipsoid dstEllipsoid; //
late TransParm transParm; //7
CoordTrans(TransOptions options) {
transParm = TransParm(options);
L0 = options.L0 ?? 0;
elevation = options.elevation ?? 0;
srcEllipsoid = Ellipsoid(options.srcEllipsoid ?? 'WGS84');
dstEllipsoid = Ellipsoid(options.dstEllipsoid ?? 'WGS2000');
zoneWidth = options.zoneWidth ?? 3;
}
CoordXYH GPS2XY(CoordGPS gps) {
return d2p(CoordBLH(H: gps.ALT ?? elevation, B: gps.LAT, L: gps.LNG));
}
//
CoordXYH d2p(CoordBLH blh) {
CoordXYZ zj = BLH2XYZ(blh);
CoordXYZ xzj = XYZ2XYZ(zj);
CoordBLH xdd = XYZ2BLH(xzj);
CoordXYH xpm = BL2XY(xdd);
return xpm;
}
//
CoordBLH p2d(CoordXYH xyh) {
CoordBLH bl = XY2BL(xyh, true);
CoordXYZ zj = BLH2XYZ(bl, true);
CoordXYZ xzj = XYZ2XYZ(zj, true);
CoordBLH xdd = XYZ2BLH(xzj, true);
return xdd;
}
setZoneWidth(width) {
if (width != 6 && width != 3) {
print('带宽应当为6或者为3');
} else {
zoneWidth = width;
}
}
setL0(l0) {
L0 = l0;
}
int getZoneNo(double lng) {
// 6
//
if (zoneWidth == 6) {
return ((lng + 6) / 6).floor();
}
// 3
return ((lng + 1.5) / 3).floor();
}
PointXY xy2xyLocal(PointXY source) {
double x = source.X;
double y = source.Y;
double destx = x * transParm.k * cos(rota) -
y * transParm.k * sin(rota) +
transParm.dx;
double desty = x * transParm.k * sin(rota) +
y * transParm.k * cos(rota) +
transParm.dy;
return PointXY(X: destx, Y: desty);
}
CoordXYZ BLH2XYZ(CoordBLH pointBLH, [srcDst = false]) {
Ellipsoid ellipsoid = srcDst ? srcEllipsoid : dstEllipsoid;
double a = ellipsoid.A;
double e12 = ellipsoid.E12;
double radB = pointBLH.B / 180 * pi;
double radL = pointBLH.L / 180 * pi;
double H = pointBLH.H;
double N = a / sqrt(1 - e12 * sin(radB) * sin(radB)); //
double X = (N + H) * cos(radB) * cos(radL);
double Y = (N + H) * cos(radB) * sin(radL);
double Z = (N * (1 - e12) + H) * sin(radB);
return CoordXYZ(X: X, Y: Y, Z: Z);
}
/*
dX, dY, dZ:
wX, wY, wZ: ()
Kppm: ppm 1000000
*/
CoordXYZ XYZ2XYZ(CoordXYZ xyz, [srcDst = false]) {
double X = xyz.X;
double Y = xyz.Y;
double Z = xyz.Z;
double dX = transParm.dx;
double dY = transParm.dy;
double dZ = transParm.dz;
double rX = transParm.rx / 3600 / 180 * pi;
double rY = transParm.ry / 3600 / 180 * pi;
double rZ = transParm.rz / 3600 / 180 * pi;
double Kppm = transParm.k / 1000000;
CoordXYZ result = CoordXYZ(X: 0, Y: 0, Z: 0);
if (srcDst) {
result.X = X - dX - Kppm * X + rY * Z - rZ * Y;
result.Y = Y - dY - Kppm * Y - rX * Z + rZ * X;
result.Z = Z - dZ - Kppm * Z + rX * Y - rY * X;
} else {
result.X = X + dX + Kppm * X - rY * Z + rZ * Y;
result.Y = Y + dY + Kppm * Y + rX * Z - rZ * X;
result.Z = Z + dZ + Kppm * Z - rX * Y + rY * X;
}
return result;
}
/*
2
https://wenku.baidu.com/view/30a08f9ddd88d0d233d46a50.html
*/
CoordBLH XYZ2BLH(CoordXYZ XYZ, [srcDst = false]) {
double X = XYZ.X;
double Y = XYZ.Y;
double Z = XYZ.Z;
Ellipsoid ellipsoid = srcDst ? srcEllipsoid : dstEllipsoid;
double a = ellipsoid.A;
double b = ellipsoid.B;
double e12 = ellipsoid.E12;
double e22 = ellipsoid.E22;
double L = atan(Y / X);
//
double degL = L * 180 / pi;
// Y值为正 西
if (Y > 0) {
while (degL < 0) {
degL += 180;
}
while (degL > 180) {
degL -= 180;
}
} else {
while (degL > 0) {
degL -= 180;
}
while (degL < -180) {
degL += 180;
}
}
double tgU = Z / (sqrt(X * X + Y * Y) * sqrt(1 - e12));
double U = atan(tgU);
double tgB = (Z + b * e22 * pow(sin(U), 3)) /
(sqrt(X * X + Y * Y) - a * e12 * pow(cos(U), 3));
double B = atan(tgB);
double degB = B * 180 / pi; //
if (Z > 0) {
// Z值为正
while (degB < 0) {
degB += 90;
}
while (degB > 90) {
degB -= 90;
}
} else {
while (degB > 0) {
degB -= 90;
}
while (degB < -90) {
degB += 90;
}
}
while (degB < 0) {
degB += 360;
}
while (degB > 360) {
degB -= 360;
}
double N = a / sqrt(1 - e12 * sin(B) * sin(B)); //
double H = 0;
// B接近极区 ±90°
if ((degB).abs() > 80) {
H = Z / sin(B) - N * (1 - e12);
} else {
H = sqrt(X * X + Y * Y) / cos(B) - N;
}
return CoordBLH(B: degB, L: degL, H: H);
}
/*
prjHeight:
http://www.cnblogs.com/imeiba/p/5696967.html
*/
CoordXYH BL2XY(CoordBLH BLH,
[srcDst = false, offsetY = 500000, offsetX = 0]) {
Ellipsoid ellipsoid = srcDst ? srcEllipsoid : dstEllipsoid;
double a = ellipsoid.A;
double b = ellipsoid.B;
double e12 = ellipsoid.E12;
double e22 = ellipsoid.E22;
if (L0 == 0) {
int zoneNo = getZoneNo(BLH.L);
L0 = (zoneNo - 0.5) * zoneWidth;
}
double radL0 = L0 / 180 * pi;
double radB = BLH.B / 180 * pi;
double radL = BLH.L / 180 * pi;
double N = a / sqrt(1 - e12 * sin(radB) * sin(radB)); //
double T = tan(radB) * tan(radB);
double C = e22 * cos(radB) * cos(radB);
double A = (radL - radL0) * cos(radB);
double M = a *
((1 - e12 / 4 - 3 * e12 * e12 / 64 - 5 * e12 * e12 * e12 / 256) * radB -
(3 * e12 / 8 + 3 * e12 * e12 / 32 + 45 * e12 * e12 * e12 / 1024) *
sin(2 * radB) +
(15 * e12 * e12 / 256 + 45 * e12 * e12 * e12 / 1024) *
sin(4 * radB) -
(35 * e12 * e12 * e12 / 3072) * sin(6 * radB));
//x,y的计算公式见孔祥元等主编武汉大学出版社2002年出版的72
//( [
double x = M +
N *
tan(radB) *
(A * A / 2 +
(5 - T + 9 * C + 4 * C * C) * A * A * A * A / 24 +
(61 - 58 * T + T * T + 600 * C - 330 * e22) *
A *
A *
A *
A *
A *
A /
720);
double y = N *
(A +
(1 - T + C) * A * A * A / 6 +
(5 - 18 * T * T * T + 72 * C - 58 * e22) * A * A * A * A * A / 120);
x = offsetX + x * (b + elevation) / b;
y = offsetY + y * (b + elevation) / b;
return CoordXYH(
X: (x * 1000).round() / 1000, Y: (y * 1000).round() / 1000, H: BLH.H);
}
/*
prjHeight:
http://www.cnblogs.com/imeiba/p/5696967.html
*/
CoordBLH XY2BL(CoordXYH xyh,
[srcDst = false, offsetY = 500000, offsetX = 0]) {
Ellipsoid ellipsoid = srcDst ? srcEllipsoid : dstEllipsoid;
double a = ellipsoid.A;
double b = ellipsoid.B;
double e12 = ellipsoid.E12;
double e22 = ellipsoid.E22;
double e1 = (1 - sqrt(1 - e12)) / (1 + sqrt(1 - e12));
double radL0 = L0 / 180 * pi;
//
double Y = xyh.Y % 1000000;
double x = (xyh.X - offsetX) * b / (b + elevation);
double y = (Y - offsetY) * b / (b + elevation);
double u = x /
(a * (1 - e12 / 4 - 3 * e12 * e12 / 64 - 5 * e12 * e12 * e12 / 256));
double fai = u +
(3 * e1 / 2 - 27 * e1 * e1 * e1 / 32) * sin(2 * u) +
(21 * e1 * e1 / 16 - 55 * e1 * e1 * e1 * e1 / 32) * sin(4 * u) +
(151 * e1 * e1 * e1 / 96) * sin(6 * u) +
(1097 * e1 * e1 * e1 * e1 / 512) * sin(8 * u);
double C = e22 * cos(fai) * cos(fai);
double T = tan(fai) * tan(fai);
double N = a / sqrt(1 - e12 * sin(fai) * sin(fai));
double R = a *
(1 - e12) /
sqrt((1 - e12 * sin(fai) * sin(fai)) *
(1 - e12 * sin(fai) * sin(fai)) *
(1 - e12 * sin(fai) * sin(fai)));
double D = y / N;
double L = radL0 +
(D -
(1 + 2 * T + C) * D * D * D / 6 +
(5 - 2 * C + 28 * T - 3 * C * C + 8 * e22 + 24 * T * T) *
D *
D *
D *
D *
D /
120) /
cos(fai);
double B = fai -
(N * tan(fai) / R) *
(D * D / 2 -
(5 + 3 * T + 10 * C - 4 * C * C - 9 * e22) *
D *
D *
D *
D /
24 +
(61 + 90 * T + 298 * C + 45 * T * T - 256 * e22 - 3 * C * C) *
D *
D *
D *
D *
D *
D /
720);
B = B * 180 / pi;
L = L * 180 / pi;
return CoordBLH(B: B, L: L, H: xyh.H);
}
//
dist(PointXY p1, PointXY p2) {
double d = sqrt(pow((p2.X - p1.X), 2) + pow((p2.Y - p1.Y), 2));
return d;
}
//
double fwj(PointXY p1, PointXY p2) {
double dx = p2.X - p1.X;
double dy = p2.Y - p1.Y;
return pi - sign(dy) - atan(dx / dy);
}
//
TransOptions calcThree(CoordBLH p1, CoordXYH p2) {
CoordXYZ source = BLH2XYZ(p1);
CoordBLH bl = XY2BL(p2, true);
CoordXYZ dest = BLH2XYZ(bl, true);
double dX = dest.X - source.X;
double dY = dest.Y - source.Y;
double dZ = dest.Z - source.Z;
return TransOptions(dx: dX, dy: dY, dz: dZ);
}
// TransOptions calcFour(List p1, List p2, int PointCount) {
// double rota = 0;
// double scale = 0;
// double dx = 0;
// double dy = 0;
// if (PointCount == 2) {
// rota = fwj(p2[0] as PointXY, p2[1]) - fwj(p1[0], p1[1]);
// scale = dist(p2[0], p2[1]) / dist(p1[0], p1[1]);
// dx = p2[0].X - scale * cos(rota) * p1[0].X + scale * sin(rota) * p1[0].Y;
// dy = p2[0].Y - scale * sin(rota) * p1[0].X - scale * cos(rota) * p1[0].Y;
// } else if (PointCount > 2) {
// double u = 1.0, v = 0, Dx = 0.0, Dy = 0.0;
// int intCount = PointCount;
// Matrix4 dx1 = Matrix.zeros(4, 1);
// // Matrix4 B1 = Matrix.zeros(2 * intCount, 4);
// Matrix4 B1 = Matrix4.zero();
// for (int i = 0; i < 2 * intCount; i++) {
// for (int j = 0; j < 4; j++) {
// B1.setEntry(i, j, 0);
// }
// }
// Matrix4 W1 = Matrix.zeros(2 * intCount, 1);
// // Matrix4 BT = Matrix.zeros(4, 2 * intCount);
// Matrix4 BT = Matrix4.zero();
// for (int i = 0; i < 4; i++) {
// for (int j = 0; j < 2 * intCount; j++) {
// BT.setEntry(i, j, 0);
// }
// }
// Matrix4 N = Matrix4(
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// );
// Matrix4 InvN = Matrix4(
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// );
// Matrix4 BTW = Matrix.zeros(4, 1);
// for (int i = 0; i < intCount; i++) {
// //
// B1.setEntry(2 * i, 0, 1);
// B1.setEntry(2 * i, 1, 0);
// B1.setEntry(2 * i, 2, p1[i].X);
// B1.setEntry(2 * i, 3, -p1[i].Y);
// B1.setEntry(2 * i + 1, 0, 0);
// B1.setEntry(2 * i + 1, 1, 1);
// B1.setEntry(2 * i + 1, 2, p1[i].Y);
// B1.setEntry(2 * i + 1, 3, p1[i].X);
// // B1[2 * i][0] = 1;
// // B1[2 * i][1] = 0;
// // B1[2 * i][2] = p1[i].X;
// // B1[2 * i][3] = -p1[i].Y;
// // B1[2 * i + 1][0] = 0;
// // B1[2 * i + 1][1] = 1;
// // B1[2 * i + 1][2] = p1[i].Y;
// // B1[2 * i + 1][3] = p1[i].X;
// }
// for (int i = 0; i < intCount; i++) {
// //
// // W1[2 * i][0] = p2[i].X - u * p1[i].X + v * p1[i].Y - Dx;
// // W1[2 * i + 1][0] = p2[i].Y - u * p1[i].Y - v * p1[i].X - Dy;
// W1.setEntry(2 * i, 0, p2[i].X - u * p1[i].X + v * p1[i].Y - Dx);
// W1.setEntry(2 * i + 1, 0, p2[i].Y - u * p1[i].Y - v * p1[i].X - Dy);
// }
// //
// Matrix4 b1 = Matrix4.identity();
// // B1
// BT = Matrix4.copy(b1);
// BT.transpose();
// //
// N = BT * B1;
// //
// InvN = N.clone();
// InvN.invert();
// BTW = BT * (W1);
// dx1 = InvN * (BTW);
// Dx = Dx + dx1[0][0];
// Dy = Dy + dx1[1][0];
// u = u + dx1[2][0];
// v = v + dx1[3][0];
// dx = Dx;
// dy = Dy;
// rota = atan(v / u);
// scale = u / cos(rota);
// }
// return TransOptions(rota: rota, k: scale, dx: dx, dy: dy);
// }
// //
// TransOptions calcBuras(List p1, List p2, pointCount) {
// let B1 = Matrix.zeros(pointCount * 3, 7);
// let dx1 = Matrix.zeros(7, 1);
// let L = Matrix.zeros(pointCount * 3, 1);
// let BT = Matrix.zeros(7, pointCount * 3);
// let N = Matrix.zeros(7, 7);
// let InvN = Matrix.zeros(7, 7);
// let BTL = Matrix.zeros(7, 1);
// for (int i = 0; i < pointCount * 3; i++) {
// if (i % 3 == 0) {
// L[i][0] = p2[(i / 3).floor()].X;
// } else if (i % 3 == 1) {
// L[i][0] = p2[(i / 3).floor()].Y;
// } else if (i % 3 == 2) {
// L[i][0] = p2[(i / 3).floor()].Z;
// }
// }
// for (int i = 0; i < pointCount * 3; i++) {
// if (i % 3 == 0) {
// int index = (i / 3) as int;
// B1[i][0] = 1;
// B1[i][1] = 0;
// B1[i][2] = 0;
// B1[i][3] = p1[index].X;
// B1[i][4] = 0;
// B1[i][5] = -p1[index].Z;
// B1[i][6] = p1[index].Y;
// } else if (i % 3 == 1) {
// int index = ((i - 1) / 3) as int;
// B1[i][0] = 0;
// B1[i][1] = 1;
// B1[i][2] = 0;
// B1[i][3] = p1[index].Y;
// B1[i][4] = p1[index].Z;
// B1[i][5] = 0;
// B1[i][6] = -p1[index].X;
// } else if (i % 3 == 2) {
// int index = ((i - 2) / 3) as int;
// B1[i][0] = 0;
// B1[i][1] = 0;
// B1[i][2] = 1;
// B1[i][3] = p1[index].Z;
// B1[i][4] = -p1[index].Y;
// B1[i][5] = p1[index].X;
// B1[i][6] = 0;
// }
// }
// Matrix4 b1 = Matrix4.identity();
// BT = B1.transpose();
// N = BT.mmul(B1);
// InvN = inverse(N);
// BTL = BT.mmul(L);
// dx1 = InvN.mmul(BTL);
// double dx = dx1[0][0];
// double dy = dx1[1][0];
// double dz = dx1[2][0];
// double scale = dx1[3][0];
// double rotax = dx1[4][0] / dx1[3][0];
// double rotay = dx1[5][0] / dx1[3][0];
// double rotaz = dx1[6][0] / dx1[3][0];
// return TransOptions(
// dx: dx, dy: dy, dz: dz, k: scale, rx: rotax, ry: rotay, rz: rotaz);
// }
double sign(num number) {
if (number < 0) {
return -1.0;
} else if (number > 0) {
return 1.0;
} else {
return 0.0;
}
}
}

View File

@ -0,0 +1,261 @@
import 'dart:math';
import 'dart:typed_data';
import 'dart:convert';
import 'package:flutter/material.dart';
class DrawContext {
DrawContext();
//
//
double zeroDX = 0;
double zeroDY = 0;
//
double zeroX = 0;
double zeroY = 0;
//
double scale = 1;
double lastScale = 1;
//
Size screenSize = const Size(100, 100);
//
static int unit = 20;
//
double angle = 0;
double lastAngle = 0;
List<double> grounScaleList = [
78271.5170,
39135.7585,
19567.8792,
9783.9396,
4891.9698,
2445.9849,
1222.9925,
611.4962,
305.7481,
152.8741,
76.4370,
38.2185,
19.1093,
9.5546,
4.7773,
2.3887,
1.1943,
0.5972,
0.2986,
0.1493,
0.0746,
0.0373,
0.0187
];
//
bool isRuler = false;
bool isScale = true;
//
bool isMap = true;
//
List dotList = [];
//
int? currentDotIndex;
//
List polyonList = [];
int polyonExpendIndex = 0;
//
Offset currentDot = const Offset(0, 0);
//
int groundScaleIndex = 21;
//
Offset pos = const Offset(0, 0);
Offset lastPos = const Offset(0, 0);
//
bool isNomal = true;
double mark = 1000;//[8,40,200,1000]100mark默认1000
double space = 1;
List? pointList;
List<List<double>> gengerateList = [];
List<Widget> devicePositioned=[];
/// @param {double} m -
m2px(double m) {
return m / 20 / scale;
}
/// @param {double} px -
px2m(double px) {
return px * 20 / scale;
}
// x是平面坐标的竖直方向
/// @param {num} x - x
/// @param {num} y - y
// xy2Screen(num x, num y, [k = 1]) {
// double screenx = (y / k * scale - zeroDX);
// double screeny = (screenSize.height - (x / k * scale - zeroDY));
// return Offset(screenx, screeny);
// }
xy2Screen(num x, num y, [k = 1]) {
double screenx = (y * k / (scale) - zeroDX);
double screeny = (screenSize.height - (x * k / (scale) - zeroDY));
return Offset(screenx, screeny);
}
/// @param {screenOffset} x - Offset(x,y)
screen2xy(Offset screenOffset, [k = 1]) {
// double X = (screenOffset.dy / k * scale + zeroDX);
// double Y = (screenSize.height - screenOffset.dx / k * scale + zeroDY);
double Y = (screenOffset.dx+zeroDX)*scale/k;
double X=(screenSize.height-screenOffset.dy+zeroDY)*scale/k;
// double X = (screenOffset.dx * k + zeroDX);
// double Y = (screenSize.height - screenOffset.dy * k + zeroDY);
return Offset(X, Y);
}
//
/// @param {Size} size - (width,height)
setSize(Size size) {
screenSize = size;
if (screenSize != size) {
setCenter(null);
lastScale = scale;
screenSize = size;
}
}
//
// setCenter(obj, [k = 1]) {
// if (obj != null) {
// zeroDX = ((obj['y'] * k * scale - screenSize.width / 2).abs())
// .floor()
// .toDouble();
// zeroDY = ((obj['x'] * k * scale - screenSize.height / 2).abs())
// .floor()
// .toDouble();
// zeroX = (obj['x'] * k).toDouble();
// zeroY = (obj['y'] * k).toDouble();
// } else {
// zeroDX =
// ((zeroY * k * scale - screenSize.width / 2).abs()).floor().toDouble();
// zeroDY = ((zeroX * k * scale - screenSize.height / 2).abs())
// .floor()
// .toDouble();
// }
// }
setCenter(obj, [k = 1]) {
scale = 1;
if (obj != null) {
zeroDX = (((obj["x"] as num) / k / (scale) - screenSize.width / 2).abs())
.floor()
.toDouble();
zeroDY = (((obj["y"] as num) / k / (scale) - screenSize.height / 2).abs())
.floor()
.toDouble();
zeroX = ((obj["x"])).toDouble();
zeroY = ((obj["y"])).toDouble();
// print("$zeroDX,$zeroDY");
} else {
zeroDX = ((zeroX / k / (scale)- screenSize.width / 2).abs())
.floor()
.toDouble();
zeroDY = ((zeroY / k / (scale) - screenSize.height / 2).abs())
.floor()
.toDouble();
}
}
//
// getGridStepXY() {
// double dx = (zeroX % 100) * 20 / scale;
// double dy = (zeroY % 100) * 20 / scale;
// double step =
// scaleList[scale.toInt() - 1 < 0 ? 0 : scale.toInt() - 1] / scale;
// return GridStepXY(step, dx, dy);
// }
setZeroOffset(Offset pos) {
//
zeroDX -= pos.dx;
zeroDY += pos.dy;
//zeroX和Y,
zeroX -=pos.dx*scale ;
zeroY += pos.dy*scale;
}
//
setCurrentDot(Offset offset) {
currentDot = offset;
}
setDotListIndex(Offset offset) {
dotList[currentDotIndex!] = offset;
}
setDotList(List list) {
dotList = list;
}
/// @param {int} index -
setPolyonList(int index, List lists) {
List arr = [];
// List arr1 = [];
for (int i = 0; i < lists.length; i++) {
Offset list = screen2xy(lists[i]);
arr.add(list);
}
polyonList[index].list = arr;
}
// 线
/// @param {Offset} dot - 3
double dot2Line(Offset dot1, Offset dot2, Offset dot) {
double A = (dot1.dy - dot2.dy) / (dot1.dx - dot2.dx); //1,2线
double B = dot1.dy - A * dot1.dx; //
double distance =
((A * dot.dx + B - dot.dy) / sqrt(A * A + 1)).abs(); //3线1,2
return distance;
}
//
int getGroundScaleIndex(double sacle) {
groundScaleIndex = grounScaleList.lastIndexWhere((el) => el > scale) + 1;
return groundScaleIndex;
}
//
double getGroundScale() {
return grounScaleList[groundScaleIndex - 1];
}
//
pointInfo(Offset point) {
if (pointList != null && pointList!.isNotEmpty) {
for (var el in pointList!) {
double x = ((el['dx'] as double) - point.dx).abs();
double y = ((el['dy'] as double) - point.dy).abs();
if (x <= 15 && y <= 15) {
return el;
}
}
}
}
}
//
class GridStepXY {
double step;
double dx;
double dy;
GridStepXY(this.step, this.dx, this.dy);
}
//
class Polyon {
String label;
String key;
bool expend;
List list;
Polyon(this.key, this.label, this.list, [this.expend = false]);
}

View File

@ -0,0 +1,146 @@
import 'dart:convert';
import 'dart:math';
import 'dart:typed_data';
class RecieveModel {
// int UTC;
// double LAT;
// double LNG;
// double ASL;
// double speed;
// int status;
// num HDG;
// num TP;
int type;
int TID;
// num count;
// String data;
// num? mile;
// int layer;
// DecodeDataObj? obj;
int x;
int y;
RecieveModel(
{
// required this.ASL, //
// required this.HDG, //
// required this.LAT, //
// required this.LNG, //
required this.TID,
// required this.TP,
// required this.UTC,
// required this.count,
// required this.data,
// required this.layer,
// required this.mile,
// required this.speed,
// required this.status,
required this.type,
required this.x,
required this.y,
// this.obj
});
factory RecieveModel.fromJson(Map<dynamic, dynamic> json) {
return RecieveModel(
// ASL: json['ASL']!.toDouble(),
// UTC: json['UTC'],
type: int.tryParse(json['type'])??1,
// TP: json['TP'],
// count: json['count'],
// data: json['data'],
// HDG: json['HDG'],
// LAT: json['LAT'],
// layer: json['layer'],
// LNG: json['LNG'],
// mile: json['mile'],
// speed: json['speed'],
// status: json['status'],
TID: json['TID'],
// obj: json['obj'],
x: json['x'] ?? 0,
y: json['y'] ?? 0);
}
}
class DecodeDataObj {
int x;
int y;
Uint16List data;
int dx;
int dy;
int w;
int h;
double rad;
DecodeDataObj(
{required this.data,
required this.dx,
required this.dy,
required this.h,
required this.w,
required this.x,
required this.y,
required this.rad});
factory DecodeDataObj.fromBase64(String base64) {
// base64
Uint8List bytes = base64Decode(base64);
ByteData byteData = bytes.buffer.asByteData();
//
int x = byteData.getInt32(0, Endian.little); //readInt32LE(str, 0);
int y = byteData.getInt32(4, Endian.little); //readInt32LE(str, 4);
int v = byteData.getUint16(8, Endian.little); //readUInt16LE(str, 8);
int w = v & 0x3ff;
double rad = (v >>> 10) * 2 * pi / 64;
Uint16List data;
int length = bytes.length;
int h = 0;
h -= 1;
int dx;
int dy;
int i = 0;
if (w < 16) {
h = (length - 10 - 1);
data = Uint16List(h * 2);
for (i = 0; i < h; i++) {
int x = bytes[10 + i] & 0x0f;
int w = bytes[10 + i] >> 4;
data[i * 2] = x;
data[i * 2 + 1] = w;
}
dx = bytes[10 + i] & 0x0f;
dy = bytes[10 + i] >> 4;
} else if (w < 256) {
h = ((length - 10) / 2 - 1).toInt();
data = Uint16List(h * 2);
for (i = 0; i < h; i++) {
int x = bytes[10 + i * 2];
int w = bytes[10 + i * 2 + 1];
data[i * 2] = x;
data[i * 2 + 1] = w;
}
dx = bytes[10 + i * 2];
dy = bytes[10 + i * 2 + 1];
} else {
h = ((length - 10) / 3 - 1).toInt();
data = Uint16List(h * 2);
for (i = 0; i < h; i++) {
if (10 + i * 3 + 3 < h) {
int a = bytes[10 + i * 3];
int b = bytes[10 + i * 3 + 1];
int c = bytes[10 + i * 3 + 2];
int x = a | (b & 0x0f) << 8;
int w = (b & 0xf0) >> 4 | (c & 0x0f) << 4;
data[i * 2] = x;
data[i * 2 + 1] = w;
}
}
int a = bytes[10 + i * 3];
int b = bytes[10 + i * 3 + 1];
int c = bytes[10 + i * 3 + 2];
dx = a | (b & 0x0f) << 8;
dy = (b & 0xf0) >> 4 | (c & 0x0f) << 4;
}
return DecodeDataObj(
x: x, y: y, w: w, h: h, dx: dx, dy: dy, data: data, rad: rad);
}
}

View File

@ -0,0 +1,674 @@
import 'dart:convert';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:pass_track/binding.dart';
import 'package:pass_track/pass_track.dart';
import 'dart:ffi' as ffi;
import 'package:ffi/ffi.dart';
import 'package:web_socket_channel/io.dart';
import 'package:web_socket_channel/status.dart' as status;
import 'package:pass_track/binding.dart' as Binding;
import '../../../service/base.dart';
import '../model/coord_trans.dart';
import '../model/draw_context.dart';
import '../model/recievemodel.dart';
final passTrackPlugin = PassTrack();
DrawContext drawCtx = DrawContext();
class FileHandle {
int textureId = -1;
int index = 0;
List deviceList = [];
Map deviceData = {};
String type = "cumulate";
List palette = [];
//
List allPointData = [];
//
List pointData = [];
double L0 = 102;
late CoordTrans coordTrans;
/* 这个是配合原版ts更改的addpoint*/
// //
// filterPoint(var point) {
// //nulltrue或者false
// if (point == null) {
// //
// List newpointData = [];
// if (pointData is List) {
// for (var i = 0; i < (pointData as List).length; i++) {
// if (pointData[i]['bits'] != 0) {
// if (pointData[i]['count'] >= 0 && pointData[i]['count'] <= 50) {
// newpointData.add(pointData[i]);
// } else if (pointData[i]['type'] == 0 || pointData[i]['type'] == 2) {
// newpointData.add(pointData[i]);
// }
// }
// }
// } else {
// //websocket时用
// }
// pointData = newpointData;
// return newpointData;
// } else {
// //
// if (point.runtimeType == "undefind" ||
// point.obj.runtimeType == "undefined") {
// return false;
// }
// if (point["bits"] != 0) {
// if (point["count"] >= 0 && point["count"] <= 50) {
// return true;
// } else if (point["type"] == 0 || point["type"] == 2) {
// return true;
// } else {
// return false;
// }
// } else {
// return false;
// }
// }
// }
//null就是全部点endindex
filterPoint(var startIndex, var endIndex) {
List newpointData = [];
if (endIndex == null || startIndex == null) {
if (allPointData is List) {
for (var i = 0; i < (allPointData as List).length; i++) {
if (allPointData[i]['bits'] != 0) {
if (allPointData[i]['count'] >= 0 &&
allPointData[i]['count'] <= 50) {
newpointData.add(allPointData[i]);
} else if (allPointData[i]['type'] == 0 ||
allPointData[i]['type'] == 2) {
newpointData.add(allPointData[i]);
}
}
}
} else {
//websocket时用
}
pointData = newpointData;
return newpointData;
} else {
if (allPointData is List) {
for (var i = startIndex; i < endIndex; i++) {
if (allPointData[i]['bits'] != 0) {
if (allPointData[i]['count'] >= 0 &&
allPointData[i]['count'] <= 50) {
newpointData.add(allPointData[i]);
} else if (allPointData[i]['type'] == 0 ||
allPointData[i]['type'] == 2) {
newpointData.add(allPointData[i]);
}
}
}
} else {
//websocket时用
}
pointData = newpointData;
return newpointData;
}
}
updateObj(pointData) {
final obj = DecodeDataObj.fromBase64(pointData['data']);
pointData['obj'] = obj;
// var check = ffi.sizeOf<Point>() - (512 * 512 - obj.w * obj.h) * 2;
var size_x = ffi.sizeOf<Point>();
// if (check < 0) {
// print('check:$check');
// }
ffi.Pointer<Point> pointer = calloc.allocate<Point>(
ffi.sizeOf<Point>() - (512 * 512 - obj.w * obj.h) * 2 + 1000);
// ffi.Pointer<Point> pointer = calloc
// .allocate<Point>(size_x>>1);
if (pointer == ffi.nullptr) {
return;
}
// pointer.ref.tile.x = obj.x;
// pointer.ref.tile.y = obj.y;
// pointer.ref.tile.w = obj.w;
// pointer.ref.tile.h = obj.h;
// pointer.ref.tile.dx = obj.dx;
// pointer.ref.tile.dy = obj.dy;
// pointer.ref.tile.rad = obj.rad;
pointer.ref.TID = pointData["TID"] as int;
pointer.ref.type = pointData["type"] as int;
pointer.ref.bits = pointData['bits'] == null ? 0 : pointData['bits'] as int;
pointer.ref.typeBits =
pointData['typeBits'] == null ? 0 : pointData['typeBits'] as int;
pointer.ref.TP = (pointData["TP"]) * 1.0;
pointer.ref.speed = pointData["speed"].toDouble();
pointer.ref.count = pointData["count"] as int;
pointer.ref.LAT = pointData["LAT"].toDouble();
pointer.ref.LNG = pointData["LNG"].toDouble();
pointer.ref.ASL = pointData["ASL"].toDouble();
var xyh = coordTrans.d2p(CoordBLH(
B: pointData["LAT"].toDouble(),
L: pointData["LNG"].toDouble(),
H: pointData["ASL"].toDouble()));
pointer.ref.X = xyh.X * 20;
pointer.ref.Y = xyh.Y * 20;
pointer.ref.H = xyh.H;
// print(pointer.ref.X);
// print(pointer.ref.Y);
// print(pointer.ref.H);
pointer.ref.HDG = pointData["HDG"].toDouble();
pointer.ref.UTC = pointData["UTC"] as int;
pointer.ref.layer = pointData["layer"] as int;
// pointer.ref.mile = pointData["mile"] as int;
pointer.ref.status = pointData["status"] as int;
// for (int i = 0; i < obj.w; i++) {
// //tile处理
// for (int j = 0; j < obj.h; j++) {
// if (i * obj.h + j < obj.data.length) {
// pointer.ref.tile.data[i * obj.h + j] = obj.data[i * obj.h + j];
// }
// }
// }
// passTrackPlugin.passTrack_fullMap_addPoint(pointer);
//calloc.free(pointer);
}
Future<bool> init() async {
return false;
// await initDevice();
// await initPalette();
// coordTrans = CoordTrans(TransOptions(L0: L0));
// List allPointData = filterPoint(null, null);
// var count = 0;
// if (allPointData is List) {
// for (var e in allPointData) {
// count++;
// updateObj(e);
// // if (count > 100000) {
// // break;
// // // ++count
// // }
// }
// } else {
// count++;
// updateObj(allPointData);
// // if (count > 100000) {
// // return true;
// // }
// }
// // passTrackPlugin.passTrack_drawFullScreen(true);
// ffi.Pointer<Binding.Point> pointerNull =
// calloc.allocate<Binding.Point>(ffi.sizeOf<Binding.Point>());
// // passTrackPlugin.playTrack(true, true, false, 0, 115000, ffi.nullptr);
// calloc.free(pointerNull);
// return true;
}
//point的bits值
initDevice() async {
//
List temp = await GetServices().getDeviceBind();
//roller和paver
temp.forEach((element) {
if (element["type"] == "roller" || element["type"] == "paver") {
deviceList.add(element);
}
});
for (var i = 0; i < deviceList.length; i++) {
//bits进行处理
deviceList[i]["bits"] = 1 << i;
//TID作为键deviceData
deviceData[deviceList[i]["tid"]] = deviceList[i];
}
await getFile();
}
//txt文件内容
getFile() async {
var fileList = await GetServices().getHisFileList();
for (var i = 0; i < fileList["list"].length; i++) {
// print(fileList[i]);
dynamic data = await GetServices().getHisFile(fileList["list"][i]);
allPointData.addAll(resolveJson(data, passTrackPlugin));
}
allPointData.forEach((ele) {
updateDevices(ele);
});
// print(pointData);
}
//
resolveJson(var res, PassTrack passTrackPlugin) {
if (res is String) {
List<RecieveModel> allPointData = [];
int start = 0;
var allPointLen = 0;
//
while (true) {
int end = res.indexOf('\n', start);
if (end < 0) {
break;
}
String str = res.substring(start, end);
try {
if (str[str.length - 1] == ",") {
str = str.substring(0, str.length - 1);
}
var item = jsonDecode(str);
RecieveModel recieveModel = RecieveModel.fromJson(item);
if (drawCtx.zeroDX == 0 || drawCtx.zeroDY == 0) {
//dart重置中心
drawCtx.setCenter(
// {"x": recieveModel.x / 20, "y": recieveModel.y / 20});//532863.8,4208668.95
{"x": 10656637 / 20, "y": 84172941 / 20});//532863.8,4208668.95
}
int x = recieveModel.x;
int y = recieveModel.y;
int tid = recieveModel.TID;
int type = recieveModel.type;
var p = passTrackPlugin.wantPoint();
p.ref.X = x.toDouble();
p.ref.Y = y.toDouble();
p.ref.TID = tid;
p.ref.type = type;
// var data = item['data'];
// if (data != null) {
// item['TID'] =
// item['TID'] is int ? item['TID'] : num.parse(item['TID']);
// item['type'] =
// item['type'] is int ? item['type'] : num.parse(item['type']);
// item['obj'] = DecodeDataObj.fromBase64(item['data']);
// // this.updateDevice(item);
// // this.sportsData.push(item);
allPointData.add(recieveModel);
// }
} catch (e) {
print("----$e\r\n$str");
}
allPointLen++;
start = end + 1;
}
return allPointLen;
} else {
//
var item = res;
var data = item['data'];
if (data != null) {
item['obj'] = DecodeDataObj.fromBase64(item['data']);
item['type'] = num.parse(item['type']);
item['TID'] = num.parse(item['TID']);
// this.updateDevice(item);
// this.sportsData.push(item);
}
return 1;
}
}
//bits和typeBits
updateDevices(var point) {
var TID = point["TID"];
if (deviceData.containsKey(TID)) {
var device = deviceData[TID];
device["show"] = true;
point["bits"] = device["bits"];
point["typeBits"] = (device["type"] == "paver" ? 2 : 1) < 2
? 1
: device["bits"] | (1 << ((device["type"] == "paver" ? 2 : 1) - 2));
device["point"] = point;
}
//bug
//websocket
// if(isLive ==true&&devicState.timer==null){
// //
// }
}
//
// initPalette() async {
// var data = await GetServices().getLayeConfig();
// for (var i = 0; i < data.length; i++) {
// if (data[i]['name'] == "times_draw") {
// data[i] = filterAndResolveModel(data[i]);
// }
// data[i] = FormatColor(data[i]);
// if (data[i]['type'] == 'layer' && data[i]["standard"] != null) {
// data[i] = BubbleSort(data[i]);
// }
// }
// palette = data[0]["color"];
// //
// for (int i = 0; i < palette.length; i++) {
// passTrackPlugin.setPalette(i, changeARGBInt8toInt32(palette[i]));
// }
// // print(palette);
// // print(palette.length);
// //cumulate类型还要对颜色进行扩充
// }
List liveData = [];
bool isLive = false;
var devicState;
num centerTid = 0;
//
bool end = true;
var sportsData;
num angle = 0;
//
var centerDevice = null;
bool isCenter = false;
//
bool isTranslate = false;
//
bool isView = false;
int? startIndex;
int? endIndex;
//websocket
liveView(bool isLive, String wsHost, String proj_code) {
String token = "";
String ws_url = wsHost + "?token=" + token;
final _channel = IOWebSocketChannel.connect(ws_url);
String? message;
//
_channel.sink.add(jsonEncode(["ProjSubscribe", "cp_road", proj_code]));
_channel.stream.listen((message) {
//
List data = json.decode(message);
if (data[0] == "ProjSubAck") {
//
if (proj_code != data[2]) {
_channel.sink
.add(jsonEncode(["ProjSubscribe", "cp_road", proj_code]));
}
//bug,
//
} else if (data[0] == "cp_roadPublish") {
if (proj_code != data[2]) {}
var row = data[3];
row.obj = DecodeDataObj.fromBase64(row.data);
row.TID = num.parse(row.TID);
liveData.add(row);
recivePoint(row);
updateDevices(row);
//tid
if (centerTid != 0 && row.TID == centerTid) {
//bug
//point传给c++
// passTrackPlugin.passTrack_fullMap_updateCenter(point);
drawCtx.setCenter(row.obj);
}
//return
if (!filterPoint(null, null).isNotEmpty) {
return;
}
if (end && isLive) {
var socketInfo;
sportsData.addAll(liveData);
liveData.clear();
if (angle == 0) {
angle = pi / 2 - row.obj.rad;
socketInfo.rotate = (180 / pi) * angle;
socketInfo.TP = row.TP;
socketInfo.speed = row.speed;
socketInfo.LAT = row.LAT;
socketInfo.LNG = row.LNG;
} else if (row.bits == centerDevice) {
angle = pi / 2 - row.obj.rad;
socketInfo.rotate = (180 / pi) * angle;
socketInfo.TP = row.TP;
socketInfo.speed = row.speed;
socketInfo.LAT = row.LAT;
socketInfo.LNG = row.LNG;
if (isCenter) {
backCenter();
}
}
socketInfo.count = row.count;
// this.eventObject['socketing']?.call(this, socketInfo);
}
if (!this.isTranslate) {
//bug
// this.fillAndDrawImageData(false, row);
if (isView || !centerDevice) {
//bug
// centerDevice=
}
}
}
});
}
recivePoint(var point) {
if (drawCtx.zeroDX == 0 || drawCtx.zeroDY == 0) {
//dart重置中心
drawCtx.setCenter(point);
//bug
//c++
ffi.Pointer<Binding.Point> pointer =
calloc.allocate<Binding.Point>(ffi.sizeOf<Binding.Point>());
// pointer.ref.x
// passTrackPlugin.playTrack(
// true, false, false, 0, -1, pointer);
calloc.free(pointer);
}
//bug
//point传给c++
// passTrackPlugin.passTrack_fullMap_addPoint(point);
// passTrackPlugin.passTrack_drawFullScreen(true);
//c++addpoint后的返回值
bool isSucceed = true;
if (isSucceed) {
isCenter = true;
} else {
isCenter = false;
}
}
//
backCenter() {
//bug
//
}
drawSection(int startIndex, int endIndex, bool isCenter) {
if (endIndex > allPointData.length) {
return;
}
if (isCenter) {
filterPoint(startIndex, endIndex);
} else {}
}
// drawSection(int startIndex, int endIndex, bool isCenter) {
// if (startIndex < 0 && endIndex < 0) {
// return;
// }
// //
// //bug
// // this.ctx.clearRect(0, 0, this.width, this.height);
// // this.global.data.fill(0);
// updateDeviceVisible();
// if (isCenter || drawCtx.zeroDX == 0 || drawCtx.zeroDY == 0) {
// if (sportsData[endIndex]["obj"] != null) {
// double ox = sportsData[endIndex]["obj"]["x"];
// double oy = sportsData[endIndex]["obj"]["y"];
// num x = ((ox / drawCtx.scale - drawCtx.screenSize.width / 2) -
// drawCtx.zeroDX)
// .floor()
// .abs();
// num y = ((oy / drawCtx.scale - drawCtx.screenSize.height / 2) -
// drawCtx.zeroDY)
// .floor()
// .abs();
// if (x >= drawCtx.screenSize.width / 2 ||
// y >= drawCtx.screenSize.height / 2) {
// drawCtx.zeroX = ox;
// drawCtx.zeroY = oy;
// drawCtx.setCenter(null);
// }
// }
// }
// reciveAndFilterPoint(startIndex, endIndex);
// //
// // this.fillAndDrawImageData(true);
// //
// // this.drawGrid();
// //线
// // this.drawSideLine(this.roadData);
// //
// // let arr = this.getDeviceData();
// //
// // this.drawDevice(arr);
// endIndex = endIndex;
// startIndex = startIndex;
// //
// // this.viewStatus(false);
// // this.isPlay = false;
// }
// //
// updateDeviceVisible() {
// for (int i = 0; i < deviceList.length; i++) {
// if (deviceList[i] != null) {
// deviceList[i]["show"] = true;
// } else {
// deviceList[i]["show"] = false;
// }
// }
// }
// reciveAndFilterPoint(int startIndex, int endIndex) {
// if (endIndex == -1) {
// endIndex = sportsData.length - 1;
// }
// for (int i = startIndex; i <= endIndex; i++) {
// var isDraw = filterPoint(sportsData[i]);
// if (isDraw) {
// recivePoint(sportsData[i]);
// updateDevices(sportsData[i]);
// // this.allowDLPI = index;
// }
// }
// }
}
//rgba转换成abgrc++abgr
int changeARGBInt8toInt32(List row) {
int result;
result = (row[3] << 24) | (row[2] << 16) | (row[1] << 8) | row[0];
return result;
}
//standard处理color的值
Map filterAndResolveModel(Map item) {
item["standard"] = tranToArray(item["standard"]);
item["color"] = tranToArray(item["color"]);
var standard = item["standard"];
var color = item["color"];
for (var i = 0; i < standard.length; i++) {
var inter = standard[i];
var actColor = color[i];
var interDiff = inter[1] - inter[0];
var colorDiff1 =
((actColor[0][0] - actColor[1][0]) / interDiff).round().abs();
var colorDiff2 =
((actColor[0][1] - actColor[1][1]) / interDiff).round().abs();
var colorDiff3 =
((actColor[0][2] - actColor[1][2]) / interDiff).round().abs();
var arr = [];
for (var j = 1; j < interDiff; j++) {
arr.add([
actColor[0][0] - colorDiff1 * j,
actColor[0][1] - colorDiff2 * j,
actColor[0][2] - colorDiff3 * j,
255
]);
}
actColor.insert(1, arr);
}
var newStandard = [];
for (var i = 0; i < standard.length; i++) {
for (var j = 0; j < standard[i].length; j++) {
newStandard.add(standard[i][j]);
}
}
item["standard"] = newStandard;
var newColor = [];
for (var i = 0; i < color.length; i++) {
for (var j = 0; j < color[i].length; j++) {
for (var k = 0; k < color[i][j].length; k++) {
if (color[i][j][k] is int) {
newColor.add(color[i][j]);
break;
} else {
newColor.add(color[i][j][k]);
}
}
}
}
item["color"] = newColor;
return item;
}
List tranToArray(List arr) {
var newArr = [];
for (var i = 0; i < arr.length; i += 2) {
newArr.add([arr[i], arr[i + 1]]);
}
return newArr;
}
//cumulate的颜色扩充到256cumulate的颜色添加一个白色的初始色
Map FormatColor(Map item) {
if (item["type"] == "cumulate") {
List newColor = [];
for (int i = 1; i < item["color"].length; i++) {
newColor.addAll([
item["color"][i],
item["color"][i],
item["color"][i],
item["color"][i]
]);
}
item["color"] = newColor;
var maxColor = item["color"][item["color"].length - 1];
for (var i = item["color"].length; i < 254; i++) {
item["color"].add(maxColor);
}
item["color"].insert(0, [0, 0, 0, 0]);
item["color"].insert(0, [0, 0, 0, 0]);
} else {
item["color"].insert(0, [0, 0, 0, 0]);
}
if (item["sideColor"] != null && item["sideColor"] != 0) {
item["color"][1] = item["sideColor"];
}
return item;
}
//layerstandard和color排序
Map BubbleSort(Map item) {
for (var i = 0; i < item["standard"].length; i++) {
for (var j = 1; j < item["standard"].length; j++) {
if (item["standard"][i] > item["standard"][j]) {
var num = item["standard"][i];
item["standard"][i] = item["standard"][j];
item["standard"][j] = num;
var color = item["color"][i];
item["color"][i] = item["color"][j];
item["color"][j] = color;
}
}
}
return item;
}

View File

@ -41,7 +41,7 @@ class _PasstrackState extends State<PassTrack> {
int bits = -1;
int speed = 50;
List<int> speedList = [1, 2, 10, 20, 50, 100, 200, 500];
int maxLength = 200;
// int maxLength = 200;
SfRangeValues _rangevalues = const SfRangeValues(0.0, 200.0);
@override
@ -118,7 +118,8 @@ class _PasstrackState extends State<PassTrack> {
padding: const EdgeInsets.only(bottom: 5),
child: SfRangeSlider(
min: 0.0,
max: maxLength,
// max: maxLength,
max: controller.allLen,
values: _rangevalues,
showTicks: false,
showLabels: false,

View File

@ -1,6 +1,7 @@
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
import 'package:http/http.dart';
import 'loginprefs.dart';
LoginPrefs loginPrefs = LoginPrefs();
@ -34,6 +35,16 @@ class BaseService {
}
}
getHisFileClient(String url) async {
String fullUrl = "$baseUrl$url";
Map<String, String> headers = {
HttpHeaders.contentTypeHeader: "text/plain",
HttpHeaders.authorizationHeader: token,
};
Response response = await _client.get(Uri.parse(fullUrl), headers: headers);
return response.body;
}
//POST请求
postClient(String url, body) async {
try {
@ -88,6 +99,21 @@ class GetServices {
}
}
getHisFileList() async {
Map res = await service.getClient(
'/api/cp_road/record/data_list?proj_code=$projCode&date=2023-10-26');
return res['data'];
}
//
getHisFile(String file) async {
// String file = '12209/26/L0122.txt';
file = file.substring(file.length - 18, file.length);
var res = await service
.getHisFileClient("/app/cp_road/record/data/$projCode/$file");
return res;
}
//
getproject() async {
Map res = await service

View File

@ -1,244 +1,244 @@
import 'package:get/get.dart';
import 'base.dart';
// import 'package:get/get.dart';
// import 'base.dart';
// String projCode = 'CJGKJEBYYB';
// String tid = "109";
// String projType = "hydraulic_tamping";
String projCode = 'TEST';
String tid = "1000";
String projType = "pile_cm";
BaseService service = BaseService();
// // String projCode = 'CJGKJEBYYB';
// // String tid = "109";
// // String projType = "hydraulic_tamping";
// String projCode = 'TEST';
// String tid = "1000";
// String projType = "pile_cm";
// BaseService service = BaseService();
class ProjController extends GetxController {
ProjController();
// 线
Future getSideLine() async {
Map res = await service.getClient(
'/api/comm/side_line/list?proj_code=$projCode&proj_type=$projType');
return res['data'];
}
// class ProjController extends GetxController {
// ProjController();
// // 线
// Future getSideLine() async {
// Map res = await service.getClient(
// '/api/comm/side_line/list?proj_code=$projCode&proj_type=$projType');
// return res['data'];
// }
// ---
Future getDeviceBind() async {
Map res = await service.getClient(
'/api/sys/device_bind/list?proj_type=$projType&proj_code=$projCode');
return res['data'];
}
// // ---
// Future getDeviceBind() async {
// Map res = await service.getClient(
// '/api/sys/device_bind/list?proj_type=$projType&proj_code=$projCode');
// return res['data'];
// }
//
getproject() async {
Map res = await service.getClient(
'/api/sys/project/list?org_code=a&proj_type=$projType&proj_code=$projCode');
return res['data'];
}
}
// //
// getproject() async {
// Map res = await service.getClient(
// '/api/sys/project/list?org_code=a&proj_type=$projType&proj_code=$projCode');
// return res['data'];
// }
// }
class LoginController {
//
getsmsCode(String phone) async {
Map res =
await service.postClient("/admin/base/open/smsCode", {"phone": phone});
return res;
}
// class LoginController {
// //
// getsmsCode(String phone) async {
// Map res =
// await service.postClient("/admin/base/open/smsCode", {"phone": phone});
// return res;
// }
//
phoneLogin(String phone, String smsCode) async {
Map res = await service.postClient(
"/admin/base/open/phone", {"phone": phone, "smsCode": smsCode});
return res;
}
// //
// phoneLogin(String phone, String smsCode) async {
// Map res = await service.postClient(
// "/admin/base/open/phone", {"phone": phone, "smsCode": smsCode});
// return res;
// }
//
getPerson() async {
Map res = await service.getClient("/admin/base/comm/person");
return res['data'];
}
// //
// getPerson() async {
// Map res = await service.getClient("/admin/base/comm/person");
// return res['data'];
// }
//
getCaptcha() async {
Map res =
await service.getClient("/admin/base/open/captcha?height=40&width=150");
return res['data'];
}
// //
// getCaptcha() async {
// Map res =
// await service.getClient("/admin/base/open/captcha?height=40&width=150");
// return res['data'];
// }
getAccountLogin(String captchaId, String password, String username,
String verifyCode) async {
Map res = await service.postClient("/admin/base/open/login", {
"captchaId": captchaId,
"password": password,
"username": username,
"verifyCode": verifyCode
});
return res;
}
}
// getAccountLogin(String captchaId, String password, String username,
// String verifyCode) async {
// Map res = await service.postClient("/admin/base/open/login", {
// "captchaId": captchaId,
// "password": password,
// "username": username,
// "verifyCode": verifyCode
// });
// return res;
// }
// }
class PileCmController {
//
getRcordData(int page, int size, String date,
[String sort = "desc", String order = "pile_id"]) async {
Map res = await service.getClient(
"/api/$projType/record/page?page=$page&size=$size&org_code=a&proj_code=$projCode&tid=$tid&date=$date&sort=$sort&order=$order");
return res['data'];
}
// class PileCmController {
// //
// getRcordData(int page, int size, String date,
// [String sort = "desc", String order = "pile_id"]) async {
// Map res = await service.getClient(
// "/api/$projType/record/page?page=$page&size=$size&org_code=a&proj_code=$projCode&tid=$tid&date=$date&sort=$sort&order=$order");
// return res['data'];
// }
getRcordList(String date, String? dateEnd) async {
dateEnd ??= date;
Map res = await service.getClient(
"/api/$projType/record/list?org_code=a&proj_code=$projCode&tid=$tid&date=$date&dateEnd=$dateEnd");
return res['data'];
}
// getRcordList(String date, String? dateEnd) async {
// dateEnd ??= date;
// Map res = await service.getClient(
// "/api/$projType/record/list?org_code=a&proj_code=$projCode&tid=$tid&date=$date&dateEnd=$dateEnd");
// return res['data'];
// }
//
getworkDateData() async {
Map res = await service.getClient(
"/api/$projType/record/work_date?org_code=a&proj_code=$projCode&tid=$tid");
if (res['code'] == 1000) {
return res['data'] ?? [];
} else {
return [];
}
}
// //
// getworkDateData() async {
// Map res = await service.getClient(
// "/api/$projType/record/work_date?org_code=a&proj_code=$projCode&tid=$tid");
// if (res['code'] == 1000) {
// return res['data'] ?? [];
// } else {
// return [];
// }
// }
//
getProcessData(int pileId) async {
Map res = await service.getClient(
"/api/$projType/process/list?pile_id=$pileId&proj_code=$projCode&tid=$tid");
return res['data'];
}
}
// //
// getProcessData(int pileId) async {
// Map res = await service.getClient(
// "/api/$projType/process/list?pile_id=$pileId&proj_code=$projCode&tid=$tid");
// return res['data'];
// }
// }
class GetServices {
BaseService service = BaseService();
// String projCode = 'CJGKJEBYYB';
// int tid = 109;
// String projType = "hydraulic_tamping";
String projCode = 'TEST';
int tid = 1000;
String projType = "pile_cm";
// 线
Future getSideLine() async {
try {
Map res = await service.getClient(
'/api/comm/side_line/list?proj_code=$projCode&proj_type=$projType');
return res['data'];
} catch (e) {
return {};
}
}
// class GetServices {
// BaseService service = BaseService();
// // String projCode = 'CJGKJEBYYB';
// // int tid = 109;
// // String projType = "hydraulic_tamping";
// String projCode = 'TEST';
// int tid = 1000;
// String projType = "pile_cm";
// // 线
// Future getSideLine() async {
// try {
// Map res = await service.getClient(
// '/api/comm/side_line/list?proj_code=$projCode&proj_type=$projType');
// return res['data'];
// } catch (e) {
// return {};
// }
// }
// ---
Future getDeviceBind() async {
Map res = await service.getClient(
'/api/sys/device_bind/list?proj_type=$projType&proj_code=$projCode');
return res['data'];
}
// // ---
// Future getDeviceBind() async {
// Map res = await service.getClient(
// '/api/sys/device_bind/list?proj_type=$projType&proj_code=$projCode');
// return res['data'];
// }
//
getproject() async {
Map res = await service
.getClient('/api/sys/project/list?org_code=a&proj_type=$projType');
return res['data'];
}
// //
// getproject() async {
// Map res = await service
// .getClient('/api/sys/project/list?org_code=a&proj_type=$projType');
// return res['data'];
// }
//
getRcordData(int page, int size, String date,
[String sort = "desc", String order = "tp_id"]) async {
Map res = await service.getClient(
"/api/$projType/record/page?page=$page&size=$size&org_code=a&proj_code=$projCode&tid=$tid&date=$date&sort=$sort&order=$order");
return res['data'];
}
// //
// getRcordData(int page, int size, String date,
// [String sort = "desc", String order = "tp_id"]) async {
// Map res = await service.getClient(
// "/api/$projType/record/page?page=$page&size=$size&org_code=a&proj_code=$projCode&tid=$tid&date=$date&sort=$sort&order=$order");
// return res['data'];
// }
//
// getRcordData(int page, int size, String date,
// [String sort = "desc", String order = "pile_id"]) async {
// Map res = await service.getClient(
// "/api/$projType/record/page?page=$page&size=$size&org_code=a&proj_code=$projCode&tid=$tid&date=$date&sort=$sort&order=$order");
// return res['data'];
// }
// //
// // getRcordData(int page, int size, String date,
// // [String sort = "desc", String order = "pile_id"]) async {
// // Map res = await service.getClient(
// // "/api/$projType/record/page?page=$page&size=$size&org_code=a&proj_code=$projCode&tid=$tid&date=$date&sort=$sort&order=$order");
// // return res['data'];
// // }
// getRcordList(String date, String? dateEnd) async {
// dateEnd ??= date;
// Map res = await service.getClient(
// "/api/$projType/record/list?org_code=a&proj_code=$projCode&tid=$tid&date=$date&dateEnd=$dateEnd");
// return res['data'];
// }
getRcordList(String date, [String? dateEnd]) async {
dateEnd ??= date;
Map res = await service.getClient(
"/api/$projType/record/list?org_code=a&proj_code=$projCode&tid=$tid&date=$date&dateEnd=$dateEnd");
if (res['code'] == 1000) {
return res['data'];
} else {
return [];
}
}
// // getRcordList(String date, String? dateEnd) async {
// // dateEnd ??= date;
// // Map res = await service.getClient(
// // "/api/$projType/record/list?org_code=a&proj_code=$projCode&tid=$tid&date=$date&dateEnd=$dateEnd");
// // return res['data'];
// // }
// getRcordList(String date, [String? dateEnd]) async {
// dateEnd ??= date;
// Map res = await service.getClient(
// "/api/$projType/record/list?org_code=a&proj_code=$projCode&tid=$tid&date=$date&dateEnd=$dateEnd");
// if (res['code'] == 1000) {
// return res['data'];
// } else {
// return [];
// }
// }
//
getworkDateData() async {
Map res = await service.getClient(
"/api/$projType/record/work_date?org_code=a&proj_code=$projCode&tid=$tid");
if (res['code'] == 1000) {
return res['data'] ?? [];
} else {
return [];
}
}
// //
// getworkDateData() async {
// Map res = await service.getClient(
// "/api/$projType/record/work_date?org_code=a&proj_code=$projCode&tid=$tid");
// if (res['code'] == 1000) {
// return res['data'] ?? [];
// } else {
// return [];
// }
// }
//
getProcessData(int pileId) async {
Map res = await service.getClient(
"/api/$projType/process/list?pile_id=$pileId&proj_code=$projCode&tid=$tid");
return res['data'];
}
// //
// getProcessData(int pileId) async {
// Map res = await service.getClient(
// "/api/$projType/process/list?pile_id=$pileId&proj_code=$projCode&tid=$tid");
// return res['data'];
// }
//
getsmsCode(String phone) async {
Map res =
await service.postClient("/admin/base/open/smsCode", {"phone": phone});
return res;
}
// //
// getsmsCode(String phone) async {
// Map res =
// await service.postClient("/admin/base/open/smsCode", {"phone": phone});
// return res;
// }
//
phoneLogin(String phone, String smsCode) async {
Map res = await service.postClient(
"/admin/base/open/phone", {"phone": phone, "smsCode": smsCode});
return res;
}
// //
// phoneLogin(String phone, String smsCode) async {
// Map res = await service.postClient(
// "/admin/base/open/phone", {"phone": phone, "smsCode": smsCode});
// return res;
// }
//
getPerson() async {
Map res = await service.getClient("/admin/base/comm/person");
return res['data'];
}
// //
// getPerson() async {
// Map res = await service.getClient("/admin/base/comm/person");
// return res['data'];
// }
//
getCaptcha() async {
Map res =
await service.getClient("/admin/base/open/captcha?height=40&width=150");
return res['data'];
}
// //
// getCaptcha() async {
// Map res =
// await service.getClient("/admin/base/open/captcha?height=40&width=150");
// return res['data'];
// }
getAccountLogin(String captchaId, String password, String username,
String verifyCode) async {
Map res = await service.postClient("/admin/base/open/login", {
"captchaId": captchaId,
"password": password,
"username": username,
"verifyCode": verifyCode
});
return res;
}
// getAccountLogin(String captchaId, String password, String username,
// String verifyCode) async {
// Map res = await service.postClient("/admin/base/open/login", {
// "captchaId": captchaId,
// "password": password,
// "username": username,
// "verifyCode": verifyCode
// });
// return res;
// }
getRtuLast() async {
Map res = await service.getClient(
"/api/t2n/rtu/rtu_last?proj_type=$projType&proj_code=$projCode");
return res['data'];
}
// getRtuLast() async {
// Map res = await service.getClient(
// "/api/t2n/rtu/rtu_last?proj_type=$projType&proj_code=$projCode");
// return res['data'];
// }
getCoordTrans() async {
Map res = await service.getClient(
"/api/comm/coord_trans/list?proj_type=$projType&proj_code=$projCode");
return res['data'];
}
}
// getCoordTrans() async {
// Map res = await service.getClient(
// "/api/comm/coord_trans/list?proj_type=$projType&proj_code=$projCode");
// return res['data'];
// }
// }

View File

@ -6,7 +6,7 @@ packages:
description:
name: args
sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.5.0"
async:
@ -14,7 +14,7 @@ packages:
description:
name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.11.0"
boolean_selector:
@ -22,7 +22,7 @@ packages:
description:
name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
bottom_picker:
@ -30,7 +30,7 @@ packages:
description:
name: bottom_picker
sha256: "7c690407c6c489bc7c556858c3f1b804aac73c3a128559f328cc829ba12983ad"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.8.0"
characters:
@ -38,7 +38,7 @@ packages:
description:
name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
clock:
@ -46,7 +46,7 @@ packages:
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
collection:
@ -54,7 +54,7 @@ packages:
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.18.0"
crypto:
@ -62,7 +62,7 @@ packages:
description:
name: crypto
sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
cupertino_icons:
@ -70,7 +70,7 @@ packages:
description:
name: cupertino_icons
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.0.8"
fake_async:
@ -78,7 +78,7 @@ packages:
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.3.1"
ffi:
@ -86,7 +86,7 @@ packages:
description:
name: ffi
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
flutter:
@ -99,7 +99,7 @@ packages:
description:
name: flutter_lints
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
flutter_svg:
@ -107,7 +107,7 @@ packages:
description:
name: flutter_svg
sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.0.10+1"
flutter_test:
@ -120,7 +120,7 @@ packages:
description:
name: get
sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "4.6.6"
get_storage:
@ -128,7 +128,7 @@ packages:
description:
name: get_storage
sha256: "39db1fffe779d0c22b3a744376e86febe4ade43bf65e06eab5af707dc84185a2"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
google_fonts:
@ -136,7 +136,7 @@ packages:
description:
name: google_fonts
sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "6.2.1"
http:
@ -144,7 +144,7 @@ packages:
description:
name: http
sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.2"
http_parser:
@ -152,7 +152,7 @@ packages:
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
intl:
@ -160,7 +160,7 @@ packages:
description:
name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.19.0"
leak_tracker:
@ -168,7 +168,7 @@ packages:
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
leak_tracker_flutter_testing:
@ -176,7 +176,7 @@ packages:
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
leak_tracker_testing:
@ -184,7 +184,7 @@ packages:
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
lints:
@ -192,7 +192,7 @@ packages:
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
matcher:
@ -200,7 +200,7 @@ packages:
description:
name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.12.16+1"
material_color_utilities:
@ -208,7 +208,7 @@ packages:
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
meta:
@ -216,7 +216,7 @@ packages:
description:
name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
pass_track:
@ -231,7 +231,7 @@ packages:
description:
name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.9.0"
path_parsing:
@ -239,7 +239,7 @@ packages:
description:
name: path_parsing
sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
path_provider:
@ -247,7 +247,7 @@ packages:
description:
name: path_provider
sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
path_provider_android:
@ -255,7 +255,7 @@ packages:
description:
name: path_provider_android
sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.2.10"
path_provider_foundation:
@ -263,7 +263,7 @@ packages:
description:
name: path_provider_foundation
sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.4.0"
path_provider_linux:
@ -271,7 +271,7 @@ packages:
description:
name: path_provider_linux
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
path_provider_platform_interface:
@ -279,7 +279,7 @@ packages:
description:
name: path_provider_platform_interface
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
path_provider_windows:
@ -287,7 +287,7 @@ packages:
description:
name: path_provider_windows
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.3.0"
petitparser:
@ -295,7 +295,7 @@ packages:
description:
name: petitparser
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "6.0.2"
platform:
@ -303,7 +303,7 @@ packages:
description:
name: platform
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.1.5"
plugin_platform_interface:
@ -311,7 +311,7 @@ packages:
description:
name: plugin_platform_interface
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.8"
scence_map:
@ -331,7 +331,7 @@ packages:
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
stack_trace:
@ -339,7 +339,7 @@ packages:
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
stream_channel:
@ -347,7 +347,7 @@ packages:
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
string_scanner:
@ -355,7 +355,7 @@ packages:
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
syncfusion_flutter_core:
@ -363,7 +363,7 @@ packages:
description:
name: syncfusion_flutter_core
sha256: "038390d6f633368dc306c250877f93d2e3932de58a781945a3b7ed10c4df5171"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "26.2.12"
syncfusion_flutter_sliders:
@ -371,7 +371,7 @@ packages:
description:
name: syncfusion_flutter_sliders
sha256: "0392849fef2990eb3b61197499f16265ae85202698d3868f740626bbda57162f"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "26.2.12"
term_glyph:
@ -379,7 +379,7 @@ packages:
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
test_api:
@ -387,7 +387,7 @@ packages:
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
typed_data:
@ -395,7 +395,7 @@ packages:
description:
name: typed_data
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.3.2"
vector_graphics:
@ -403,7 +403,7 @@ packages:
description:
name: vector_graphics
sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.11+1"
vector_graphics_codec:
@ -411,7 +411,7 @@ packages:
description:
name: vector_graphics_codec
sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.11+1"
vector_graphics_compiler:
@ -419,7 +419,7 @@ packages:
description:
name: vector_graphics_compiler
sha256: "12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.11+1"
vector_math:
@ -427,31 +427,47 @@ packages:
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.flutter-io.cn"
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.2.4"
web:
dependency: transitive
description:
name: web
sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
web_socket:
dependency: transitive
description:
name: web_socket
sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83"
url: "https://pub.dev"
source: hosted
version: "0.1.6"
web_socket_channel:
dependency: "direct main"
description:
name: web_socket_channel
sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
xml:
@ -459,7 +475,7 @@ packages:
description:
name: xml
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "6.5.0"
sdks:

View File

@ -46,6 +46,7 @@ dependencies:
google_fonts: ^6.2.1
syncfusion_flutter_sliders: ^26.2.9
bottom_picker: ^2.8.0
web_socket_channel: ^3.0.1
dev_dependencies:
flutter_test:

View File

@ -39,7 +39,7 @@ add_definitions(-DUNICODE -D_UNICODE)
# of modifying this function.
function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_features(${TARGET} PUBLIC cxx_std_17)
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
# target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
target_compile_options(${TARGET} PRIVATE /EHsc)
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")