Jump to content
Sign in to follow this  
Guest Fabio Miguez

Fuel Dump

Recommended Posts

Guest Peyroteo

HiAny chance to make a xml gauge for dumping the fuel?I try a lot but the K: variables don

Share this post


Link to post
Share on other sites
Guest Fabio Miguez

Hey Peyroteo.Sorry, can't help you on that one, but as an encouragement, I know it is possible (although haven't figured out how to do it yet) to do that in C, so it might be possible in XML.

Share this post


Link to post
Share on other sites

Hi all,There was already a discussion about this subject, try search function.It is not possible in xml.But.... there is a good working C gauge which i use and it is made with coop of Arne.It is in the experimental aircraft and panel of mr. Pike.Search in the library:c4sst12.zipIt works well!Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest Fabio Miguez

Hey Jan.Thanks for the answer. Say, would you mind showing us the code for this gauge? I have been left wondering how you'd go about doing that, but can't seem to find an answer. FSUIPC perhaps?

Share this post


Link to post
Share on other sites

Hi,gauge00=FSUIPC_DUMP!fuel_dump, 440, 285, 70, 60You need :FSUIPC_DUMP.gau and set fuel.xml from his gaugesThey are in the zipJan"Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest bartels

Something like this?#include "fs2k2gauges.h"#include "resource.h"#include "FSUIPC_User.h"#include "FUEL_DUMP.h"#define GAUGE_NAME "Fuel_Dump0"#define GAUGE_W 40#define REF_HELPID HELP_NONE#define BMP_BACK BMP_FUEL_DUMP_BACK#define CENTRE_LEVEL 0x0B74#define LEFT_MAIN_LEVEL 0x0B7C#define LEFT_AUX_LEVEL 0x0B84#define LEFT_TIP_LEVEL 0x0B8C#define RIGHT_MAIN_LEVEL 0x0B94#define RIGHT_AUX_LEVEL 0x0B9C#define RIGHT_TIP_LEVEL 0x0BA4static DWORD dwResult;static BOOL FSAPI FuelDump(PPIXPOINT arg1, FLAGS32 mouse_flags ){ DWORD fuellevel=66536*128;//100% fuellevel = (int)((double)fuellevel*0.5);//50% FSUIPC_Open(SIM_FS2K2 , &dwResult); FSUIPC_Write(CENTRE_LEVEL, 4, &fuellevel, &dwResult); FSUIPC_Write(LEFT_MAIN_LEVEL, 4, &fuellevel, &dwResult); FSUIPC_Write(LEFT_AUX_LEVEL, 4, &fuellevel, &dwResult); FSUIPC_Write(LEFT_TIP_LEVEL, 4, &fuellevel, &dwResult); FSUIPC_Write(RIGHT_MAIN_LEVEL, 4, &fuellevel, &dwResult); FSUIPC_Write(RIGHT_AUX_LEVEL, 4, &fuellevel, &dwResult); FSUIPC_Write(RIGHT_TIP_LEVEL, 4, &fuellevel, &dwResult); FSUIPC_Process(&dwResult); FSUIPC_Close(); return FALSE;}static void FSAPI gauge_cb(PGAUGEHDR pgauge, int service_id, UINT32 extra_data){ switch(service_id) { case PANEL_SERVICE_CONNECT_TO_WINDOW: case PANEL_SERVICE_DISCONNECT: break; default: break; }}/////////////////////////////////////////////////////////////////////////////////////////////////////////static MAKE_STATIC( background, BMP_BACK, NULL, NULL, IMAGE_USE_TRANSPARENCY| IMAGE_USE_ERASE, 0, 0,0)static MAKE_PLIST(plist,&background)static MOUSE_BEGIN( mouse_rect, REF_HELPID, 0, 0 ) MOUSE_CHILD_FUNCT(0,0,40,40, CURSOR_UPARROW, MOUSE_LEFTSINGLE,FuelDump)MOUSE_ENDstatic char gauge_name[] = GAUGE_NAME;GAUGE_HEADER_FS700( GAUGE_W, gauge_name, plist, mouse_rect, gauge_cb, 0, 0, 0 );The use of FSUIPC_Open instead of FSUIPC_Open2 might be ineffecient if used often ,but since it is only in one callback, seldom used....The code is not in the standrad form since I add the subgauge.c file to the project and include a subgauge.h, but you actually only need the stuff around the "FuelDump"-function. "FuelDump" sets each tank to half full, you can also use other levels/tank selections of course.Arne Bartels

Share this post


Link to post
Share on other sites
Guest Fabio Miguez

Great stuff Arne, thanks a lot!

Share this post


Link to post
Share on other sites
Guest Peyroteo

Hi,Thanks for your answers.It a pity, I do not program in C anymore for 15 years ago. I can understand the code and if have more time I start again programing in C. Thanks a lot Arne.My idea is a gauge only to dump the fuel, i.e. 200 gallons/minute, not to refill too.I start developing a xml gauge to get a failure if the plane weight is above the maximum landing weight and so I must have any mean to dump the fuel in the case of a forced landing.Best regards,Peyroteo

Share this post


Link to post
Share on other sites
Guest Fabio Miguez

Well, if you were to use C (and for others reading), you can still vary the ammount of fuel dumped overboard with time by using the "fill to" function.All you'd have to do is read the current level of the fuel tanks, determine what the fuel dump rate would be, then fill the tanks to a lesser value every, say, second, according to the dump rate.So if the fuel dump activate switch/knob/lever stayed in the ON position, for every second that went by, the tanks would be refilled to a smaller value, giving the impression fuel is guzzling out.

Share this post


Link to post
Share on other sites
Guest

>I start developing a xml gauge to get a failure if the plane>weight is above the maximum landing weight and so I must have>any mean to dump the fuel in the case of a forced landing.Great tip, thanks :)IF max realism AND gear extended AND 1 feet above ground AND retarded throttles AND above maximum weight, THEN toggle gear :D

Share this post


Link to post
Share on other sites
Guest Fabio Miguez

:-)

Share this post


Link to post
Share on other sites
Guest AndrewW

>All you'd have to do is read the current level of the fuel>tanks, determine what the fuel dump rate would be, then fill>the tanks to a lesser value every, say, second, according to>the dump rate.>>So if the fuel dump activate switch/knob/lever stayed in the>ON position, for every second that went by, the tanks would be>refilled to a smaller value, giving the impression fuel is>guzzling out.I'm trying this approach, and have the following : //--------------------------------------------------------MODULE_VAR dump_left = {FUEL_TANK_LEFT_MAIN_LEVEL};....lookup_var(&dump_left);dump_left.var_value.n = dump_left.var_value.n - 537.3386; //dump 2T/min case PANEL_SERVICE_PRE_UPDATE: //Set fuel selector to External tanks if (*pfdump == 1) { fuellevel = dump_left.var_value.n; FSUIPC_Write(LEFT_MAIN_LEVEL, 4, &fuellevel, &dwResult); FSUIPC_Process(&dwResult); }//--------------------------------------------------------This approach works, however the jettison flow rate seems to vary with the fuel level. It will dump 2T/min when at 0% level, but something much higher when the tank level is at 100%. Is there a way to work around this? I'm sure I'm doing something wrong! Thanks for any help or suggestions. Andrew

Share this post


Link to post
Share on other sites
Guest Skymed

Further to this....is there a way to use XML parameters to make the fuel dump/add work? In other words, custom L:Vars that can trigger the fuel-dump gauge to add or subtract fuel?Steve

Share this post


Link to post
Share on other sites

Steve,Ask Doug Dawson.He made a fuel dump gauge with xml parameters.Works perfect!!Different tanks, rate etc.Probably he is willing to make it custom for you (adding fuel)Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest Skymed

Janyes I have been talking with Doug :-))Also I have been playing with the (>K:ADD_FUEL_QUANTITY) event, and it is quite possible to customise the amount of fuel added using numbers from 0 to 65535 (full fuel). Can't get it to subtract though.Steve

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...