Skip to content

Commit b9e0b2c

Browse files
committed
fix(Heaters): improves PID_CALIBRATE check
Signed-off-by: Pedro Lamas <[email protected]>
1 parent d6b7cd9 commit b9e0b2c

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/components/widgets/thermals/HeaterContextMenu.vue

+8-12
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
>
1111
<v-list dense>
1212
<v-list-item
13-
:disabled="!klippyReady || printerPrinting"
13+
:disabled="!klippyReady || printerPrinting || !heaterIsOn"
1414
@click="$emit('turn-off', heater)"
1515
>
1616
<v-list-item-icon>
@@ -23,10 +23,9 @@
2323
</v-list-item-content>
2424
</v-list-item>
2525

26-
<v-divider v-if="supportsPidCalibrate || supportsMpcCalibrate" />
26+
<v-divider />
2727

2828
<v-list-item
29-
v-if="supportsPidCalibrate"
3029
:disabled="!klippyReady || printerPrinting"
3130
@click="$emit('pid-calibrate', heater)"
3231
>
@@ -41,8 +40,8 @@
4140
</v-list-item>
4241

4342
<v-list-item
44-
v-if="supportsMpcCalibrate"
45-
:disabled="!klippyReady || printerPrinting"
43+
v-if="klippyApp.isKalicoOrDangerKlipper"
44+
:disabled="!klippyReady || printerPrinting || !heaterUsesMpcControl"
4645
@click="$emit('mpc-calibrate', heater)"
4746
>
4847
<v-list-item-icon>
@@ -81,15 +80,12 @@ export default class HeaterContextMenu extends Mixins(StateMixin) {
8180
return this.$store.getters['printer/getKlippyApp'] as KlippyApp
8281
}
8382
84-
get supportsPidCalibrate () {
85-
return ['pid', 'pid_v'].includes(this.heater.config?.control)
83+
get heaterIsOn () {
84+
return this.heater.target > 0
8685
}
8786
88-
get supportsMpcCalibrate () {
89-
return (
90-
this.klippyApp.isKalicoOrDangerKlipper &&
91-
this.heater.config?.control === 'mpc'
92-
)
87+
get heaterUsesMpcControl () {
88+
return this.heater.config?.control === 'mpc'
9389
}
9490
}
9591
</script>

0 commit comments

Comments
 (0)