Search the Community
Showing results for tags 'fuel'.
-
Hi guys, I am so happy with the WPF C# from Paul Templates and the DLL. Right now I am trying to write one value (Fuel in kgs) from my textbox (txtboxCenterTank.Text) to the Simulator. But I am struggling a bit. Do you guys have any hints ? Thanks Patrick public partial class MainWindow : Window { FsFuelTanksCollection fuelTanks = null; // Set up a main timer private DispatcherTimer timerMain = new DispatcherTimer(); // And another to look for a connection private DispatcherTimer timerConnection = new DispatcherTimer(); // ===================================== // DECLARE OFFSETS YOU WANT TO USE HERE // ===================================== private Offset<uint> airspeed = new Offset<uint>(0x02BC); public MainWindow() { InitializeComponent(); configureForm(); timerMain.Interval = TimeSpan.FromMilliseconds(50); timerMain.Tick += timerMain_Tick; timerConnection.Interval = TimeSpan.FromMilliseconds(1000); timerConnection.Tick += timerConnection_Tick; timerConnection.Start(); } private void timerConnection_Tick(object sender, EventArgs e) { // Try to open the connection try { FSUIPCConnection.Open(); // If there was no problem, stop this timer and start the main timer this.timerConnection.Stop(); this.timerMain.Start(); // Update the connection status configureForm(); } catch { // No connection found. Don't need to do anything, just keep trying } } // This method runs 20 times per second (every 50ms). This is set in the form constructor above. private void timerMain_Tick(object sender, EventArgs e) { // Call process() to read/write data to/from FSUIPC // We do this in a Try/Catch block incase something goes wrong try { FSUIPCConnection.Process(); // Update the information on the form // (See the Examples Application for more information on using Offsets). // 1. Airspeed double airspeedKnots = (double)this.airspeed.Value / 128d; this.txtAirspeed.Text = airspeedKnots.ToString("F0"); } catch (Exception ex) { // An error occured. Tell the user and stop this timer. this.timerMain.Stop(); MessageBox.Show("Communication with Aircraft Failed\n\n" + ex.Message, "FSUIPC", MessageBoxButton.OK, MessageBoxImage.Exclamation); // Update the connection status configureForm(); } } // Configures the button and status label depending on if we're connected or not private void configureForm() { if (FSUIPCConnection.IsOpen) { this.lblConnectionStatus.Text = "Connection to Aircraft established"; this.lblConnectionStatus.Foreground = Brushes.Green; } else { this.lblConnectionStatus.Text = "Disconnected. Looking for Aircraft Connection..."; this.lblConnectionStatus.Foreground = Brushes.Red; } } // Window closing so stop all the timers and close the connection private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { this.timerConnection.Stop(); this.timerMain.Stop(); FSUIPCConnection.Close(); } // With this Button I am trying to write values to the Center Main Tank private void btnWrite_Click(object sender, RoutedEventArgs e) { FsFuelTank tank = this.fuelTanks[tankControl.FuelTank]; FSFuelTanks.Centre_Main = txtboxCenterTank.Text; //here the error occures FSUIPCConnection.PayloadServices.WriteChanges(); } } }
-
Hello captains!! Some time ago, I made a flight and my Acft get out of fuel, but it keep flying. Now, I have just made a flight to test this and it happen again. I'm flying for about 30 minutes without fuel, but the engines still running. It is wright?? Can I do something to change this?? Thanks a lot!
-
Moved to Main Forum, where questions should be posted! Pleas post always to Main Forum. Evening all, I am a member of Delta Virtual Airlines (deltava.org) and we have been having issues with the latest FSUIPC 5.xxx in P3Dv4.1 and the PMDG 747 QOTSII in regards to the fuel quantities, when FSUIPC is reporting the fuel to our ACARS system (developed by Luke Kolin). Ever since updating to the latest FSUIPC in P3Dv4.1, FSUIPC either reports to ACARS that there is 0lbs fuel, +2,447,447,447lbs of fuel, or -2,447,447,447lbs of fuel. It also reports that in flight refueling is detected, although I am not sure how much of an issue that is with the ACARS system using what FSUIPC reports, or both, or FSUIPC. In any case, Luke Kolin told me that the only way this could be fixed would be to have Pete make a fix for it. I know he is away till the 2nd, tomorrow, so figured I would post it now.
-
Hi! This is my first post here so bare with me :) I have 7 years programming background so you can "TechTalk" to me as im familiar with data types and stuff. So at first i wanted to know why PS.FuelLevelUSGallons.ToString("f1") Returns integer value 52.00 even if there is 52.69 in tanks. Is there other function to have this value as more accurate ? Second, how i add fuel to tanks ? Thank you in advance !