Test Directory copy

This commit is contained in:
portree_kid 2020-04-11 08:10:46 +02:00
parent 41214581fd
commit 4c76d30010
4 changed files with 51 additions and 10 deletions

View File

@ -4,6 +4,7 @@
<EditButton icon="fas fa-th" v-on:click="zoomin" :show="true" tooltip="Zoomin"></EditButton> <EditButton icon="fas fa-th" v-on:click="zoomin" :show="true" tooltip="Zoomin"></EditButton>
<EditButton icon="fas fa-th-large" v-on:click="zoomout" :show="true" tooltip="Zoomout"></EditButton> <EditButton icon="fas fa-th-large" v-on:click="zoomout" :show="true" tooltip="Zoomout"></EditButton>
<EditButton icon="fas fa-upload" v-on:click="upload" :show="!editing" tooltip="Upload"></EditButton> <EditButton icon="fas fa-upload" v-on:click="upload" :show="!editing" tooltip="Upload"></EditButton>
<EditButton icon="fas fa-plane" v-on:click="test" :show="!editing" tooltip="Test"></EditButton>
<EditButton icon="fas fa-edit" v-on:click="edit" :show="!editing" tooltip="Edit"></EditButton> <EditButton icon="fas fa-edit" v-on:click="edit" :show="!editing" tooltip="Edit"></EditButton>
<EditButton <EditButton
icon="fas fa-undo" icon="fas fa-undo"
@ -53,6 +54,7 @@
import fileUrl from 'file-url' import fileUrl from 'file-url'
const path = require('path') const path = require('path')
const fs = require('fs');
export default { export default {
components: { EditButton, Upload }, components: { EditButton, Upload },
@ -112,7 +114,9 @@
} }
}, 1000) }, 1000)
}, },
test() {
this.$parent.$parent.$refs.editLayer.test()
},
check () { check () {
try { try {
this.scanning = true this.scanning = true

View File

@ -12,6 +12,9 @@
import L2 from 'leaflet-textpath' import L2 from 'leaflet-textpath'
import Vue from 'vue' import Vue from 'vue'
const path = require('path')
const fs = require('fs')
// import {LSymbol} from 'leaflet-polylinedecorator' // import {LSymbol} from 'leaflet-polylinedecorator'
export default { export default {
@ -588,6 +591,19 @@
writeGroundnetXML(this.$store.state.Settings.settings.airportsDirectory, this.icao, xml) writeGroundnetXML(this.$store.state.Settings.settings.airportsDirectory, this.icao, xml)
this.load(this.icao, false) this.load(this.icao, false)
}, },
test() {
var f = path.join(this.$store.state.Settings.settings.airportsDirectory, this.icao[0], this.icao[1], this.icao[2], this.icao + '.groundnet.new.xml');
var fNew = path.join(this.$store.state.Settings.settings.testDirectory, 'Airports', this.icao[0], this.icao[1], this.icao[2], this.icao + '.groundnet.xml');
try {
fs.mkdirSync(path.join(this.$store.state.Settings.settings.testDirectory, 'Airports'), { recursive: true })
fs.mkdirSync(path.join(this.$store.state.Settings.settings.testDirectory, 'Airports', this.icao[0]),{ recursive: true })
fs.mkdirSync(path.join(this.$store.state.Settings.settings.testDirectory, 'Airports', this.icao[0], this.icao[1]), { recursive: true })
fs.mkdirSync(path.join(this.$store.state.Settings.settings.testDirectory, 'Airports', this.icao[0], this.icao[1], this.icao[2]), { recursive: true })
} catch (err) {
}
fs.copyFileSync(f, fNew)
},
setVisible(visible) { setVisible(visible) {
if (this.layerGroup) { if (this.layerGroup) {
if (visible) { if (visible) {

View File

@ -8,23 +8,27 @@
</h1> </h1>
<div id="panel" width="100%"> <div id="panel" width="100%">
<el-row> <el-row>
<el-col :span="7" class="label">Airports Directory</el-col> <el-col :span="22" class="label">Airports Directory</el-col>
<el-col :span="15">{{ airports_directory }}</el-col> </el-row>
<el-col :span="2"> <el-row>
<el-col :span="20" class="label">{{ airports_directory }}</el-col>
<el-col :span="4">
<directory-select @input="airportsDirectorySelect"></directory-select> <directory-select @input="airportsDirectorySelect"></directory-select>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="7" class="label">Flightgear Directory</el-col> <el-col :span="22" class="label">Flightgear Directory</el-col>
<el-col :span="15">{{ flightgear_directory }}</el-col> </el-row>
<el-col :span="2"> <el-row>
<el-col :span="20" class="label">{{ flightgear_directory }}</el-col>
<el-col :span="4">
<directory-select @input="flightgearDirectorySelect"></directory-select> <directory-select @input="flightgearDirectorySelect"></directory-select>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="7" class="label">AI Directory</el-col> <el-col :span="7" class="label">AI Directory</el-col>
<el-col :span="15">{{ AI_directory }}</el-col> <el-col :span="15" class="label">{{ AI_directory }}</el-col>
<el-col :span="2"> <el-col :span="2" class="label">
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
@ -39,6 +43,13 @@
<el-col :span="2"> <el-col :span="2">
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="7" class="label">Test Directory</el-col>
<el-col :span="15">{{ test_directory }}</el-col>
<el-col :span="2">
<directory-select @input="testDirectorySelect"></directory-select>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="7" class="label">Author : </el-col> <el-col :span="7" class="label">Author : </el-col>
<el-col :span="17"> <el-col :span="17">
@ -71,6 +82,10 @@
airportsDirectorySelect: function (flightgearDirectory) { airportsDirectorySelect: function (flightgearDirectory) {
console.log(flightgearDirectory) console.log(flightgearDirectory)
this.$store.commit('AIPORTS_DIRECTORY', flightgearDirectory.path) this.$store.commit('AIPORTS_DIRECTORY', flightgearDirectory.path)
},
testDirectorySelect: function (testDirectory) {
console.log(testDirectory)
this.$store.commit('TEST_DIRECTORY', testDirectory.path)
} }
}, },
computed: { computed: {
@ -98,6 +113,9 @@
}, },
airports_directory: function () { airports_directory: function () {
return this.$store.state.Settings.settings.airportsDirectory return this.$store.state.Settings.settings.airportsDirectory
},
test_directory: function () {
return this.$store.state.Settings.settings.testDirectory
} }
} }
} }

View File

@ -1,5 +1,5 @@
const state = { const state = {
settings: { flightgearDirectory: '.', email: 'x' }, settings: { flightgearDirectory: '.', testDirectory: '.', email: 'x' },
zoom: 14, zoom: 14,
center: [47.413220, -1.219482], center: [47.413220, -1.219482],
bounds: undefined, bounds: undefined,
@ -17,6 +17,9 @@ const mutations = {
'AIPORTS_DIRECTORY' (state, airportsDirectory) { 'AIPORTS_DIRECTORY' (state, airportsDirectory) {
state.settings.airportsDirectory = airportsDirectory state.settings.airportsDirectory = airportsDirectory
}, },
'TEST_DIRECTORY' (state, testDirectory) {
state.settings.testDirectory = testDirectory
},
'ZOOM' (state, zoom) { 'ZOOM' (state, zoom) {
state.zoom = zoom state.zoom = zoom
}, },