Phi: define properties using the new object/hash syntax
This commit is contained in:
parent
7bfa20933b
commit
fd3a5d240a
1 changed files with 54 additions and 102 deletions
156
Phi/main.js
156
Phi/main.js
|
@ -19,9 +19,9 @@ require.config({
|
||||||
aircraft : '../aircraft-dir',
|
aircraft : '../aircraft-dir',
|
||||||
pagedown : '3rdparty/pagedown',
|
pagedown : '3rdparty/pagedown',
|
||||||
clockpicker : '3rdparty/clockpicker/jquery-clockpicker.min',
|
clockpicker : '3rdparty/clockpicker/jquery-clockpicker.min',
|
||||||
stamen: 'http://maps.stamen.com/js/tile.stamen',
|
stamen : 'http://maps.stamen.com/js/tile.stamen',
|
||||||
},
|
},
|
||||||
waitSeconds: 30,
|
waitSeconds : 30,
|
||||||
});
|
});
|
||||||
|
|
||||||
require([
|
require([
|
||||||
|
@ -29,107 +29,59 @@ require([
|
||||||
'jquery-ui/sortable', 'flot', 'leaflet', 'knockprops'
|
'jquery-ui/sortable', 'flot', 'leaflet', 'knockprops'
|
||||||
], function(ko, jquery, Sammy, fgcommand) {
|
], function(ko, jquery, Sammy, fgcommand) {
|
||||||
|
|
||||||
ko.utils.knockprops.setAliases([
|
ko.utils.knockprops.setAliases({
|
||||||
// time
|
|
||||||
[
|
|
||||||
"gmt", "/sim/time/gmt"
|
|
||||||
], [
|
|
||||||
"timeWarp", "/sim/time/warp"
|
|
||||||
],
|
|
||||||
|
|
||||||
// flight
|
// time
|
||||||
[
|
gmt : "/sim/time/gmt",
|
||||||
"pitch", "/orientation/pitch-deg"
|
timeWarp : "/sim/time/warp",
|
||||||
], [
|
// flight
|
||||||
"roll", "/orientation/roll-deg"
|
pitch : "/orientation/pitch-deg",
|
||||||
], [
|
roll : "/orientation/roll-deg",
|
||||||
"heading", "/orientation/heading-magnetic-deg"
|
heading : "/orientation/heading-magnetic-deg",
|
||||||
], [
|
"true-heading" : "/orientation/heading-deg",
|
||||||
"true-heading", "/orientation/heading-deg"
|
altitude : "/position/altitude-ft",
|
||||||
], [
|
latitude : "/position/latitude-deg",
|
||||||
"altitude", "/position/altitude-ft"
|
longitude : "/position/longitude-deg",
|
||||||
], [
|
airspeed : "/velocities/airspeed-kt",
|
||||||
"latitude", "/position/latitude-deg"
|
groundspeed : "/velocities/groundspeed-kt",
|
||||||
], [
|
slip : "/instrumentation/slip-skid-ball/indicated-slip-skid",
|
||||||
"longitude", "/position/longitude-deg"
|
cg : "/fdm/jsbsim/inertia/cg-x-in",
|
||||||
], [
|
weight : "/fdm/jsbsim/inertia/weight-lbs",
|
||||||
"airspeed", "/velocities/airspeed-kt"
|
|
||||||
], [
|
// radio settings
|
||||||
"groundspeed", "/velocities/groundspeed-kt"
|
com1stn : "/instrumentation/comm/station-name",
|
||||||
], [
|
com1use : "/instrumentation/comm/frequencies/selected-mhz",
|
||||||
"slip", "/instrumentation/slip-skid-ball/indicated-slip-skid"
|
com1sby : "/instrumentation/comm/frequencies/standby-mhz",
|
||||||
], [
|
com1stn : "/instrumentation/comm/station-name",
|
||||||
"cg", "/fdm/jsbsim/inertia/cg-x-in"
|
com2stn : "/instrumentation/comm[1]/station-name",
|
||||||
], [
|
com2use : "/instrumentation/comm[1]/frequencies/selected-mhz",
|
||||||
"weight", "/fdm/jsbsim/inertia/weight-lbs"
|
com2sby : "/instrumentation/comm[1]/frequencies/standby-mhz",
|
||||||
],
|
com2stn : "/instrumentation/comm[1]/station-name",
|
||||||
// radio settings
|
nav1use : "/instrumentation/nav/frequencies/selected-mhz",
|
||||||
[
|
nav1sby : "/instrumentation/nav/frequencies/standby-mhz",
|
||||||
"com1stn", "/instrumentation/comm/station-name"
|
nav1stn : "/instrumentation/nav/nav-id",
|
||||||
], [
|
nav2use : "/instrumentation/nav[1]/frequencies/selected-mhz",
|
||||||
"com1use", "/instrumentation/comm/frequencies/selected-mhz"
|
nav2sby : "/instrumentation/nav[1]/frequencies/standby-mhz",
|
||||||
], [
|
nav2stn : "/instrumentation/nav[1]/nav-id",
|
||||||
"com1sby", "/instrumentation/comm/frequencies/standby-mhz"
|
adf1use : "/instrumentation/adf/frequencies/selected-khz",
|
||||||
], [
|
adf1sby : "/instrumentation/adf/frequencies/standby-khz",
|
||||||
"com1stn", "/instrumentation/comm/station-name"
|
adf1stn : "/instrumentation/adf/ident",
|
||||||
], [
|
dme1use : "/instrumentation/dme/frequencies/selected-mhz",
|
||||||
"com2stn", "/instrumentation/comm[1]/station-name"
|
dme1dst : "/instrumentation/dme/indicated-distance-nm",
|
||||||
], [
|
xpdrcod : "/instrumentation/transponder/id-code",
|
||||||
"com2use", "/instrumentation/comm[1]/frequencies/selected-mhz"
|
// weather
|
||||||
], [
|
"ac-wdir" : "/environment/wind-from-heading-deg",
|
||||||
"com2sby", "/instrumentation/comm[1]/frequencies/standby-mhz"
|
"ac-wspd" : "/environment/wind-speed-kt",
|
||||||
], [
|
"ac-visi" : "/environment/visibility-m",
|
||||||
"com2stn", "/instrumentation/comm[1]/station-name"
|
"ac-temp" : "/environment/temperature-degc",
|
||||||
], [
|
"ac-dewp" : "/environment/dewpoint-degc",
|
||||||
"nav1use", "/instrumentation/nav/frequencies/selected-mhz"
|
"gnd-wdir" : "/environment/config/boundary/entry/wind-from-heading-deg",
|
||||||
], [
|
"gnd-wspd" : "/environment/config/boundary/entry/wind-speed-kt",
|
||||||
"nav1sby", "/instrumentation/nav/frequencies/standby-mhz"
|
"gnd-visi" : "/environment/config/boundary/entry/visibility-m",
|
||||||
], [
|
"gnd-temp" : "/environment/config/boundary/entry/temperature-degc",
|
||||||
"nav1stn", "/instrumentation/nav/nav-id"
|
"gnd-dewp" : "/environment/config/boundary/entry/dewpoint-degc",
|
||||||
], [
|
"metar-valid" : "/environment/metar/valid",
|
||||||
"nav2use", "/instrumentation/nav[1]/frequencies/selected-mhz"
|
});
|
||||||
], [
|
|
||||||
"nav2sby", "/instrumentation/nav[1]/frequencies/standby-mhz"
|
|
||||||
], [
|
|
||||||
"nav2stn", "/instrumentation/nav[1]/nav-id"
|
|
||||||
], [
|
|
||||||
"adf1use", "/instrumentation/adf/frequencies/selected-khz"
|
|
||||||
], [
|
|
||||||
"adf1sby", "/instrumentation/adf/frequencies/standby-khz"
|
|
||||||
], [
|
|
||||||
"adf1stn", "/instrumentation/adf/ident"
|
|
||||||
], [
|
|
||||||
"dme1use", "/instrumentation/dme/frequencies/selected-mhz"
|
|
||||||
], [
|
|
||||||
"dme1dst", "/instrumentation/dme/indicated-distance-nm"
|
|
||||||
], [
|
|
||||||
"xpdrcod", "/instrumentation/transponder/id-code"
|
|
||||||
],
|
|
||||||
// weather
|
|
||||||
[
|
|
||||||
"ac-wdir", "/environment/wind-from-heading-deg"
|
|
||||||
], [
|
|
||||||
"ac-wspd", "/environment/wind-speed-kt"
|
|
||||||
], [
|
|
||||||
"ac-visi", "/environment/visibility-m"
|
|
||||||
], [
|
|
||||||
"ac-temp", "/environment/temperature-degc"
|
|
||||||
], [
|
|
||||||
"ac-dewp", "/environment/dewpoint-degc"
|
|
||||||
], [
|
|
||||||
"gnd-wdir", "/environment/config/boundary/entry/wind-from-heading-deg"
|
|
||||||
], [
|
|
||||||
"gnd-wspd", "/environment/config/boundary/entry/wind-speed-kt"
|
|
||||||
], [
|
|
||||||
"gnd-visi", "/environment/config/boundary/entry/visibility-m"
|
|
||||||
], [
|
|
||||||
"gnd-temp", "/environment/config/boundary/entry/temperature-degc"
|
|
||||||
], [
|
|
||||||
"gnd-dewp", "/environment/config/boundary/entry/dewpoint-degc"
|
|
||||||
], [
|
|
||||||
"metar-valid", "/environment/metar/valid"
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
|
|
||||||
function PhiViewModel(props) {
|
function PhiViewModel(props) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
Loading…
Add table
Reference in a new issue