From 6725c6a12dc730a93a88f2b3e759f3cd16282d72 Mon Sep 17 00:00:00 2001 From: liuwu <975499773@qq.com> Date: Fri, 3 Nov 2023 18:15:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A8=B3=E5=AE=9A=E5=8C=85?= =?UTF-8?q?=E6=95=B0=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEmtu120?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/collection.html | 1090 ++++++++++++++++++++++++++++++++++++++++++ html/config.html | 17 + html/index.html | 114 +++++ html/index1.html | 8 + script/ble.js | 9 +- 5 files changed, 1235 insertions(+), 3 deletions(-) create mode 100644 html/collection.html create mode 100644 html/index.html diff --git a/html/collection.html b/html/collection.html new file mode 100644 index 0000000..15a3aeb --- /dev/null +++ b/html/collection.html @@ -0,0 +1,1090 @@ + + + + + + + Document + + + + + + + + + + + + +
+
+
+ +
+
+ + + +
+
+ +
+
+
+
+
+
+
+
+
+ + +
+
+
+
+ +
+ + + + diff --git a/html/config.html b/html/config.html index 4f5567e..d7af084 100644 --- a/html/config.html +++ b/html/config.html @@ -102,6 +102,12 @@ +
+ + + +
@@ -283,6 +289,17 @@ mui.alert('默认页面"' + name + '"设置成功'); } } + + function weightSizeSave(){ + var value = document.getElementById('weightSize').value; + if (value) { + api.setPrefs({ + key: 'weightSize', + value: value + }); + mui.alert('自动跳转数据包"' + value + '"成功'); + } + } \ No newline at end of file diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..44828c4 --- /dev/null +++ b/html/index.html @@ -0,0 +1,114 @@ + + + + + + + Document + + + + + + + + + + +
+
+ +
+
+ +
+
+ +
+
+ + + diff --git a/html/index1.html b/html/index1.html index 86a9a24..5a724d6 100644 --- a/html/index1.html +++ b/html/index1.html @@ -249,7 +249,15 @@ 30: "㉚" } var ble; + + var weightSize = 40; + var apiready = function apiready() { + var size = api.getPrefs({sync: true,key: 'weightSize'}) + if (size && !isNaN(size)){ + weightSize = size + console.log(weightSize) + } ble = api.require('ble'); zfk = api.require("moduleDemo"); clearInterval(resultInterval); diff --git a/script/ble.js b/script/ble.js index 7143ae5..b66ca79 100644 --- a/script/ble.js +++ b/script/ble.js @@ -133,7 +133,7 @@ function connect(param) { console.log('主机端连接成功') ble.setMtu({ peripheralUUID: param.peripheralUUID, - mtu:50 + mtu:120 },function(ret){ if(ret.status){ initWeight(); @@ -388,7 +388,7 @@ function discoverService(param) { // 重量稳定计数 var filteredValue = weightDataFilter.filter(nowWeight); // 重量稳定自动跳转 - if (weightDataFilter.dataBuffer.length === 40) { + if (weightDataFilter.dataBuffer.length === weightSize) { console.log("重量稳定", currTimeFn(new Date())); weightDataFilter.dataBuffer = [] document.getElementById('submitData').click(); @@ -577,6 +577,9 @@ function strToHex(str,length){ } return append+hex; } + +var weightSize = 40; + /*初始化重量图表*/ function initWeight() { api.showProgress({ @@ -584,7 +587,7 @@ function initWeight() { modal: true }); weightStatus = true; - weightDataFilter = new WeightDataFilter(40, _weightSum); + weightDataFilter = new WeightDataFilter(weightSize, _weightSum); renderUnload(); renderLoad(); feedMyChart.setOption({