1
0
Fork 0

- Alexis Bory (and Melchior):

- Changed properties name in the XML: radardist -> radar-performance.
- Corrected spelling of data.
- Shortened the init message.
This doesn' change the way to call radardist.nas functions.
This commit is contained in:
abory 2008-07-11 21:10:48 +00:00
parent abdc416f32
commit 5eaebdb728
2 changed files with 13 additions and 14 deletions

View file

@ -14,7 +14,7 @@
# radar stuff too. # radar stuff too.
var datas_path = getprop("/sim/fg-root") ~ "/Aircraft/Generic/radardist.xml"; var data_path = getprop("/sim/fg-root") ~ "/Aircraft/Generic/radardist.xml";
var aircraftData = {}; var aircraftData = {};
var radarData = []; var radarData = [];
@ -110,10 +110,10 @@ var radis = func(t, my_radarcorr) {
} }
var load_datas = func { var load_data = func {
# a) converts aircraft model name to lookup (index) number in aircraftData{}. # a) converts aircraft model name to lookup (index) number in aircraftData{}.
# b) appends ordered list of datas into radarData[], # b) appends ordered list of data into radarData[],
# datas are: # data is:
# - acname (the index number) # - acname (the index number)
# - the first (if several) aircraft model name corresponding to this type, # - the first (if several) aircraft model name corresponding to this type,
# - RCS(m2), # - RCS(m2),
@ -122,8 +122,8 @@ var load_datas = func {
# - max. radar range(km), # - max. radar range(km),
# - max. radar range target seize(RCS)m2, # - max. radar range target seize(RCS)m2,
# - 4th root of radar RCS. # - 4th root of radar RCS.
var datas_node = props.globals.getNode("instrumentation/radardist/datas"); var data_node = props.globals.getNode("instrumentation/radar-performance/data");
var aircraft_types = datas_node.getChildren(); var aircraft_types = data_node.getChildren();
foreach( var t; aircraft_types ) { foreach( var t; aircraft_types ) {
var index = t.getIndex(); var index = t.getIndex();
var aircraft_names = t.getChildren(); var aircraft_names = t.getChildren();
@ -148,11 +148,10 @@ var load_datas = func {
} }
var init = func { var init = func {
print("Initializing Radar Datas from: " ~ datas_path); print("Initializing Radar Data");
fgcommand("load", props.Node.new({ "file": datas_path })); fgcommand("load", props.Node.new({ "file": data_path }));
load_datas(); load_data();
} }

View file

@ -9,8 +9,8 @@
max. radar range target seize(RCS)m2, 4th root of radar RCS --> max. radar range target seize(RCS)m2, 4th root of radar RCS -->
<instrumentation> <instrumentation>
<radardist> <radar-performance>
<datas> <data>
<aircraft n="0"> <aircraft n="0">
<name>generic</name> <name>generic</name>
<rcs-sq-meter>5</rcs-sq-meter> <rcs-sq-meter>5</rcs-sq-meter>
@ -533,8 +533,8 @@ max. radar range target seize(RCS)m2, 4th root of radar RCS -->
<max-target-sq-meter>100</max-target-sq-meter> <max-target-sq-meter>100</max-target-sq-meter>
<max-target-4th-root>3.16</max-target-4th-root> <max-target-4th-root>3.16</max-target-4th-root>
</aircraft> </aircraft>
</datas> </data>
</radardist> </radar-performance>
</instrumentation> </instrumentation>