| | |
| | | win = new BrowserWindow({ |
| | | title: 'Main window', |
| | | transparent: true, |
| | | frame:false, |
| | | frame:store.get('debug'),//关闭菜单栏 |
| | | fullscreen: true,// 开启默认全屏 |
| | | kiosk: true, |
| | | autoHideMenuBar:store.get('debug'), //关闭菜单栏 |
| | | // autoHideMenuBar:store.get('debug'), |
| | | webPreferences: { |
| | | preload: splash, |
| | | nodeIntegration: true, |
| | |
| | | { |
| | | "name": "sign-tool", |
| | | "version": "2.6.9", |
| | | "version": "2.7.0", |
| | | "icon": "public/favicon.ico", |
| | | "main": "dist/electron/main/index.js", |
| | | "author": "", |
| | |
| | | function getUserMedia(constrains:any, success:any, error:any) { |
| | | if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { |
| | | //最新标准API |
| | | ElMessage({ type: 'success', message: '支持最新标准API' }); |
| | | ElMessage({ type: 'success', message: '支持人脸识别最新Api' }); |
| | | navigator.mediaDevices.getUserMedia(constrains).then(success).catch(error); |
| | | } else if (navigator.webkitGetUserMedia) { |
| | | ElMessage({ type: 'success', message: '支持webkit内核浏览器' }); |
| New file |
| | |
| | | // 欧姆龙 HBP-9030 115200 |
| | | import { ElMessage } from 'element-plus' |
| | | const { SerialPort } = require('serialport') |
| | | const { DelimiterParser } = require('@serialport/parser-delimiter') |
| | | const { ReadyParser } = require('@serialport/parser-ready') |
| | | import {sockteStore} from '@/stores/sockteInfo' |
| | | |
| | | const initPort=(path:String,baudRate:Number)=>{ |
| | | console.log('初始化打开志荣体重秤端口') |
| | | const serialport = new SerialPort({ path, baudRate }, (err: any) => { |
| | | if (err) { |
| | | console.log(err) |
| | | ElMessage({ |
| | | message: '志荣体重秤端口打开失败!', |
| | | type: 'error', |
| | | }) |
| | | console.log(err) |
| | | }else{ |
| | | ElMessage({ |
| | | message: '志荣体重秤端口打开成功', |
| | | type: 'success', |
| | | }) |
| | | } |
| | | }) |
| | | serialport.on("close",(err: any)=>{ |
| | | console.log('志荣体重秤端口异常端口链接断开') |
| | | console.log(err) |
| | | }) |
| | | // 解析分割数据流 |
| | | // No:4742 |
| | | // Gross: 75.0kg |
| | | // Tare: 0.0kg |
| | | // Net: 75.0kg |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // 20 20 20 4E6F 3A 34 37 34 31 0A47 72 6F 73 73 3A 20 20 3733 2E 37 6B 67 0A 20 5461 72 65 3A 20 20 2030 2E 30 6B 67 0A 20 204E 65 74 3A 20 20 3733 2E 37 6B 67 0A 0A0A 0A 0A |
| | | const parser = serialport.pipe(new DelimiterParser({ delimiter:Buffer.from([10,10,10,10,10]),includeDelimiter:true })) |
| | | parser.on('data', (value: string | any[])=>{ |
| | | console.log(value.toString()) |
| | | const str=value.toString() |
| | | const list=str.split('Net:') |
| | | console.log(list) |
| | | if(list.length===2){ |
| | | const re=list[1].trim() |
| | | const res=re.substring(0,re.length-2) |
| | | console.log(res) |
| | | sockteStore().setweightSockte( |
| | | { |
| | | deviceName:'志荣T605', |
| | | type:"体重秤", |
| | | result:res, |
| | | resultTime:new Date().toString(), |
| | | state:2 |
| | | } |
| | | ) |
| | | }else{ |
| | | console.log('数据格式不对') |
| | | } |
| | | }) // all data after READY is received |
| | | } |
| | | |
| | | export { |
| | | initPort, |
| | | } |
| | |
| | | baudRate:115200, |
| | | Is_xyj:false, |
| | | xueyanjiPortPath:"COM35", |
| | | xueyanjiBaudRate:115200 |
| | | xueyanjiBaudRate:115200, |
| | | Is_tzc:false, |
| | | tzcPortPath:"COM34", |
| | | tzcBaudRate:1200 |
| | | |
| | | }) |
| | | /** |
| | |
| | | import {base64toFile} from '@/samples/faceApi' |
| | | import{initPort} from '@/samples/portApi' |
| | | import{initPort as oumulongHbp9030 } from '@/samples/deviceApi/oumulong-HBP-9030' |
| | | import{initPort as zhiRongT605 } from '@/samples/deviceApi/zhiRongT605' |
| | | |
| | | import { ElLoading, ElMessage } from 'element-plus' |
| | | let trackerTask: any = null; |
| | | // 标识用的画布 |
| | |
| | | onMounted(() => { |
| | | console.log('页面初始化', os.hostname()) |
| | | setTimeout(()=>{ |
| | | |
| | | console.log('8秒后执行') |
| | | console.log('打印设置文件') |
| | | console.log(configData.value) |
| | |
| | | if(configData.value.Is_xyj){ |
| | | oumulongHbp9030(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate) |
| | | } |
| | | // 是否开启志荣体重秤联机 |
| | | if(configData.value.Is_tzc){ |
| | | zhiRongT605(configData.value.tzcPortPath,configData.value.tzcBaudRate) |
| | | } |
| | | // 是否开启脸识别 |
| | | isUseFaceRecogService.value = configData.value.isUseFaceRecogService |
| | | console.log('人脸识别',isUseFaceRecogService.value) |