page({
data: {
buttons: [
{ method: 'getdeviceid', label: '获取红外测温仪设备id' },
{ method: 'setemittance', label: '设置辐射率' },
{ method: 'setmodel', label: '设置温度模型' },
{ method: 'setautocalibration', label: '设置自动校准' },
],
switch: false,
monitor: false,
src: '',
temperature: ''
},
// 转码表
tables : [
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'l', 'm', 'n', 'o' ,'p',
'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
'y', 'z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', ' ', '/'
],
// base64编码
base64encode : function (data) {
if (!data) {
return '';
}
let i = 0; // 遍历索引
let len = data.length;
let results = [];
while (i < len) {
let c1 = data[i] & 0xff;
results.push(this.tables[c1 >> 2]);