Skip to content

Commit

Permalink
refactor: make all MachineSettings use new NumberInput (#651)
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Dej <[email protected]>
  • Loading branch information
dw-0 and meteyou authored Feb 28, 2022
1 parent 5bfdcf3 commit fef6ba3
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 422 deletions.
3 changes: 0 additions & 3 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ declare module 'vue' {
FarmPrinterPanel: typeof import('./src/components/panels/FarmPrinterPanel.vue')['default']
FilamentSensor: typeof import('./src/components/inputs/FilamentSensor.vue')['default']
FirmwareRetractionSettings: typeof import('./src/components/panels/MachineSettings/FirmwareRetractionSettings.vue')['default']
FirmwareRetractionSettingsInput: typeof import('./src/components/inputs/FirmwareRetractionSettingsInput.vue')['default']
GcodefilesPanel: typeof import('./src/components/panels/GcodefilesPanel.vue')['default']
HistoryAllPrintStatus: typeof import('./src/components/charts/HistoryAllPrintStatus.vue')['default']
HistoryFilamentUsage: typeof import('./src/components/charts/HistoryFilamentUsage.vue')['default']
Expand All @@ -46,12 +45,10 @@ declare module 'vue' {
MjpegstreamerAdaptive: typeof import('./src/components/webcams/MjpegstreamerAdaptive.vue')['default']
MoonrakerStatePanel: typeof import('./src/components/panels/MoonrakerStatePanel.vue')['default']
MotionSettings: typeof import('./src/components/panels/MachineSettings/MotionSettings.vue')['default']
MotionSettingsInput: typeof import('./src/components/inputs/MotionSettingsInput.vue')['default']
NumberInput: typeof import('./src/components/inputs/NumberInput.vue')['default']
Panel: typeof import('./src/components/ui/Panel.vue')['default']
PowerControlPanel: typeof import('./src/components/panels/PowerControlPanel.vue')['default']
PressureAdvanceSettings: typeof import('./src/components/panels/MachineSettings/PressureAdvanceSettings.vue')['default']
PressureAdvanceSettingsInput: typeof import('./src/components/inputs/PressureAdvanceSettingsInput.vue')['default']
PrinterSelector: typeof import('./src/components/ui/PrinterSelector.vue')['default']
PrintsettingsPanel: typeof import('./src/components/panels/PrintsettingsPanel.vue')['default']
SettingsConsoleTab: typeof import('./src/components/settings/SettingsConsoleTab.vue')['default']
Expand Down
109 changes: 0 additions & 109 deletions src/components/inputs/FirmwareRetractionSettingsInput.vue

This file was deleted.

110 changes: 0 additions & 110 deletions src/components/inputs/MotionSettingsInput.vue

This file was deleted.

11 changes: 5 additions & 6 deletions src/components/inputs/NumberInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ export default class NumberInput extends Mixins(BaseMixin) {
declare readonly param: string
// props defining incoming data
@Prop({ type: Number, required: true, default: 0 })
@Prop({ type: Number, required: true })
declare readonly target: number
@Prop({ type: Number, required: true, default: 0 })
@Prop({ type: Number, required: true })
declare readonly defaultValue: number
// props for internal processing
@Prop({ type: Number, required: true, default: 0 })
@Prop({ type: Number, required: true })
declare readonly min: number
@Prop({ type: Number, default: null })
declare readonly max: number | null
@Prop({ type: Number, required: true, default: 0 })
@Prop({ type: Number, required: true })
declare readonly dec: number
@Prop({ type: Number, required: false, default: 1 })
Expand Down Expand Up @@ -147,8 +147,7 @@ export default class NumberInput extends Mixins(BaseMixin) {
submit(): void {
if (this.invalidInput()) return
this.$emit('target-changed', this.param, this.value)
this.$emit('submit', this.param)
this.$emit('submit', { name: this.param, value: this.value })
}
// input validation //
Expand Down
117 changes: 0 additions & 117 deletions src/components/inputs/PressureAdvanceSettingsInput.vue

This file was deleted.

Loading

0 comments on commit fef6ba3

Please sign in to comment.