Phi: Difference between revisions

Jump to navigation Jump to search
6,207 bytes removed ,  21 March 2016
Quoting cleanup
mNo edit summary
(Quoting cleanup)
Line 1: Line 1:
[[File:Early-Phi-screen shot.PNG|thumb|right|http://forum.flightgear.org/viewtopic.php?f=6&t=25482]]
[[File:Early-Phi-screen shot.PNG|thumb|right|http://forum.flightgear.org/viewtopic.php?f=6&t=25482]]


{{DeQuote}}
== Phi - 'map in browser' ==


{{FGCquote|1= I have just started with Phi a few month ago and the entire system evolves more that it follows a planned route. I have a vision - well sort of - of what I'd like have implemented but it's not a clear picture. Probably the best for you would be to clone fgdata from git and either install a nightly build or compile from source to get the latest features. If that works make yourself familiar with what is there. Some knowledge of jQuery, knockout and require.js will help getting started. If you find something missing or have an idea for improvements, I am happy to work it in ;-)|2= {{cite web | url    = http://sourceforge.net/p/flightgear/mailman/message/33694681/  | title  = <nowiki>Re: [Flightgear-devel] Support to develop new features</nowiki>  | author = <nowiki>Torsten Dreyer</nowiki>  | date  = Apr 2nd, 2015  }}}}
An HTML5/JavaScript/CSS based multi-platform user interface and instructor station. The implementation uses some state-of-the-art JavaScript libraries, most notably jQuery, knockoutjs and requirejs (files included for offline usage). Phi is capable of being run on any device that has a web browser or web app's like Apple's iPad without the browser decorations. See Usage section below for further details.  
 
 
{{FGCquote|1= I am planning to rebuild the web-panel feature on the Phi's framework. Some firste steps are already taken, have a look the Seneca's Engine Panel: https://www.dropbox.com/s/wxbl7e4l255uio/Phi_SideBySide.png?dl=1 Responsive SVG elements should be easy to implement, too.|2= {{cite web  | url    = http://sourceforge.net/p/flightgear/mailman/message/34278378/  | title  = <nowiki>Re: [Flightgear-devel] c172p - Show/Hide Yoke</nowiki>  | author = <nowiki>Torsten Dreyer</nowiki>  | date  = Jul 8th, 2015  }}}}


== Background ==
== Background ==
{{FGCquote
  |while working on the new radio/atis implementation, I rediscovered the <br/>
internal httpd (aka webserver) to browse the property tree.<br/>
It's much easier to have multiple browser windows open and point to <br/>
various locations in the property tree than to reopen the internal <br/>
property browser and navigate to the locations after each sim restart.
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32068663/
    |title=<nowiki>[Flightgear-devel] FlightGear goes web 2.0</nowiki>
    |author=<nowiki>Torsten Dreyer</nowiki>
    |date=<nowiki>2014-03-06</nowiki>
  }}
}}
{{FGCquote
  |After a while, I got disappointed by the functionality and the look&feel <br/>
of the http property-browser, so i had a look at the code to see if it <br/>
could be improved. I quickly realized, that the implementation was <br/>
simple but not scalable, so I looked for something allready available on <br/>
the GPL market.<br/>
I found Mongoose as a well maintained, feature rich and yet simple <br/>
implementation of a web server and started to embedd that into FlightGear.
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32068663/
    |title=<nowiki>[Flightgear-devel] FlightGear goes web 2.0</nowiki>
    |author=<nowiki>Torsten Dreyer</nowiki>
    |date=<nowiki>2014-03-06</nowiki>
  }}
}}
{{FGCquote
  |What I have ready so far and just pushed to next is:<br/>
- A single threaded httpd running in the main loop (should probably get <br/>
it's own thread soon)<br/>
- Running as a replacement for the old httpd<br/>
- Serving FGDATA/Docs as the document root<br/>
- Serving the uri /props/ as a replacement for the old property browser <br/>
(improved functionality, improved l&f, styling via css)<br/>
- Serving the uri /run.cgi as a replacement for the old interface to run <br/>
fg_commands<br/>
- Serving the uri /json/ to return selected properties as JSON <br/>
(read-only so far)
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32068663/
    |title=<nowiki>[Flightgear-devel] FlightGear goes web 2.0</nowiki>
    |author=<nowiki>Torsten Dreyer</nowiki>
    |date=<nowiki>2014-03-06</nowiki>
  }}
}}
{{FGCquote
  |I think this all has a lot of potential. With the JSON interface <br/>
extended to being able to write properties, the CGI interface  of <br/>
Mongoose turned on, the webserver running stable in it's own thread, It <br/>
should be possible to run e.g. PHP with jQuery or dojo.<br/>
<br/>
If you want to test the new functions, goto<br/>
http://localhost:<httpd-port>/  for FGDATA/Docs<br/>
http://localhost:<httpd-port>/props/  for the internal property browser<br/>
http://localhost:<httpd-port>/json/some/property/name/or/path  for the <br/>
internal property browser<br/>
http://localhost:<httpd-port>/run.cgi?value=pause  to pause/unpause the <br/>
simulation<br/>
<br/>
Please mind the trailing slash for /props/ and /json/ (no, it's not <br/>
bug-free yet.)
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32068663/
    |title=<nowiki>[Flightgear-devel] FlightGear goes web 2.0</nowiki>
    |author=<nowiki>Torsten Dreyer</nowiki>
    |date=<nowiki>2014-03-06</nowiki>
  }}
}}
{{FGCquote
  |It runs on any device that has a web browser. So yes, if your FlightGear <br/>
computer can run Firefox, Opera or alike you can run it on the same <br/>
computer, too.<br/>
It is not related to the "classical" way of rendering instruments within <br/>
flightgear, so everything in this area works as before.<br/>
<br/>
Probably a video is more descriptive, here is a shot of an earlier <br/>
(incomplete) version:<br/>
http://youtu.be/sYM7uiWIprc<br/>
You can see a FlightGear instance on the top right of the big monitor <br/>
and Firefox on the left showing the EFIS. Both run on the same computer.<br/>
Below the monitor are an old iPod touch (left) and a Nexus 7 (right), <br/>
both running the EFIS as a web-app in full screen mode connected over WLAN.<br/>
The EFIS in the FlightGear window is based on Canvas/Nasal. The other <br/>
EFISes are 100% Nasal free, just HTML/SVG/CSS/JavaScript
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32840980/
    |title=<nowiki>Re: [Flightgear-devel] Goodbye fgpanel - hello fgpanel 2.0</nowiki>
    |author=<nowiki>Torsten Dreyer</nowiki>
    |date=<nowiki>2014-09-17</nowiki>
  }}
}}


{{FGCquote
While working on the new radio/atis implementation, I rediscovered the internal httpd (aka web-server) to browse the property tree. It's much easier to have multiple browser windows open and point to various locations in the property tree than to reopen the internal property browser and navigate to the locations after each sim restart. After a while, I got disappointed by the functionality, look, and feel of the http property-browser. So I had a look at the code to see if it could be improved. I quickly realized, that the implementation was simple but not scale-able. I looked for alternatives already available on the GPL market. I found Mongoose as a well maintained, feature rich and yet simple implementation of a web server and started to embed that into FlightGear.
  |I have just pushed my first draft of a HTML5/CSS/JavaScript based user <br/>
<ref>http://sourceforge.net/p/flightgear/mailman/message/32068663/</ref>
interface to FGDATA/master.<br/>
For the impatient: get latest fg and fgdata from git, start fgfs <br/>
--httpd=8080 and browse to http://localhost:8080/gui/<br/>
<br/>
Somewhat longer abstract:<br/>
This is very much work in progress, it has many layout quirks and <br/>
runtime bugs, not every clickable item does something useful by now.<br/>
It should work with any aircraft, the Mass and Balance page currently <br/>
works best with the c172p and the SenecaII, other Aircraft may work but <br/>
will lack some features.<br/>
<br/>
The implementation uses some state-of-the-art JavaScript libraries, most <br/>
notably jQuery, knockoutjs and requirejs. I have included these so there <br/>
is no active internet connection required for base functionality <br/>
(exception: the moving map won't show tiles without internet).
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/33347855/
    |title=<nowiki>[Flightgear-devel] Introducing Phi - a multiplatform user interface
& instructor station</nowiki>
    |author=<nowiki>Torsten Dreyer</nowiki>
    |date=<nowiki>2015-02-04</nowiki>
  }}
}}


{{FGCquote
Probably a video is more descriptive, here is a shot of an earlier (incomplete) version: http://youtu.be/sYM7uiWIprc <br/>
  |The design pattern is based on MVVM (Model-View-ViewModel).<br/>
You can see a FlightGear instance on the top right of the big monitor and Firefox on the left showing the EFIS. Both run on the same computer. Below the monitor are an old iPod touch (left) and a Nexus 7 (right), both running the EFIS as a web-app in full screen mode connected over WLAN. The EFIS in the FlightGear window is based on Canvas/Nasal. The other EFISes are 100% Nasal free, just HTML/SVG/CSS/JavaScript
<br/>
<ref>http://sourceforge.net/p/flightgear/mailman/message/32840980/</ref>
Communication with the flightgear instance is through AJAX calls and a <br/>
websocket for realtime updates of property changes.<br/>
It is web-app capable so you can not only run it on your mobile device <br/>
but also install it to it's home screen and run it without the browser <br/>
decoration. It prefers screen sizes of at least 7" (looks OK on Nexus 7 <br/>
and good on iPad - looks crappy on a Nexus 4 or the iPod - looks <br/>
fantastic on a 27" retina iMac).<br/>
<br/>
I'll try to get this into a stable and usable state during this release <br/>
cycle to have a functional version for the release of 3.6 in summer this <br/>
year.<br/>
<br/>
Feedback and comments are welcome, co-workers are more than welcome ;-)
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/33347855/
    |title=<nowiki>[Flightgear-devel] Introducing Phi - a multiplatform user interface
& instructor station</nowiki>
    |author=<nowiki>Torsten Dreyer</nowiki>
    |date=<nowiki>2015-02-04</nowiki>
  }}
}}


== Instruments via Phi ==
== Instruments via Phi ==
67

edits

Navigation menu