mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:57:08 +00:00
Refactor <dougal-project-settings-planner/>
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
type="number"
|
||||
hint="Expected line change time in minutes"
|
||||
persistent-hint
|
||||
v-model.number="defaultLineChangeDuration"
|
||||
v-model.number="planner_.defaultLineChangeDuration"
|
||||
>
|
||||
</v-text-field>
|
||||
<v-text-field
|
||||
@@ -19,7 +19,7 @@
|
||||
type="number"
|
||||
hint="Expected acquisition speed in knots"
|
||||
persistent-hint
|
||||
v-model.number="defaultAcquisitionSpeed"
|
||||
v-model.number="planner_.defaultAcquisitionSpeed"
|
||||
>
|
||||
</v-text-field>
|
||||
<v-text-field
|
||||
@@ -27,7 +27,7 @@
|
||||
type="number"
|
||||
hint="Default number of shots to overlap before the FGSP, for reshoots"
|
||||
persistent-hint
|
||||
v-model.number="overlapBefore"
|
||||
v-model.number="planner_.overlapBefore"
|
||||
>
|
||||
</v-text-field>
|
||||
<v-text-field
|
||||
@@ -35,7 +35,7 @@
|
||||
type="number"
|
||||
hint="Default number of shots to overlap after the LGSP, for reshoots"
|
||||
persistent-hint
|
||||
v-model.number="overlapAfter"
|
||||
v-model.number="planner_.overlapAfter"
|
||||
>
|
||||
</v-text-field>
|
||||
</v-form>
|
||||
@@ -60,23 +60,35 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { deepCompare, deepMerge } from '@/lib/utils';
|
||||
import setIfDifferent from '@/lib/watcher-mixin';
|
||||
|
||||
export default {
|
||||
name: "DougalProjectSettingsPlanner",
|
||||
|
||||
props: [ "value" ],
|
||||
mixins: [
|
||||
setIfDifferent({
|
||||
planner: "planner_"
|
||||
})
|
||||
],
|
||||
|
||||
props: {
|
||||
planner: Object
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
defaultLineChangeDuration: null,
|
||||
defaultAcquisitionSpeed: null,
|
||||
overlapBefore: null,
|
||||
overlapAfter: null
|
||||
planner_: {
|
||||
defaultLineChangeDuration: null,
|
||||
defaultAcquisitionSpeed: null,
|
||||
overlapBefore: null,
|
||||
overlapAfter: null
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
value (newValue) {
|
||||
planner (newValue) {
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
@@ -84,13 +96,19 @@ export default {
|
||||
methods: {
|
||||
|
||||
reset () {
|
||||
for (const key of Object.keys(this.$data)) {
|
||||
this[key] = this.value[key];
|
||||
}
|
||||
|
||||
this.planner_ = deepMerge({
|
||||
defaultLineChangeDuration: null,
|
||||
defaultAcquisitionSpeed: null,
|
||||
overlapBefore: null,
|
||||
overlapAfter: null
|
||||
}, structuredClone(this.planner ?? {}));
|
||||
|
||||
},
|
||||
|
||||
save () {
|
||||
this.$emit('input', {...this.$data});
|
||||
this.$emit("merge", [ [ ], this.planner_ ]);
|
||||
this.$nextTick(this.reset);
|
||||
},
|
||||
|
||||
back () {
|
||||
|
||||
Reference in New Issue
Block a user