From 01d32c6d5d2155446c66072bcb568a8a55ae3b52 Mon Sep 17 00:00:00 2001 From: LiXiaoqi <2360211477@qq.com> Date: Fri, 6 Sep 2024 17:21:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E6=AD=A3=E5=B8=B8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/pass_track/controller.dart | 2 ++ lib/pages/pass_track/sevice/file_handle.dart | 11 +++++++++-- lib/pages/pass_track/view.dart | 3 +++ plugins/pass_track | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/pages/pass_track/controller.dart b/lib/pages/pass_track/controller.dart index 3d854bf..23d2c30 100644 --- a/lib/pages/pass_track/controller.dart +++ b/lib/pages/pass_track/controller.dart @@ -20,6 +20,7 @@ class PassTrackController extends GetxController { // final PassTrack _passTrackPlugin; PassTrackController(this.projCode, this.projType); Map deviceMap = {}; + Map coorTransMap = {}; @override void onInit() { super.onInit(); @@ -94,6 +95,7 @@ class PassTrackController extends GetxController { break; } } + coorTransMap = fileHandle.pointsMap; return allLen; } } diff --git a/lib/pages/pass_track/sevice/file_handle.dart b/lib/pages/pass_track/sevice/file_handle.dart index 0e3f25f..6cbd975 100644 --- a/lib/pages/pass_track/sevice/file_handle.dart +++ b/lib/pages/pass_track/sevice/file_handle.dart @@ -23,6 +23,7 @@ class FileHandle { int index = 0; List deviceList = []; Map deviceData = {}; + Map pointsMap = {}; String type = "cumulate"; List palette = []; //所有点的数据 @@ -253,8 +254,8 @@ class FileHandle { var data = jsonDecode(res)["data"]; for (var item in data) { // RecieveModel recieveModel = RecieveModel.fromJson(item); - var X = item["X"].toDouble(); - var Y = item["Y"].toDouble(); + var X = item["Y"].toDouble() * 20; + var Y = item["X"].toDouble() * 20; var TID = item["TID"]; var type = int.parse(item["type"]); var p = passTrackPlugin.wantPoint(); @@ -262,7 +263,13 @@ class FileHandle { p.ref.Y = Y; p.ref.TID = TID; p.ref.type = type; + if (pointsMap.containsKey(TID.toString())) { + pointsMap[TID.toString()] = pointsMap[TID.toString()]! + 1; + } else { + pointsMap[TID.toString()] = 1; + } } + print("dataLenth: ${data.length}"); return data.length; } return 0; diff --git a/lib/pages/pass_track/view.dart b/lib/pages/pass_track/view.dart index 6b638d3..23a3f64 100644 --- a/lib/pages/pass_track/view.dart +++ b/lib/pages/pass_track/view.dart @@ -94,6 +94,9 @@ class _PasstrackState extends State { for (var TID in controller.deviceMap.keys) { _passTrackPlugin.addDevice(int.parse(TID), 0); } + for (var item in controller.coorTransMap.entries) { + print("tid:${item.key} value:${item.value}"); + } _passTrackPlugin.generateTile(0, value); _passTrackPlugin.waitForTile(); _passTrackPlugin.playTrack(0, value, true, 0, ffi.nullptr); diff --git a/plugins/pass_track b/plugins/pass_track index 5145127..26455a0 160000 --- a/plugins/pass_track +++ b/plugins/pass_track @@ -1 +1 @@ -Subproject commit 5145127697ac2f0e3c8b80ae44d49fad9da760cf +Subproject commit 26455a018ed9cdda8413c8477baeaa38bd57499f