| | |
| | | { |
| | | "name": "sign-tool", |
| | | "version": "2.7.2", |
| | | "version": "2.7.3", |
| | | "icon": "public/favicon.ico", |
| | | "main": "dist/electron/main/index.js", |
| | | "author": "", |
| | |
| | | import router from './router/index' |
| | | import "tracking"; |
| | | import "tracking/build/data/face"; |
| | | import "tracking/build/data/eye"; |
| | | import "tracking/build/data/mouth"; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { createPinia } from 'pinia' |
| | | import App from './App.vue' |
| | |
| | | import { confingInfoStore } from '@/stores/StoresConfing' |
| | | |
| | | const initPort=(path:String,baudRate:Number)=>{ |
| | | |
| | | // 是否清零了 |
| | | let sfqingling=true |
| | | // 配置文件定义的对此次数 |
| | | const yanjiancishu=confingInfoStore().confingInfo.jianyancishu===undefined?4:confingInfoStore().confingInfo.jianyancishu |
| | | console.log('初始化打开XK3190-A12体重秤端口',yanjiancishu) |
| | |
| | | duibinum=0 |
| | | } |
| | | // 对比4次结果都一致 |
| | | if(duibinum>=yanjiancishu){ |
| | | if(duibinum>=yanjiancishu&&sfqingling){ |
| | | // 数据发送 体重没有清零 下次就不播报不发送 |
| | | sfqingling=false |
| | | const res=Number(list) |
| | | console.log(res,'获取到的体重') |
| | | sockteStore().setweightSockte( |
| | |
| | | |
| | | |
| | | }else{ |
| | | sfqingling=true |
| | | console.log('小于20') |
| | | } |
| | | }) // all data after READY is received |
| | |
| | | if(err){ |
| | | console.log(err); |
| | | }else{ |
| | | console.log('写入成功!',path); |
| | | console.log('写入成功!验证阿里',path); |
| | | // getOssUrl(path) |
| | | // 验证图片 |
| | | faceShibie(path) |
| | |
| | | // 志荣的[zhiRongT605];台衡的M523[taiHengM523] //[s]eca101]读文件夹// 耀华XK3190-A12 |
| | | tzc_type:"seca101", |
| | | tzcPortPath:"COM34", |
| | | tzcBaudRate:9600,// zhiRongT605波特率1200;台衡523波特率9600, 耀华XK3190-A12 9600 |
| | | tzcBaudRate:9600,// zhiRongT605波特率1200;台衡523波特率9600, 耀华XK3190-A12 9600 耀华XK3190-A11E 1200 |
| | | seca101Path:"D:/seca101/data/",//该参数只对体重秤 赛康101 文件获取目录, |
| | | jianyancishu:4,// 该参数只对耀华XK3190-A12体重秤有效 检验体重秤多次数据相等就传送 |
| | | |
| | |
| | | import { Data } from "electron/main" |
| | | |
| | | /** |
| | | * 时间日期转换 |
| | | * @param date 当前时间,new Date() 格式 |
| | |
| | | const y=Math.abs(parseInt(date1[11]) - parseInt(date2[12])) |
| | | return m+'年'+y+'月' |
| | | } |
| | | export function jgTime(data1:Data,data2:Data):number{ |
| | | // 获取两个日期的毫秒数 |
| | | var milliseconds1 = data1.getTime(); |
| | | var milliseconds2 = data2.getTime(); |
| | | // 计算两个日期的差值(毫秒数差) |
| | | var differenceInMilliseconds = milliseconds2 - milliseconds1; |
| | | var differenceInSeconds = Math.floor(differenceInMilliseconds / 1000); |
| | | return differenceInSeconds |
| | | } |
| | |
| | | import Speech from 'speak-tts' |
| | | import { reactive,computed, toRefs, onMounted, watch, ref } from "vue" |
| | | import { sendPationCodeApi } from '../../samples/httpApi' |
| | | import { formatDate } from '@/utils/formatTime' |
| | | import { formatDate,jgTime } from '@/utils/formatTime' |
| | | import { confingInfoStore } from '@/stores/StoresConfing' |
| | | import {base64toFile} from '@/samples/faceApi' |
| | | import{initPort} from '@/samples/portApi' |
| | |
| | | import{toDataTz,todatatzs } from '@/samples/deviceApi/seca101' |
| | | import { ElLoading, ElMessage } from 'element-plus' |
| | | import { el } from 'element-plus/es/locale' |
| | | import { Console } from 'console' |
| | | let trackerTask: any = null; |
| | | let lsDateTime:any=new Date() |
| | | // 标识用的画布 |
| | | const myCanvas = ref<HTMLCanvasElement | null>(null); |
| | | let imgSrc:''; |
| | | const msg = ref<string>("没识别到人脸..."); |
| | | // 实例人脸检查器 |
| | | // 实例人脸检查器 ObjectTracker |
| | | const myTracker: any = new tracking.ObjectTracker("face"); |
| | | myTracker.setInitialScale(4); |
| | | myTracker.setStepSize(2); |
| | |
| | | context.clearRect(0, 0, myCanvas.value.width, myCanvas.value.height); |
| | | } |
| | | if (event.data.length === 0) { |
| | | // console.log('没有监测到---') |
| | | msg.value = "没识别到人脸..."; |
| | | } else if(event.data.length === 1) { |
| | | } else if(event.data.length >= 1){ |
| | | trackerTask.stop(); |
| | | msg.value = "检测到人脸"; |
| | | console.log('监测到人脸2样') |
| | | console.log(event.data) |
| | | const myCanvas = document.getElementById("myCanvas");// |
| | | const thisContext = myCanvas?.getContext("2d"); |
| | | const myVideo = document.querySelector("#myVideo") as HTMLVideoElement; |
| | | thisContext.drawImage(myVideo, 0,0, 250, 200); |
| | | imgSrc = myCanvas?.toDataURL('image/png'); |
| | | const X= jgTime(lsDateTime,new Date()) |
| | | |
| | | // 转文件 |
| | | // 识别框显示才能到传阿里云识别 |
| | | if(dialogVisible.value){ |
| | | if(dialogVisible.value&&X>configData.value.face_push){ |
| | | lsDateTime=new Date() |
| | | console.log(X,'上传阿里识别间隔') |
| | | base64toFile(imgSrc) |
| | | } |
| | | setTimeout(() => { |
| | |
| | | console.log(0%5) |
| | | console.log('页面初始化', os.hostname()) |
| | | setTimeout(()=>{ |
| | | |
| | | console.log('8秒后执行') |
| | | console.log('打印设置文件') |
| | | console.log(configData.value) |
| | |
| | | <script setup lang="ts"> |
| | | import { computed, onMounted, ref } from "vue"; |
| | | import {base64toFile} from '@/samples/faceApi' |
| | | import { formatDate } from "@/utils/formatTime"; |
| | | import { formatDate ,jgTime} from "@/utils/formatTime"; |
| | | import { confingInfoStore } from "@/stores/StoresConfing"; |
| | | |
| | | const msg = ref<string>("没识别到人脸..."); |
| | |
| | | // 标识用的画布 |
| | | const myCanvas = ref<HTMLCanvasElement | null>(null); |
| | | let imgSrc:''; |
| | | let chuansongTime; |
| | | // 实例人脸检查器 |
| | | const myTracker: any = new tracking.ObjectTracker("face"); |
| | | myTracker.setInitialScale(4); |
| | |
| | | // 转文件 |
| | | // 识别框显示才能到传阿里云识别 |
| | | if(dialogVisible.value){ |
| | | // if(new Date()) |
| | | // chuansongTime=new Date() |
| | | base64toFile(imgSrc) |
| | | } |
| | | setTimeout(() => { |
| | |
| | | // 触发人脸检查器 |
| | | console.log('人脸识别初始化') |
| | | const isUseFaceRecogService = confingInfoStore().confingInfo.isUseFaceRecogService |
| | | console.log('人脸识别',isUseFaceRecogService) |
| | | // console.log('人脸识别',isUseFaceRecogService) |
| | | |
| | | let jg= jgTime(new Date(),new Date()) |
| | | console.log(jg) |
| | | setInterval(function () { |
| | | date.value= formatDate(new Date(),'YYYY-mm-dd HH:MM') |
| | | }, 1000) |