- Messages
- 86
- Country
I would like to ask the fsdeveloper community for help with a 2D fuel selector gauge. This gauge is for a freeware B-25J that was converted from FSX to P3D.
The first issues I noticed with this gauge were...
1. The left fuel selector, when set to left main, would feed fuel from both the left and right aux tanks.
2. The left fuel selector, when set to right main, would feed fuel from the right aux tank.
3. The left fuel selector, when set to left aux, would cause the engine to die.
4. The right fuel selector, when set to right main, would feed fuel from both the left and right aux tanks.
5. The right fuel selector was unclickable, so the user could not switch tanks.
I made sure that the LeftMain, RightMain, LeftAux, and RightAux entries in the aircraft.cfg were correct, and they were. I noticed number_of_tank_selectors=1 in the aircraft config, so I changed it to number_of_tank_selectors=2. That fixed the problem with the fuel selector being unclickable, but then I noticed...
6. The right fuel selector, when set to left main, would feed fuel from the left aux tank.
7. The right fuel selector, when set to right aux, would cause the engine to die.
I looked through the panel.cfg to see what xml file controls the fuel selector gauge, which was ecu.xml located in the B25.bin. I extracted the ecu.xml file and looked through it with notepad. I noticed...
I tried many different things to fix it, but what ultimately solved the tank switching problem was this...
With these changes, I am now able to switch the tanks by clicking on the respective area on the gauge, and I even get a nice tooltip when I hover my mouse over it.
HOWEVER, during startup, the aircraft always defaults to...
1. Left fuel selector sets to Left Main and feeds fuel from the LeftAux tank
2. Right fuel selector sets to Right Main and feeds fuel from the RightAux tank.
3. Switching tanks on the fuel selector causes the fuel to begin to feed from the selected tanks correctly.
3. The BMP images (that point to which tank is selected) for the fuel selector levers disappears UNLESS I have the tanks switched to OFF. The disappearing BMP images do not cause a problem with the selected tanks feeding fuel correctly.
I took a look at the ecu.xml file again, and noticed...
I tried changing <!-- If ALL the default to LEFT--> and <!-- If ALL the default to RIGHT--> to LEFT MAIN and RIGHT MAIN, and it doesn't solve the issue with it defaulting to feeding fuel from the LEFTAUX and RIGHTAUX tanks.
I'm also stumped as to how to fix the issue with the bitmaps disappearing.
During startup...
When switching tanks EXCEPT OFF
Everything I've mentioned above is the only lines of code I found associated with anything fuel related in this ecu.xml.
I hope this is enough information provided to receive some help. It would be appreciated!
The first issues I noticed with this gauge were...
1. The left fuel selector, when set to left main, would feed fuel from both the left and right aux tanks.
2. The left fuel selector, when set to right main, would feed fuel from the right aux tank.
3. The left fuel selector, when set to left aux, would cause the engine to die.
4. The right fuel selector, when set to right main, would feed fuel from both the left and right aux tanks.
5. The right fuel selector was unclickable, so the user could not switch tanks.
I made sure that the LeftMain, RightMain, LeftAux, and RightAux entries in the aircraft.cfg were correct, and they were. I noticed number_of_tank_selectors=1 in the aircraft config, so I changed it to number_of_tank_selectors=2. That fixed the problem with the fuel selector being unclickable, but then I noticed...
6. The right fuel selector, when set to left main, would feed fuel from the left aux tank.
7. The right fuel selector, when set to right aux, would cause the engine to die.
I looked through the panel.cfg to see what xml file controls the fuel selector gauge, which was ecu.xml located in the B25.bin. I extracted the ecu.xml file and looked through it with notepad. I noticed...
XML:
<!-- Fuel Selector L -->
<Area Left="29" Top="312" Width="76" Height="76">
<Help ID="HELPID_GAUGE_FUEL_SELECTOR" />
<Tooltip ID="TOOLTIPTEXT_DC3_LEFT_FUEL_SELECTOR" />
<Area Left="39" Top="38" Width="40" Height="36">
<Cursor Type="Hand" />
<Click Event="FUEL_SELECTOR_OFF" />
</Area>
<Area Left="0" Top="0" Width="38" Height="33">
<Cursor Type="Hand" />
<Click Event="FUEL_SELECTOR_LEFT" />
</Area>
<Area Left="39" Top="0" Width="37" Height="38">
<Cursor Type="Hand" />
<Click Event="FUEL_SELECTOR_RIGHT" />
</Area>
<Area Left="0" Top="36" Width="37" Height="31">
<Cursor Type="Hand" />
<Click Event="FUEL_SELECTOR_CENTER" />
</Area>
</Area>
<!-- Fuel Selector R -->
<Area Left="290" Top="312" Width="76" Height="76">
<Help ID="HELPID_GAUGE_FUEL_SELECTOR" />
<Tooltip ID="TOOLTIPTEXT_DC3_RIGHT_FUEL_SELECTOR" />
<Area Left="39" Top="38" Width="40" Height="36">
<Cursor Type="Hand" />
<Click Event="FUEL_SELECTOR_2_OFF" />
</Area>
<Area Left="0" Top="0" Width="38" Height="33">
<Cursor Type="Hand" />
<Click Event="FUEL_SELECTOR_2_LEFT" />
</Area>
<Area Left="39" Top="0" Width="37" Height="38">
<Cursor Type="Hand" />
<Click Event="FUEL_SELECTOR_2_RIGHT" />
</Area>
<Area Left="0" Top="36" Width="37" Height="31">
<Cursor Type="Hand" />
<Click Event="FUEL_SELECTOR_2_CENTER" />
</Area>
</Area>
</Mouse>
</Gauge>
I tried many different things to fix it, but what ultimately solved the tank switching problem was this...
XML:
<!-- Fuel Selector L -->
<Area Left="29" Top="312" Width="76" Height="76">
<Help ID="HELPID_GAUGE_FUEL_SELECTOR" />
<Tooltip ID="TOOLTIPTEXT_DC3_LEFT_FUEL_SELECTOR" />
<Area Left="39" Top="38" Width="40" Height="36">
<Tooltip ID="">Engine 1 Fuel Selector Off</Tooltip>
<Help ID=""/>
<Cursor Type="Hand" />
<Click>(>K:FUEL_SELECTOR_OFF)
</Click>
</Area>
<Area Left="0" Top="0" Width="38" Height="33">
<Tooltip ID="">Engine 1 Fuel Selector Left Main</Tooltip>
<Help ID=""/>
<Cursor Type="Hand" />
<Click>19 (>K:FUEL_SELECTOR_SET)
</Click>
</Area>
<Area Left="39" Top="0" Width="37" Height="38">
<Tooltip ID="">Engine 1 Fuel Selector Right Main</Tooltip>
<Help ID=""/>
<Cursor Type="Hand" />
<Click>20 (>K:FUEL_SELECTOR_SET)
</Click>
</Area>
<Area Left="0" Top="36" Width="37" Height="31">
<Tooltip ID="">Engine 1 Fuel Selector Left Aux</Tooltip>
<Help ID=""/>
<Cursor Type="Hand" />
<Click>4 (>K:FUEL_SELECTOR_SET)
</Click>
</Area>
</Area>
<!-- Fuel Selector R -->
<Area Left="290" Top="312" Width="76" Height="76">
<Help ID="HELPID_GAUGE_FUEL_SELECTOR" />
<Tooltip ID="TOOLTIPTEXT_DC3_RIGHT_FUEL_SELECTOR" />
<Area Left="39" Top="38" Width="40" Height="36">
<Tooltip ID="">Engine 1 Fuel Selector Off</Tooltip>
<Help ID=""/>
<Cursor Type="Hand" />
<Click>(>K:FUEL_SELECTOR_2_OFF)
</Click>
</Area>
<Area Left="0" Top="0" Width="38" Height="33">
<Tooltip ID="">Engine 1 Fuel Selector Left Main</Tooltip>
<Help ID=""/>
<Cursor Type="Hand" />
<Click>19 (>K:FUEL_SELECTOR_2_SET)
</Click>
</Area>
<Area Left="39" Top="0" Width="37" Height="38">
<Tooltip ID="">Engine 1 Fuel Selector Right Main</Tooltip>
<Help ID=""/>
<Cursor Type="Hand" />
<Click>20 (>K:FUEL_SELECTOR_2_SET)
</Click>
</Area>
<Area Left="0" Top="36" Width="37" Height="31">
<Tooltip ID="">Engine 1 Fuel Selector Right Aux</Tooltip>
<Help ID=""/>
<Cursor Type="Hand" />
<Click>5 (>K:FUEL_SELECTOR_2_SET)
</Click>
</Area>
</Area>
</Mouse>
</Gauge>
With these changes, I am now able to switch the tanks by clicking on the respective area on the gauge, and I even get a nice tooltip when I hover my mouse over it.
HOWEVER, during startup, the aircraft always defaults to...
1. Left fuel selector sets to Left Main and feeds fuel from the LeftAux tank
2. Right fuel selector sets to Right Main and feeds fuel from the RightAux tank.
3. Switching tanks on the fuel selector causes the fuel to begin to feed from the selected tanks correctly.
3. The BMP images (that point to which tank is selected) for the fuel selector levers disappears UNLESS I have the tanks switched to OFF. The disappearing BMP images do not cause a problem with the selected tanks feeding fuel correctly.
I took a look at the ecu.xml file again, and noticed...
XML:
<!-- ========================= Left Fuel Selector ================ -->
<Element>
<Position X="67" Y="350" />
<Select>
<Value>(A:Fuel tank selector:1,enum)</Value>
<Case Value="0">
<Image Name="ecu_fuel_tank_selector_off.bmp" UseTransparency="Yes">
<Axis X="47" Y="25" />
</Image>
</Case>
<!-- If ALL then default to LEFT-->
<Case Value="1">
<Image Name="ecu_fuel_tank_selector_left_main.bmp" UseTransparency="Yes">
<Axis X="19" Y="29" />
</Image>
</Case>
<Case Value="2">
<Image Name="ecu_fuel_tank_selector_left_main.bmp" UseTransparency="Yes">
<Axis X="19" Y="29" />
</Image>
</Case>
<Case Value="3">
<Image Name="ecu_fuel_tank_selector_right_main.bmp" UseTransparency="Yes">
<Axis X="32" Y="25" />
</Image>
</Case>
<Case Value="6">
<Image Name="ecu_fuel_tank_selector_aux.bmp" UseTransparency="Yes">
<Axis X="31" Y="24" />
</Image>
</Case>
</Select>
</Element>
<!-- ========================= Right Fuel Selector =============== -->
<Element>
<Position X="328" Y="350" />
<Select>
<Value>(A:Fuel tank selector:2,enum)</Value>
<Case Value="0">
<Image Name="ecu_fuel_tank_selector_off.bmp" UseTransparency="Yes">
<Axis X="47" Y="25" />
</Image>
</Case>
<!-- If ALL the default to RIGHT-->
<Case Value="1">
<Image Name="ecu_fuel_tank_selector_right_main.bmp" UseTransparency="Yes">
<Axis X="32" Y="25" />
</Image>
</Case>
<Case Value="2">
<Image Name="ecu_fuel_tank_selector_left_main.bmp" UseTransparency="Yes">
<Axis X="19" Y="29" />
</Image>
</Case>
<Case Value="3">
<Image Name="ecu_fuel_tank_selector_right_main.bmp" UseTransparency="Yes">
<Axis X="32" Y="25" />
</Image>
</Case>
<Case Value="6">
<Image Name="ecu_fuel_tank_selector_aux.bmp" UseTransparency="Yes">
<Axis X="31" Y="24" />
</Image>
</Case>
</Select>
</Element>
I tried changing <!-- If ALL the default to LEFT--> and <!-- If ALL the default to RIGHT--> to LEFT MAIN and RIGHT MAIN, and it doesn't solve the issue with it defaulting to feeding fuel from the LEFTAUX and RIGHTAUX tanks.
I'm also stumped as to how to fix the issue with the bitmaps disappearing.
During startup...
When switching tanks EXCEPT OFF
Everything I've mentioned above is the only lines of code I found associated with anything fuel related in this ecu.xml.
I hope this is enough information provided to receive some help. It would be appreciated!
Attachments
Last edited: