Skip to content

Commit

Permalink
Merge branch 'develop' into feat/add-tmc2240-temp
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Sep 19, 2023
2 parents a26eb24 + 5007646 commit b1fc4bb
Show file tree
Hide file tree
Showing 15 changed files with 216 additions and 98 deletions.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions 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
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
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>
20 changes: 18 additions & 2 deletions src/components/settings/General/GeneralReset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class SettingsGeneralTabResetDatabase extends Mixins(BaseMixin, S
resetCheckboxes: string[] = []
async mounted() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
await this.loadResetableNamespaces()
}
onSelectResetCheckboxes(resetCheckboxes: string[]) {
Expand All @@ -78,10 +78,26 @@ export default class SettingsGeneralTabResetDatabase extends Mixins(BaseMixin, S
}
async openDialog() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
await this.loadResetableNamespaces()
this.showDialog = true
}
async loadResetableNamespaces() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
if (this.moonrakerComponents.includes('history')) {
this.resetableNamespaces.push({
value: 'history_jobs',
label: this.$t('Settings.GeneralTab.DbHistoryJobs'),
})
this.resetableNamespaces.push({
value: 'history_totals',
label: this.$t('Settings.GeneralTab.DbHistoryTotals'),
})
}
}
closeDialog() {
this.showDialog = false
}
Expand Down
33 changes: 26 additions & 7 deletions src/components/webcams/WebrtcCameraStreamer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default class WebrtcCameraStreamer extends Mixins(BaseMixin, WebcamMixin)
private remote_pc_id: string | null = null
private aspectRatio: null | number = null
private status: string = 'connecting'
private restartTimer: number | null = null
@Prop({ required: true }) readonly camSettings!: GuiWebcamStateWebcam
@Prop({ default: null }) declare readonly printerUrl: string | null
Expand Down Expand Up @@ -99,11 +100,15 @@ export default class WebrtcCameraStreamer extends Mixins(BaseMixin, WebcamMixin)
)
this.pc.addEventListener('connectionstatechange', () => {
this.status = (this.pc?.connectionState ?? '').toString()
// clear restartTimer if it is set
if (this.restartTimer) window.clearTimeout(this.restartTimer)
if (['failed', 'disconnected'].includes(this.status)) {
setTimeout(async () => {
await this.pc?.close()
this.startStream()
}, 500)
// set restartTimer to restart stream after 5 seconds
this.restartTimer = window.setTimeout(() => {
this.restartStream()
}, 5000)
}
})
this.pc.addEventListener('icecandidate', (e) => {
Expand Down Expand Up @@ -147,8 +152,16 @@ export default class WebrtcCameraStreamer extends Mixins(BaseMixin, WebcamMixin)
if (isFirefox) this.status = 'connected'
return response.json()
})
.catch(function (e) {
.catch((e) => {
window.console.error(e)
// clear restartTimer if it is set
if (this.restartTimer) window.clearTimeout(this.restartTimer)
// set restartTimer to restart stream after 5 seconds
this.restartTimer = window.setTimeout(() => {
this.restartStream()
}, 5000)
})
}
Expand All @@ -160,10 +173,16 @@ export default class WebrtcCameraStreamer extends Mixins(BaseMixin, WebcamMixin)
this.pc?.close()
}
restartStream() {
this.pc?.close()
setTimeout(async () => {
this.startStream()
}, 500)
}
@Watch('url')
async changedUrl() {
await this.pc?.close()
this.startStream()
this.restartStream()
}
}
</script>
Expand Down
4 changes: 4 additions & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"App": {
"Notifications": {
"BrowserWarnings": {
"Headline": "Veralteter Browser",
"Description": "Die verwendete {name} Version ({version}) ist veraltet und wird nicht vollständig unterstützt. Mainsail benötigt die Version {minVersion} oder höher."
},
"DependencyDescription": "Die momentane {name} Version unterstützt nicht alle Funktionen von Mainsail. Aktualisiere {name} mindestens auf Version {neededVersion}.",
"DependencyName": "Abhängigkeit: {name}",
"DismissAll": "Alles verwerfen",
Expand Down
8 changes: 4 additions & 4 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"App": {
"Notifications": {
"BrowserWarnings": {
"Headline": "Outdated Browser",
"Description": "{name} is outdated and not fully supported. The current version is {version}, but Mainsail requires version {minVersion} or higher."
},
"DependencyDescription": "The current {name} version does not support all features of Mainsail. Update {name} to at least {neededVersion}.",
"DependencyName": "Dependency: {name}",
"DismissAll": "Dismiss all",
Expand Down Expand Up @@ -506,10 +510,6 @@
"KlipperUpdateQuestionConfig": "This update may also contain changes to config parameters that would need to be modified in the printer.cfg file, see the change log for details.",
"MoonrakerUpdateQuestion": "This will update the Moonraker API. Changes to the moonraker.conf file may be required to continue using the machine.",
"MoreCommitsInfo": "A maximum of 30 commits can be displayed here. To see all commits, please click on the following link:",
"Notification": {
"Detached": "Detached state is not an error nor is it a problem. It only means that additional commits exist in the local repository that do not exist in the remote repository.",
"Dirty": "The local repository has been modified and cannot be updated in this state. Please recover this repository."
},
"OSPackages": "OS-Packages",
"SoftRecovery": "Soft Recovery",
"StartUpdate": "Start Update",
Expand Down
22 changes: 11 additions & 11 deletions src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,13 @@
},
"UpdatePanel": {
"CheckForUpdates": "Sprawdź dostępność aktualizacji",
"Commits": "Zmiany",
"CommitsAvailable": "Brak nowych wydań | {count} dostępne wydanie | {count} dostępnych wydań",
"CommitsOnDate": "Zmiany w {date}",
"CommittedDaysAgo": "Wydano {days} dni temu",
"CommittedHoursAgo": "Wydano {hours} godzin temu",
"CommittedOnDate": "Wydano {date}",
"CommittedYesterday": "Wydano wczoraj",
"Commits": "Zatwierdzenia",
"CommitsAvailable": "Brak nowych zatwierdzeń | Dostępne zatwierdzenia: {count} | Dostępne zatwierdzenia: {count}",
"CommitsOnDate": "zatwierdzenia w {date}",
"CommittedDaysAgo": "zatwierdzono {days} dni temu",
"CommittedHoursAgo": "zatwierdzono {hours} godz. temu",
"CommittedOnDate": "zatwierdzono w {date}",
"CommittedYesterday": "zatwierdzono wczoraj",
"Detached": "Osobne",
"Dirty": "brudny",
"Invalid": "Nieprawidłowe",
Expand All @@ -487,15 +487,15 @@
"Upgrade": "Uaktualnij",
"UpToDate": "aktualny",
"Abort": "Przerwij",
"GenericUpdateQuestion": "Sprawdź historię zmian (jeśli jest dostępna) i stronę GitHub dla tego projektu, aby sprawdzić, czy konieczne są jakiekolwiek ręczne korekty dla tej aktualizacji.",
"GenericUpdateQuestion": "Sprawdź historię zatwierdzeń (jeśli dostępne) i stronę GitHub dla tego projektu, aby sprawdzić, czy konieczne są jakiekolwiek ręczne korekty dla tej aktualizacji.",
"InitUpdateManager": "Menedżer aktualizacji nie został jeszcze zainicjowany. Jest to normalne zjawisko podczas pierwszego uruchomienia systemu. Kliknij przycisk odświeżania, aby zainicjować wszystkie komponenty.",
"MoonrakerUpdateQuestion": "Spowoduje to aktualizację API Moonraker. Zmiany w pliku moonraker.conf mogą być wymagane do dalszego korzystania z urządzenia.",
"MoonrakerUpdateQuestion": "Spowoduje to aktualizację API Moonrakera. Zmiany w pliku moonraker.conf mogą być wymagane do prawidłowego funkcjonowania drukarki.",
"StartUpdate": "Rozpocznij aktualizację",
"ThesePackagesCanBeUpgrade": "Te pakiety systemowe mogą być zaktualizowane:",
"WebClientUpdateQuestion": "W niektórych przypadkach aktualizacja klienta sieciowego może spowodować zmiany, które mogą spowodować niezgodność. Więcej informacji można znaleźć w uwagach wydania.",
"AreYouSure": "Czy na pewno?",
"Close": "Zamknij",
"CommitHistory": "Historia zmian",
"CommitHistory": "Historia zatwierdzeń",
"ConfigChanges": "Zmiany konfiguracji",
"CountPackagesCanBeUpgraded": "Można uaktualnić {count} pakietów",
"GitHubPage": "Strona GitHub",
Expand All @@ -504,7 +504,7 @@
"LinkToGithub": "Link do GitHub",
"KlipperUpdateQuestionFirmware": "Spowoduje to aktualizację oprogramowania hosta Klipper. Płyty sterujące z działającym firmware Klipper mogą wymagać flashowania ponownie skompilowanym firmware przed przywróceniem urządzenia do pracy.",
"KlipperUpdateQuestionConfig": "Ta aktualizacja może również zawierać zmiany w parametrach konfiguracyjnych, które będą musiały zostać zmodyfikowane w pliku printer.cfg, szczegóły można znaleźć w dzienniku zmian.",
"MoreCommitsInfo": "Można tu wyświetlić maksymalnie 30 zmian. Aby zobaczyć wszystkie zmiany, kliknij poniższy link:",
"MoreCommitsInfo": "Można zobaczyć tutaj maksymalnie 30 zatwierdzeń. Kliknij poniższy przycisk, aby zobaczyć wszystkie:",
"SoftRecovery": "Przywróć miękko",
"UpdateWarning": "Ostrzeżenie o aktualizacji: {name}",
"UpgradeableSystemPackages": "Pakiety systemowe, które można uaktualnić",
Expand Down
Loading

0 comments on commit b1fc4bb

Please sign in to comment.