Board index FlightGear Support Interfacing

Vertical fgpanel

Connecting two computers, using generic protocol, connecting with Matlab?

Vertical fgpanel

Postby dhudach » Fri Jul 05, 2019 10:23 am

I am working on fgpanel. I want to flip one of the monitors 90 degrees so that the monitor is vertically positioned. Therefore the instruments on the panel need to be rotated 90 degrees. When I was experimenting with webpanel I could do that easily in the css code and the instrument behavior wasn't impacted. However, I cannot find an instrument xml setting that will allow me to rotate the entire instrument on the panel. I looked at fgpanel source code and nothing jumped out. The only setting that seemed to make sense was flip-x however it didn't do anything. Is it possible to rotate an instrument on the panel in fgpanel? Any suggestions?

Thanks,
Dave
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: Vertical fgpanel

Postby dhudach » Sat Jul 06, 2019 8:14 pm

As to the vertical panel .... I decided to try to resolve this by modifying the instrument xml files. I'm working on three instruments: Airspeed, Turn Coordinator, ADF as well as the engine instruments (cyl head temp, oil pressure, fuel, oil temp, amps). After messing with them, and doing a bit of reverse engineering, I got them all to work. Excellent.

I have one more instrument that I would like to have on this panel - the analog clock. There doesn't seem to be an appropriate clock for fgpanel. The analog clock that's in the SenecaII is one that takes the .ac file so it won't work. I created the clock dial and needles using Inkscape, saved as png then exported them all to rgb using GIMP. I created a clock.xml file and got everything set up. All is good. To test clock hands rotations I used the airspeed property. No problem. All clock hands work. Now the strange part. When I try to associate the hands with any of the time properties, the hands do not move. I've tried many of the /sim/time properties as well as /instrumentation/clock properties. I'm using hour, minute and second values, not formatted strings from the properties. I'm using seconds properties where the value is between 0-60. I believe that my interpolation values are ok, and if not, they should be close enough that I should see some movement in at least one of the hands. But it almost seems like the clock and and sim time properties are not getting associated. I've double checked the properties and they seem fine.

Is there something I don't know about the clock and time properties? Any ideas how to get them working?

Thanks in advance,
Dave
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: Vertical fgpanel

Postby dhudach » Sat Jul 06, 2019 8:59 pm

Ignore the question. I spent so much time working in Inkscape and in the clock xml file that I completely neglected to add the properties to the protocol file. So things are working. Whew.
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: Vertical fgpanel

Postby Kaosiia » Wed Feb 19, 2020 3:01 am

Hello,

I see that you were able to implement the 2-D instrument display. I am currently trying to have one monitor show the instrument panel only. I have read all the wikis on fgpanels but none seem to provide any substantial information. I even posted on the forum asking for help. I have doen everything but I cant seem to get only the 2-D instrument panel showing on one screen and the outside world view on the other screen.

Please if you can help, that will be amazing.

Thank you
Kaosiia
 
Posts: 71
Joined: Fri Jan 24, 2020 1:06 am

Re: Vertical fgpanel

Postby dhudach » Wed Feb 19, 2020 4:13 am

It's been a few months since I've worked on my project, I'll get back into it at the end of April. So I'll need to get familiar with this again. But to start, let me ask this - what have you done thus far and what have been your results?

Aside from that, as I'm thinking back, fgpanel needs a few things. It needs to the instruments and properties to be rendered. You can configure that information and run fgpanel. It should display the instruments in their screen positions based on the settings in the configuration xml file. The instruments will not move just yet. You need to tell flightgear to send the necessary instrument property values and you need to tell fgpanel to listen for those properties.

I believe those are the basic components for getting fgpanel to render the instruments.

Give me a day or two to dig into what I have already set up and I can send you some complete examples and files with instructions and commands to get them working. If you don't hear from me in a day or two, please feel free to send another note to remind me. But I'll start looking into what I've done.
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: Vertical fgpanel

Postby dhudach » Wed Feb 19, 2020 3:38 pm

To start, here is the Flightgear page on generic protocol: http://wiki.flightgear.org/Generic_protocol

Generic protocol is how you get flight properties out of flight gear. You need to do that to run fgpanel. In order to move instrument needles and components, fgpanel needs real time data, and that data comes from flight gear via generic protocol. The information on that page is helpful.

The first thing that fgpanel needs is the list of instruments that you want to display as well as their screen locations. To do that, you'll need to find the instrument xml files for your aircraft. Some planes use the same instruments. But in general, to display and animate an instrument, you might need to do some digging in the aircraft xml files to see what instruments are being used and where the xml files are for the instruments. Keep in mind that as I understand it, fgpanel only displays "2d" panels. In other words, the ".ac" instrument files can't be used.

I will list the files and include only a few instruments to avoid confusion.

The first one is the file that fgpanel needs in order to render the instruments:

Code: Select all
<?xml version="1.0"?>
<!--
    Piper Seneca II panel
-->

<PropertyList>
    <name>SenecaII IFR Panel</name>
    <w>1900</w>
    <h>1000</h>

    <instruments>
        <instrument include="Aircraft/Instruments/alt-c172s.xml">
            <name>Altimeter</name>
            <x>1400</x>
            <y>835</y>
            <w>260</w>
            <h>260</h>
        </instrument>

        <instrument include="Aircraft/Instruments/trn-c172s.xml">
            <name>Turn Coordinator</name>
            <x>535</x>
            <y>550</y>
            <w>250</w>
            <h>250</h>
        </instrument>

        <instrument include="Aircraft/Instruments/vsi-c172s.xml">
            <name>Vertical Velocity Indicator</name>
            <x>1300</x>
            <y>540</y>
            <w>260</w>
            <h>260</h>
        </instrument>
    </instruments>
</PropertyList>


You can see three instruments and their xml file locations under the Aircraft folder. You can also see in this file that each instrument has screen position (x,y) and size (w,h). Give this file a name. In my case since I built this for the SenecaII, I called it SenecaII-fgpanel-items.xml and I placed it into the Aircraft/SenecaII/Panels folder.

The next thing fgpanel needs to have is the list of properties for the instruments above. These are typically in a protocol file. They list the properties for each instrument and the link above has a lot of this information:

Code: Select all
<?xml version="1.0"?>

<PropertyList>
 <comment>
  <![CDATA[
    Usage:
    # fgfs --generic=socket,out,<hz>,<host>,55737,udp,Aircraft/SenecaII/Protocols/Panel1.xml
  ]]>
 </comment>

 <generic>
  <output>
   <line_separator>newline</line_separator>
   <var_separator>,</var_separator>
   <chunk>
    <type>float</type>
    <format>%.3f</format>
    <node>/instrumentation/altimeter/setting-inhg</node>
   </chunk>

   <chunk>
    <type>float</type>
    <format>%.2f</format>
    <node>/instrumentation/altimeter/indicated-altitude-ft</node>
   </chunk>

   <chunk>
    <type>float</type>
    <format>%.3f</format>
    <node>/instrumentation/slip-skid-ball/indicated-slip-skid</node>
   </chunk>

   <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/instrumentation/vertical-speed-indicator/indicated-speed-fpm</node>
   </chunk>

  </output>
 </generic>
</PropertyList>


Again, give this file a name. In my case, SenecaII-fgpanel-protocol.xml.

And finally, a single xml file is used to consolidate these two above for fgpanel. I call it a definition file and mine looks like this:

Code: Select all
<PropertyList>
  <game-mode type="bool">false</game-mode>
  <panel include="SenecaII-fgpanel-items.xml"/>

  <sim>
    <panel>
      <flip-x type="bool">false</flip-x>
    </panel>
    <frame-rate-throttle-hz>30</frame-rate-throttle-hz>
    <instrument-options>
      <omit-knobs type="bool">true</omit-knobs>
    </instrument-options>
  </sim>

  <communication>
    <listen>
      <host>127.0.0.1</host> <!-- multicast address! -->
      <port>5432</port> <!-- tcp port to listen to -->
      <style>udp</style>
    </listen>
    <protocol include="SenecaII-fgpanel-protocol.xml"/>
  </communication>
</PropertyList>


You can see that it names both the items and protocol files. In addition, it contains the generic protocol communication information. Again, give this file a name. For me, it's SenecaII-fgpanel-defs.xml.

You now have the three files that fgpanel needs. In my case I placed them all in my Aircraft/Panels folder. And when you start fgpanel and fgfs, you will need to tell them where these files are. So let's see how to run them.

First you can start fgpanel. When you start it, you should at least be able to see the instruments on the screen. If you don't, something is amiss. I built flightgear using the download and compile script and am running linux. So my installation and paths may be entirely different from yours. So you might need to experiment to get it right. When I run fgpanel, I am using a shell script and cd to the flightgear bin directory. I am sure there are other ways of starting fgpanel to get it to recognize paths, but I've only done it this way. If you have difficulty, post your issues and we'll try to help. It shouldn't really be rocket science at this point! In any event, you can see that I am instructing fgpanel to use my definition file that we created above. Remember it contains the list of instruments, the protocol file and the communications information.

Code: Select all
./fgpanel --fg-root=$PWD/../fgdata/ --panel=Aircraft/SenecaII/Panels/SenecaII-fgpanel-def.xml


Now you can start flightgear:

Code: Select all
./fgfs --fg-root=$PWD/../fgdata/ --launcher --generic=socket,out,10,127.0.0.1,5432,udp,../Aircraft/SenecaII/Panels/SenecaII-fgpanel-protocol


Again, I am running linux And you can see here that we're providing generic protocol information as well as the generic protocol file. And **Notice** that the ".xml" extension is not used in the filename here. In other words, don't use SenecaII-fgpanel-protocol.xml in the fgfs command here, just use the truncated name without the extension.

What to look for ....

You should be able to run fgpanel without starting flightgear and you should see your instruments displayed. When you start flightgear and start your aircraft, you should see the needles move immediately. If you don't, check the flightgear log - look for things like file not found, etc.

Post your results in either case. Good Luck!!
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: Vertical fgpanel

Postby Kaosiia » Wed Feb 19, 2020 7:59 pm

I have set up the 3 xml files needed. What I am having problem with is opening fgpanel. Is that an application?

When I search in the flightgear directory, it comes up as a json file and a html document that opens in internet explorer but does not show anything
Kaosiia
 
Posts: 71
Joined: Fri Jan 24, 2020 1:06 am

Re: Vertical fgpanel

Postby dhudach » Wed Feb 19, 2020 8:10 pm

fgpanel is an executable file. It's in the flightgear bin directory, in the same location as fgfs. What happens when you run it? Are you on linux or Windows? Are you running from a command prompt. If you are in linux, you can do this:

type fgfs
type fgpanel

You should then see where they are. I guess it would be helpful if you would provide more information - what OS, what have you tried, what happens, how are you trying to run it, etc.
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: Vertical fgpanel

Postby Kaosiia » Wed Feb 19, 2020 8:22 pm

I am using windows. I have one computer and 2 monitors.
I tried using command prompt. I am in the bin directory of Flightgear. and i type just 'fgfs' and flight gear opens. When i type 'fgpanel' it says - not an executable command or batch file.
Kaosiia
 
Posts: 71
Joined: Fri Jan 24, 2020 1:06 am

Re: Vertical fgpanel

Postby Kaosiia » Wed Feb 19, 2020 8:25 pm

Fgpanel is also not in my bin directory, but i see 'fgfs'. It seems fgpanel is not in 'bin' but rather in something called 'tools' and it appears to look exactly like command prompt but it is instead called 'fgpanel'
Kaosiia
 
Posts: 71
Joined: Fri Jan 24, 2020 1:06 am

Re: Vertical fgpanel

Postby dhudach » Wed Feb 19, 2020 8:37 pm

It's been years since I've used a Windows command prompt, but I suppose what you are seeing could mean that fgpanel was not built in your installation of flightgear. In other words, fgpanel doesn't exist. To be 100% sure, do
Code: Select all
dir fgpanel.exe
or
Code: Select all
dir fgpanel
or
Code: Select all
dir
in the bin folder to find out if fgpanel is indeed in there. If not, then I think the solution is to build it and unfortunately that is out of my area .... especially in Windows. If you do see it, it's possible that you need to grant execute rights to the program. That seems an unlikely scenario, but I don't really know for certain. Basically, step #1 is - find out if fgpanel.exe exists. If not, then we may need to enlist the expertise of Windows users who would know how to get fgpanel built for your system.

I suppose there is one other situation, and this is an outside shot. Possibly when flightgear was built/installed, it didn't name fgpanel as fgpanel.exe, it kept it named as fgpanel. Again, that is an outside possibility. If that is the case, does Windows only run an executable if it sees the ".exe" in the file name? I don't know. In other words, if you see a file called fgpanel, you could simply try to rename it as fgpanel.exe to see if it runs. Again, I am throwing darts here from 100 yards. Windows command prompt behavior right now is a reach for me ....

Good Luck
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: Vertical fgpanel

Postby dhudach » Wed Feb 19, 2020 8:40 pm

Ok, I just saw your post that fgpanel is in the 'tools' directory. You could cd to tools and try to run it from there. Go figure, of all of the possibilities I mentioned in my previous post, that fgpanel would be in another directory didn't occur to me. If you have found fgpanel, then you can try to run it.
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: Vertical fgpanel

Postby dhudach » Wed Feb 19, 2020 8:42 pm

I'm not sure what you mean when you say it looks like 'command prompt' Possibly that's the way it appears in your Windows folder explorer.
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: Vertical fgpanel

Postby Kaosiia » Wed Feb 19, 2020 8:55 pm

Command prompt is like shell script on linux
Kaosiia
 
Posts: 71
Joined: Fri Jan 24, 2020 1:06 am

Re: Vertical fgpanel

Postby dhudach » Wed Feb 19, 2020 9:04 pm

I know what command prompt is. I guess I didn't know what you meant when you said
and it appears to look exactly like command prompt but it is instead called 'fgpanel'
. But I guess if you found it, you should be able to try to run it and see what happens.
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Next

Return to Interfacing

Who is online

Users browsing this forum: No registered users and 2 guests