Skip to content

Commit faafad5

Browse files
authored
feat: disable controls for disconnected Kalico MCU (#1716)
Signed-off-by: Pedro Lamas <[email protected]>
1 parent 9577216 commit faafad5

File tree

16 files changed

+127
-58
lines changed

16 files changed

+127
-58
lines changed

src/components/widgets/outputs/OutputFan.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:rules="[
1010
customRules.minFan
1111
]"
12-
:disabled="!klippyReady"
12+
:disabled="!klippyReady || fan.disconnected"
1313
:locked="isMobileUserAgent"
1414
:loading="hasWait(`${$waits.onSetFanSpeed}${fan.name}`)"
1515
@submit="handleChange"
@@ -19,7 +19,7 @@
1919
v-else
2020
align-center
2121
justify-space-between
22-
:class="{ 'text--disabled': !klippyReady }"
22+
:class="{ 'text--disabled': !klippyReady || fan.disconnected }"
2323
>
2424
<div class="text-body-1">
2525
{{ fan.prettyName }}

src/components/widgets/outputs/OutputLed.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
align-self="center"
88
cols="5"
99
class="text-body-1"
10-
:class="{ 'text--disabled': !klippyReady }"
10+
:class="{ 'text--disabled': !klippyReady || led.disconnected }"
1111
>
1212
{{ led.prettyName }}
1313
</v-col>
@@ -17,7 +17,7 @@
1717
:white.sync="whiteValue"
1818
:title="led.prettyName"
1919
:supported-channels="supportedChannels"
20-
:disabled="!klippyReady"
20+
:disabled="!klippyReady || led.disconnected"
2121
dot
2222
/>
2323
</v-col>

src/components/widgets/outputs/OutputPin.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
:max="100"
99
:value="value"
1010
:reset-value="resetValue"
11-
:disabled="!klippyReady"
11+
:disabled="!klippyReady || pin.disconnected"
1212
:locked="isMobileUserAgent"
1313
:loading="hasWait(`${$waits.onSetOutputPin}${pin.name}`)"
1414
@submit="handleChange"
1515
/>
1616

1717
<app-named-switch
1818
v-else
19-
:disabled="!klippyReady"
19+
:disabled="!klippyReady || pin.disconnected"
2020
:label="pin.prettyName"
2121
:value="pin.value > 0"
2222
:loading="hasWait(`${$waits.onSetOutputPin}${pin.name}`)"

src/components/widgets/system/McuCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
</v-icon>
4949
{{
5050
mcu.non_critical_disconnected
51-
? $t('app.system_info.label.disconnected')
52-
: $t('app.system_info.label.connected')
51+
? $t('app.general.label.disconnected')
52+
: $t('app.general.label.connected')
5353
}}
5454
</v-chip>
5555
</td>

src/components/widgets/thermals/HeaterContextMenu.vue

Lines changed: 3 additions & 3 deletions
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 || !heaterIsOn"
13+
:disabled="!klippyReady || printerPrinting || !heaterIsOn || heater.disconnected"
1414
@click="$emit('turn-off', heater)"
1515
>
1616
<v-list-item-icon>
@@ -26,7 +26,7 @@
2626
<v-divider />
2727

2828
<v-list-item
29-
:disabled="!klippyReady || printerPrinting"
29+
:disabled="!klippyReady || printerPrinting || heater.disconnected"
3030
@click="$emit('pid-calibrate', heater)"
3131
>
3232
<v-list-item-icon>
@@ -41,7 +41,7 @@
4141

4242
<v-list-item
4343
v-if="klippyApp.isKalicoOrDangerKlipper"
44-
:disabled="!klippyReady || printerPrinting || !heaterUsesMpcControl"
44+
:disabled="!klippyReady || printerPrinting || !heaterUsesMpcControl || heater.disconnected"
4545
@click="$emit('mpc-calibrate', heater)"
4646
>
4747
<v-list-item-icon>

src/components/widgets/thermals/TemperatureTargets.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,18 @@
7272
</span>
7373
</td>
7474
<td class="temp-actual">
75-
{{ (item.temperature) ? item.temperature.toFixed(1) : 0 }}<small>°C</small>
75+
<span v-if="item.temperature != null && !item.disconnected">
76+
{{ item.temperature.toFixed(1) }}<small>°C</small>
77+
</span>
78+
<span v-else>
79+
-
80+
</span>
7681
</td>
7782
<td>/</td>
7883
<td @contextmenu.stop>
7984
<app-text-field
8085
v-if="klippyReady"
86+
:disabled="item.disconnected"
8187
:value="item.target"
8288
:rules="[
8389
$rules.required,
@@ -147,7 +153,7 @@
147153
</span>
148154
</td>
149155
<td class="temp-actual">
150-
<span v-if="item.temperature">
156+
<span v-if="item.temperature != null && !item.disconnected">
151157
{{ item.temperature.toFixed(1) }}<small>°C</small>
152158
<small v-if="item.humidity != null && showRelativeHumidity"><br>{{ item.humidity.toFixed(1) }} %</small>
153159
<small v-if="item.pressure != null && showBarometricPressure"><br>{{ $filters.getReadableAtmosphericPressureString(item.pressure) }}</small>
@@ -161,6 +167,7 @@
161167
<td @contextmenu.stop>
162168
<app-text-field
163169
v-if="klippyReady && item.type === 'temperature_fan'"
170+
:disabled="item.disconnected"
164171
:value="item.target"
165172
:rules="[
166173
$rules.required,
@@ -221,7 +228,7 @@
221228
v-bind="attrs"
222229
v-on="on"
223230
>
224-
<span v-if="item.temperature != null">
231+
<span v-if="item.temperature != null && !item.disconnected">
225232
{{ item.temperature.toFixed(1) }}<small>°C</small>
226233
<small v-if="item.humidity != null && showRelativeHumidity"><br>{{ item.humidity.toFixed(1) }} %</small>
227234
<small v-if="item.pressure != null && showBarometricPressure"><br>{{ $filters.getReadableAtmosphericPressureString(item.pressure) }}</small>

src/components/widgets/toolhead/ExtruderMoves.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</v-col>
3131
<v-col cols="6">
3232
<app-btn
33-
:disabled="!klippyReady || !extruderReady || !valid"
33+
:disabled="!klippyReady || !extruderReady || extruderDisconnected || !valid"
3434
block
3535
@click="retract"
3636
>
@@ -68,7 +68,7 @@
6868
</v-col>
6969
<v-col cols="6">
7070
<app-btn
71-
:disabled="!klippyReady || !extruderReady || !valid"
71+
:disabled="!klippyReady || !extruderReady || extruderDisconnected || !valid"
7272
block
7373
@click="extrude"
7474
>

src/components/widgets/toolhead/ExtruderStepperSync.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<app-named-switch
2727
:value="extruderStepper.enabled"
2828
:label="$t('app.general.label.stepper_enabled')"
29-
:disabled="!klippyReady || printerPrinting"
29+
:disabled="!klippyReady || printerPrinting || extruderStepper.disconnected"
3030
:loading="hasWait(`${$waits.onStepperEnable}${extruderStepper.name}`)"
3131
@change="sendSetStepperEnable"
3232
/>

src/components/widgets/toolhead/ExtruderSteppers.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,19 @@ export default class ExtruderSteppers extends Vue {
6868
6969
return extruderSteppers
7070
.map(x => {
71-
const motionQueueName = (x.motion_queue && extruders.find(y => y.key === x.motion_queue)?.name) ?? this.$t('app.setting.label.none')
72-
const enabledDesc = x.enabled !== undefined && this.$t(`app.general.label.${x.enabled ? 'on' : 'off'}`)
73-
const description = enabledDesc ? `${motionQueueName}, ${enabledDesc}` : motionQueueName
71+
const labels = [
72+
(x.motion_queue && extruders.find(y => y.key === x.motion_queue)?.name) || this.$t('app.setting.label.none')
73+
]
74+
75+
if (x.enabled !== undefined) {
76+
labels.push(this.$t(`app.general.label.${x.enabled ? 'on' : 'off'}`).toString())
77+
}
78+
79+
if (x.disconnected) {
80+
labels.push(this.$t('app.general.label.disconnected').toString())
81+
}
82+
83+
const description = labels.join(', ')
7484
7585
return {
7686
...x,

src/components/widgets/toolhead/ToolheadCard.vue

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,28 @@
1212
</v-icon>
1313
<span class="font-weight-light">{{ $t('app.general.title.tool') }}</span>
1414

15-
<v-tooltip bottom>
15+
<v-tooltip
16+
v-if="extruderDisconnected"
17+
bottom
18+
>
19+
<template #activator="{ on, attrs }">
20+
<v-icon
21+
v-bind="attrs"
22+
class="ml-3"
23+
color="warning"
24+
small
25+
v-on="on"
26+
>
27+
$warning
28+
</v-icon>
29+
</template>
30+
<span v-html="$t('app.general.label.disconnected')" />
31+
</v-tooltip>
32+
33+
<v-tooltip
34+
v-else
35+
bottom
36+
>
1637
<template #activator="{ on, attrs }">
1738
<v-icon
1839
v-show="hasExtruder && !extruderReady"
@@ -251,7 +272,7 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) {
251272
name: loadFilamentMacro.name.toUpperCase(),
252273
label: loadFilamentMacro.name.toLowerCase() === 'm701' ? 'M701 (Load Filament)' : undefined,
253274
icon: '$loadFilament',
254-
disabled: !(ignoreMinExtrudeTemp || this.extruderReady)
275+
disabled: !(ignoreMinExtrudeTemp || this.extruderReady) || this.extruderDisconnected
255276
})
256277
}
257278
@@ -264,7 +285,7 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) {
264285
name: unloadFilamentMacro.name.toUpperCase(),
265286
label: unloadFilamentMacro.name.toLowerCase() === 'm702' ? 'M702 (Unload Filament)' : undefined,
266287
icon: '$unloadFilament',
267-
disabled: !(ignoreMinExtrudeTemp || this.extruderReady)
288+
disabled: !(ignoreMinExtrudeTemp || this.extruderReady) || this.extruderDisconnected
268289
})
269290
}
270291

0 commit comments

Comments
 (0)