@gaidalou/control 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/control.js +62 -54
- package/dist/es/control.umd.cjs +4 -4
- package/package.json +1 -1
package/dist/es/control.js
CHANGED
|
@@ -46893,7 +46893,7 @@ const Nc = class Nc {
|
|
|
46893
46893
|
a = a.map((c) => uf(c, 0));
|
|
46894
46894
|
let r = a.length + 4;
|
|
46895
46895
|
const s = Math.floor(r / 256), i = r % 256;
|
|
46896
|
-
let u = [90, 165, s, i, 0, 2, ...a,
|
|
46896
|
+
let u = [90, 165, s, i, 0, 2, ...a, 0, 0];
|
|
46897
46897
|
await Qo.sendMsg({
|
|
46898
46898
|
characteristic: "0000ff04",
|
|
46899
46899
|
value: u
|
|
@@ -46914,24 +46914,19 @@ const Nc = class Nc {
|
|
|
46914
46914
|
const n = t & 255, o = t >> 8 & 255;
|
|
46915
46915
|
return [n, o];
|
|
46916
46916
|
}
|
|
46917
|
-
//
|
|
46918
|
-
async
|
|
46919
|
-
this.
|
|
46920
|
-
let o = new TextEncoder().encode(t), r = Array.from(o).map((d) => d.toString(10).padStart(2, "0")).join(" ").split(" ");
|
|
46921
|
-
r = r.map((d) => uf(d, 0));
|
|
46922
|
-
let s = r.length + 4;
|
|
46923
|
-
const i = Math.floor(s / 256), u = s % 256;
|
|
46924
|
-
let c = [90, 165, i, u, 0, 2, ...r, 248, 192];
|
|
46917
|
+
// 发送平台名称
|
|
46918
|
+
async sendBluePlatformType(t) {
|
|
46919
|
+
let o = [90, 165, 0, 5, 0, 10, ...this.numberToBytes(t), 0, 0];
|
|
46925
46920
|
await Qo.sendMsg({
|
|
46926
46921
|
characteristic: "0000ff04",
|
|
46927
|
-
value:
|
|
46922
|
+
value: o
|
|
46928
46923
|
}), await Jo.sendMsg({
|
|
46929
|
-
value:
|
|
46924
|
+
value: o
|
|
46930
46925
|
});
|
|
46931
46926
|
}
|
|
46932
46927
|
// 发送温度给操作台
|
|
46933
46928
|
async sendBlueWenDu(t) {
|
|
46934
|
-
let o = [90, 165, 0, 6, 0, 3, ...this.numberToBytes(t * 10),
|
|
46929
|
+
let o = [90, 165, 0, 6, 0, 3, ...this.numberToBytes(t * 10), 0, 0];
|
|
46935
46930
|
await Qo.sendMsg({
|
|
46936
46931
|
characteristic: "0000ff04",
|
|
46937
46932
|
value: o
|
|
@@ -46941,7 +46936,7 @@ const Nc = class Nc {
|
|
|
46941
46936
|
}
|
|
46942
46937
|
// 发送风速 延迟100毫秒 因为共用一个通道
|
|
46943
46938
|
async sendBlueFengSu(t) {
|
|
46944
|
-
let o = [90, 165, 0, 6, 0, 5, ...this.numberToBytes(t * 10),
|
|
46939
|
+
let o = [90, 165, 0, 6, 0, 5, ...this.numberToBytes(t * 10), 0, 0];
|
|
46945
46940
|
await Qo.sendMsg({
|
|
46946
46941
|
characteristic: "0000ff04",
|
|
46947
46942
|
value: o
|
|
@@ -46949,9 +46944,9 @@ const Nc = class Nc {
|
|
|
46949
46944
|
value: o
|
|
46950
46945
|
});
|
|
46951
46946
|
}
|
|
46952
|
-
//
|
|
46953
|
-
async
|
|
46954
|
-
let o = [90, 165, 0,
|
|
46947
|
+
// 发送距离
|
|
46948
|
+
async sendBlueDistance(t) {
|
|
46949
|
+
let o = [90, 165, 0, 6, 0, 12, ...this.numberToBytes(t * 10), 0, 0];
|
|
46955
46950
|
await Qo.sendMsg({
|
|
46956
46951
|
characteristic: "0000ff04",
|
|
46957
46952
|
value: o
|
|
@@ -46959,13 +46954,14 @@ const Nc = class Nc {
|
|
|
46959
46954
|
value: o
|
|
46960
46955
|
});
|
|
46961
46956
|
}
|
|
46962
|
-
//
|
|
46963
|
-
async
|
|
46957
|
+
// 发送名字给操作台
|
|
46958
|
+
async sendBlueYunTaiName(t) {
|
|
46959
|
+
this.yunTaiName = t;
|
|
46964
46960
|
let o = new TextEncoder().encode(t), r = Array.from(o).map((d) => d.toString(10).padStart(2, "0")).join(" ").split(" ");
|
|
46965
46961
|
r = r.map((d) => uf(d, 0));
|
|
46966
46962
|
let s = r.length + 4;
|
|
46967
46963
|
const i = Math.floor(s / 256), u = s % 256;
|
|
46968
|
-
let c = [90, 165, i, u, 0,
|
|
46964
|
+
let c = [90, 165, i, u, 0, 2, ...r, 0, 0];
|
|
46969
46965
|
await Qo.sendMsg({
|
|
46970
46966
|
characteristic: "0000ff04",
|
|
46971
46967
|
value: c
|
|
@@ -46973,14 +46969,18 @@ const Nc = class Nc {
|
|
|
46973
46969
|
value: c
|
|
46974
46970
|
});
|
|
46975
46971
|
}
|
|
46976
|
-
//
|
|
46977
|
-
async
|
|
46978
|
-
let o =
|
|
46972
|
+
// 发送机库名称
|
|
46973
|
+
async sendBlueAirportName(t) {
|
|
46974
|
+
let o = new TextEncoder().encode(t), r = Array.from(o).map((d) => d.toString(10).padStart(2, "0")).join(" ").split(" ");
|
|
46975
|
+
r = r.map((d) => uf(d, 0));
|
|
46976
|
+
let s = r.length + 4;
|
|
46977
|
+
const i = Math.floor(s / 256), u = s % 256;
|
|
46978
|
+
let c = [90, 165, i, u, 0, 11, ...r, 0, 0];
|
|
46979
46979
|
await Qo.sendMsg({
|
|
46980
46980
|
characteristic: "0000ff04",
|
|
46981
|
-
value:
|
|
46981
|
+
value: c
|
|
46982
46982
|
}), await Jo.sendMsg({
|
|
46983
|
-
value:
|
|
46983
|
+
value: c
|
|
46984
46984
|
});
|
|
46985
46985
|
}
|
|
46986
46986
|
// 发送Uav 水平速度
|
|
@@ -47252,7 +47252,7 @@ const gS = (e, t) => {
|
|
|
47252
47252
|
i(o.write) || o.write && o.write.value && r.sendBlueFengSu(o.write.value);
|
|
47253
47253
|
});
|
|
47254
47254
|
let u = async (d) => {
|
|
47255
|
-
i(d) || (d.
|
|
47255
|
+
i(d) || (d.platformType && d.platformType.value && await r.sendBluePlatformType(d.platformType.value), d.wind && d.wind.value !== null && await r.sendBlueFengSu(d.wind.value), d.temperature && d.temperature.value !== null && await r.sendBlueWenDu(d.temperature.value), d.distance && d.distance.value && await r.sendBlueDistance(d.distance.value), d.deviceName && d.deviceName.value && await r.sendBlueYunTaiName(d.deviceName.value), d.airportName && d.airportName.value && await r.sendBlueAirportName(d.airportName.value));
|
|
47256
47256
|
}, c = null;
|
|
47257
47257
|
return yt(() => {
|
|
47258
47258
|
c = Ti.init(), c.has({ type: "blueSend", fnName: "blueSend_homePage_control" }) || c.bus.on("blueSend", s);
|
|
@@ -47358,70 +47358,78 @@ ni.install = (e) => {
|
|
|
47358
47358
|
const DU = {
|
|
47359
47359
|
__name: "controlTest",
|
|
47360
47360
|
setup(e) {
|
|
47361
|
-
let t = B(
|
|
47361
|
+
let t = B(1), n = B(!1), o = B({
|
|
47362
47362
|
deviceName: { value: null },
|
|
47363
47363
|
temperature: { value: null },
|
|
47364
47364
|
wind: { value: null },
|
|
47365
|
-
platformType: { value:
|
|
47365
|
+
platformType: { value: t.value },
|
|
47366
47366
|
// 平台类型 平台1 一网统飞2 警务3
|
|
47367
47367
|
airportName: { value: null },
|
|
47368
47368
|
// 机库名称
|
|
47369
47369
|
distance: { value: null }
|
|
47370
47370
|
// 机库与无人机距离
|
|
47371
|
-
}),
|
|
47372
|
-
|
|
47373
|
-
|
|
47374
|
-
}, 1e3 *
|
|
47375
|
-
},
|
|
47376
|
-
const
|
|
47377
|
-
|
|
47371
|
+
}), a = (f) => {
|
|
47372
|
+
n.value || (d(f), i && clearInterval(i), i = setInterval(() => {
|
|
47373
|
+
d(f);
|
|
47374
|
+
}, 1e3 * 2));
|
|
47375
|
+
}, r = B(null);
|
|
47376
|
+
const s = (f) => {
|
|
47377
|
+
a(f.version);
|
|
47378
47378
|
};
|
|
47379
|
-
let
|
|
47380
|
-
|
|
47381
|
-
|
|
47382
|
-
|
|
47379
|
+
let i = null, u = (f, g = 2) => {
|
|
47380
|
+
let h = null;
|
|
47381
|
+
if (isNaN(f)) {
|
|
47382
|
+
let m = parseFloat(f);
|
|
47383
|
+
isNaN(m) ? h = f : (m *= Math.pow(10, g), m = Math.round(m), h = m / Math.pow(10, g));
|
|
47384
|
+
} else
|
|
47385
|
+
f *= Math.pow(10, g), f = Math.round(f), h = f / Math.pow(10, g);
|
|
47386
|
+
return h;
|
|
47387
|
+
}, c = 0.01, d = (f) => {
|
|
47388
|
+
n.value = !0;
|
|
47389
|
+
let g = {}, h = aa(o.value);
|
|
47390
|
+
f === "version3" ? (g.deviceName = h.deviceName, g.temperature = h.temperature, g.wind = h.wind, g.platformType = h.platformType, g.airportName = h.airportName, g.distance = h.distance) : (g.deviceName = h.deviceName, g.temperature = h.temperature, g.wind = h.wind), g.deviceName = { value: "设备测试1" }, g.temperature = { value: 36.5 }, g.wind = { value: 17.5 }, g.platformType = { value: t.value }, g.airportName = { value: "机库测试2" }, c += 10, g.distance = { value: u(c / 1e3, 2) }, console.log("平台发送的数据message===>", g), r.value.sendMessage(g);
|
|
47383
47391
|
};
|
|
47384
47392
|
return yt(() => {
|
|
47385
|
-
let
|
|
47393
|
+
let g = r.value.getBlueStore()(), { blueScanBtnShow: h, usbScanBtnShow: m, selectLinkText: p } = dd(g);
|
|
47386
47394
|
Ce(
|
|
47387
47395
|
[
|
|
47388
|
-
() =>
|
|
47389
|
-
() =>
|
|
47390
|
-
() =>
|
|
47396
|
+
() => h.value,
|
|
47397
|
+
() => m.value,
|
|
47398
|
+
() => p.value
|
|
47391
47399
|
],
|
|
47392
|
-
([
|
|
47393
|
-
|
|
47400
|
+
([w, b, $], [C, k, _]) => {
|
|
47401
|
+
w || (n.value = !1), b || (n.value = !1), !w && !b && (n.value = !1, i && clearInterval(i));
|
|
47394
47402
|
}
|
|
47395
47403
|
);
|
|
47396
47404
|
}), Wa(async () => {
|
|
47397
|
-
|
|
47398
|
-
}), (
|
|
47405
|
+
i && clearInterval(i), i = null;
|
|
47406
|
+
}), (f, g) => (N(), H("div", null, [
|
|
47399
47407
|
Q(ni, {
|
|
47400
|
-
onMessage:
|
|
47408
|
+
onMessage: s,
|
|
47401
47409
|
tipStatus: !0,
|
|
47402
47410
|
testModel: !0,
|
|
47403
|
-
scene:
|
|
47411
|
+
scene: l(t),
|
|
47404
47412
|
blueLinkText: "blueLinkText",
|
|
47405
47413
|
blueDisconnectText: "blueDisconnectText",
|
|
47406
47414
|
usbLinkText: "usbLinkText",
|
|
47407
47415
|
usbDisconnectText: "usbDisconnectText",
|
|
47408
47416
|
ref_key: "controlRef",
|
|
47409
|
-
ref:
|
|
47417
|
+
ref: r
|
|
47410
47418
|
}, {
|
|
47411
|
-
blueUnlink: te(() =>
|
|
47419
|
+
blueUnlink: te(() => g[0] || (g[0] = [
|
|
47412
47420
|
q("div", null, " blueLink ", -1)
|
|
47413
47421
|
])),
|
|
47414
|
-
blueLink: te(() =>
|
|
47422
|
+
blueLink: te(() => g[1] || (g[1] = [
|
|
47415
47423
|
q("div", null, " blueUnlink ", -1)
|
|
47416
47424
|
])),
|
|
47417
|
-
usbUnlink: te(() =>
|
|
47425
|
+
usbUnlink: te(() => g[2] || (g[2] = [
|
|
47418
47426
|
q("div", null, " usbLink ", -1)
|
|
47419
47427
|
])),
|
|
47420
|
-
usbLink: te(() =>
|
|
47428
|
+
usbLink: te(() => g[3] || (g[3] = [
|
|
47421
47429
|
q("div", null, " usbUnlink ", -1)
|
|
47422
47430
|
])),
|
|
47423
47431
|
_: 1
|
|
47424
|
-
},
|
|
47432
|
+
}, 8, ["scene"])
|
|
47425
47433
|
]));
|
|
47426
47434
|
}
|
|
47427
47435
|
}, BU = {
|