Skip to content

Commit

Permalink
Merge branch 'develop' into feat/add-spoolman
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou committed Sep 19, 2023
2 parents b4ef4a6 + 7ae9589 commit 3d27588
Show file tree
Hide file tree
Showing 21 changed files with 518 additions and 274 deletions.
277 changes: 184 additions & 93 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"axios": "^0.27.0",
"codemirror": "^6.0.1",
"core-js": "^3.16.0",
"detect-browser": "^5.3.0",
"echarts": "^5.2.2",
"echarts-gl": "^2.0.8",
"hls.js": "^1.3.3",
Expand Down Expand Up @@ -81,7 +82,7 @@
"@typescript-eslint/parser": "^5.11.0",
"@vue/eslint-config-typescript": "^11.0.0",
"autoprefixer": "^10.4.2",
"cypress": "^10.0.0",
"cypress": "^13.2.0",
"eslint": "^8.9.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jsonc": "^2.2.1",
Expand Down
4 changes: 3 additions & 1 deletion src/components/TheTopCornerMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ export default class TheTopCornerMenu extends Mixins(BaseMixin) {
}
get powerDevices() {
return this.$store.getters['server/power/getDevices']
const devices = this.$store.getters['server/power/getDevices'] ?? []
return devices.filter((device: ServerPowerStateDevice) => !device.device.startsWith('_'))
}
get service_states() {
Expand Down
8 changes: 6 additions & 2 deletions src/components/inputs/MacroButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,13 @@ export default class MacroButton extends Mixins(BaseMixin) {
sendWithParams() {
let params: string[] = []
this.paramArray.forEach((paramname: string) => {
if (this.params[paramname].value !== null && this.params[paramname].value !== '') {
let value = this.params[paramname].value?.toString().trim()
if (this.params[paramname].value !== null && value !== '') {
let tmp: string = paramname
tmp += this.isGcodeStyle ? this.params[paramname].value : `=${this.params[paramname].value}`
if (value?.includes(' ')) value = `"${value}"`
tmp += this.isGcodeStyle ? value : `=${value}`
params.push(tmp)
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/inputs/ToolSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
import { Debounce } from 'vue-debounce-decorator'
import BaseMixin from '@/components/mixins/base'
import { mdiLockOpenVariantOutline, mdiLockOutline, mdiMinus, mdiPlus, mdiRestart } from '@mdi/js'
import { TranslateResult } from 'vue-i18n'
@Component
export default class ToolSlider extends Mixins(BaseMixin) {
Expand All @@ -107,7 +108,7 @@ export default class ToolSlider extends Mixins(BaseMixin) {
@Prop({ type: Number, required: true }) declare readonly target: number
@Prop({ type: String, required: true }) declare readonly command: string
@Prop({ type: String, default: '' }) declare readonly attributeName: string
@Prop({ type: String, default: '' }) declare readonly label: string
@Prop({ default: '' }) declare readonly label: string | TranslateResult
@Prop({ type: String, default: '' }) declare readonly icon: string
@Prop({ type: String, default: '%' }) declare readonly unit: string
@Prop({ type: Number, default: 1 }) declare readonly attributeScale: number
Expand Down
58 changes: 39 additions & 19 deletions src/components/panels/MiniconsolePanel.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
<style scoped lang="scss">
.consoleTable {
border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.gcode-command-field {
font-family: 'Roboto Mono', monospace;
}
</style>

<template>
<panel
v-if="socketIsConnected && klipperState !== 'disconnected'"
Expand All @@ -20,38 +10,45 @@
<v-btn icon tile @click="clearConsole">
<v-icon small>{{ mdiTrashCan }}</v-icon>
</v-btn>
<command-help-modal :in-toolbar="true" @onCommand="gcode = $event"></command-help-modal>
<command-help-modal :in-toolbar="true" @onCommand="gcode = $event" />
<v-menu
:offset-y="true"
:close-on-content-click="false"
:title="$t('Panels.MiniconsolePanel.SetupConsole')">
<template #activator="{ on, attrs }">
<v-btn icon tile v-bind="attrs" v-on="on">
<v-icon small>{{ mdiFilter }}</v-icon>
<v-icon small>{{ mdiCog }}</v-icon>
</v-btn>
</template>
<v-list>
<v-list-item v-if="consoleDirection === 'shell'" class="minHeight36">
<v-checkbox
v-model="autoscroll"
class="mt-0"
hide-details
:label="$t('Panels.MiniconsolePanel.Autoscroll')" />
</v-list-item>
<v-list-item class="minHeight36">
<v-checkbox
v-model="hideWaitTemperatures"
class="mt-0"
hide-details
:label="$t('Panels.MiniconsolePanel.HideTemperatures')"></v-checkbox>
:label="$t('Panels.MiniconsolePanel.HideTemperatures')" />
</v-list-item>
<v-list-item v-if="moonrakerComponents.includes('timelapse')" class="minHeight36">
<v-checkbox
v-model="hideTlCommands"
class="mt-0"
hide-details
:label="$t('Panels.MiniconsolePanel.HideTimelapse')"></v-checkbox>
:label="$t('Panels.MiniconsolePanel.HideTimelapse')" />
</v-list-item>
<v-list-item v-for="(filter, index) in customFilters" :key="index" class="minHeight36">
<v-checkbox
v-model="filter.bool"
class="mt-0"
hide-details
:label="filter.name"
@change="toggleFilter(filter)"></v-checkbox>
@change="toggleFilter(filter)" />
</v-list-item>
</v-list>
</v-menu>
Expand Down Expand Up @@ -93,7 +90,7 @@
:events="events"
:is-mini="true"
@command-click="commandClick" />
<v-divider></v-divider>
<v-divider />
</overlay-scrollbars>
</v-col>
</v-row>
Expand All @@ -109,7 +106,7 @@ import BaseMixin from '@/components/mixins/base'
import { CommandHelp, VTextareaType } from '@/store/printer/types'
import ConsoleTable from '@/components/console/ConsoleTable.vue'
import Panel from '@/components/ui/Panel.vue'
import { mdiChevronDoubleRight, mdiConsoleLine, mdiFilter, mdiSend, mdiTrashCan } from '@mdi/js'
import { mdiChevronDoubleRight, mdiCog, mdiConsoleLine, mdiSend, mdiTrashCan } from '@mdi/js'
import CommandHelpModal from '@/components/CommandHelpModal.vue'
@Component({
Expand All @@ -122,7 +119,7 @@ import CommandHelpModal from '@/components/CommandHelpModal.vue'
export default class MiniconsolePanel extends Mixins(BaseMixin) {
mdiTrashCan = mdiTrashCan
mdiConsoleLine = mdiConsoleLine
mdiFilter = mdiFilter
mdiCog = mdiCog
mdiSend = mdiSend
mdiChevronDoubleRight = mdiChevronDoubleRight
Expand Down Expand Up @@ -155,13 +152,18 @@ export default class MiniconsolePanel extends Mixins(BaseMixin) {
@Watch('events')
eventsChanged() {
if (this.consoleDirection === 'shell') {
if (this.consoleDirection === 'shell' && this.autoscroll) {
setTimeout(() => {
this.scrollToBottom()
}, 50)
}
}
@Watch('autoscroll')
autoscrollChanged(newVal: boolean) {
if (newVal) this.scrollToBottom()
}
clearConsole() {
this.$store.dispatch('gui/console/clear')
}
Expand Down Expand Up @@ -194,6 +196,14 @@ export default class MiniconsolePanel extends Mixins(BaseMixin) {
return this.$store.state.gui.gcodehistory.entries ?? []
}
get autoscroll(): boolean {
return this.$store.state.gui.console.autoscroll ?? true
}
set autoscroll(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'console.autoscroll', value: newVal })
}
commandClick(msg: string): void {
this.gcode = msg
Expand Down Expand Up @@ -325,3 +335,13 @@ export default class MiniconsolePanel extends Mixins(BaseMixin) {
}
}
</script>

<style scoped>
.consoleTable {
border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.gcode-command-field {
font-family: 'Roboto Mono', monospace;
}
</style>
32 changes: 15 additions & 17 deletions src/components/panels/ToolheadControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@
<panel
v-if="klipperReadyForGui"
:icon="mdiGamepad"
:title="$t('Panels.ToolheadControlPanel.Headline').toString()"
:title="$t('Panels.ToolheadControlPanel.Headline')"
:collapsible="true"
card-class="toolhead-control-panel">
<!-- PANEL-HEADER 3-DOT-MENU -->
<template
v-if="
(controlStyle !== 'bars' && (existsZtilt || existsQGL)) ||
existsBedScrews ||
existsBedTilt ||
existsDeltaCalibrate ||
existsScrewsTilt
"
#buttons>
<template v-if="showButtons" #buttons>
<v-menu left offset-y :close-on-content-click="false" class="pa-0">
<template #activator="{ on, attrs }">
<v-btn icon tile v-bind="attrs" :disabled="['printing'].includes(printer_state)" v-on="on">
Expand Down Expand Up @@ -92,21 +84,21 @@
</v-menu>
</template>
<!-- MOVE TO CONTROL -->
<move-to-control class="py-0 pt-3"></move-to-control>
<move-to-control class="py-0 pt-3" />
<!-- AXIS CONTROL -->
<v-container v-if="axisControlVisible">
<component :is="`${controlStyle}-control`"></component>
<component :is="`${controlStyle}-control`" />
</v-container>
<!-- Z-OFFSET CONTROL -->
<v-divider :class="{ 'mt-3': !axisControlVisible }"></v-divider>
<v-divider :class="{ 'mt-3': !axisControlVisible }" />
<v-container>
<zoffset-control></zoffset-control>
<zoffset-control />
</v-container>
<!-- SPEED FACTOR -->
<v-divider></v-divider>
<v-divider />
<v-container>
<tool-slider
:label="$t('Panels.ToolheadControlPanel.SpeedFactor').toString()"
:label="$t('Panels.ToolheadControlPanel.SpeedFactor')"
:icon="mdiSpeedometer"
:target="speedFactor"
:min="1"
Expand All @@ -116,7 +108,7 @@
:dynamic-range="true"
:has-input-field="true"
command="M220"
attribute-name="S"></tool-slider>
attribute-name="S" />
</v-container>
</panel>
</template>
Expand Down Expand Up @@ -172,5 +164,11 @@ export default class ToolheadControlPanel extends Mixins(BaseMixin, ControlMixin
get axisControlVisible() {
return !(this.isPrinting && (this.$store.state.gui.control.hideDuringPrint ?? false))
}
get showButtons() {
if (this.controlStyle !== 'bars' && (this.existsZtilt || this.existsQGL)) return true
return this.existsBedScrews || this.existsBedTilt || this.existsDeltaCalibrate || this.existsScrewsTilt
}
}
</script>
Loading

0 comments on commit 3d27588

Please sign in to comment.