I inserted the following code into acconfig.nas
First I created a list of all the properties (called "experiment_props") which I wanted to be able to switch the webpanels I had created from reading from the flightgear FDM to reading from my data.
This was done as it meant my webpanels could watch properties I could guarantee weren't being used by a flightgear process for anything.
Then it was just a matter of unaliasing the new properties when I wanted to start feeding my data to the pilots panels.
I did contemplate making it robust enough to switch it on and off but decided not to fiddle with it for the time being.
- Code: Select all
setprop("/systems/acconfig/autostart-taxi", 0);
setlistener("/systems/acconfig/autostart-taxi", func {
if (getprop("/systems/acconfig/autostart-taxi") == 1 ) {
taxi();
setprop("/systems/acconfig/panel-load-completed", 1);
var experiments_props = experiments_props;
foreach(var lentry; experiments_props){
var experiment_tmp = string.join("",["/experiment",lentry]);
var tmp_node = props.globals.initNode(experiment_tmp).alias(lentry);
};
setlistener("/systems/acconfig/override-begin", func {
if (getprop("/systems/acconfig/override-begin") ==1) {
setprop("/systems/acconfig/override-message-ack",1);
var experiments_props = experiments_props;
foreach(var lentry; experiments_props){
var experiment_tmp = string.join("",["/experiment",lentry]);
var tmp_node = props.globals.getNode(experiment_tmp).unalias(lentry);
var tmp_val = getprop(lentry);
setprop(experiment_tmp,tmp_val);
};
};
});
}
});