I ran FGPanel successfully for ages but the switch to 2016 either broke it or broke my implementation of it. However over the last few month I have been experimenting with using Phi to create instrument panels for my favourite aircraft. Flydaddit, I'm not sure if this is exactly what you want to do but it sounds close so I thought it might be worth posting what I did. Essentially I wanted to create panels for the DHC6 and DHC2 (initially) as I fly these a lot. I have established the process using Thorstens original Phi description, and he may well have some comments on my notes as they may not be the best way of implementing panels or not the way it was intended. In summary it works well for me. I have a dual computer setup with the instrument panel operating on a second machine in a browser referencing a generic web address on the first computer(i.e. you don't have to change it for each aircraft).
Mark
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Modifying the C172 Webpanel for another aircraftOn the move to v2016 my Flightpanel setup on a second computer failed – however Phi offers a potential way to create web based instrument panels for all aircraft. In the text below I have documented my approach which used the information provided by Thorsten and copying the work done for the C172 aircraft.
1. Create the WebPanel folder for the new aircraft
- First make sure that the webpanel works for you with the C172 aircraft. Use the “Panel in Browser” option from the Flightgear menu and ensure the instrument panel appears in your browser, and bookmark the page for future reference. Get this working before proceeding any further.
- Make a copy of the WebPanel folder and its contents found in the Aircraft / C172 folder and paste it into the Aircraft folder for which you want to create a webpanel. For example create dhc6/WebPanel.
- In the WebPanel folder:
- Rename the file c172-webpanel-properties.json to webpanel-properties.json
- Rename the file c172-webpanel.html file to webpanel.html
- Open the file webpanel.html with a text editor and change the <title> reference from C172 to reflect the new aircraft type.
- In the file webpanel.html change the <body reference to point to the .json file that you renamed eg “data-fgpanel-props = webpanel-properties.json”
The file webpanel.html displays the instruments in the browser and uses the data in webpanel-properties.json to link the instruments to the flightgear internal properties. The svg files are the graphics for the various instruments and the individual json files deal with the animation. These now need to be changed to tailor them to the new aircraft type.
2. Add a new instrument to the display – e.g. a fuel gauge
- Edit the file webpanel-properties.json with a text editor
- Add a new definition or edit an existing one to link the new property mirror variable to the relevant variable in the internal properties. See the existing entries as examples of how this works. eg Create a new line such as fuelfwd .... see below
- Run Flightgear selecting the aircraft for which you are creating the Webpanel (aircraft location does not matter) and from the main menu under “Debug” select “Browse internal Properties”.
- Navigate to the relevant internal property, and enter the path (eg /consumables/fuel/tank.....) in the webpanel-properties.json file … see below.
["egt", "/engines/active-engine/egt-norm"],
["egtBug", "/engines/engine/egt-bug-norm"],
["adf", "/instrumentation/adf/indicated-bearing-deg"],
["adf-rotation-deg", "/instrumentation/adf/rotation-deg"],
["fuelfwd", "/consumables/fuel/tank/level-gal_imp"],
3. Create the New instrument
Two or three file types need to be present for the new instrument (1) the .svg graphics file which draws the instrument dial and (2) the .json file which links the graphic to the internal property and animates the graphic to represent the change in the internal property e.g. moves the needle as fuel is used. And possibly (3) interpolation.xml file which scales the dial movement.
First make the svg and json files for the new dial – I did this by making copies of the rpm files and modifying them to display fuel.
- Copy an existing instrument svg file (such as the rpm) and rename it to something relevant to the new instrument eg rename rpm.svg to fuel.svg or alternatively create a new instrument graphic in Inkscape or a similar application, yourself.
- Copy the matching json and interpolation.xml files (in this case rpm) and rename them to the new instrument eg fuel.json. Interpolation files are not required of all types of dial so ignore this file type if they are not present / required.
- Use Inkscape to modify the new graphic to reflect the required look of the dial eg replacing the RPM scale with the fuel quantity such as lbs or gallons.
- Change the document properties meta data using Inkscape to reflect the name of the new instrument. (this is displayed when “hovering” the mouse over the instrument in the browser.
- Edit the json file to make sure (a) "src" references the correct svg file and (b) the internal property is specified correctly e.g. “property”: “fuel”, and (c) if present the interpolation file is referenced.
- A bit of trial and error will be needed here if you are not familiar with json and / or Inkscape.
Place the dial on the webpanel:
- Open webpanel.html in a text editor and modify one of the empty.json entries to reflect the newly created json file for your new instrument. Eg change empty.json to fuel.json.
- Enter a new ID for your instrument eg <div ID = "FUEL" ........> in the same line
- Rearrange the order of the instruments if you need to (not essential now- perhaps wait until it’s all working?)
- Now the webpanel.html file points to the xxx.json file which in turn points to the xxx.svg file and its associated xxx-interpolation.xml file if it is required.
4. Try out the new panel
- start Flightgear with the relevant aircraft selected
- In a separate window start your browser and open the webpage at http://localhost:8080/aircraft-dir/WebP ... panel.html . (i.e. the address you used for the C172 webpanel at the start) You should see the instrument panel which will now include your new instrument.
- (This assumes httpd = 8080 is set in the Flightgear launcher settings)
- aircraft-dir is the logical path to the aircraft folder of the aircraft you are flying
- Test the new instrument (for example fuel) by making a change to the variable displayed in the new instrument - e.g. fuel - in Flightgear menu select Equipment/Fuel - Payload and move the slider to adjust the amount of fuel. If all is well this will be reflected in the dials on the gauge.
- You will almost certainly have to make adjustments to the interpolation.json file to match the angle of the needle against the value show on the gauge. The data in this file relates the internal property values to the position on the dial (0-360 degrees).
Tips
- Needle graphic must be called Needle unless you modify the json file accordingly
- The needle must point to 0 degrees in the graphic so that the relevant compass point positions can be referenced in the interpolation file. (eg 50% fuel = needle pointer at 180 degrees) - you will need to experiment with this.
- New graphics should be 512 x 512 pixels in size to fit with the existing instrument matrix in webpanel.html. If you copy and edit an existing instrument the graphic will already be t he right size.
- The browser needs to be refreshed after making changes to the WepPanel files. (eg <shift>F5 in Firefox)
- Clear the cache on the browser if you get unexpected results when changing between aircraft as strange things can happen with cached data and images.