Richard Harrison
2c8aad12ba
Model relative property tree root binding.
...
Change fgcommand to take an optional property tree root element.
This fixes the animation bindings to use the defined property tree root - to support multiplayer (or other) model that can bind to the correct part of the property tree.
Requires a corresponding fix in sg to allow the command methods to take an optional root parameter.
What this means is that when inside someone else's multiplayer model (e.g. backseat, or co-pilot), the multipalyer (AI) model will correctly modify properties inside the correct part of the property tree inside (/ai), rather than modifying the properties inside the same part of the tree as the non-ai model.
This means that a properly setup model will operate within it's own space in the property tree; and permit more generic multiplayer code to be written.
This is probably responsible for some of the pollution of the root property tree with MP aircraft properties.
2017-07-05 11:37:17 +02:00
James Turner
29fe9316af
Generic protocol fix for integer-factors.
...
Read all values as floating point before applying a factor, then
convert to the target type (int, byte or short). Suggested and
implemented by Oliver Kroth.
2017-03-16 15:54:38 +00:00
Szymon Acedański
f71c20600a
Fixed erroreous reference to array instead of its element
...
net->master_{bat,alt} are arrays, but were mistakenly used as
values.
This correctly generated a compilation warning.
2017-02-25 15:05:09 +01:00
James Turner
8472f8c6d0
Fix positional ordering of remote-canvas elements.
...
The mirror protocol now sends the position for internal as well as
leaf nodes, and the group uses this data to sort when no explicit
Z-indices exist. This gets the extra-500 much closer to working!
2017-01-26 23:14:48 +00:00
James Turner
c9f922ce1b
Expose node position over property-mirror protocol.
2017-01-26 20:36:07 +00:00
martymac
ffc7ad6cdf
Fix build with Clang 4.0.0.
...
Those patches fix errors related to ordered comparisons between pointers and
integers, such as the ones related here on FreeBSD :
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216203
2017-01-21 21:32:50 +00:00
James Turner
95e09de1ff
Remove a log message.
2016-12-28 22:01:29 +01:00
James Turner
eba1f3221f
Fix a bug starting the property-tree mirror.
2016-12-21 10:26:31 +00:00
Torsten Dreyer
c472788ad8
Httpd: fix slow websocket init
2016-12-20 11:46:02 +01:00
James Turner
4fb5bc8512
Property-Mirror websocket: fix removing props.
...
Special case handling when recently removed properties are re-added;
when this happens simply send a value change since it's much cheaper
over the wire and for the receiver. Poorly designed Canvas code does
this frequently (eg, every update)
2016-12-10 22:01:25 +00:00
James Turner
b767a33f84
MirrorPropertyTree websocket fixes
...
- deal with ‘NONE’ properties correctly
- use a better method to send the initial tree on connection.
2016-12-05 21:27:38 +00:00
Torsten Dreyer
c3c0d25fe7
Fix Linux build
2016-12-03 22:46:31 +01:00
James Turner
47042b03f4
Expose an entire property tree via WebSockets.
...
Use a recursive listener to expose a property tree via a WebSocket.
Currently using a JSON-based encoding, will likely change to binary so
please don’t write code using this interface until the encoding
is stable and documented!
2016-12-03 14:23:48 +00:00
Torsten Dreyer
c4ea89dc97
Revert "temporarily add some noisy debug messages"
...
This reverts commit f538a6e1a1
.
2016-11-20 11:39:46 +01:00
Torsten Dreyer
f538a6e1a1
temporarily add some noisy debug messages
2016-11-19 18:26:06 +01:00
Torsten Dreyer
b652758330
Merge branch 'topics/mpdiscovery-via-dns' into next
2016-11-17 14:45:40 +01:00
Torsten Dreyer
994ea1674b
replace many auto_ptr by unique_ptr
2016-11-14 22:20:46 +01:00
Torsten Dreyer
09949ff3e3
Some logging cleanup and ignore SRV records with port #0
2016-11-14 21:57:50 +01:00
Torsten Dreyer
979010de4d
Initial commit of mpserver discovery via DNS
2016-11-10 11:14:49 +01:00
Torsten Dreyer
65b51b8d91
Limit the update rate of the property change websocket
...
Of fast systems with 60fps sending many properties to web clients
may overrun the rendering capabilities of the browser. At some point
the web socket client halts the simulation by throtteling the network
connection.
Update rate is settable at startup setting to a double value
/sim/http/property-websocket/update-interval-secs
(default: 0.05 aka 20Hz)
2016-10-26 11:02:24 +02:00
Curtis L. Olson
7da08db463
Update default aircraft hangar catalog.xml url.
2016-09-07 11:39:37 -05:00
James Turner
9cffcf63ae
Further SGPath encoding fixes.
2016-07-01 04:54:29 -05:00
James Turner
6d0c2070fd
Use future-proof SGPath APIs.
...
Remove uses of .str(), .c_str() and some other methods of SGPath.
Pass SGPath directly where possible, or explicitly convert to the
appropriate 8-bit encoding.
2016-06-28 10:08:38 +01:00
James Turner
5d624b4882
Fallback URL when official catalog is not found.
...
Tolerate the case where a URL matching the exact FG version is
not found; lookup a generic URL, in the hope it supports our
version (additional changes will make this more likely)
2016-05-26 17:37:26 +01:00
James Turner
733e3b3f0c
HTTP subsystem has a default name.
...
Switch to using type-safe accessors now.
2016-03-24 15:08:38 +00:00
James Turner
bb9fd9defe
Fix a bug with updating packages.
...
- always refresh the catalogs each launch, so we don’t get mismatches
between the cached copy the and package zips.
2016-01-26 16:46:58 +00:00
Torsten Dreyer
6f09b9e31e
httpd: expose /fg-home and /fg-root
2016-01-13 13:25:16 +01:00
James Turner
e5fa1a5ab1
Merge /u/userid-1550991/flightgear/ branch next into next
...
http://sourceforge.net/p/flightgear/flightgear/merge-requests/31/
2015-12-14 14:57:18 +00:00
www2
2da5541901
Add feedback if prompt mode is use
2015-12-13 15:57:53 +01:00
www2
95e3d00a17
Add new commands to telnet protocall
...
New comands:
setb set a Boolean value
setd set a Floaring point value
seti set a integer value
del delete a node
2015-12-12 15:43:00 +01:00
James Turner
8877b442f8
ATC/Traffic doesn’t crash reset.
...
- remove some global headers from AI headers, to avoid pollution
- change how ATC owns the ‘player’ FGAIAircraft so reset works
- ensure AIAircraft controllers are cleared on unbind for reset
2015-12-11 12:11:59 -06:00
James Turner
be1291f689
Change handling of default hangar / catalog.
...
- no longer re-add it on startup, add an explicit button in the UI
(will add a more obvious item to the aircraft list in a follow-up
commit)
2015-11-23 22:58:00 +00:00
James Turner
5f0e347c60
Keep in sync with SimGear Package API
2015-09-27 19:44:39 -05:00
James Turner
18a898f5f9
Lots of work on aircraft package support
2015-09-20 19:46:35 -05:00
Torsten Dreyer
36113bf69d
Cleanup: remove unused code and includes
...
no functional change
jpg-httpd functionality was moved into httpd with 3.4
cmd-line option still spits out a warning
2015-07-08 17:24:13 +02:00
Torsten Dreyer
cd0f0b9856
Fix some warnings
2015-06-12 11:51:11 +02:00
Torsten Dreyer
93f03f5f2e
property browser: group radio-button elements
...
This allows to better render bool properties
2015-04-15 10:41:31 +02:00
Torsten Dreyer
8f9df6940f
httpd: extend the NavDbUriHandler
...
- add more details for airports
- add "q=airports" query to get the airport list
- add "q=airport&id=abcd" query to get airport details
2015-03-28 00:34:28 +01:00
James Turner
f2d6b76b13
Portability: Fix compile errors on MSVC (cmath)
...
From Scott (xDraconian)
2015-03-24 11:11:42 -05:00
Torsten Dreyer
3ee36a7143
PropertyChangeWebsocket: sanitize property names
2015-03-17 09:27:03 +01:00
Torsten Dreyer
f5f82c461f
RunUriHandler: add some INFO logging for the requests
2015-03-11 22:28:23 +01:00
Torsten Dreyer
f7d476c856
extract RemoteXMLRequest to make it reusable
2015-03-11 18:50:11 +01:00
James Turner
11c2623dec
Start wiring package manager into the launcher.
2015-03-11 17:09:59 +00:00
James Turner
68efa84b3a
Remove obsolete #ifdef check
2015-03-11 17:09:59 +00:00
Torsten Dreyer
f32f1fba59
Fix recently introduced bug in json-to-prop conversion
2015-03-11 16:59:58 +01:00
Torsten Dreyer
fced50f480
JSON Properties: encode NaN as null
...
JSON doesn't know about NaN, probably null matches best
2015-03-09 16:17:20 +01:00
Torsten Dreyer
8b141025cd
httpd: expose if airport has metar in navdb uri handler
2015-03-09 14:53:40 +01:00
James Turner
bfeb41858d
Cmake always generates version.h
...
- simplify some code as a result
2015-03-08 00:42:39 +00:00
Torsten Dreyer
0f72564140
Use the pagedPathForHistory in the FlightHistoryUriHandler
2015-03-03 17:10:16 +01:00
Torsten Dreyer
2e5db3ce85
httpd: fix misplaced warning message
2015-03-02 20:39:23 +01:00
Torsten Dreyer
0fcfbe9221
wrap the json flight history as a feature
...
this allows to attach properties later
2015-02-27 15:54:28 +01:00
Torsten Dreyer
146efcafa4
JsonUriHandler: allow POST updates without child
...
updates to properties used to be
POST /json/some/property/path
{
name: 'somechild',
value: 'somevalue'
}
which required some ugly path hacking when directly updating a node.
now, this works too (and in a probably more intuitive way)
POST /json/some/property/path/somechild
{
value: 'somevalue'
}
2015-02-27 11:07:25 +01:00
Torsten Dreyer
4b5dec2cae
HTML Property Browser: use radiobuttons for bools
2015-02-26 18:14:09 +01:00
Torsten Dreyer
0034d6b59a
flighthistory service: use GeoJSON instead of own invention
...
Track now comes as a LineString object
{
"type":"LineString",
"coordinates": [ [lon,lat,alt], [lon,lat,alt], ... ]
}
ref: http://geojson.org/geojson-spec.html#linestring
2015-02-25 10:38:22 +01:00
Torsten Dreyer
cc6178a9f3
Expose FlightHistory as a http service
...
usage:
GET http://localhost:8080/flighthistory/track.json
retrieves track as JSON data
{
flightHistory: [
{
latitude: (number),
longitude: (number),
altitude: (number)
}
]
}
GET http://localhost:8080/flighthistory/track.kml
retrieves track as KML path
optional request parameter:
LineColor=(hex encoded rgba color)
LineWidth=(line width in pixel)
PolyColor=(hex encoded rgba color)
interval=(number of seconds to auto-refresh)
2015-02-23 16:33:58 +01:00
Torsten Dreyer
6ecbca9e01
package system: de-hardcode default catalog id and url
...
make default catalog id and url configurable through properties
on startup. Provide defaults to preserve current functionality.
/sim/package-system/default-catalog/id
/sim/package-system/default-catalog/url
2015-02-17 12:41:18 +01:00
Torsten Dreyer
828f14c4f7
Ooops...
2015-02-17 12:09:22 +01:00
Torsten Dreyer
ae91b9cede
Initial work for a PKG http service
2015-02-17 12:06:50 +01:00
Torsten Dreyer
6e3486349b
PropertyBrowser: Add a JSON link and the path
2015-02-13 11:42:45 +01:00
Torsten Dreyer
6970ea69a8
httpd/json: send as correct typ for bools and numbers
2015-02-11 11:34:16 +01:00
Rebecca N. Palmer
fe0015bda0
Fix typo, thanks to Markus Wanner
2015-01-18 22:23:49 +00:00
Torsten Dreyer
4b4f5c9e9a
httpd: some code cleanup for JsonUriHandler.
...
no functional change
2014-11-11 08:59:41 +01:00
Torsten Dreyer
aeb1eedba8
Allow property set on the /json/ uri handler
2014-11-10 14:23:12 +01:00
Torsten Dreyer
d46aa5114f
httpd: upgrade to latest mongoose 5.5
2014-11-06 22:21:22 +01:00
Torsten Dreyer
0376ab3f28
Fix #1579 : Handle special characters in html property browser
2014-11-04 22:21:44 +01:00
Torsten Dreyer
e786b1a54e
httpd: expose airport id to geojson properties
2014-10-16 13:09:43 +02:00
Torsten Dreyer
cc526174c1
httpd: fix mjpeg encoding
2014-10-02 11:13:12 +02:00
Torsten Dreyer
c0c82f4f7b
Fix (1st try) absolute paths for httpd url_rewrites
...
Thanks to Alan Teeder for guiding me into the right direction
2014-09-24 20:50:10 +02:00
Torsten Dreyer
2859400336
Some debug stuff for the mongoose httpd
...
- add a config-dump on log-level=info
- add an access-log option
use --prop:string:/sim/http/options/access-log-file="/path/to/access.log"
2014-09-24 17:40:04 +02:00
Torsten Dreyer
996a46536d
httpd: fix log message typos
...
no functional change
2014-09-21 22:29:10 +02:00
Torsten Dreyer
e8d851d236
Allow user defined mime types for the internal httpd
2014-09-20 01:48:32 +02:00
Torsten Dreyer
c9d159e71f
httpd: downgrade log message
2014-09-15 10:54:00 +02:00
Torsten Dreyer
512ec61e8e
Expose the running-state of the internal webserver
2014-09-12 22:58:30 +02:00
Torsten Dreyer
b50b1a778b
httpd: expose the aircraft dir to the web server
...
add a (currently) hard coded url rewrite to access the
currently used aircraft by
http://localhost:8080/aircraft-dir/
2014-09-10 22:43:06 +02:00
Thomas Geymayer
486ef5b06c
pkg: retrieve existing install (or register callback).
2014-06-30 18:15:31 +02:00
James Turner
7e8d713b28
Pkg: initial support for Variants
...
- aircraft init code can deal with a variant ID
- Nasal API can return a hash with variant IDs and names
2014-06-15 20:10:24 +02:00
Thomas Geymayer
33d23026c4
pkg: allow 'installed' as filter criterion.
2014-06-15 16:36:02 +02:00
Thomas Geymayer
e1eb9e4418
Enable package system API
2014-06-13 16:08:26 +02:00
James Turner
8f754a1673
Type-correct decoding of JSON to props.
2014-06-12 19:58:13 +01:00
James Turner
d1a477324e
Websocket get/set props and exec commands.
2014-06-12 17:57:25 +01:00
James Turner
ee627b8652
Expose package file size to Nasal.
2014-06-12 17:51:19 +01:00
James Turner
7a5b729052
Pkg: nicer Nasal syntax for tags in queries.
2014-06-12 08:17:05 +01:00
Thomas Geymayer
53c0454931
Package: warn for unknown filter term and use Hash::iterator.
2014-06-11 18:19:13 +02:00
Thomas Geymayer
0e286717a6
pkg: Expose install callbacks to Nasal.
2014-06-10 23:53:57 +02:00
James Turner
afa45240b0
Packages: search from Nasal
...
- also allow direct uninstallation.
2014-06-10 22:12:27 +01:00
Thomas Geymayer
1af3ad2525
Nasal: extend pkg API.
2014-06-04 17:50:25 +02:00
James Turner
d1fd5756f6
Initial package-system integration.
...
- disabled by default
- incomplete, adding so Thomas can see the API
2014-05-31 18:04:56 +01:00
Torsten Dreyer
2e76a2c72a
Update of the httpd implementation
...
- Add a screenshot uri handler
- Enable persistent http connections
- Simple CORS implementatation for the
JSON property uri handler
many changes for the httpd
2014-05-22 10:28:54 +02:00
Torsten Dreyer
390f6dd32d
fix wrong computation of delta-t in jpg-httpd
...
this lead to a screenshot taken on each frame instead of
the defined interval
2014-03-29 11:22:34 +01:00
Torsten Dreyer
75f9d7e66e
add nChildren to json properties
2014-03-26 15:06:24 +01:00
Torsten Dreyer
0dcc8aa34d
Add a timestamp to JSON properties
...
add special attribute 'ts' to a JSON property reflecting
/sim/time/elapsed-sec
always add timestamp for listener properties
add timestamp for json requests if req param t=y is set
2014-03-26 08:51:15 +01:00
Torsten Dreyer
f68ae55068
Don't return invalid JSON if node not found
2014-03-25 21:43:08 +01:00
Torsten Dreyer
e7dec994b8
httpd: provide more airport information in geojson
...
- provide runways as polygon geometry
- provide longest runway lenght, heading and surface type
- some code cleanup
2014-03-23 21:19:04 +01:00
Torsten Dreyer
527eb9d444
httpd navdb: report ils/loc as geojson multilinestring
2014-03-21 13:00:59 +01:00
Torsten Dreyer
3d33aff7bc
Add a http handler to access the nav database
...
see the browsermap for an example
2014-03-19 17:23:53 +01:00
Torsten Dreyer
efcc89480d
httpd: don't spam the console with debug messages
2014-03-17 16:38:53 +01:00
Torsten Dreyer
1867ccb4a8
httpd: better handling of first-time notifications
...
ensure new listeners get notified on first update loop
also cleanup the PropertyChangeObserver on reset
2014-03-17 16:22:42 +01:00
Torsten Dreyer
a830708252
PropertyChangeWebsocket: fire change after subscribe
2014-03-14 21:36:29 +01:00
Torsten Dreyer
95d4c5898d
httpd: handle url-rewrites
2014-03-14 16:39:16 +01:00
Torsten Dreyer
7132947d16
httpd: update mongoose and websockets
...
* mongoose updated to 5.3
* first stab at implementing websockets, here a property change listener
websocket. This websocket is at ws://yourhost:yourport/PropertyListener
see FGDATA/Docs/gui/radio.html for an example
2014-03-12 22:39:37 +01:00