This commit is contained in:
parent
4dd17ad726
commit
1bba5e2157
@ -139,6 +139,7 @@ You should have received a copy of the GNU General Public License along with FG
|
||||
saveDefered () {
|
||||
this.$parent.$parent.$refs.editLayer.save()
|
||||
this.$parent.$parent.$refs.towerLayer.save()
|
||||
this.$parent.$parent.$refs.thresholdLayer.save()
|
||||
this.$parent.$parent.$refs.editLayer.disableEdit()
|
||||
this.scanGroundnets()
|
||||
Vue.set(this, 'saveDialogVisible', false)
|
||||
|
@ -40,6 +40,7 @@ You should have received a copy of the GNU General Public License along with FG
|
||||
<ParkingEdit></ParkingEdit>
|
||||
<ArcEditMulti></ArcEditMulti>
|
||||
<ArcEdit></ArcEdit>
|
||||
<ThresholdEdit></ThresholdEdit>
|
||||
<TowerEdit></TowerEdit>
|
||||
<NodeEdit></NodeEdit>
|
||||
<ParkingGroupEdit ref="parkingGroupEdit" @editParking="(msg) => $emit('editParking', msg)"></ParkingGroupEdit>
|
||||
@ -82,6 +83,7 @@ You should have received a copy of the GNU General Public License along with FG
|
||||
import FileSelect from './FileSelect'
|
||||
import Help from './Help'
|
||||
import NodeEdit from './NodeEdit'
|
||||
import ThresholdEdit from './ThresholdEdit'
|
||||
import ParkingEdit from './ParkingEdit'
|
||||
import ParkingGroupEdit from './ParkingGroupEdit'
|
||||
// import ParkingList from './ParkingList'
|
||||
@ -93,7 +95,7 @@ You should have received a copy of the GNU General Public License along with FG
|
||||
|
||||
export default {
|
||||
name: 'leaflet-sidebar',
|
||||
components: { Help, AirportEdit, ArcEdit, ArcEditMulti, CheckPanel, NodeEdit, ParkingEdit, ParkingGroupEdit, RunScan, TowerEdit, FileSelect, SettingsPanel, Search, Upload, WorkInProgress },
|
||||
components: { Help, AirportEdit, ArcEdit, ArcEditMulti, CheckPanel, NodeEdit, ParkingEdit, ParkingGroupEdit, RunScan, TowerEdit, ThresholdEdit, FileSelect, SettingsPanel, Search, Upload, WorkInProgress },
|
||||
props: [],
|
||||
created () {
|
||||
window.addEventListener('keydown', this.doCommand)
|
||||
|
95
src/renderer/components/ThresholdEdit.vue
Normal file
95
src/renderer/components/ThresholdEdit.vue
Normal file
@ -0,0 +1,95 @@
|
||||
<!--
|
||||
Copyright 2020 Keith Paterson
|
||||
|
||||
This file is part of FG Airports.
|
||||
|
||||
FG Airports is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
FG Airports is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with FG Airports. If not, see http://www.gnu.org/licenses/.
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div width="100%" v-if="threshold">
|
||||
<div>
|
||||
<el-row>
|
||||
<el-col :span="7">
|
||||
<span class="label">Runway :</span>
|
||||
</el-col>
|
||||
<el-col :span="17">
|
||||
<el-input
|
||||
placeholder="Please input"
|
||||
v-model="runway"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="7">
|
||||
<span class="label">Displacement :</span>
|
||||
</el-col>
|
||||
<el-col :span="17">
|
||||
<el-input-number
|
||||
v-model="displacement"
|
||||
:disabled="!editing"
|
||||
></el-input-number>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script lang="js">
|
||||
/* eslint-disable */
|
||||
const Coordinates = require('coordinate-parser');
|
||||
import {writeTowerXML} from '../loaders/tower_writer'
|
||||
|
||||
|
||||
export default {
|
||||
/*
|
||||
methods: {
|
||||
updateIsOnRunway (value) {
|
||||
this.$store.commit('SET_EDIT_ISONRUNWAY', value)
|
||||
}
|
||||
},
|
||||
*/
|
||||
data () {
|
||||
return {
|
||||
coordFocussed: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
save () {
|
||||
var o = {latitude: this.latitude, longitude: this.longitude, height: this.height};
|
||||
writeTowerXML(this.$store.state.Settings.settings.airportsDirectory, this.$parent.$parent.$parent.icao, o)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
editing: {
|
||||
get: function () {
|
||||
return this.$parent.$parent.$parent.$refs.editLayer.editing
|
||||
}
|
||||
},
|
||||
threshold: function () {
|
||||
return this.$store.state.Editable.type === 'threshold'
|
||||
},
|
||||
//<rwy>07L</rwy>
|
||||
//<hdg-deg>68.77</hdg-deg>
|
||||
//<displ-m>0.0</displ-m>
|
||||
//<stopw-m>160.0</stopw-m>
|
||||
runway: function () {
|
||||
return this.$store.state.Editable.data.threshold.runway;
|
||||
},
|
||||
displacement: {
|
||||
set: function (newValue) {
|
||||
this.$store.dispatch('setDisplacement', newValue);
|
||||
},
|
||||
get: function () {
|
||||
return this.$store.state.Editable.data.threshold.displacement;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -5,6 +5,7 @@
|
||||
import L from 'leaflet'
|
||||
import LEdit from 'leaflet-editable/src/Leaflet.Editable.js'
|
||||
import {readThresholdXML} from '../loaders/threshold_loader'
|
||||
import {writeThresholdXML} from '../loaders/threshold_writer'
|
||||
|
||||
export default {
|
||||
name: 'edit-layer',
|
||||
@ -12,10 +13,17 @@
|
||||
created () {
|
||||
},
|
||||
mounted () {
|
||||
console.log(LMap)
|
||||
console.log(LMarker)
|
||||
console.log(L)
|
||||
console.log(LEdit)
|
||||
console.debug(LMap, LMarker, L, LEdit)
|
||||
this.$store.watch(
|
||||
function (state) {
|
||||
return state.Editable.data.threshold
|
||||
},
|
||||
() => { this.editedThreshold() }
|
||||
,
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.remove()
|
||||
@ -25,6 +33,17 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
editedThreshold () {
|
||||
var rwy = this.$store.state.Editable.data.threshold.runway
|
||||
var displacement = this.$store.state.Editable.data.threshold.displacement
|
||||
this.layerGroup.eachLayer(l => {
|
||||
if (l instanceof L.Threshold) {
|
||||
if (l.rwy === rwy) {
|
||||
l.setDisplacement(displacement)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getLayer () {
|
||||
return this.layerGroup
|
||||
},
|
||||
@ -65,6 +84,25 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
save () {
|
||||
if (this.layerGroup) {
|
||||
var list = {}
|
||||
|
||||
this.layerGroup.eachLayer(l => {
|
||||
if (l instanceof L.Threshold) {
|
||||
var latitude = l.originLatLng[0].toFixed(6)
|
||||
var longitude = l.originLatLng[1].toFixed(6)
|
||||
|
||||
if (list[l.index] === undefined) {
|
||||
list[l.index] = []
|
||||
}
|
||||
var o = {latitude: latitude, longitude: longitude, index: l.index, rwy: l.rwy, heading: l.heading, displacement: l.displacement, stopw_m: l.stopw_m}
|
||||
list[l.index].push(o)
|
||||
}
|
||||
})
|
||||
writeThresholdXML(this.$store.state.Settings.settings.airportsDirectory, this.icao, list)
|
||||
}
|
||||
},
|
||||
zoomUpdated () {
|
||||
if (this.layerGroup) {
|
||||
this.layerGroup.eachLayer(l => {
|
||||
|
@ -73,16 +73,18 @@ You should have received a copy of the GNU General Public License along with FG
|
||||
}
|
||||
},
|
||||
save () {
|
||||
this.layerGroup.eachLayer(l => {
|
||||
if (l instanceof L.TowerMarker) {
|
||||
var latitude = l.getLatLng().lat.toFixed(6)
|
||||
var longitude = l.getLatLng().lng.toFixed(6)
|
||||
var height = l.elev_m
|
||||
if (this.layerGroup) {
|
||||
this.layerGroup.eachLayer(l => {
|
||||
if (l instanceof L.TowerMarker) {
|
||||
var latitude = l.getLatLng().lat.toFixed(6)
|
||||
var longitude = l.getLatLng().lng.toFixed(6)
|
||||
var height = l.elev_m
|
||||
|
||||
var o = {latitude: latitude, longitude: longitude, height: height}
|
||||
writeTowerXML(this.$store.state.Settings.settings.airportsDirectory, l.icao, o)
|
||||
}
|
||||
})
|
||||
var o = {latitude: latitude, longitude: longitude, height: height}
|
||||
writeTowerXML(this.$store.state.Settings.settings.airportsDirectory, l.icao, o)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
setVisible (visible) {
|
||||
if (this.layerGroup !== undefined) {
|
||||
|
@ -1,3 +1,15 @@
|
||||
<!--
|
||||
Copyright 2020 Keith Paterson
|
||||
|
||||
This file is part of FG Airports.
|
||||
|
||||
FG Airports is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
FG Airports is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with FG Airports. If not, see http://www.gnu.org/licenses/.
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-dialog :title.sync="title" :visible.sync="visible" width="30%" center>
|
||||
<span v-if="max>0">
|
||||
@ -10,6 +22,7 @@
|
||||
|
||||
<el-button @click="handleOkClicked('twr')" :disabled="!tower_comittable" >Upload Tower</el-button>
|
||||
<el-button @click="handleOkClicked('groundnet')" :disabled="!groundnet_comittable" >Upload Groundnet</el-button>
|
||||
<el-button @click="handleOkClicked('threshold')" :disabled="!threshold_comittable" >Upload Threshold</el-button>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeClicked">{{buttonText}}</el-button>
|
||||
@ -321,6 +334,14 @@
|
||||
this.icao + '.groundnet.new.xml');
|
||||
return fs.existsSync(f) && this.$store.state.Check.results.filter(a => a.id>=0).length === 0 && this.gplv2 && this.max === 0 && this.azure && !this.uploading
|
||||
},
|
||||
threshold_comittable: function () {
|
||||
var f = path.join(this.$store.state.Settings.settings.airportsDirectory,
|
||||
this.icao[0],
|
||||
this.icao[1],
|
||||
this.icao[2],
|
||||
this.icao + '.threshold.new.xml');
|
||||
return fs.existsSync(f) && this.gplv2 && this.max === 0 && this.azure && !this.uploading
|
||||
},
|
||||
comittable: function () {
|
||||
return this.$store.state.Check.results.filter(a => a.id>=0).length === 0 && this.gplv2 && this.max === 0 && this.azure && !this.uploading
|
||||
},
|
||||
|
@ -14,14 +14,19 @@ You should have received a copy of the GNU General Public License along with FG
|
||||
const convert = require('geo-coordinates-parser');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const store = require('../store');
|
||||
const turf = require('@turf/turf');
|
||||
|
||||
|
||||
/**http://wiki.openstreetmap.org/wiki/Zoom_levels*/
|
||||
|
||||
|
||||
L.Threshold = L.Marker.extend({
|
||||
options: {
|
||||
zIndexOffset: 20000,
|
||||
},
|
||||
heading: 0,
|
||||
displacement: 0,
|
||||
stopw_m: 0,
|
||||
originLatLng: null,
|
||||
rwy: '',
|
||||
stripSVG: function(fName) {
|
||||
var rx = /<\s*svg[^>]*>([\s\S]*)<\s*\/svg[^>]*>/gm;
|
||||
var svg = fs.readFileSync(path.join(__static, '/', fName), 'utf8');
|
||||
@ -41,11 +46,10 @@ L.Threshold = L.Marker.extend({
|
||||
this.setIcon(L.divIcon({
|
||||
iconSize: 64,
|
||||
className: 'threshold-marker-icon',
|
||||
html: `<div style=\'transform: translateX(${offset}px) translateY(${offset}px) scale(${scale}) rotate(${this.options.heading}deg); border: 1px red\'>${this.svg}</div>`,
|
||||
html: `<div style=\'transform: translateX(${offset}px) translateY(${offset}px) scale(${scale}) rotate(${this.heading}deg); border: 1px red\'>${this.svg}</div>`,
|
||||
}));
|
||||
|
||||
this.update(this.getLatLng());
|
||||
console.debug();
|
||||
this.setLatLng(this.getLatLng());
|
||||
this._metersPP = metersPP;
|
||||
}
|
||||
@ -60,21 +64,86 @@ L.Threshold = L.Marker.extend({
|
||||
pixelValue: function (latitude, meters, zoomLevel) {
|
||||
return meters / metersPerPixel(latitude, zoomLevel);
|
||||
},
|
||||
|
||||
setOrigin (originLatLng) {
|
||||
this.originLatLng = originLatLng;
|
||||
},
|
||||
setHeading (heading) {
|
||||
this.heading = Number(heading);
|
||||
},
|
||||
setRunway (rwy) {
|
||||
this.rwy = Number(rwy);
|
||||
},
|
||||
setStopW (stopw_m) {
|
||||
this.stopw_m = stopw_m;
|
||||
},
|
||||
setDisplacement(displacement) {
|
||||
const turfOptions = { units: 'kilometers' };
|
||||
this.displacement = Number(displacement);
|
||||
|
||||
var newPos = turf.destination([this.originLatLng[1], this.originLatLng[0]], displacement/1000, this.normalizeAngle(this.heading), turfOptions);
|
||||
var newValue = {lat: newPos.geometry.coordinates[1].toFixed(6),
|
||||
lng: newPos.geometry.coordinates[0].toFixed(6) };
|
||||
console.debug(`Threshold Old : ${this.originLatLng} -> ${this.turfToLatLng(newPos)}`);
|
||||
this.setLatLng(newValue);
|
||||
},
|
||||
normalizeAngle( angle ) {
|
||||
if(angle >= 180) {
|
||||
return angle - 360;
|
||||
}
|
||||
if(angle <= -180) {
|
||||
return angle + 360;
|
||||
}
|
||||
return angle;
|
||||
},
|
||||
latToTurf (turfPoint) {
|
||||
return [turfPoint.lng, turfPoint.lat];
|
||||
},
|
||||
latLngToTurf (turfPoint) {
|
||||
return [turfPoint.decimalLongitude, turfPoint.decimalLatitude];
|
||||
},
|
||||
turfToLatLng: function (turfPoint) {
|
||||
return '' + turfPoint.geometry.coordinates[1].toFixed(6) + ',' + turfPoint.geometry.coordinates[0].toFixed(6);
|
||||
}
|
||||
});
|
||||
|
||||
L.Threshold.addInitHook(function(){
|
||||
this.svg = this.stripSVG('FGA_THR.svg');
|
||||
this.iconSize = 500;
|
||||
|
||||
this.on('click', function (event) {
|
||||
console.debug("Click Threshold : ", event);
|
||||
store.default.dispatch('setThreshold', {rwy: event.target.rwy, displacement: event.target.displacement});
|
||||
});
|
||||
this.on('add', function (event) {
|
||||
// event.target.direction.addTo(event.target._map);
|
||||
});
|
||||
});
|
||||
|
||||
//Builds a marker for a ai or multiplayer aircraft
|
||||
//Builds a marker for a threshold
|
||||
/*
|
||||
<threshold>
|
||||
<lon>13.517142</lon>
|
||||
<lat>52.380125</lat>
|
||||
<rwy>07L</rwy>
|
||||
<hdg-deg>68.77</hdg-deg>
|
||||
<displ-m>0.0</displ-m>
|
||||
<stopw-m>160.0</stopw-m>
|
||||
</threshold>
|
||||
*/
|
||||
var threshold = function (n, options) {
|
||||
var latlon = convert(n.find('lat/text()').text() + " " + n.find('lon/text()').text());
|
||||
var rwy = n.find('rwy/text()').text();
|
||||
var heading = n.find('hdg-deg/text()').text();
|
||||
var displ_m = n.find('displ-m/text()').text();
|
||||
var stopw_m = n.find('stopw-m/text()').text();
|
||||
|
||||
var marker = new L.Threshold([latlon.decimalLatitude, latlon.decimalLongitude], {heading: heading, pane: 'threshold-pane'});
|
||||
var marker = new L.Threshold([latlon.decimalLatitude, latlon.decimalLongitude],
|
||||
{pane: 'threshold-pane'});
|
||||
marker.setOrigin([latlon.decimalLatitude, latlon.decimalLongitude]);
|
||||
marker.setHeading(heading);
|
||||
marker.setDisplacement(displ_m);
|
||||
marker.setRunway(rwy);
|
||||
marker.setStopW(stopw_m);
|
||||
return marker;
|
||||
}
|
||||
|
||||
|
@ -40,26 +40,21 @@ exports.readThresholdXML = function (fDir, icao, force) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
var thresholdNodes = xml.find('PropertyList/runway/threshold');
|
||||
console.log("Threshold Nodes" + thresholdNodes.length);
|
||||
var runwayNodes = xml.find('PropertyList/runway');
|
||||
console.log("Threshold Nodes" + runwayNodes.length);
|
||||
|
||||
var merged = new Array();
|
||||
|
||||
var nodesLookup = {};
|
||||
featureLookup = [];
|
||||
|
||||
|
||||
thresholdNodes.map(n => {
|
||||
var icon = threshold(n);
|
||||
icon.addTo(layerGroup);
|
||||
|
||||
var latlon = convert(n.find('lat/text()').text() + " " + n.find('lon/text()').text());
|
||||
/*
|
||||
var marker = new L.Circle([latlon.decimalLatitude, latlon.decimalLongitude], 5);
|
||||
marker.addTo(layerGroup);
|
||||
*/
|
||||
|
||||
// features.push(circle);
|
||||
var index = 0;
|
||||
runwayNodes.map(r => {
|
||||
var thresholds = r.find('threshold');
|
||||
thresholds.map(t => {
|
||||
var icon = threshold(t);
|
||||
icon.index = index;
|
||||
icon.addTo(layerGroup);
|
||||
}
|
||||
)
|
||||
index+=1;
|
||||
}).sort();
|
||||
|
||||
return layerGroup;
|
||||
|
120
src/renderer/loaders/threshold_writer.js
Normal file
120
src/renderer/loaders/threshold_writer.js
Normal file
@ -0,0 +1,120 @@
|
||||
/*
|
||||
Copyright 2021 Keith Paterson
|
||||
|
||||
This file is part of FG Airports.
|
||||
|
||||
FG Airports is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
FG Airports is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with FG Airports. If not, see http://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
/* eslint-disable */
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const store = require('../store');
|
||||
|
||||
const util = require('util');
|
||||
|
||||
const mathjs = require('mathjs');
|
||||
|
||||
var builder = require('xmlbuilder');
|
||||
|
||||
|
||||
|
||||
var writeThresholdXML = function (fDir, icao, coordinates) {
|
||||
try {
|
||||
try { fs.mkdirSync(path.join(fDir), { recursive: true })} catch (err) { }
|
||||
try { fs.mkdirSync(path.join(fDir, icao[0]),{ recursive: true })} catch (err) { }
|
||||
try { fs.mkdirSync(path.join(fDir, icao[0], icao[1]), { recursive: true })} catch (err) { }
|
||||
try { fs.mkdirSync(path.join(fDir, icao[0], icao[1], icao[2]), { recursive: true })} catch (err) { }
|
||||
|
||||
var f = path.join(fDir, icao[0], icao[1], icao[2], icao + '.threshold.new.xml');
|
||||
var fBak = path.join(fDir, icao[0], icao[1], icao[2], icao + '.threshold.bak.xml');
|
||||
|
||||
if( fs.existsSync(f) ) {
|
||||
fs.copyFileSync(f, fBak);
|
||||
}
|
||||
if (f == null)
|
||||
return;
|
||||
var xmlObj = { PropertyList: { runway: map(coordinates) } };
|
||||
|
||||
xmlString = builder.create(xmlObj).end({ pretty: true });
|
||||
fs.writeFileSync(f, xmlString);
|
||||
console.debug(xmlString);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var map = function (o) {
|
||||
console.debug(o);
|
||||
|
||||
/**
|
||||
<?xml version='1.0' encoding='ISO-8859-1'?>
|
||||
<PropertyList>
|
||||
<runway>
|
||||
<threshold>
|
||||
<lon>13.485025</lon>
|
||||
<lat>52.367689</lat>
|
||||
<rwy>07</rwy>
|
||||
<hdg-deg>68.75</hdg-deg>
|
||||
<displ-m>0.0</displ-m>
|
||||
<stopw-m>300.0</stopw-m>
|
||||
</threshold>
|
||||
<threshold>
|
||||
<lon>13.526097</lon>
|
||||
<lat>52.377431</lat>
|
||||
<rwy>25</rwy>
|
||||
<hdg-deg>248.78</hdg-deg>
|
||||
<displ-m>0.0</displ-m>
|
||||
<stopw-m>300.0</stopw-m>
|
||||
</threshold>
|
||||
</runway>
|
||||
<runway>
|
||||
<threshold>
|
||||
<lon>13.517142</lon>
|
||||
<lat>52.380125</lat>
|
||||
<rwy>07L</rwy>
|
||||
<hdg-deg>68.77</hdg-deg>
|
||||
<displ-m>0.0</displ-m>
|
||||
<stopw-m>160.0</stopw-m>
|
||||
</threshold>
|
||||
<threshold>
|
||||
<lon>13.554253</lon>
|
||||
<lat>52.388919</lat>
|
||||
<rwy>25R</rwy>
|
||||
<hdg-deg>248.80</hdg-deg>
|
||||
<displ-m>0.0</displ-m>
|
||||
<stopw-m>300.0</stopw-m>
|
||||
</threshold>
|
||||
</runway>
|
||||
</PropertyList>
|
||||
*/
|
||||
var ret = [];
|
||||
Object.keys(o).forEach(key => {
|
||||
ret.push({ threshold: mapThreshold(o[key])});
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* <latitude>58.106924</latitude>
|
||||
<longitude>6.610419</longitude>
|
||||
<index>0</index>
|
||||
<rwy>14</rwy>
|
||||
<heading>131.16</heading>
|
||||
<displacement>273</displacement>
|
||||
<stopw_m>0.0</stopw_m>
|
||||
|
||||
* @param {*} t
|
||||
*/
|
||||
|
||||
var mapThreshold = function (t) {
|
||||
return t.map( t => {return {lon: t.longitude, lat: t.latitude, rwy: t.rwy, 'hdg-deg': t.heading, 'displ-m': t.displacement, 'stopw-m': t.stopw_m}});
|
||||
}
|
||||
|
||||
export { writeThresholdXML };
|
@ -1,3 +1,14 @@
|
||||
/*
|
||||
Copyright 2021 Keith Paterson
|
||||
|
||||
This file is part of FG Airports.
|
||||
|
||||
FG Airports is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
FG Airports is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with FG Airports. If not, see http://www.gnu.org/licenses/.
|
||||
*/
|
||||
/* eslint-disable */
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
@ -16,7 +16,7 @@ const state = {
|
||||
type: 'none',
|
||||
index: 'none',
|
||||
editing: false,
|
||||
data: {airports: {}, parking: {}, arc: {}, multiarc: {}, node: {}, runway: {}}
|
||||
data: {airports: {}, parking: {}, arc: {}, multiarc: {}, node: {}, runway: {}, threshold: {}}
|
||||
}
|
||||
|
||||
const SET_EDIT_AIRPORT = 'SET_EDIT_AIRPORT'
|
||||
@ -165,6 +165,14 @@ const mutations = {
|
||||
Vue.set(state.data.tower.coords, 'longitude', coords.split(' ')[1])
|
||||
Vue.set(state.data.tower.coords, 'height', coords.split(' ')[2])
|
||||
},
|
||||
'SET_EDIT_THRESHOLD_COORDS' (state, threshold) {
|
||||
state.type = 'threshold'
|
||||
Vue.set(state.data.threshold, 'runway', threshold.rwy)
|
||||
Vue.set(state.data.threshold, 'displacement', threshold.displacement)
|
||||
},
|
||||
'SET_EDIT_THRESHOLD_DISPLACEMENT' (state, displacement) {
|
||||
Vue.set(state.data.threshold, 'displacement', displacement)
|
||||
},
|
||||
'SET_EDIT_ISONRUNWAY' (state, isOnRunway) {
|
||||
Vue.set(state.data.node, 'isOnRunway', isOnRunway)
|
||||
}
|
||||
@ -204,6 +212,12 @@ const actions = {
|
||||
},
|
||||
async setTowerCoords (context, node) {
|
||||
context.commit('SET_EDIT_TOWER_COORDS', node)
|
||||
},
|
||||
async setThreshold (context, node) {
|
||||
context.commit('SET_EDIT_THRESHOLD_COORDS', node)
|
||||
},
|
||||
async setDisplacement (context, displacement) {
|
||||
context.commit('SET_EDIT_THRESHOLD_DISPLACEMENT', displacement)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user