Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add spoolman support #1542

Merged
merged 35 commits into from
Oct 6, 2023
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a00259f
feat: add first init process of spoolman
meteyou Aug 30, 2023
d8bffe6
feat: add spoolman panel on dashboard if moonraker component exists
meteyou Aug 30, 2023
818be40
feat: add icon for spool
meteyou Sep 2, 2023
215aea8
WIP
meteyou Sep 5, 2023
2c0ccb0
WIP
meteyou Sep 7, 2023
31be81f
WIP
meteyou Sep 8, 2023
475e31e
WIP
meteyou Sep 10, 2023
9bf10c6
WIP
meteyou Sep 11, 2023
0026126
refactor: change format for spool details format
meteyou Sep 12, 2023
9bd4787
feat: add option to remove spool
meteyou Sep 12, 2023
093dc21
refactor: remove submenu for change/eject spool and add a prompt to e…
meteyou Sep 14, 2023
11370b5
refactor: remove div in SpoolmanEjectSpoolDialog.vue
meteyou Sep 14, 2023
c07b44b
WIP
meteyou Sep 14, 2023
45e4f16
feat: autorefresh rest weight of spool
meteyou Sep 15, 2023
24d7e6c
refactor: also convert to kg in change spool dialog total weight
meteyou Sep 15, 2023
9ed824e
refactor: round remaining weight in spoolman panel
meteyou Sep 15, 2023
c10cc4a
WIP
meteyou Sep 15, 2023
d069329
locale: add headline to locale
meteyou Sep 17, 2023
b6fc068
locale: fix locale
meteyou Sep 17, 2023
bad9181
WIP
meteyou Sep 19, 2023
b4ef4a6
feat: add warnings in the print start dialog
meteyou Sep 19, 2023
3d27588
Merge branch 'develop' into feat/add-spoolman
meteyou Sep 19, 2023
c0414f2
Merge branch 'develop' into feat/add-spoolman
meteyou Sep 22, 2023
c478235
refactor: better usability on mobile devices in change spool dialog
meteyou Sep 24, 2023
fc0af95
feat: add option to click on the spool or name to open change spool d…
meteyou Oct 1, 2023
df4cd3a
feat: add option to click on the spool or name to open change spool d…
meteyou Oct 1, 2023
abcd497
refactor: remove unused getters in SpoolmanPanel.vue
meteyou Oct 3, 2023
c3d2723
refactor: remove filter for spools
meteyou Oct 3, 2023
43c40a7
refactor: remove testing true for timelapse
meteyou Oct 3, 2023
97643eb
fix: change margin bottom when timelapse exists
meteyou Oct 3, 2023
5a90fae
feat: reset search on opening change spool dialog
meteyou Oct 3, 2023
b076fb1
Merge branch 'develop' into feat/add-spoolman
meteyou Oct 3, 2023
4635026
refactor: use remaining_weight instead of calculating it
meteyou Oct 3, 2023
fd715ce
refactor: remove debug output
meteyou Oct 4, 2023
fff13b8
feat: add sort to spool dialog
meteyou Oct 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add option to remove spool
Signed-off-by: Stefan Dej <meteyou@gmail.com>
meteyou committed Sep 12, 2023
commit 9bd4787c93a32b3b186e18a94bb7a4e8a4492c1b
42 changes: 38 additions & 4 deletions src/components/panels/SpoolmanPanel.vue
Original file line number Diff line number Diff line change
@@ -2,9 +2,37 @@
<div>
<panel :icon="mdiAdjust" :title="title" card-class="spoolman-panel" :collapsible="true">
<template #buttons>
<v-btn icon @click="showChangeSpoolDialog = true">
<v-icon>{{ mdiSync }}</v-icon>
</v-btn>
<v-menu left offset-y :close-on-content-click="true" class="pa-0">
<template #activator="{ on, attrs }">
<v-btn icon tile v-bind="attrs" :disabled="['printing'].includes(printer_state)" v-on="on">
<v-icon>{{ mdiDotsVertical }}</v-icon>
</v-btn>
</template>
<v-list dense>
<template v-if="active_spool === null">
<v-list-item>
<v-btn small style="width: 100%" @click="showChangeSpoolDialog = true">
<v-icon left small>{{ mdiAdjust }}</v-icon>
{{ $t('Panels.Spoolman.SelectSpool') }}
</v-btn>
</v-list-item>
</template>
<template v-else>
<v-list-item>
<v-btn small style="width: 100%" @click="showChangeSpoolDialog = true">
<v-icon left small>{{ mdiSync }}</v-icon>
{{ $t('Panels.Spoolman.ChangeSpool') }}
</v-btn>
</v-list-item>
<v-list-item>
<v-btn small style="width: 100%" @click="removeSpool">
<v-icon left small>{{ mdiMinusCircleOutline }}</v-icon>
{{ $t('Panels.Spoolman.RemoveSpool') }}
</v-btn>
</v-list-item>
</template>
</v-list>
</v-menu>
</template>
<v-card-text v-if="active_spool === null">
<v-row>
@@ -38,7 +66,7 @@
import { Component, Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import Panel from '@/components/ui/Panel.vue'
import { mdiAdjust, mdiSync } from '@mdi/js'
import { mdiAdjust, mdiDotsVertical, mdiMinusCircleOutline, mdiSync } from '@mdi/js'
import SpoolmanChangeSpoolDialog from '@/components/panels/Spoolman/SpoolmanChangeSpoolDialog.vue'
import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
@@ -47,6 +75,8 @@ import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
})
export default class SpoolmanPanel extends Mixins(BaseMixin) {
mdiAdjust = mdiAdjust
mdiDotsVertical = mdiDotsVertical
mdiMinusCircleOutline = mdiMinusCircleOutline
mdiSync = mdiSync
showChangeSpoolDialog = false
@@ -122,6 +152,10 @@ export default class SpoolmanPanel extends Mixins(BaseMixin) {
get subtitle() {
return [this.materialOutput, this.weightOutput, this.lengthOutput].filter((v) => v !== null).join(' | ')
}
removeSpool() {
this.$store.dispatch('server/spoolman/setActiveSpool', 0)
}
}
</script>

1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -634,6 +634,7 @@
"NoSpools": "No spools available",
"OpenSpoolManager": "open Spool Manager",
"Refresh": "refresh",
"RemoveSpool": "Remove spool",
"Search": "Search",
"SelectSpool": "Select Spool",
"Today": "Today",
4 changes: 2 additions & 2 deletions src/store/server/spoolman/actions.ts
Original file line number Diff line number Diff line change
@@ -47,8 +47,8 @@ export const actions: ActionTree<ServerSpoolmanState, RootState> = {
commit('setActiveSpoolId', payload.spool_id)
dispatch('socket/removeInitModule', 'server/spoolman/getActiveSpoolId', { root: true })

// also set active spool to null, if spool_id is null
if (payload.spool_id === null) {
// also set active spool to null, if spool_id is 0
if (payload.spool_id === 0) {
commit('setActiveSpool', null)
return
}