Author name in XML

This commit is contained in:
portree_kid 2020-03-13 22:45:26 +01:00
parent 43f8aeb9d6
commit 45980c3abe
3 changed files with 32 additions and 7 deletions

View File

@ -8,37 +8,43 @@
</h1>
<div id="panel" width="100%">
<el-row>
<el-col :span="7">Airports Directory</el-col>
<el-col :span="7" class="label">Airports Directory</el-col>
<el-col :span="15">{{ airports_directory }}</el-col>
<el-col :span="2">
<directory-select @input="airportsDirectorySelect"></directory-select>
</el-col>
</el-row>
<el-row>
<el-col :span="7">Flightgear Directory</el-col>
<el-col :span="7" class="label">Flightgear Directory</el-col>
<el-col :span="15">{{ flightgear_directory }}</el-col>
<el-col :span="2">
<directory-select @input="flightgearDirectorySelect"></directory-select>
</el-col>
</el-row>
<el-row>
<el-col :span="7">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="2">
</el-col>
</el-row>
<el-row>
<el-col :span="7">Traffic Directory</el-col>
<el-col :span="7" class="label">Traffic Directory</el-col>
<el-col :span="15">{{ Traffic_directory }}</el-col>
<el-col :span="2">
</el-col>
</el-row>
<el-row>
<el-col :span="7">APT File</el-col>
<el-col :span="7" class="label">APT File</el-col>
<el-col :span="15">{{ apt_file }}</el-col>
<el-col :span="2">
</el-col>
</el-row>
<el-row>
<el-col :span="7" class="label">Author : </el-col>
<el-col :span="17">
<el-input placeholder="Please input your name" v-model="name"></el-input>
</el-col>
</el-row>
</div>
</div>
</template>
@ -68,6 +74,16 @@
}
},
computed: {
name: {
// getter
get: function () {
return this.$store.state.Settings.settings.name
},
// setter
set: function (newValue) {
this.$store.commit('SET_USERNAME', newValue)
}
},
flightgear_directory: function () {
return this.$store.state.Settings.settings.flightgearDirectory
},
@ -94,4 +110,7 @@
.el-col {
border-radius: 4px;
}
.label {
padding: 10px;
}
</style>

View File

@ -31,6 +31,9 @@ exports.writeGroundnetXML = function (fDir, icao, featureList) {
var nodes = [];
var arcList = [];
var version = new Date().toUTCString() + ' by FlightgearAirports';
var name = store.default.state.Settings.settings.name;
//Frequencies
var frequencies = {
'AWOS': store.default.state.Frequencies.AWOS,
@ -99,7 +102,7 @@ exports.writeGroundnetXML = function (fDir, icao, featureList) {
var maxId = uniqueNodes.slice(-1)[0]['@index'];
var xmlObj = { groundnet: { version: 1, frequencies, parkingList: { Parking: parkings }, TaxiNodes: { node: uniqueNodes }, TaxiWaySegments: { arc: arcList } } };
var xmlObj = { groundnet: { version: version, name: name, frequencies, parkingList: { Parking: parkings }, TaxiNodes: { node: uniqueNodes }, TaxiWaySegments: { arc: arcList } } };
xmlString = builder.create(xmlObj).end({ pretty: true });
fs.writeFileSync(f, xmlString);

View File

@ -1,5 +1,5 @@
const state = {
settings: { flightgearDirectory: '.' },
settings: {flightgearDirectory: '.', name: ''},
zoom: 14,
center: [47.413220, -1.219482],
bounds: undefined
@ -24,6 +24,9 @@ const mutations = {
},
'BOUNDS' (state, bounds) {
state.bounds = bounds
},
'SET_USERNAME' (state, name) {
state.settings.name = name
}
}