Commit 5943ef0a authored by Михаил Данилов's avatar Михаил Данилов 💬

Орбита-10: радиус Земли. Show load in ground supply.

parent 66f04aee
......@@ -11,16 +11,22 @@ var PrintParkingArgs = func {
var PrintPosAndFuel = func {
var pos = geo.aircraft_position();
var psi = getprop("/orientation/heading-deg");
print("========== Position and fuel ==========");
print("===== Position, fuel and payload ======");
print("phi " ~ pos.lat() ~ " deg");
print("lambda " ~ pos.lon() ~ " deg");
print("psi " ~ psi ~ " deg");
print("H " ~ pos.alt() ~ " m");
var numtanks = getprop("/consumables/fuel/numtanks");
for(var itank = 0; itank < numtanks; itank += 1){
var name = getprop("/consumables/fuel/tank[" ~ itank ~ "]/name");
var fuel = getprop("/consumables/fuel/tank[" ~ itank ~ "]/level-kg");
print(name ~ " " ~ fuel ~ " kg");
var name = getprop("/consumables/fuel/tank[" ~ itank ~ "]/name");
var fuel = getprop("/consumables/fuel/tank[" ~ itank ~ "]/level-kg");
print(name ~ " " ~ fuel ~ " kg");
}
var numweights = 7;
for(var iweight = 0; iweight < numweights; iweight += 1){
var name = getprop("/payload/weight[" ~ iweight ~ "]/name");
var weight = getprop("/payload/weight[" ~ iweight ~ "]/weight-lb") * LB2KG;
print(name ~ " " ~ weight ~ " kg");
}
print("=======================================");
}
......
......@@ -43,6 +43,8 @@ var _loop = func() {
getprop("/fdm/jsbsim/atmosphere/T-degC")
)
);
setprop("/payload/aircraft-weight-kg", getprop("/fdm/jsbsim/inertia/weight-lbs") * LB2KG);
calcWeight();
}
var _timer = maketimer(1.02, func{_loop()});
......@@ -54,3 +56,22 @@ setlistener("/sim/signals/fdm-initialized", func(p) {
}
_timer.start();
});
var numweights = 7;
var calcWeight = func() {
var sum = 0.0;
for(var iweight = 0; iweight < numweights; iweight += 1){
sum += getprop("/payload/weight[" ~ iweight ~ "]/weight-lb");
}
sum *= LB2KG;
setprop("/payload/payload-weight-kg", sum);
}
# FGBUG Broken!
#for(var iweight = 0; iweight < numweights; iweight += 1){
# setlistener("/payload/weight[" ~ iweight ~ "]/weight-lb", func() {
# calcWeight();
# });
#}
......@@ -78,10 +78,7 @@ XXX K_PU most likely not meant literally! Such a large value would get clipped l
-->
<property value="-4.0">&U;/roll/tuning/F_deltapsi-min</property>
<property value="4.0">&U;/roll/tuning/F_deltapsi-max</property>
<!-- FIXME Disconnected until we got proper ortho compass or FMC.
<property value="2.0">&U;/roll/tuning/K_gamma_psi</property>
-->
<property value="0.0">&U;/roll/tuning/K_gamma_psi</property>
<property value="3.6">&U;/roll/tuning/K_psiZK</property>
<property value="-20.0">&U;/roll/tuning/F_psiZK-min</property>
<property value="20.0">&U;/roll/tuning/F_psiZK-max</property>
......
......@@ -31,9 +31,9 @@
<product>
<sum>
<p>fcs/NPK/SVS/H/Habs-m</p>
<v>6378138.12</v><!-- Eath radius -->
<v>6371000.0</v><!-- Eath radius -->
</sum>
<v>0.00000015678556675721534</v><!-- = 1 / Earth radius -->
<v>0.00000015696123057604</v><!-- = 1 / Earth radius -->
</product>
</function>
</fcs_function>
......@@ -41,11 +41,11 @@
<fcs_function name="fcs/NPK/Orbita/func/Vground/SVS/tas2gs">
<function>
<quotient>
<v>6378138.12</v><!-- Eath radius -->
<v>6371000.0</v><!-- Eath radius -->
<max>
<sum>
<p>fcs/NPK/SVS/H/Habs-m</p>
<v>6378138.12</v><!-- Eath radius -->
<v>6371000.0</v><!-- Eath radius -->
</sum>
<v>1.0</v>
</max>
......
......@@ -163,7 +163,7 @@
<pure_gain name="fcs/NPK/Orbita/func/airport/ortho/Y-km">
<input>fcs/NPK/Orbita/func/airport/ortho/Y-rad</input>
<gain>6378.13812</gain><!-- Earth radius -->
<gain>6371.0</gain><!-- Earth radius -->
</pure_gain>
<fcs_function name="fcs/NPK/Orbita/func/airport/ortho/X-rad">
......@@ -179,7 +179,7 @@
<pure_gain name="fcs/NPK/Orbita/func/airport/ortho/X-km">
<input>fcs/NPK/Orbita/func/airport/ortho/X-rad</input>
<gain>6378.13812</gain><!-- Earth radius -->
<gain>6371.0</gain><!-- Earth radius -->
</pure_gain>
</channel>
......
......@@ -138,7 +138,7 @@
<pure_gain name="fcs/NPK/Orbita/func/corr/common/S-rad">
<input>fcs/NPK/Orbita/func/corr/phi-lam/mS-km</input>
<gain>-0.00015678556675721534</gain><!-- = -1 / Earth radius = -1 / 6378.13812 -->
<gain>-0.00015696123057604771</gain><!-- = -1 / Earth radius = -1 / 6371 -->
</pure_gain>
<fcs_function name="fcs/NPK/Orbita/func/corr/common/S-sin">
......@@ -394,7 +394,7 @@
<pure_gain name="fcs/NPK/Orbita/func/corr/ortho/S-km">
<input>fcs/NPK/Orbita/func/corr/ortho/S-rad</input>
<gain>6378.13812</gain><!-- Earth radius -->
<gain>6371.0</gain><!-- Earth radius -->
</pure_gain>
<fcs_function name="fcs/NPK/Orbita/func/corr/ortho/Z-rad">
......@@ -410,7 +410,7 @@
<pure_gain name="fcs/NPK/Orbita/func/corr/ortho/Z-km">
<input>fcs/NPK/Orbita/func/corr/ortho/Z-rad</input>
<gain>6378.13812</gain><!-- Earth radius -->
<gain>6371.0</gain><!-- Earth radius -->
</pure_gain>
</channel>
......
......@@ -4795,7 +4795,7 @@
<pure_gain name="fcs/NPK/Orbita/func/dist/dist/distance-km">
<input>fcs/NPK/Orbita/func/dist/dist/distance-rad</input>
<gain>6378.13812</gain><!-- Earth radius -->
<gain>6371.0</gain><!-- Earth radius -->
</pure_gain>
</channel>
......
......@@ -17,7 +17,7 @@
Take note of longitude (lam_start), turn right with a fixed bank angle (gamma)
and capture lam_end when the heading is 180.
K = (lam_end - lam_start) * R_Earth * g * tg(gamma) / V^2 =
= 0.1872 * 6378.13812 * 9.8 tg(20) / 739.6^2.
= 0.1872 * 6371 * 9.8 tg(20) / 739.6^2.
-->
<property value="-100.0">fcs/NPK/Orbita/func/leg/tuning/F_LUR</property>
<property value="1.1">fcs/NPK/Orbita/func/leg/tuning/K_prepare</property>
......@@ -536,7 +536,7 @@
<pure_gain name="fcs/NPK/Orbita/func/leg/ortho/S-km">
<input>fcs/NPK/Orbita/func/leg/ortho/S-rad</input>
<gain>6378.13812</gain><!-- Earth radius -->
<gain>6371.0</gain><!-- Earth radius -->
</pure_gain>
<fcs_function name="fcs/NPK/Orbita/func/leg/ortho/S-norm">
......@@ -568,7 +568,7 @@
<pure_gain name="fcs/NPK/Orbita/func/leg/ortho/Z-km">
<input>fcs/NPK/Orbita/func/leg/ortho/Z-rad</input>
<gain>6378.13812</gain><!-- Earth radius -->
<gain>6371.0</gain><!-- Earth radius -->
</pure_gain>
<!-- Spherical SAS triangle. -->
......
......@@ -2452,7 +2452,7 @@
</pure_gain>
<fcs_function name="gear/unit[1]/brake/force-norm">
<!-- XXX -->
<!-- FGBUG controlled directly from input by default. -->
<output>fcs/left-brake-cmd-norm</output>
<function>
<product>
......@@ -2549,7 +2549,7 @@
</pure_gain>
<fcs_function name="gear/unit[2]/brake/force-norm">
<!-- XXX -->
<!-- FGBUG controlled directly from input by default. -->
<output>fcs/right-brake-cmd-norm</output>
<function>
<product>
......
......@@ -370,11 +370,11 @@
<fcs_function name="velocities/tas2gs">
<function>
<quotient>
<v>6378138.12</v><!-- Eath radius -->
<v>6371000.0</v><!-- Eath radius -->
<max>
<sum>
<p>position/h-sl-meters</p>
<v>6378138.12</v><!-- Eath radius -->
<v>6371000.0</v><!-- Eath radius -->
</sum>
<v>0.1</v>
</max>
......
......@@ -125,6 +125,46 @@
</group>
<group><layout>hbox</layout>
<text><label>Fuel:</label></text>
<text>
<pref-width>24</pref-width>
<property>/fdm/jsbsim/propulsion/fuel/contents-kg</property>
<format>%3.0f kg</format>
<live>true</live>
</text>
</group>
<group><layout>hbox</layout>
<text><label>Payload:</label></text>
<text>
<pref-width>24</pref-width>
<property>/payload/payload-weight-kg</property>
<format>%3.0f kg</format>
<live>true</live>
</text>
</group>
<group><layout>hbox</layout>
<text><label>Gross weight:</label></text>
<text>
<pref-width>24</pref-width>
<property>/payload/aircraft-weight-kg</property>
<format>%3.0f kg</format>
<live>true</live>
</text>
</group>
<group><layout>hbox</layout>
<text><label>CoG:</label></text>
<text>
<pref-width>24</pref-width>
<property>/fdm/jsbsim/propulsion/fuel/trim/cg-pMAC</property>
<format>%3.2f %%MAC</format>
<live>true</live>
</text>
</group>
<checkbox>
<halign>left</halign>
<label>Wheel chocks</label>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment