Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeanon committed Aug 29, 2024
1 parent 30edbc2 commit 4fccd91
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mainsail",
"version": "2.12.3",
"version": "2.12.4",
"private": true,
"decription": "a klipper web interface",
"author": {
Expand Down
14 changes: 12 additions & 2 deletions src/components/inputs/MiscellaneousSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
<v-icon v-else-if="type.includes('fan')" small :class="fanClasses">{{ mdiFan }}</v-icon>
<span>{{ convertName(name) }}</span>
<v-spacer />
<small v-if="rpm !== null" :class="rpmClasses">{{ Math.round(rpm ?? 0) }} RPM</small>
<small v-if="rpm !== null && !(showRealPWM && normalized_target != undefined)" :class="rpmClasses">{{ Math.round(rpm ?? 0) }} RPM</small>
<small v-if="rpm !== null && showRealPWM && normalized_target != undefined" :class="pwmClasses">{{ Math.round(rpm ?? 0) }} RPM</small>
<small v-if="showRealPWM && normalized_target != undefined" :class="rpmClasses"> {{ Math.round(parseFloat(target) * 100) }}% PWM</small>
<span v-if="!controllable" class="font-weight-bold">
{{ Math.round(parseFloat(value) * 100) }} %
{{ Math.round(value * 100) }} %
</span>
<v-icon v-if="controllable && !pwm" @click="switchOutputPin">
{{ value ? mdiToggleSwitch : mdiToggleSwitchOffOutline }}
Expand Down Expand Up @@ -320,6 +321,15 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
return output
}
get pwmClasses() {
const output = []
if (!this.controllable) output.push(['mr-3', 'mt-1'])
else output.push(['mr-3', 'mt-2'])
if (this.rpm === 0 && this.value > 0) output.push('red--text')
return output
}
get ledChannelName() {
if (this.colorOrder === 'R') return 'RED'
if (this.colorOrder === 'G') return 'GREEN'
Expand Down
9 changes: 7 additions & 2 deletions src/components/mixins/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,13 @@ export default class BaseMixin extends Vue {

get printer_state(): string {
const printer_state =
this.$store.state.printer.print_stats?.state ?? this.$store.state.printer.idle_timeout?.state ?? ''
const timelapse_pause = this.$store.state.printer['gcode_macro TIMELAPSE_TAKE_FRAME']?.is_paused ?? false
this.$store.state?.printer?.print_stats?.state ?? this.$store.state?.printer?.idle_timeout?.state ?? ''
const printer = this.$store.state?.printer
let timelapse_pause = false
if (printer != undefined) {
timelapse_pause = printer['gcode_macro TIMELAPSE_TAKE_FRAME']?.is_paused ?? false
}

return printer_state === 'paused' && timelapse_pause ? 'printing' : printer_state
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
</v-tooltip>
</td>
<td class="current">
<v-tooltip top :disabled="!(measured_min_temp !== null || measured_max_temp !== null)">
<v-tooltip top :disabled="(measured_min_temp === null && measured_max_temp === null) || (measured_min_temp === '0.0' && measured_max_temp === '0.0')">
<template #activator="{ on, attrs }">
<span style="cursor: default" v-bind="attrs" v-on="on">
{{ formatTemperature }}
</span>
</template>
<span>
{{ $t('Panels.TemperaturePanel.Max') }}: {{ measured_max_temp }}°C
{{ $t('Panels.TemperaturePanel.Max') }}: {{ measured_max_temp ?? "--" }}°C
<br />
{{ $t('Panels.TemperaturePanel.Min') }}: {{ measured_min_temp }}°C
{{ $t('Panels.TemperaturePanel.Min') }}: {{ measured_min_temp ?? "--" }}°C
</span>
</v-tooltip>
<div v-if="rpm !== null">
Expand Down
2 changes: 1 addition & 1 deletion src/store/gui/maintenance/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const actions: ActionTree<GuiMaintenanceState, RootState> = {
entry.end_time = Date.now() / 1000
entry.end_filament = totalFilament
entry.end_printtime = totalPrintTime
entry.perform_note = payload.note.trim() || null
entry.perform_note = payload.note?.trim() || null

dispatch('update', entry)

Expand Down
2 changes: 1 addition & 1 deletion src/store/printer/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const getters: GetterTree<PrinterState, RootState> = {

// remove macros with rename_existing in the config
const propLower = prop.toLowerCase()
const propSettings = settings[propLower] ?? {}
const propSettings = settings != undefined ? settings[propLower] ?? {} : {}
if ('rename_existing' in propSettings) return

array.push({
Expand Down

0 comments on commit 4fccd91

Please sign in to comment.