mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 12:17:08 +00:00
Add configuration GUI for SEG-Y near field hydrophone data
This commit is contained in:
@@ -0,0 +1,135 @@
|
||||
<template>
|
||||
<dougal-project-settings-file-matching-parameters
|
||||
title="Smartsource hydrophone data"
|
||||
subtitle="Smartsource SEG-Y hydrophone data files location and parameters."
|
||||
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 { deepCompare, deepMerge } from '@/lib/utils';
|
||||
import setIfDifferent from '@/lib/watcher-mixin';
|
||||
import DougalProjectSettingsFileMatchingParameters from '@/components/project-settings/file-matching-parameters';
|
||||
import { mapActions, mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: "DougalProjectSettingsSmartsourceSegy",
|
||||
|
||||
components: {
|
||||
DougalProjectSettingsFileMatchingParameters
|
||||
},
|
||||
|
||||
props: [ "value", "title", "subtitle" ],
|
||||
|
||||
mixins: [
|
||||
setIfDifferent({
|
||||
globs: "globs_",
|
||||
paths: "paths_",
|
||||
pattern: "pattern_",
|
||||
lineNameInfo: "lineNameInfo_"
|
||||
})
|
||||
],
|
||||
|
||||
props: {
|
||||
title: String,
|
||||
subtitle: String,
|
||||
rootPath: String,
|
||||
paths: Array,
|
||||
globs: Array,
|
||||
lineNameInfo: Object,
|
||||
pattern: Object
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
tab: null,
|
||||
paths_: [],
|
||||
globs_: [],
|
||||
pattern_: {},
|
||||
lineNameInfo_: {}
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
||||
bind () {
|
||||
return {
|
||||
globs: this.globs_,
|
||||
paths: this.paths_,
|
||||
//pattern: this.pattern_,
|
||||
lineNameInfo: this.lineNameInfo_
|
||||
};
|
||||
},
|
||||
|
||||
isValid () {
|
||||
return true;
|
||||
return !!(this.paths.length && this.globs.length && (
|
||||
this.pattern?.regex &&
|
||||
["sequence"].every( i => this.pattern?.captures?.includes(i) )) || (
|
||||
this.lineNameInfo &&
|
||||
this.lineNameInfo?.fields &&
|
||||
[ "sequence" ].every( i =>
|
||||
["offset", "length"].every( j => j in this.lineNameInfo.fields[i] ))));
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
watch: {
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
reset () {
|
||||
|
||||
this.paths_ = [...this.paths];
|
||||
|
||||
this.globs_ = [...this.globs];
|
||||
|
||||
this.lineNameInfo_ = deepMerge({
|
||||
example: "",
|
||||
fields: {
|
||||
sequence: {
|
||||
length: 3,
|
||||
type: "int"
|
||||
},
|
||||
}
|
||||
}, structuredClone(this.lineNameInfo ?? {}));
|
||||
|
||||
this.pattern_ = structuredClone(this.pattern ?? {});
|
||||
},
|
||||
|
||||
save () {
|
||||
this.$emit("merge", [ ["raw", "source", "smsrc", "segy"], {
|
||||
paths: this.paths_,
|
||||
globs: this.globs_,
|
||||
//pattern: this.pattern_,
|
||||
lineNameInfo: this.lineNameInfo_
|
||||
}]);
|
||||
this.$nextTick(this.reset);
|
||||
},
|
||||
|
||||
back () {
|
||||
this.$emit('close');
|
||||
},
|
||||
|
||||
...mapActions(["api"])
|
||||
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -155,6 +155,7 @@ import DougalProjectSettingsFinalP111 from '@/components/project-settings/input-
|
||||
import DougalProjectSettingsRawNTBP from '@/components/project-settings/input-raw-ntbp';
|
||||
import DougalProjectSettingsFinalPending from '@/components/project-settings/input-final-pending';
|
||||
import DougalProjectSettingsSmartsourceHeader from '@/components/project-settings/input-smartsource-header';
|
||||
import DougalProjectSettingsSmartsourceSegy from '@/components/project-settings/input-smartsource-segy';
|
||||
import DougalProjectSettingsPlanner from '@/components/project-settings/planner';
|
||||
import DougalProjectSettingsOnlineLineNameFormat from '@/components/project-settings/online-line-name-format';
|
||||
import DougalProjectSettingsASAQC from '@/components/project-settings/asaqc';
|
||||
@@ -172,6 +173,7 @@ const components = {
|
||||
//raw_data: DougalProjectSettingsNotImplemented,
|
||||
raw_data_p111: DougalProjectSettingsRawP111,
|
||||
raw_data_smsrc_header: DougalProjectSettingsSmartsourceHeader,
|
||||
raw_data_smsrc_segy: DougalProjectSettingsSmartsourceSegy,
|
||||
raw_data_ntbp: DougalProjectSettingsRawNTBP,
|
||||
//final_data: DougalProjectSettingsNotImplemented,
|
||||
final_data_p111: DougalProjectSettingsFinalP111,
|
||||
@@ -277,6 +279,17 @@ export default {
|
||||
lineNameInfo: obj?.raw?.source?.smsrc?.header?.lineNameInfo
|
||||
})
|
||||
},
|
||||
{
|
||||
id: "raw_data_smsrc_segy",
|
||||
name: "Hydrophone data",
|
||||
values: (obj) => ({
|
||||
rootPath: obj.rootPath,
|
||||
globs: obj?.raw?.source?.smsrc?.segy?.globs,
|
||||
paths: obj?.raw?.source?.smsrc?.segy?.paths,
|
||||
pattern: obj?.raw?.source?.smsrc?.segy?.pattern,
|
||||
lineNameInfo: obj?.raw?.source?.smsrc?.segy?.lineNameInfo
|
||||
})
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user