| | |
| | | // 欧姆龙 HBP-9030 115200 |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' |
| | | const { SerialPort } = require('serialport') |
| | | const { DelimiterParser } = require('@serialport/parser-delimiter') |
| | | const { ReadyParser } = require('@serialport/parser-ready') |
| | |
| | | if (err) { |
| | | console.log(err) |
| | | ipcRenderer.invoke('logger', 'lianjiang体重秤端口打开失败!') |
| | | ElMessage({ |
| | | message: 'lianjiang体重秤端口打开失败!', |
| | | type: 'error', |
| | | }) |
| | | ElNotification.warning({ |
| | | title: '警告', |
| | | message: 'lianjiang体重秤端口打开失败!!', |
| | | showClose: false, |
| | | duration:10000 |
| | | }) |
| | | setTimeout(()=>{ |
| | | initPort(path,baudRate) |
| | | }, RECONNECT_INTERVAL); |