Thanks for your answer, Hooray.
I know I can read and write elements of the property tree, but I'm not sure if I can run a more complex Nasal command.
For example, imagine a remote panel. All light switches I checked can be operated writing on a property, and this can be done easily using telnet. But the autopilot buttons are different because they make a lot of test and conditions. Take the b1900b. To set the autopilot in the HDG mode you can run this simple nasal code:
FCP65_input("hdg");
or run this pseudocode in the remote panel:
tmp = Lmode.getValue();
if(tmp != "HDG") tmp="HDG" else tmp = "ROLL";
Lmode.setValue(tmp);
Larmed.setValue("");
appr_enabled.setValue(0);
nav_enabled.setValue(0);
I prefer to run the first simple command and not mess with the autopilot logic in the remote panel, but I can't see any way to do this.
One nice way to do this would be declaring nasal functions in the protocol files, but I don't know if including nasal code inside the protocol files is possible. For example, this would be "FGDATA/Protocol/remoteautopilot.xml"
- Code: Select all
<PropertyList>
<nasal>
if (some_property_changes) {
FCP65_input("hdg");
}
</nasal>
<generic>
<output>
<line_separator>newline</line_separator>
<var_separator>:</var_separator>
<chunk>
<name>speed</name>
<format>%f</format>
<type>float</type>
<node>/instrumentation/airspeed-indicator/indicated-speed-kt</node>
</chunk>
....
</PropertyList>