AC001 wrote: > First am a newbie to FlightGear and am throughly enjoying the experience ;-) > > Am hacking in pyqt experimenting/researching with sockets (to eventually > interface with Arudino) > > The FG->output to pyqt listening is working great, with no major issues. > > However I am having problems with the input side and would appreciate > some direction. > > The issues are. > 1) can I acknowledge/debug that fg is receiving the input from socket > 2) unsure about the formatting of the <input><chunk> > 3) unsure how to format the input variable in the correct way.. > > below are the various elements snipped in parts > > my command line is > > /home/flight-sim/flight-gear-9/source/src/Main/fgfs \ > --fg-root=/home/flight-sim/flight-gear-9/data \ > --httpd=9090 \ > --aircraft=A380 \ > --disable-real-weather-fetch --disable-clouds --timeofday=noon > --fog-disable \ > --generic=socket,out,10,127.0.0.1,6789,udp,mash \ > --generic=socket,in,5,127.0.0.1,6788,udp,mash \ > --trace-write=/sim/gui/dialogs/autopilot/speed-active > > and the mash.xml protocol file > > <?xml version="1.0"?> > <PropertyList> > <generic> > <input> > <line_separator>newline</line_separator> > <var_separator>tab</var_separator> > > > <chunk> > <name>speed-active</name> > <type>bool</type> > <node>/sim/gui/dialogs/autopilot/speed-active</node> > </chunk> > </input> > > <output> > <line_separator>newline</line_separator> > <var_separator>tab</var_separator> > > <chunk> > <name>aileron</name> > <type>float</type> > <format>aileron=%03.2f</format> > <node>/controls/flight/aileron</node> > </chunk> > > <chunk> > <name>elevator</name> > <type>float</type> > <format>elevator=%03.2f</format> > <node>/surface-positions/elevator-pos-norm</node> > </chunk> > ---- snipped------ > > > the python code > # eg "speed-active=true\n" is sent > datagram = "speed-active=%s\n" % (val) > print datagram > self.udpSocket.writeDatagram(datagram, > QtNetwork.QHostAddress(QtNetwork.QHostAddress.Broadcast), 6788) > > > help would be greatly appreciated > tia > pedro > ac001 > > 1) Find the property /sim/gui/dialogs/autopilot/speed-active in property tree (via FG menu or in browser at local port 9090 ). If you can drive it from external program than all is fine.
2) As I see you are sending data from python in the form like this: speed-active=0 speed-active=1 speed-active=1 FG does not accepts variable names and expects input in the form 0 1 1 With respect, Alex ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel