mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:57:08 +00:00
Another refactoring. What we're doing now is eliminating the need to save individually on each section. Configuration changes are done directly on the local configuration and then the local configuration is saved, downloaded or discarded in one go.
150 lines
3.3 KiB
Vue
150 lines
3.3 KiB
Vue
<template>
|
|
<dougal-project-settings-file-matching-parameters
|
|
title="Final P1/11"
|
|
subtitle="Final P1/11 files location and parameters."
|
|
v-bind="{rootPath: value.rootPath}"
|
|
v-bind.sync="bind"
|
|
:is-valid="isValid"
|
|
:save="save"
|
|
>
|
|
</dougal-project-settings-file-matching-parameters>
|
|
|
|
</template>
|
|
|
|
<style scoped>
|
|
.sample {
|
|
font-family: mono;
|
|
white-space: pre;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
import { deepSet } from '@/lib/utils';
|
|
import DougalProjectSettingsFileMatchingParameters from '@/components/project-settings/file-matching-parameters';
|
|
import { mapActions, mapGetters } from 'vuex';
|
|
|
|
export default {
|
|
name: "DougalProjectSettingsFinal111",
|
|
|
|
components: {
|
|
DougalProjectSettingsFileMatchingParameters
|
|
},
|
|
|
|
props: {
|
|
title: String,
|
|
subtitle: String,
|
|
value: Object
|
|
},
|
|
|
|
data () {
|
|
return {
|
|
tab: null,
|
|
}
|
|
},
|
|
|
|
computed: {
|
|
// Current working object.
|
|
// A shortcut so we don't have to specify the full path
|
|
// on every input control. It also makes it easier to
|
|
// change that path if necessary. Finally, it ensures that
|
|
// the properties being modified are always available.
|
|
cwo: {
|
|
|
|
get () {
|
|
if (this.value) {
|
|
if (!this.value?.final?.p111) {
|
|
deepSet(this.value, [ "final", "p111" ], {
|
|
globs: [ "**/*.p111", "**/*.P111" ],
|
|
paths: [],
|
|
lineNameInfo: {
|
|
example: "",
|
|
fields: {
|
|
line: {
|
|
length: 4,
|
|
type: "int"
|
|
},
|
|
sequence: {
|
|
length: 3,
|
|
type: "int"
|
|
},
|
|
incr: {
|
|
length: 1,
|
|
type: "bool"
|
|
},
|
|
attempt: {
|
|
length: 1,
|
|
type: "int"
|
|
},
|
|
file_no: {
|
|
length: 3,
|
|
type: "int"
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return this.value.final.p111;
|
|
} else {
|
|
return {
|
|
globs: [ "**/*.p111", "**/*.P111" ],
|
|
paths: [],
|
|
lineNameInfo: {
|
|
example: "",
|
|
fields: {
|
|
}
|
|
}
|
|
};
|
|
}
|
|
},
|
|
|
|
set (v) {
|
|
if (this.value) {
|
|
deepSet(this.value, [ "final", "p111" ], v);
|
|
}
|
|
}
|
|
},
|
|
|
|
bind () {
|
|
return {
|
|
globs: this.cwo?.globs,
|
|
paths: this.cwo?.paths,
|
|
pattern: this.cwo?.pattern,
|
|
lineNameInfo: this.cwo?.lineNameInfo
|
|
};
|
|
},
|
|
|
|
isValid () {
|
|
return !!(this.cwo?.paths.length && this.cwo?.globs.length && (
|
|
this.cwo?.pattern?.regex &&
|
|
["direction", "line", "sequence"].every( i => this.cwo?.pattern?.captures?.includes(i) )) || (
|
|
this.cwo?.lineNameInfo &&
|
|
this.cwo?.lineNameInfo?.fields &&
|
|
[ "line", "sequence", "incr" ].every( i =>
|
|
["offset", "length"].every( j => j in this.cwo?.lineNameInfo.fields[i] ))));
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
},
|
|
|
|
methods: {
|
|
|
|
reset () {
|
|
},
|
|
|
|
save () {
|
|
},
|
|
|
|
back () {
|
|
this.$emit('close');
|
|
},
|
|
},
|
|
|
|
mounted () {
|
|
this.reset();
|
|
}
|
|
|
|
}
|
|
</script>
|