f16jockey_2 Posted September 7, 2019 Share Posted September 7, 2019 I made a background gauge to make the Captain Sim L-1011 work with ISG gauges FMS flightplan. It's loosely based on a gauge from Paul Tally for the CS-737 I found at Avsim. Here's the code: ISG FMS Control for Captain Sim 1011 ISG_Control_CS1011.xml True 0.000,0.000 <br /> <br /> [color=#a52a2a] (L:isg_lnav,bool)<br /> if{ (A:HEADING INDICATOR,degrees) near (L:isg_lnav_hdg_set) != <br /> if{ (L:isg_lnav_hdg_set) (>K:HEADING_BUG_SET) } }<br /> <br /> [/color] Basically it reads two variables from ISG: L:isg_lnav detects if the LNAV button is active or not L:isg_lnav_hdg_set is the heading the FMS wants the AC to follow So when needed, the gauge injects L:isg_lnav_hdg_set into A:HEADING INDICATOR via >K:HEADING_BUG_SET Meaning with AP HDG and LNAV active, the aircraft follows the FMS flightplan. Hurray! Using the gauge, I observed the following: when the gauge is refreshing A:HEADING INDICATOR constantly (when the AC is turning) it puts a high load on the system, making other gauges lag. For example the altitude selector changes in increments of 1000 where normallly it's 100. The IAS selector changes in increments of 10 where it should be 1. IIRC that's proof of the gauge refreshing too fast. When flying straight, all mentioned selectors work OK. So my question is: how do I diminish the load from the above gauge? Maybe a timer, maybe something else? Any suggestion is welcome. And code would be appreciated, as I'm a very casual programmer. Wim Link to comment Share on other sites More sharing options...
f16jockey_2 Posted September 7, 2019 Author Share Posted September 7, 2019 Never mind. Found a pretty simple solution with a counter. ISG FMS Control for Captain Sim 1011 ISG_Control_CS1011.xml True 0.000,0.000 <br /> (L:count,enum) 7 >= <!-- Check every nth time --><br /> if{ 0 (>L:count,enum) <!-- Reset counter --><br /> (L:isg_lnav,bool)<br /> if{ (A:HEADING INDICATOR,degrees) near (L:isg_lnav_hdg_set) != <br /> if{ (L:isg_lnav_hdg_set) (>K:HEADING_BUG_SET) } } }<br /> els{ (L:count,enum) ++ (>L:count,enum) } <!-- Increment counter --><br /> <br /> Wim Link to comment Share on other sites More sharing options...
Recommended Posts