一些小优化
This commit is contained in:
@ -7,3 +7,7 @@ export function deviceSendAlarmMessage(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function deviceDefaultAlarm(data){
|
||||||
|
return Promise.reject(data);
|
||||||
|
}
|
||||||
@ -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特有相关 */
|
||||||
|
|||||||
@ -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的当前位置
|
||||||
|
|||||||
@ -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(() => {
|
||||||
|
|
||||||
|
|||||||
@ -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(() => {
|
||||||
|
|||||||
@ -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 {
|
||||||
|
|||||||
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user