可以正常显示

This commit is contained in:
LiXiaoqi 2024-09-06 17:21:40 +08:00
parent 38f7234280
commit 01d32c6d5d
4 changed files with 15 additions and 3 deletions

View File

@ -20,6 +20,7 @@ class PassTrackController extends GetxController {
// final PassTrack _passTrackPlugin;
PassTrackController(this.projCode, this.projType);
Map<String, int> deviceMap = {};
Map<String, int> coorTransMap = {};
@override
void onInit() {
super.onInit();
@ -94,6 +95,7 @@ class PassTrackController extends GetxController {
break;
}
}
coorTransMap = fileHandle.pointsMap;
return allLen;
}
}

View File

@ -23,6 +23,7 @@ class FileHandle {
int index = 0;
List deviceList = [];
Map deviceData = {};
Map<String, int> 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;

View File

@ -94,6 +94,9 @@ class _PasstrackState extends State<PassTrackWidget> {
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);

@ -1 +1 @@
Subproject commit 5145127697ac2f0e3c8b80ae44d49fad9da760cf
Subproject commit 26455a018ed9cdda8413c8477baeaa38bd57499f