From 98d140e8fd033e42755f93c9e137306f59efd266 Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Fri, 3 Jan 2025 11:35:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E5=AE=9A=E7=94=B5=E5=8E=8B=E9=9A=8F?= =?UTF-8?q?=E7=9D=80=E6=8C=AF=E5=B9=85=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ECG/ECGhtml.vue | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/views/ECG/ECGhtml.vue b/src/views/ECG/ECGhtml.vue index e9946cfa..ff182984 100644 --- a/src/views/ECG/ECGhtml.vue +++ b/src/views/ECG/ECGhtml.vue @@ -409,6 +409,15 @@ const suduratioMap = { 1: '25', 2: '50' } +const dyMap = { + 0.012: '10', + 0.025: '20', + 0.05: '40', + 0.1: '80', + 0.2: '160' +} + +infoParams.lineratio function convert(command, type) { if (type === 0) { return suduratioMap[command] || null @@ -580,16 +589,16 @@ function begin(c_canvas, beatArray) { beatArray.forEach((dataArray, index) => { if (index <= 6) { const x = 0 - const y = offset - dataArray[index - 1] * 0.025 + const y = (offset - dataArray[index - 1] * 0.025) ctx.beginPath() ctx.moveTo(x, y) ctx.lineTo(x + 5, y) - ctx.moveTo(x + 5, y - 40) - ctx.lineTo(x + 15, y - 40) - ctx.moveTo(x + 5, y - 40) - ctx.lineTo(x + 5, y) - ctx.moveTo(x + 15, y - 40) - ctx.lineTo(x + 15, y) + ctx.moveTo(x + 5, (y - dyMap[infoParams.lineratio]))//上面的横线 + ctx.lineTo(x + 15, (y - dyMap[infoParams.lineratio]))//上面的横线 + ctx.moveTo(x + 5, (y - dyMap[infoParams.lineratio]))//左边的竖线 + ctx.lineTo(x + 5, y)//左边的竖线 + ctx.moveTo(x + 15, y - dyMap[infoParams.lineratio])//右边的竖线 + ctx.lineTo(x + 15, y)//右边的竖线 ctx.moveTo(x + 15, y) ctx.lineTo(x + 20, y) ctx.stroke() @@ -622,11 +631,11 @@ function beginr(c_canvas, beatArray) { ctx.beginPath() ctx.moveTo(x, y) ctx.lineTo(x + 5, y) - ctx.moveTo(x + 5, y - 40) - ctx.lineTo(x + 15, y - 40) - ctx.moveTo(x + 5, y - 40) + ctx.moveTo(x + 5, y - dyMap[infoParams.lineratio]) + ctx.lineTo(x + 15, y - dyMap[infoParams.lineratio]) + ctx.moveTo(x + 5, y - dyMap[infoParams.lineratio]) ctx.lineTo(x + 5, y) - ctx.moveTo(x + 15, y - 40) + ctx.moveTo(x + 15, y - dyMap[infoParams.lineratio]) ctx.lineTo(x + 15, y) ctx.moveTo(x + 15, y) ctx.lineTo(x + 20, y)