一些小优化

This commit is contained in:
liub
2026-02-10 15:45:45 +08:00
parent 63214ded3b
commit fc88bd6f7d
8 changed files with 51 additions and 40 deletions

View File

@ -7,3 +7,7 @@ export function deviceSendAlarmMessage(data) {
data: data data: data
}) })
} }
export function deviceDefaultAlarm(data){
return Promise.reject(data);
}

View File

@ -2,7 +2,7 @@
"name" : "星汉物联", "name" : "星汉物联",
"appid" : "__UNI__A21EF43", "appid" : "__UNI__A21EF43",
"description" : "设备管控", "description" : "设备管控",
"versionName" : "1.0.16", "versionName" : "1.0.17",
"versionCode" : "100", "versionCode" : "100",
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */

View File

@ -715,7 +715,7 @@
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 创建RGB565格式的像素数据 // 创建RGB565格式的像素数据
// console.log("pixels=",pixels); // console.log("pixels=",pixels);
const arr = ble.convertToRGB565(pixels, 'bgr'); const arr = Common.convertToRGB565(pixels, 'bgr');
var list = []; var list = [];
let index = 0; // 用于追踪arr的当前位置 let index = 0; // 用于追踪arr的当前位置

View File

@ -1029,7 +1029,7 @@ import request, { baseURL } from '@/utils/request.js';
}); });
these.Status.BottomMenu.show = false; these.Status.BottomMenu.show = false;
these.rgb565Data = ble.convertToRGB565(data.piexls); these.rgb565Data = Common.convertToRGB565(data.piexls);
setTimeout(function() { setTimeout(function() {
sendImagePackets().catch(() => { sendImagePackets().catch(() => {

View File

@ -1848,7 +1848,7 @@
these.Status.BottomMenu.show = false; these.Status.BottomMenu.show = false;
these.picPath = data.picPath; these.picPath = data.picPath;
these.rgb565Data = ble.convertToRGB565(data.piexls); these.rgb565Data = Common.convertToRGB565(data.piexls);
setTimeout(function() { setTimeout(function() {
sendImagePackets().catch(() => { sendImagePackets().catch(() => {

View File

@ -927,18 +927,22 @@
@keyframes expand { @keyframes expand {
0% { 0% {
width: 0; width: 0;
height: 0; height: 0;
opacity: 0.9; opacity: 0.8;
} }
90% {
width: 18rem;
height: 18rem;
opacity: 0;
}
100% {
100% { width: 0rem;
width: 18rem; height: 0rem;
height: 18rem; opacity: 0;
opacity: 0; }
}
} }
.mainContent { .mainContent {

View File

@ -2030,29 +2030,7 @@ class BleHelper {
} }
//将点阵数据转换成RGB565
convertToRGB565(pixels, type) {
if (!type) {
type = 'rgb';
}
const result = new Uint16Array(pixels.length / 4);
let index = 0;
for (let i = 0; i < pixels.length; i += 4) {
let r = pixels[i];
let g = pixels[i + 1];
let b = pixels[i + 2];
let a = pixels[i + 3];
if (type == 'bgr') {
result[index++] = ((b & 0xF8) << 8) | ((g & 0xFC) << 3) | (r >> 3);
} else {
result[index++] = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
}
}
return result;
}

View File

@ -462,5 +462,30 @@ export default {
url='https://www.pgyer.com/xhwl'; url='https://www.pgyer.com/xhwl';
} }
return {os:os,url:url}; return {os:os,url:url};
},
//将点阵数据转换成RGB565
convertToRGB565(pixels, type) {
if (!type) {
type = 'rgb';
}
const result = new Uint16Array(pixels.length / 4);
let index = 0;
for (let i = 0; i < pixels.length; i += 4) {
let r = pixels[i];
let g = pixels[i + 1];
let b = pixels[i + 2];
let a = pixels[i + 3];
if (type == 'bgr') {
result[index++] = ((b & 0xF8) << 8) | ((g & 0xFC) << 3) | (r >> 3);
} else {
result[index++] = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
}
}
return result;
} }
} }