import DeviceReact from "../native/device_react"; import Aliyun from '../helper/aliyun'; import PlusCommonLog from '../common/log'; export default class { static connect(sType: string, fCallBack: Function) { DeviceReact.initDevice(); //血氧 //DeviceReact.commandFine('SpO208'); //体温 //DeviceReact.commandFine('TEMP'); //血压 //DeviceReact.commandFine('NIBP04'); //尿液 //DeviceReact.commandFine('BC01'); //血糖 //DeviceReact.commandFine('BG01'); //肺活量 //DeviceReact.commandFine('PULMO01'); //心电 //DeviceReact.commandFine('PM10'); DeviceReact.commandFine(sType); DeviceReact.bindEvent((data) => { //console.warn(JSON.stringify(data)); fCallBack(data); DeviceReact.removeEvent(); }); } static bindView(fCallBack: Function) { DeviceReact.bindView((data) => { //console.warn(JSON.stringify(data)); let sUrl=data.filePath; let fStr="files/ect/"+data.codeEct+".xml"; Aliyun.uploadBlob(fStr, sUrl).then( (res) => { if (res.respInfo.status === 200) { //let sSave = BaseFunc.stringArrayOption(PlusOperateData.upSystemVar('wait_image_sync'), fStr, 4); //PlusOperateData.systemVariable.inValue(BaseDefine.upPlusDefine().systemVarStart + "wait_image_sync", sSave); //PlusOperateData.inSystemVar('wait_image_sync', sSave); data.serverUrl=Aliyun.upServerUrl(fStr); fCallBack(data); } else { PlusCommonLog.logWarn(9410103, res); } } ).catch( (error) => { PlusCommonLog.logError(9310102, error); } ) ; DeviceReact.removeEvent(); }); } }