Skip to content

Commit 03a6475

Browse files
moggieukpedrolamasCopilot
authored
feat(Happy Hare): Adds new flowguard meter for monitoring clog and tangles (#1759)
Signed-off-by: Paul Morgan <moggieuk@hotmail.com> Co-authored-by: Pedro Lamas <pedrolamas@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 66d7a5c commit 03a6475

File tree

14 files changed

+420
-33
lines changed

14 files changed

+420
-33
lines changed

src/components/widgets/mmu/MmuCard.vue

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,18 @@
177177
</div>
178178
<mmu-filament-status />
179179
<template v-if="showClogDetection">
180-
<mmu-clog-meter
181-
v-if="hasEncoder"
182-
width="40%"
183-
/>
184-
<div class="text--disabled">
185-
{{ $t('app.mmu.label.clog_detection') }}
180+
<div class="text-center">
181+
<mmu-clog-meter
182+
v-if="hasEncoder"
183+
width="40%"
184+
/>
185+
<mmu-flowguard-meter
186+
v-if="hasSyncFeedback"
187+
width="40%"
188+
/>
189+
<div class="text--disabled body-1">
190+
{{ $t('app.mmu.label.clog_tangle_detection') }}
191+
</div>
186192
</div>
187193
</template>
188194
</v-col>
@@ -261,6 +267,7 @@ import MmuTtgMap from '@/components/widgets/mmu/MmuTtgMap.vue'
261267
import MmuControls from '@/components/widgets/mmu/MmuControls.vue'
262268
import MmuGateSummary from '@/components/widgets/mmu/MmuGateSummary.vue'
263269
import MmuClogMeter from '@/components/widgets/mmu/MmuClogMeter.vue'
270+
import MmuFlowguardMeter from '@/components/widgets/mmu/MmuFlowguardMeter.vue'
264271
import MmuSettings from '@/components/widgets/mmu/MmuSettings.vue'
265272
import MmuRecoverStateDialog from '@/components/widgets/mmu/MmuRecoverStateDialog.vue'
266273
import MmuEditGateMapDialog from '@/components/widgets/mmu/MmuEditGateMapDialog.vue'
@@ -274,6 +281,7 @@ import MmuMaintenanceDialog from '@/components/widgets/mmu/MmuMaintenanceDialog.
274281
MmuControls,
275282
MmuGateSummary,
276283
MmuClogMeter,
284+
MmuFlowguardMeter,
277285
MmuSettings,
278286
MmuRecoverStateDialog,
279287
MmuEditGateMapDialog,
@@ -299,7 +307,7 @@ export default class MmuCard extends Mixins(StateMixin, MmuMixin) {
299307
}
300308
301309
get showClogDetection (): boolean {
302-
return this.hasEncoder && this.$typedState.config.uiSettings.mmu.showClogDetection
310+
return (this.hasEncoder || this.hasSyncFeedback) && this.$typedState.config.uiSettings.mmu.showClogDetection
303311
}
304312
305313
get showTtgMap (): boolean {
@@ -344,6 +352,26 @@ export default class MmuCard extends Mixins(StateMixin, MmuMixin) {
344352
show: true,
345353
})
346354
}
355+
356+
get hasSyncFeedback (): boolean {
357+
return this.hasFilamentCompressionSensor || this.hasFilamentTensionSensor || this.hasFilamentProportionalSensor
358+
}
359+
360+
get hasFilamentProportionalSensor (): boolean {
361+
return this.hasSensor('filament_proportional')
362+
}
363+
364+
get hasFilamentCompressionSensor (): boolean {
365+
return this.hasSensor('filament_compression')
366+
}
367+
368+
get hasFilamentTensionSensor (): boolean {
369+
return this.hasSensor('filament_tension')
370+
}
371+
372+
private hasSensor (sensorName: string): boolean {
373+
return sensorName in this.sensors
374+
}
347375
}
348376
</script>
349377

src/components/widgets/mmu/MmuClogMeter.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
class="warning-color"
3737
fill="transparent"
3838
stroke-width="18"
39-
opacity="0.4"
39+
opacity="0.3"
4040
:stroke-dasharray="circumference"
4141
:stroke-dashoffset="headroomArc"
4242
/>
@@ -51,7 +51,7 @@
5151
:class="{ 'warning-color': headroomWarning, 'primary-color': !headroomWarning }"
5252
stroke-width="4"
5353
stroke-dashoffset="0"
54-
stroke-dasharray="25,65"
54+
stroke-dasharray="23,63"
5555
/>
5656
<line
5757
:x1="x1Start"
@@ -61,7 +61,7 @@
6161
stroke="white"
6262
stroke-width="2"
6363
stroke-dashoffset="0"
64-
stroke-dasharray="24,65"
64+
stroke-dasharray="22,63"
6565
/>
6666
<line
6767
:x1="x1End"
@@ -71,7 +71,7 @@
7171
class="warning-color"
7272
stroke-width="2"
7373
stroke-dashoffset="0"
74-
stroke-dasharray="24,65"
74+
stroke-dasharray="22,63"
7575
/>
7676

7777
<text
@@ -91,25 +91,25 @@
9191
<text
9292
v-if="encoderDetectionMode === 2"
9393
x="70"
94-
y="124"
94+
y="122"
9595
text-anchor="middle"
9696
class="small-text-color"
9797
font-size="12px"
9898
>
9999
Auto
100100
</text>
101101
<text
102-
x="30"
103-
y="136"
102+
x="32"
103+
y="139"
104104
text-anchor="end"
105105
class="small-text-color"
106106
font-size="12px"
107107
>
108108
{{ encoderDetectionLength }}
109109
</text>
110110
<text
111-
x="108"
112-
y="136"
111+
x="106"
112+
y="139"
113113
class="small-text-color"
114114
font-size="12px"
115115
>0</text>
@@ -133,13 +133,13 @@ export default class MmuClogMeter extends Mixins(StateMixin, MmuMixin) {
133133
private dialArc: number = this.circumference * (60 / 360)
134134
private dashOffset: number = this.circumference
135135
136-
private x1Start: number = 70 + 65 * Math.cos((120 * Math.PI) / 180)
137-
private y1Start: number = 70 + 65 * Math.sin((120 * Math.PI) / 180)
138-
private x1End: number = 70 + 65 * Math.cos((60 * Math.PI) / 180)
139-
private y1End: number = 70 + 65 * Math.sin((60 * Math.PI) / 180)
136+
private x1Start: number = 70 + 63 * Math.cos((120 * Math.PI) / 180)
137+
private y1Start: number = 70 + 63 * Math.sin((120 * Math.PI) / 180)
138+
private x1End: number = 70 + 63 * Math.cos((60 * Math.PI) / 180)
139+
private y1End: number = 70 + 63 * Math.sin((60 * Math.PI) / 180)
140140
141-
x1MinHeadroom: number = 70 + 66 * Math.cos(((120 + 0) * Math.PI) / 180)
142-
y1MinHeadroom: number = 70 + 66 * Math.sin(((120 + 0) * Math.PI) / 180)
141+
x1MinHeadroom: number = 70 + 64 * Math.cos(((120 + 0) * Math.PI) / 180)
142+
y1MinHeadroom: number = 70 + 64 * Math.sin(((120 + 0) * Math.PI) / 180)
143143
headroomWarning: boolean = false
144144
145145
get headroomArc (): number {

0 commit comments

Comments
 (0)