Smoother G1000¶
The FG1000 runs almost entirely in Nasal and slowed my Cessna in flight to 1 to 2 frames per second. Two bug fixes and a filter make it much smoother: in cruise, 18.5 to 30 instead of 11 frames per second. The analysis is in the article G1000: Zwei Fehler beheben (German).

With the patch¶
cd "$FG_BASIS/downloads"
curl -LO https://codemich.de/medien/fg1000/fg1000_patch.zip
unzip -o fg1000_patch.zip -d fg1000_patch
python3 fg1000_patch/fg1000_patch.py "$FG_BASIS/fgdata"
The script backs up each file as .orig and changes only places it finds exactly as expected. The other calls:
python3 fg1000_patch/fg1000_patch.py "$FG_BASIS/fgdata" --ohne-karte # also turns off the OSM map in the MFD
python3 fg1000_patch/fg1000_patch.py "$FG_BASIS/fgdata" --zurueck # restores the originals
Then fly with the G1000:
"$FG_BASIS/werkzeuge/starten.sh" --aircraft=c172p-fg1000-gfc --airport=EDDE
By hand¶
The files are in fgdata/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/.
PropertyPublisher.nas: The last parameter of setlistener decides. 1 means on every write, 0 only on a real change.
var listener = setlistener(propmap.getPropPath(), func(p) { me.publish(p); }, 1, 0);
That alone almost doubles the frame rate on the ground.
GFC700Publisher.nas: The flight director bar targets get their own publisher with 10 messages per second:
obj._fdPublisher = PeriodicPropertyPublisher.new(notifications.PFDEventNotification.FMSData, 0.1);
obj._fdPublisher.addPropMap("AutopilotTargetPitch", "/autopilot/settings/target-pitch-deg", 0.2);
obj._fdPublisher.addPropMap("AutopilotTargetRoll", "/autopilot/settings/target-roll-deg", 0.2);
start : func() {
call(TriggeredPropertyPublisher.start, [], me);
me._fdPublisher.start();
},
stop : func() {
call(TriggeredPropertyPublisher.stop, [], me);
me._fdPublisher.stop();
},
FG1000/GFC700.xml: The ILS receiver briefly delivers nonsense values during capture, which made the Cessna sink about 200 ft below the glide path. A filter goes in front of both GS controllers, and the controller uses its output as reference:
<filter>
<name>GS target climb rate NAV1 limited</name>
<type>noise-spike</type>
<input>
<prop>/instrumentation/nav[0]/gs-rate-of-climb</prop>
<min>-25.0</min>
<max>5.0</max>
</input>
<output><prop>/autopilot/internal/gs-rate-of-climb-nav0</prop></output>
<max-rate-of-change>4.0</max-rate-of-change>
</filter>
Measure it yourself¶
The pattern fits any Emesary system: the script wraps the Receive function of each recipient and counts time and messages.
foreach (var r; emesary.GlobalTransmitter.Recipients) {
r._orig = r.Receive;
r.Receive = func(n) {
var ts = maketimestamp();
ts.stamp();
var res = call(me._orig, [n], me);
var key = me.Ident ~ " | " ~ n.NotificationType ~ " " ~ n.Event_Id;
zeit[key] = (zeit[key] or 0) + ts.elapsedUSec();
anzahl[key] = (anzahl[key] or 0) + 1;
return res;
};
}
An fgdata update overwrites the changes; in that case, run the script again.