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

fix(timelapse): fix issue with changing timelapse settings #1745

Merged
merged 8 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
154 changes: 138 additions & 16 deletions src/components/settings/SettingsTimelapseTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v >= 0 || $t('Settings.TimelapseTab.RulesZeroAndPositive'),
]"
:disabled="blockedsettings.includes('stream_delay_compensation')" />
</settings-row>
<v-divider class="my-2" />
Expand Down Expand Up @@ -148,6 +152,15 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) =>
(v >= stepperXmin && v <= stepperXmax) ||
$t('Settings.TimelapseTab.RulesBetweenMinMax', {
min: stepperXmin,
max: stepperXmax,
}),
]"
:disabled="blockedsettings.includes('park_custom_pos_x')"
hide-spin-buttons />
</settings-row>
Expand All @@ -164,6 +177,15 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) =>
(v >= stepperYmin && v <= stepperYmax) ||
$t('Settings.TimelapseTab.RulesBetweenMinMax', {
min: stepperYmin,
max: stepperYmax,
}),
]"
:disabled="blockedsettings.includes('park_custom_pos_y')"
hide-spin-buttons />
</settings-row>
Expand All @@ -180,6 +202,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v >= 0 || $t('Settings.TimelapseTab.RulesZeroAndPositive'),
]"
:disabled="blockedsettings.includes('park_custom_pos_dz')"
hide-spin-buttons />
</settings-row>
Expand All @@ -195,6 +221,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v >= 0 || $t('Settings.TimelapseTab.RulesZeroAndPositive'),
]"
:disabled="blockedsettings.includes('park_travel_speed')"
hide-spin-buttons />
</settings-row>
Expand All @@ -221,6 +251,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v > 0 || $t('Settings.TimelapseTab.RulesPositive'),
]"
:disabled="blockedsettings.includes('park_retract_speed')"
hide-spin-buttons />
</settings-row>
Expand All @@ -235,6 +269,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v >= 0 || $t('Settings.TimelapseTab.RulesZeroAndPositive'),
]"
:disabled="blockedsettings.includes('park_retract_distance')"
hide-spin-buttons />
</settings-row>
Expand All @@ -249,6 +287,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v > 0 || $t('Settings.TimelapseTab.RulesPositive'),
]"
:disabled="blockedsettings.includes('park_extrude_speed')"
hide-spin-buttons />
</settings-row>
Expand All @@ -263,6 +305,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v >= 0 || $t('Settings.TimelapseTab.RulesZeroAndPositive'),
]"
:disabled="blockedsettings.includes('park_extrude_distance')"
hide-spin-buttons />
</settings-row>
Expand All @@ -279,6 +325,10 @@
step="0.1"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v >= 0 || $t('Settings.TimelapseTab.RulesZeroAndPositive'),
]"
:disabled="blockedsettings.includes('park_time')" />
</settings-row>
</template>
Expand Down Expand Up @@ -306,6 +356,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v > 0 || $t('Settings.TimelapseTab.RulesPositive'),
]"
:disabled="blockedsettings.includes('targetlength')"
hide-spin-buttons />
</settings-row>
Expand All @@ -320,6 +374,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v > 0 || $t('Settings.TimelapseTab.RulesPositive'),
]"
:disabled="blockedsettings.includes('variable_fps_min')"
hide-spin-buttons />
</settings-row>
Expand All @@ -334,6 +392,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v > variable_fps_min || $t('Settings.TimelapseTab.RulesMin'),
]"
:disabled="blockedsettings.includes('variable_fps_max')"
hide-spin-buttons />
</settings-row>
Expand All @@ -350,6 +412,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v > 0 || $t('Settings.TimelapseTab.RulesPositive'),
]"
:disabled="blockedsettings.includes('output_framerate')"
hide-spin-buttons />
</settings-row>
Expand All @@ -364,6 +430,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v >= 0 || $t('Settings.TimelapseTab.RulesZeroAndPositive'),
]"
:disabled="blockedsettings.includes('duplicatelastframe')"
hide-spin-buttons />
</settings-row>
Expand All @@ -377,6 +447,10 @@
hide-details="auto"
outlined
dense
:rules="[
(v) => !!v || $t('Settings.TimelapseTab.RulesRequired'),
(v) => v > 0 || $t('Settings.TimelapseTab.RulesPositive'),
]"
:disabled="blockedsettings.includes('constant_rate_factor')"
hide-spin-buttons />
</settings-row>
Expand Down Expand Up @@ -542,7 +616,9 @@ export default class SettingsTimelapseTab extends Mixins(BaseMixin) {
return this.$store.state.server.timelapse.settings.stream_delay_compensation
}

set stream_delay_compensation(newVal) {
set stream_delay_compensation(newVal: number | string) {
if (newVal === '') newVal = 0

this.$store.dispatch('server/timelapse/saveSetting', { stream_delay_compensation: newVal })
}

Expand Down Expand Up @@ -582,71 +658,105 @@ export default class SettingsTimelapseTab extends Mixins(BaseMixin) {
return this.$store.state.server.timelapse.settings.park_custom_pos_x
}

set park_custom_pos_x(newVal) {
set park_custom_pos_x(newVal: number | string) {
if (newVal === '' || newVal < this.stepperXmin || newVal > this.stepperXmax) return

this.$store.dispatch('server/timelapse/saveSetting', { park_custom_pos_x: newVal })
}

get stepperXmin() {
return this.$store.state.printer.configfile?.settings?.stepper_x?.position_min ?? 0
}

get stepperXmax() {
return this.$store.state.printer.configfile?.settings?.stepper_x?.position_max ?? 200
}

get park_custom_pos_y() {
return this.$store.state.server.timelapse.settings.park_custom_pos_y
}

set park_custom_pos_y(newVal) {
set park_custom_pos_y(newVal: number | string) {
if (newVal === '' || newVal < this.stepperYmin || newVal > this.stepperYmax) return

this.$store.dispatch('server/timelapse/saveSetting', { park_custom_pos_y: newVal })
}

get stepperYmin() {
return this.$store.state.printer.configfile?.settings?.stepper_y?.position_min ?? 0
}

get stepperYmax() {
return this.$store.state.printer.configfile?.settings?.stepper_y?.position_max ?? 200
}

get park_custom_pos_dz() {
return this.$store.state.server.timelapse.settings.park_custom_pos_dz
}

set park_custom_pos_dz(newVal) {
set park_custom_pos_dz(newVal: number | string) {
if (newVal === '' || newVal < 0) return

this.$store.dispatch('server/timelapse/saveSetting', { park_custom_pos_dz: newVal })
}

get park_travel_speed() {
return this.$store.state.server.timelapse.settings.park_travel_speed
}

set park_travel_speed(newVal) {
set park_travel_speed(newVal: number | string) {
if (newVal === '' || newVal < 0) return

this.$store.dispatch('server/timelapse/saveSetting', { park_travel_speed: newVal })
}

get park_retract_speed() {
return this.$store.state.server.timelapse.settings.park_retract_speed
}

set park_retract_speed(newVal) {
set park_retract_speed(newVal: number | string) {
if (newVal === '' || newVal <= 0) return

this.$store.dispatch('server/timelapse/saveSetting', { park_retract_speed: newVal })
}

get park_extrude_speed() {
return this.$store.state.server.timelapse.settings.park_extrude_speed
}

set park_extrude_speed(newVal) {
set park_extrude_speed(newVal: number | string) {
if (newVal === '' || newVal <= 0) return

this.$store.dispatch('server/timelapse/saveSetting', { park_extrude_speed: newVal })
}

get park_retract_distance() {
return this.$store.state.server.timelapse.settings.park_retract_distance
}

set park_retract_distance(newVal) {
set park_retract_distance(newVal: number | string) {
if (newVal === '' || newVal < 0) return

this.$store.dispatch('server/timelapse/saveSetting', { park_retract_distance: newVal })
}

get park_extrude_distance() {
return this.$store.state.server.timelapse.settings.park_extrude_distance
}

set park_extrude_distance(newVal) {
set park_extrude_distance(newVal: number | string) {
if (newVal === '' || newVal < 0) return

this.$store.dispatch('server/timelapse/saveSetting', { park_extrude_distance: newVal })
}

get park_time() {
return this.$store.state.server.timelapse.settings.park_time
}

set park_time(newVal) {
set park_time(newVal: number | string) {
if (newVal === '' || newVal < 0) return

this.$store.dispatch('server/timelapse/saveSetting', { park_time: newVal })
}

Expand All @@ -662,15 +772,19 @@ export default class SettingsTimelapseTab extends Mixins(BaseMixin) {
return this.$store.state.server.timelapse.settings.constant_rate_factor
}

set constant_rate_factor(newVal) {
set constant_rate_factor(newVal: number | string) {
if (newVal === '' || newVal <= 0) return

this.$store.dispatch('server/timelapse/saveSetting', { constant_rate_factor: newVal })
}

get output_framerate() {
return this.$store.state.server.timelapse.settings.output_framerate
}

set output_framerate(newVal) {
set output_framerate(newVal: number | string) {
if (newVal === '' || newVal <= 0) return

this.$store.dispatch('server/timelapse/saveSetting', { output_framerate: newVal })
}

Expand Down Expand Up @@ -702,31 +816,39 @@ export default class SettingsTimelapseTab extends Mixins(BaseMixin) {
return this.$store.state.server.timelapse.settings.targetlength
}

set targetlength(newVal) {
set targetlength(newVal: number | string) {
if (newVal === '' || newVal <= 0) return

this.$store.dispatch('server/timelapse/saveSetting', { targetlength: newVal })
}

get variable_fps_min() {
return this.$store.state.server.timelapse.settings.variable_fps_min
}

set variable_fps_min(newVal) {
set variable_fps_min(newVal: number | string) {
if (newVal === '' || newVal <= 0) return

this.$store.dispatch('server/timelapse/saveSetting', { variable_fps_min: newVal })
}

get variable_fps_max() {
return this.$store.state.server.timelapse.settings.variable_fps_max
}

set variable_fps_max(newVal) {
set variable_fps_max(newVal: number | string) {
if (newVal === '' || newVal <= this.variable_fps_min) return

this.$store.dispatch('server/timelapse/saveSetting', { variable_fps_max: newVal })
}

get duplicatelastframe() {
return this.$store.state.server.timelapse.settings.duplicatelastframe
}

set duplicatelastframe(newVal) {
set duplicatelastframe(newVal: number | string) {
if (newVal === '' || newVal < 0) return

this.$store.dispatch('server/timelapse/saveSetting', { duplicatelastframe: newVal })
}

Expand Down
5 changes: 5 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,11 @@
"RetractDistanceDescription": "The length of filament that the extruder retracts.",
"RetractSpeed": "Retract Speed",
"RetractSpeedDescription": "Speed at which the extruder retracts the filament.",
"RulesBetweenMinMax": "This value has to be between {min} and {max}!",
meteyou marked this conversation as resolved.
Show resolved Hide resolved
"RulesMin": "This value has to be minimum {min}!",
meteyou marked this conversation as resolved.
Show resolved Hide resolved
"RulesPositive": "This value has to be positive!",
meteyou marked this conversation as resolved.
Show resolved Hide resolved
"RulesRequired": "This value is required!",
meteyou marked this conversation as resolved.
Show resolved Hide resolved
"RulesZeroAndPositive": "This value has to be 0 or above!",
meteyou marked this conversation as resolved.
Show resolved Hide resolved
"SaveFrames": "Save Frames",
"SaveFramesDescription": "Save the frames to a zip-file for external rendering",
"StreamDelayCompensation": "Stream Delay Compensation",
Expand Down
Loading