lq-adidata
v1.1.3
Published
adi数据下载导出
Downloads
13
Readme
Aid数据下载
Installation
方式1,使用构建工具:
npm install lq-adidata -S
方式2,使用script标签:先下载本库到本地,然后将dist文件夹下的lq-aidData.js通过script标签引入
<script src="./lq-adidata.js"></script>
Usage
通过方式1安装的,可以通过以下代码使用
import * as AdiData from "lq-adidata";
import AdiData from "lq-adidata";
通过方式2安装的,会在全局变量中创建一个AdiData的变量,可以直接使用
API
//本次登录保存的token
let token='xxxxxxx'
//下载原始数据
AdiData.downloadRaw({
baseUrl: baseUrl.value,
tenantId:'t.2103c8',
local: local.value,
codes: ['vibx', 'vibxFFT', 'vibz', 'vibzFFT', 'flux', 'fluxFFT', 'tempe', 'tempm', 'abs-vibxFFT', 'abs-vibzFFT', 'abs-fluxFFT'],
fileName: 'filename',
timezone:'Europe/Madrid',
motorId: 'ba86323d-b27a-42a0-b7ed-b093974aa9da',
start: 1713650400000,
end: 1713653999000,
headers: {
Authorization: token,
}
}).then(res=>{
console.log(res);
}).catch(e=>{
//error
})
//下载性能数据
AdiData.downloadPerformance({
baseUrl: baseUrl.value,
tenantId:'t.2103c8',
local: local.value,
codes: ['rmsVx', 'rmsVz', 'rmsFlux', 'rpm', 'tempEnv', 'tempMotor', 'rmsVxD', 'rmsVxV', 'rmsVzD', 'rmsVzV', 'operationHours', 'numberOfStarts'],
fileName: 'filename',
timezone:'Europe/Madrid',
motorId: 'ba86323d-b27a-42a0-b7ed-b093974aa9da',
start: 1713650400000,
end: 1713653999000,
headers: {
Authorization: token,
}
}).then(res=>{
console.log(res);
}).catch(e=>{
//error
})
//下载健康数据
//下载性能数据
AdiData.downloadHealth({
baseUrl: baseUrl.value,
tenantId:'t.2103c8',
local: local.value,
codes: ['powerSystem', 'statorWinding', 'rotorBar', 'imbalance', 'eccentricity', 'bearing', 'misalignment', 'cooling', 'motorStructure'],
fileName: 'filename',
timezone:'Europe/Madrid',
motorId: 'ba86323d-b27a-42a0-b7ed-b093974aa9da',
start: 1713650400000,
end: 1713653999000,
headers: {
Authorization: token,
}
}).then(res=>{
console.log(res);
}).catch(e=>{
//error
})
其他参数请参考项目的d.ts