From e3f03f72d41bbedece4b7a4d0baf02b18c0b2bf9 Mon Sep 17 00:00:00 2001 From: huanshuo-W <15258427350@163.com> Date: Thu, 10 Jul 2025 14:35:31 +0800 Subject: [PATCH] =?UTF-8?q?Feature:=20=E7=BA=B8=E5=B8=A6=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E8=A7=92=E5=BA=A6=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/PaperTapeWidthAngleCalculate.vue | 123 +++++++++++++++++- src/locale/en.json | 6 +- src/locale/zh.json | 6 +- src/utils/angle.ts | 8 ++ 4 files changed, 135 insertions(+), 8 deletions(-) create mode 100644 src/utils/angle.ts diff --git a/src/components/Modules/PaperTapeWidthAngleCalculate.vue b/src/components/Modules/PaperTapeWidthAngleCalculate.vue index 1abb27b..070425a 100644 --- a/src/components/Modules/PaperTapeWidthAngleCalculate.vue +++ b/src/components/Modules/PaperTapeWidthAngleCalculate.vue @@ -1,11 +1,122 @@ - - - + const paperCoreDiameter = ref(createParam(76.2, 'mm')) + const paperRollWallThickness = ref(createParam(10, 'mm')) + const innerPaperWidth = ref(createParam(105, 'mm')) + + const result = computed(() => { + const paperRollExternalDiameter = paperCoreDiameter.value.value + 2 * paperRollWallThickness.value.value + const paperHolderAngle = 90 - radiansToDegrees(Math.acos(innerPaperWidth.value.value / (paperCoreDiameter.value.value * Math.PI))) + const leadingLength = innerPaperWidth.value.value / Math.sin(degreesToRadians(90 - paperHolderAngle)) + const beltAngle = 90 - radiansToDegrees(Math.atan(paperRollExternalDiameter * Math.PI / leadingLength)) + const paperWidth = leadingLength * Math.sin(Math.atan(paperRollExternalDiameter * Math.PI / leadingLength)) + + return { + beltAngle: createParam(beltAngle, '°'), + paperHolderAngle: createParam(paperHolderAngle, '°'), + leadingLength: createParam(leadingLength, 'mm'), + paperWidth: createParam(paperWidth, 'mm'), + } + }) + + const resetParameters = () => { + paperCoreDiameter.value = createParam(76.2, 'mm') + paperRollWallThickness.value = createParam(10, 'mm') + innerPaperWidth.value = createParam(105, 'mm') + } + + diff --git a/src/locale/en.json b/src/locale/en.json index 853f036..bc48997 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -31,5 +31,9 @@ "productionAmountPerDay": "Daily output", "productionAmountPerHour": "Hourly output", "productionWeightPerDay": "Daily output", - "productionWeightPerHour": "Hourly output" + "productionWeightPerHour": "Hourly output", + "beltAngle": "Belt angle", + "paperHolderAngle": "Paper holder angle", + "leadingLength": "Leading length", + "paperWidth": "Paper width" } diff --git a/src/locale/zh.json b/src/locale/zh.json index feab888..b50abdc 100644 --- a/src/locale/zh.json +++ b/src/locale/zh.json @@ -31,5 +31,9 @@ "productionAmountPerHour": "每小时产量", "productionWeightPerHour": "每小时产量", "productionAmountPerDay": "每天产量", - "productionWeightPerDay": "每天产量" + "productionWeightPerDay": "每天产量", + "beltAngle": "皮带角度", + "paperHolderAngle": "纸架角度", + "leadingLength": "导程", + "paperWidth": "面纸宽度" } diff --git a/src/utils/angle.ts b/src/utils/angle.ts new file mode 100644 index 0000000..8e996f0 --- /dev/null +++ b/src/utils/angle.ts @@ -0,0 +1,8 @@ +// 角度转弧度 +export function degreesToRadians (degrees: number): number { + return degrees * (Math.PI / 180) +} +// 弧度转角度 +export function radiansToDegrees (radians: number): number { + return radians * (180 / Math.PI) +}