Jump to content
The simFlight Network Forums

rfresh

Members
  • Posts

    128
  • Joined

  • Last visited

Everything posted by rfresh

  1. Hmmm...I tried out your example code Paul but I didn't see anything show up in the CDU Fuel Page. UPDATE: I have not registered FSUIPC yet...could that be it? namespace FSUIPC_Fuel_Tanks { public partial class FSXFuelConfigForm : Form { PayloadServices ps; private Offset<int> sendControl = new Offset<int>("SendControl", 0x3110, true); private readonly int THIRD_PARTY_EVENT_ID_MIN = 0x00011000; // equal to 69632 public FSXFuelConfigForm() { InitializeComponent(); } private void btnClose_Click(object sender, EventArgs e) { this.Close(); } private void FSXFuelConfigForm_Load(object sender, EventArgs e) { try { FSUIPCConnection.Open(); } catch (FSUIPCException ex) { if (ex.FSUIPCErrorCode == FSUIPCError.FSUIPC_ERR_SENDMSG) { FSUIPCConnection.Close(); MessageBox.Show("Unable to connect to FSX."); } else { } } ps = FSUIPCConnection.PayloadServices; } private void btnSetTankValues_Click(object sender, EventArgs e) { ps.RefreshData(); sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 551; FSUIPCConnection.Process("SendControl"); // Press FS ACTIONS> LSK5R sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 544; FSUIPCConnection.Process("SendControl"); // Press <FUEL LSK1L sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 534; FSUIPCConnection.Process("SendControl"); // Press digit 3 sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 563; FSUIPCConnection.Process("SendControl"); // Press digit 4 sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 564; FSUIPCConnection.Process("SendControl"); // Press digit 5 sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 565; FSUIPCConnection.Process("SendControl"); // Press digit 6 sendControl.Value = THIRD_PARTY_EVENT_ID_MIN + 566; FSUIPCConnection.Process("SendControl"); ps.WriteChanges(); ps.RefreshData(); } } }
  2. I see Paul. Thanks a lot...I will give this a try later today. And thanks to Pete as well for jumping into this thread! Both of you guys really rock!!
  3. Hi Pete Yes, but can I do this in C#? I'm not programming my flight stick buttons to do this as is the usual way folks interact with FSUIPC. So, here is my key sequence as an example of pushing keys to the CDU to load 3,456 pounds of fuel into tank 1 (using the Left CDU): Press MENU button #define EVT_CDU_L_MENU (THIRD_PARTY_EVENT_ID_MIN + 551) Press FS ACTIONS> LSK5R #define EVT_CDU_L_R5 (THIRD_PARTY_EVENT_ID_MIN + 544) Press <FUEL LSK1L #define EVT_CDU_L_L1 (THIRD_PARTY_EVENT_ID_MIN + 534) Press digit 3 #define EVT_CDU_L_3 (THIRD_PARTY_EVENT_ID_MIN + 563) Press digit 4 #define EVT_CDU_L_4 (THIRD_PARTY_EVENT_ID_MIN + 564) Press digit 5 #define EVT_CDU_L_5 (THIRD_PARTY_EVENT_ID_MIN + 565) Press digit 6 #define EVT_CDU_L_6 (THIRD_PARTY_EVENT_ID_MIN + 566) Load '3456' pounds of fuel into tank1 for example which is LSK3L #define EVT_CDU_L_L3 (THIRD_PARTY_EVENT_ID_MIN + 536)
  4. Here is what I've found in the PMDG SDK .h file. It looks like they have mapped out the key inputs to the CDU pretty well but I don't know how to make use of this information (sorry). I also see they have some mouse detection defines but, I don't know how to use those. However, I don't need mouse input, I need to send keys presses to the CDU itself to load the fuel tanks. (I'm attaching the whole .h file). PMDG_NGX_SDK.h file: {snip lines above this seciton} // The rest of the controls and indicators match their standard FSX counterparts // and can be accessed using the standard SimConnect means. // NGX Control Structure struct PMDG_NGX_Control { unsigned int Event; unsigned int Parameter; }; #define MOUSE_FLAG_RIGHTSINGLE 0x80000000 #define MOUSE_FLAG_MIDDLESINGLE 0x40000000 #define MOUSE_FLAG_LEFTSINGLE 0x20000000 #define MOUSE_FLAG_RIGHTDOUBLE 0x10000000 #define MOUSE_FLAG_MIDDLEDOUBLE 0x08000000 #define MOUSE_FLAG_LEFTDOUBLE 0x04000000 #define MOUSE_FLAG_RIGHTDRAG 0x02000000 #define MOUSE_FLAG_MIDDLEDRAG 0x01000000 #define MOUSE_FLAG_LEFTDRAG 0x00800000 #define MOUSE_FLAG_MOVE 0x00400000 #define MOUSE_FLAG_DOWN_REPEAT 0x00200000 #define MOUSE_FLAG_RIGHTRELEASE 0x00080000 #define MOUSE_FLAG_MIDDLERELEASE 0x00040000 #define MOUSE_FLAG_LEFTRELEASE 0x00020000 #define MOUSE_FLAG_WHEEL_FLIP 0x00010000 // invert direction of mouse wheel #define MOUSE_FLAG_WHEEL_SKIP 0x00008000 // look at next 2 rect for mouse wheel commands #define MOUSE_FLAG_WHEEL_UP 0x00004000 #define MOUSE_FLAG_WHEEL_DOWN 0x00002000 // Control Events #ifndef THIRD_PARTY_EVENT_ID_MIN #define THIRD_PARTY_EVENT_ID_MIN 0x00011000 // equals to 69632 #endif // CDU #define EVT_CDU_L_L1 (THIRD_PARTY_EVENT_ID_MIN + 534) #define EVT_CDU_L_L2 (THIRD_PARTY_EVENT_ID_MIN + 535) #define EVT_CDU_L_L3 (THIRD_PARTY_EVENT_ID_MIN + 536) #define EVT_CDU_L_L4 (THIRD_PARTY_EVENT_ID_MIN + 537) #define EVT_CDU_L_L5 (THIRD_PARTY_EVENT_ID_MIN + 538) #define EVT_CDU_L_L6 (THIRD_PARTY_EVENT_ID_MIN + 539) #define EVT_CDU_L_R1 (THIRD_PARTY_EVENT_ID_MIN + 540) #define EVT_CDU_L_R2 (THIRD_PARTY_EVENT_ID_MIN + 541) #define EVT_CDU_L_R3 (THIRD_PARTY_EVENT_ID_MIN + 542) #define EVT_CDU_L_R4 (THIRD_PARTY_EVENT_ID_MIN + 543) #define EVT_CDU_L_R5 (THIRD_PARTY_EVENT_ID_MIN + 544) #define EVT_CDU_L_R6 (THIRD_PARTY_EVENT_ID_MIN + 545) #define EVT_CDU_L_INIT_REF (THIRD_PARTY_EVENT_ID_MIN + 546) #define EVT_CDU_L_RTE (THIRD_PARTY_EVENT_ID_MIN + 547) #define EVT_CDU_L_CLB (THIRD_PARTY_EVENT_ID_MIN + 548) #define EVT_CDU_L_CRZ (THIRD_PARTY_EVENT_ID_MIN + 549) #define EVT_CDU_L_DES (THIRD_PARTY_EVENT_ID_MIN + 550) #define EVT_CDU_L_MENU (THIRD_PARTY_EVENT_ID_MIN + 551) #define EVT_CDU_L_LEGS (THIRD_PARTY_EVENT_ID_MIN + 552) #define EVT_CDU_L_DEP_ARR (THIRD_PARTY_EVENT_ID_MIN + 553) #define EVT_CDU_L_HOLD (THIRD_PARTY_EVENT_ID_MIN + 554) #define EVT_CDU_L_PROG (THIRD_PARTY_EVENT_ID_MIN + 555) #define EVT_CDU_L_EXEC (THIRD_PARTY_EVENT_ID_MIN + 556) #define EVT_CDU_L_N1_LIMIT (THIRD_PARTY_EVENT_ID_MIN + 557) #define EVT_CDU_L_FIX (THIRD_PARTY_EVENT_ID_MIN + 558) #define EVT_CDU_L_PREV_PAGE (THIRD_PARTY_EVENT_ID_MIN + 559) #define EVT_CDU_L_NEXT_PAGE (THIRD_PARTY_EVENT_ID_MIN + 560) #define EVT_CDU_L_1 (THIRD_PARTY_EVENT_ID_MIN + 561) #define EVT_CDU_L_2 (THIRD_PARTY_EVENT_ID_MIN + 562) #define EVT_CDU_L_3 (THIRD_PARTY_EVENT_ID_MIN + 563) #define EVT_CDU_L_4 (THIRD_PARTY_EVENT_ID_MIN + 564) #define EVT_CDU_L_5 (THIRD_PARTY_EVENT_ID_MIN + 565) #define EVT_CDU_L_6 (THIRD_PARTY_EVENT_ID_MIN + 566) #define EVT_CDU_L_7 (THIRD_PARTY_EVENT_ID_MIN + 567) #define EVT_CDU_L_8 (THIRD_PARTY_EVENT_ID_MIN + 568) #define EVT_CDU_L_9 (THIRD_PARTY_EVENT_ID_MIN + 569) #define EVT_CDU_L_DOT (THIRD_PARTY_EVENT_ID_MIN + 570) #define EVT_CDU_L_0 (THIRD_PARTY_EVENT_ID_MIN + 571) #define EVT_CDU_L_PLUS_MINUS (THIRD_PARTY_EVENT_ID_MIN + 572) #define EVT_CDU_L_A (THIRD_PARTY_EVENT_ID_MIN + 573) #define EVT_CDU_L_B (THIRD_PARTY_EVENT_ID_MIN + 574) #define EVT_CDU_L_C (THIRD_PARTY_EVENT_ID_MIN + 575) #define EVT_CDU_L_D (THIRD_PARTY_EVENT_ID_MIN + 576) #define EVT_CDU_L_E (THIRD_PARTY_EVENT_ID_MIN + 577) #define EVT_CDU_L_F (THIRD_PARTY_EVENT_ID_MIN + 578) #define EVT_CDU_L_G (THIRD_PARTY_EVENT_ID_MIN + 579) #define EVT_CDU_L_H (THIRD_PARTY_EVENT_ID_MIN + 580) #define EVT_CDU_L_I (THIRD_PARTY_EVENT_ID_MIN + 581) #define EVT_CDU_L_J (THIRD_PARTY_EVENT_ID_MIN + 582) #define EVT_CDU_L_K (THIRD_PARTY_EVENT_ID_MIN + 583) #define EVT_CDU_L_L (THIRD_PARTY_EVENT_ID_MIN + 584) #define EVT_CDU_L_M (THIRD_PARTY_EVENT_ID_MIN + 585) #define EVT_CDU_L_N (THIRD_PARTY_EVENT_ID_MIN + 586) #define EVT_CDU_L_O (THIRD_PARTY_EVENT_ID_MIN + 587) #define EVT_CDU_L_P (THIRD_PARTY_EVENT_ID_MIN + 588) #define EVT_CDU_L_Q (THIRD_PARTY_EVENT_ID_MIN + 589) #define EVT_CDU_L_R (THIRD_PARTY_EVENT_ID_MIN + 590) #define EVT_CDU_L_S (THIRD_PARTY_EVENT_ID_MIN + 591) #define EVT_CDU_L_T (THIRD_PARTY_EVENT_ID_MIN + 592) #define EVT_CDU_L_U (THIRD_PARTY_EVENT_ID_MIN + 593) #define EVT_CDU_L_V (THIRD_PARTY_EVENT_ID_MIN + 594) #define EVT_CDU_L_W (THIRD_PARTY_EVENT_ID_MIN + 595) #define EVT_CDU_L_X (THIRD_PARTY_EVENT_ID_MIN + 596) #define EVT_CDU_L_Y (THIRD_PARTY_EVENT_ID_MIN + 597) #define EVT_CDU_L_Z (THIRD_PARTY_EVENT_ID_MIN + 598) #define EVT_CDU_L_SPACE (THIRD_PARTY_EVENT_ID_MIN + 599) #define EVT_CDU_L_DEL (THIRD_PARTY_EVENT_ID_MIN + 600) #define EVT_CDU_L_SLASH (THIRD_PARTY_EVENT_ID_MIN + 601) #define EVT_CDU_L_CLR (THIRD_PARTY_EVENT_ID_MIN + 602) #define EVT_CDU_L_BRITENESS (THIRD_PARTY_EVENT_ID_MIN + 605) #define EVT_CDU_R_L1 (THIRD_PARTY_EVENT_ID_MIN + 606) #define EVT_CDU_R_L2 (THIRD_PARTY_EVENT_ID_MIN + 607) #define EVT_CDU_R_L3 (THIRD_PARTY_EVENT_ID_MIN + 608) #define EVT_CDU_R_L4 (THIRD_PARTY_EVENT_ID_MIN + 609) #define EVT_CDU_R_L5 (THIRD_PARTY_EVENT_ID_MIN + 610) #define EVT_CDU_R_L6 (THIRD_PARTY_EVENT_ID_MIN + 611) #define EVT_CDU_R_R1 (THIRD_PARTY_EVENT_ID_MIN + 612) #define EVT_CDU_R_R2 (THIRD_PARTY_EVENT_ID_MIN + 613) #define EVT_CDU_R_R3 (THIRD_PARTY_EVENT_ID_MIN + 614) #define EVT_CDU_R_R4 (THIRD_PARTY_EVENT_ID_MIN + 615) #define EVT_CDU_R_R5 (THIRD_PARTY_EVENT_ID_MIN + 616) #define EVT_CDU_R_R6 (THIRD_PARTY_EVENT_ID_MIN + 617) #define EVT_CDU_R_INIT_REF (THIRD_PARTY_EVENT_ID_MIN + 618) #define EVT_CDU_R_RTE (THIRD_PARTY_EVENT_ID_MIN + 619) #define EVT_CDU_R_CLB (THIRD_PARTY_EVENT_ID_MIN + 620) #define EVT_CDU_R_CRZ (THIRD_PARTY_EVENT_ID_MIN + 621) #define EVT_CDU_R_DES (THIRD_PARTY_EVENT_ID_MIN + 622) #define EVT_CDU_R_MENU (THIRD_PARTY_EVENT_ID_MIN + 623) #define EVT_CDU_R_LEGS (THIRD_PARTY_EVENT_ID_MIN + 624) #define EVT_CDU_R_DEP_ARR (THIRD_PARTY_EVENT_ID_MIN + 625) #define EVT_CDU_R_HOLD (THIRD_PARTY_EVENT_ID_MIN + 626) #define EVT_CDU_R_PROG (THIRD_PARTY_EVENT_ID_MIN + 627) #define EVT_CDU_R_EXEC (THIRD_PARTY_EVENT_ID_MIN + 628) #define EVT_CDU_R_N1_LIMIT (THIRD_PARTY_EVENT_ID_MIN + 629) #define EVT_CDU_R_FIX (THIRD_PARTY_EVENT_ID_MIN + 630) #define EVT_CDU_R_PREV_PAGE (THIRD_PARTY_EVENT_ID_MIN + 631) #define EVT_CDU_R_NEXT_PAGE (THIRD_PARTY_EVENT_ID_MIN + 632) #define EVT_CDU_R_1 (THIRD_PARTY_EVENT_ID_MIN + 633) #define EVT_CDU_R_2 (THIRD_PARTY_EVENT_ID_MIN + 634) #define EVT_CDU_R_3 (THIRD_PARTY_EVENT_ID_MIN + 635) #define EVT_CDU_R_4 (THIRD_PARTY_EVENT_ID_MIN + 636) #define EVT_CDU_R_5 (THIRD_PARTY_EVENT_ID_MIN + 637) #define EVT_CDU_R_6 (THIRD_PARTY_EVENT_ID_MIN + 638) #define EVT_CDU_R_7 (THIRD_PARTY_EVENT_ID_MIN + 639) #define EVT_CDU_R_8 (THIRD_PARTY_EVENT_ID_MIN + 640) #define EVT_CDU_R_9 (THIRD_PARTY_EVENT_ID_MIN + 641) #define EVT_CDU_R_DOT (THIRD_PARTY_EVENT_ID_MIN + 642) #define EVT_CDU_R_0 (THIRD_PARTY_EVENT_ID_MIN + 643) #define EVT_CDU_R_PLUS_MINUS (THIRD_PARTY_EVENT_ID_MIN + 644) #define EVT_CDU_R_A (THIRD_PARTY_EVENT_ID_MIN + 645) #define EVT_CDU_R_B (THIRD_PARTY_EVENT_ID_MIN + 646) #define EVT_CDU_R_C (THIRD_PARTY_EVENT_ID_MIN + 647) #define EVT_CDU_R_D (THIRD_PARTY_EVENT_ID_MIN + 648) #define EVT_CDU_R_E (THIRD_PARTY_EVENT_ID_MIN + 649) #define EVT_CDU_R_F (THIRD_PARTY_EVENT_ID_MIN + 650) #define EVT_CDU_R_G (THIRD_PARTY_EVENT_ID_MIN + 651) #define EVT_CDU_R_H (THIRD_PARTY_EVENT_ID_MIN + 652) #define EVT_CDU_R_I (THIRD_PARTY_EVENT_ID_MIN + 653) #define EVT_CDU_R_J (THIRD_PARTY_EVENT_ID_MIN + 654) #define EVT_CDU_R_K (THIRD_PARTY_EVENT_ID_MIN + 655) #define EVT_CDU_R_L (THIRD_PARTY_EVENT_ID_MIN + 656) #define EVT_CDU_R_M (THIRD_PARTY_EVENT_ID_MIN + 657) #define EVT_CDU_R_N (THIRD_PARTY_EVENT_ID_MIN + 658) #define EVT_CDU_R_O (THIRD_PARTY_EVENT_ID_MIN + 659) #define EVT_CDU_R_P (THIRD_PARTY_EVENT_ID_MIN + 660) #define EVT_CDU_R_Q (THIRD_PARTY_EVENT_ID_MIN + 661) #define EVT_CDU_R_R (THIRD_PARTY_EVENT_ID_MIN + 662) #define EVT_CDU_R_S (THIRD_PARTY_EVENT_ID_MIN + 663) #define EVT_CDU_R_T (THIRD_PARTY_EVENT_ID_MIN + 664) #define EVT_CDU_R_U (THIRD_PARTY_EVENT_ID_MIN + 665) #define EVT_CDU_R_V (THIRD_PARTY_EVENT_ID_MIN + 666) #define EVT_CDU_R_W (THIRD_PARTY_EVENT_ID_MIN + 667) #define EVT_CDU_R_X (THIRD_PARTY_EVENT_ID_MIN + 668) #define EVT_CDU_R_Y (THIRD_PARTY_EVENT_ID_MIN + 669) #define EVT_CDU_R_Z (THIRD_PARTY_EVENT_ID_MIN + 670) #define EVT_CDU_R_SPACE (THIRD_PARTY_EVENT_ID_MIN + 671) #define EVT_CDU_R_DEL (THIRD_PARTY_EVENT_ID_MIN + 672) #define EVT_CDU_R_SLASH (THIRD_PARTY_EVENT_ID_MIN + 673) #define EVT_CDU_R_CLR (THIRD_PARTY_EVENT_ID_MIN + 674) #define EVT_CDU_R_BRITENESS (THIRD_PARTY_EVENT_ID_MIN + 677) PMDG_NGX_SDK.txt
  5. So, I'm still figuring out how to change the fuel tank levels in the PMDG 737NGX and now PMDG has confirmed that the only way to do this is to send keys to the CDU on the MENU->FS ACTIONS->FUEL page. I looked in your UserGuide but didn't see anything about sending key strokes to FSX. Did I miss it worded in another way? How do I send keys to FSUIPC/FSX using your .DLL? Thanks...
  6. My understanding is that while I cannot directly access the fuel tank levels of the 737NGX, I can access the MENU->FS ACTIONS->FUEL screen inside the FMS/CDU and send key strokes to that device to get the fuel load into the tanks. It's sort of like a 'back door' approach to doing the same thing. My C# app has a fuel planning window that will calculate the fuel load for a given trip and I'd like to send those fuel tank values to the CDU, as described above, to set the fuel tank values. I'm not clear, from an application point of view, if I can use FSUIPC to do that or if using LUA is a better way to do it. Thanks Pete.
  7. Pete, I'm afraid I've gotten a little lost in all of this FSUIPC and LUA stuff. FSUIPC is used primarily to setup my FSX keys to control various things within FSX. My controls are setup and working fine, so I don't think I need to re-program them all over again using FSUIPC (although from what I've read, that may not be a bad idea, but that is not my main focus at this time). Where I'm lost is that I want to send keys to the 737NGX CDU (now that I know from PMDG I can't mess with the tanks directly themselves) from my windows application. Joe has suggested that I use LUA for this, but am I not able to do this just with using FSUIPC itself? And if so, how do I make these key calls in my .NET C# code?
  8. I have to use FSUIPC to send the 737NGX FMC key commands to load the fuel tanks it looks like.
  9. Pete: Yes I did look at your Offset Mapping for the 737NGX .PDF document...that's where I saw the Fuel offserts but they are mostly Booleans so I knew they wouldn't be able to set any fuel values. I got this email early this morning from PMDG (Ryan) regarding this issue: "Ralph This will not work, our fuel systems are completely custom coded to get around issues with the way FSX handles fuel consumption for jet engines by default. There's no way to externally load fuel, you have to use the FMC's MENU/FS ACTIONS/FUEL page." So, it looks like Joe was on the right track!
  10. Thanks Pete for that answer. I looked in the PMDG .h file and on line 402 there is this block: // Additional variables: used by FS2Crew bool ENG_StartValve[2]; // true: valve open float AIR_DuctPress[2]; // PSI unsigned char COMM_Attend_PressCount; // incremented with each button press unsigned char COMM_GrdCall_PressCount; // incremented with each button press unsigned char COMM_SelectedMic[3]; // array: 0=capt, 1=F/O, 2=observer. // values: 0=VHF1 1=VHF2 2=VHF3 3=HF1 4=HF2 5=FLT 6=SVC 7=PA float FUEL_QtyCenter; // LBS float FUEL_QtyLeft; // LBS float FUEL_QtyRight; // LBS So there are the defines for the three fuel tanks, as floats. And that looks like the only ones as all other FUEL constants are boolean or char types. However, I don't know what the comment means for non-FS2Crew apps like mine. I suppose I could just try it but I'm not sure how to map those .h header defines to FSUIPC? and I surely don't know if (probably not) Paul's .DLL Class handles these. If I could get some guidance on how to try these out, I'll report back on my results. Thanks...
  11. I apologize for this basic post but I searched this forum and found no threads on this topic. When I googled it, I found some old posts that talked about PMDG's SDK having the offsets to support being able to set their tank levels and then some folks said the offsets were read-only, etc. Quite confusing, thus my post here. Using Paul Hently's .NET .DLL and FSUIPC I wrote a small utility that works setting the fuel levels on the default FSX 737NGX and on the CS 777. When I try to set the fuel levels on the PMDG 737NGX, the quantities (the fuel digits) flash then return to their prior levels as if the PMDG is constantly resetting them. So, I'm wondering if I'm using the wrong offsets or if PMDG just doesn't allow us to change their fuel tank values? Thanks...
  12. I saw from one of the examples I needed to do this: FSUIPCConnection.Process("info"); to get the aircraftName to populate. I also see that "info" can be any name I want to use to identify this specific Group. I can use "acName" or "info2" if I wanted and it will still work.
  13. Hi Paul Here I'm trying to fetch the aircraft name but this.Text doesn't display the name. public partial class FSXFuelConfigForm : Form { private Offset<string> aircraftName = new Offset<string>("info", 0x3D00, 24); public FSXFuelConfigForm() { InitializeComponent(); } private Offset<string> aircraftName = new Offset<string>("info", 0x3D00, 24); private void FSXFuelConfigForm_Load(object sender, EventArgs e) { try { FSUIPCConnection.Open(); } catch (FSUIPCException ex) { if (ex.FSUIPCErrorCode == FSUIPCError.FSUIPC_ERR_SENDMSG) { // Send message error - connection to FSUIPC lost. // Show message, relight the // connection button: // Also Close the broken connection. FSUIPCConnection.Close(); MessageBox.Show("Unable to connect to FSX."); } else { // not the disonnect error so some other baddness occured. // just rethrow to halt the application throw ex; } } } PayloadServices ps = FSUIPCConnection.PayloadServices; FSUIPCConnection.Process(); ps.RefreshData(); this.Text = aircraftName.Value.ToString(); } }
  14. Yes, that worked...well, that's not so bad to have to do that, as long as one knows...thanks...
  15. So I have a small form that I'm entering fuel load values into textboxes and writing the changes to the aircraft. The line leftTank.WeightLbs = Convert.ToDouble(textBoxLeftTank.Text.ToString()); has leftTank as null and gives a runtime error. I can't see why this should not work? Even leftTank.WeightLbs = 8000; gives the same null error. PayloadServices ps = FSUIPCConnection.PayloadServices; FsFuelTank leftTank = ps.GetFuelTank(FSFuelTanks.Left_Main); FsFuelTank centerTank = ps.GetFuelTank(FSFuelTanks.Centre_Main); FsFuelTank rightTank = ps.GetFuelTank(FSFuelTanks.Right_Main); leftTank.WeightLbs = Convert.ToDouble(textBoxLeftTank.Text.ToString()); centerTank.WeightLbs = Convert.ToDouble(textBoxCenterTank.Text.ToString()); rightTank.WeightLbs = Convert.ToDouble(textBoxRightTank.Text.ToString()); ps.WriteChanges(); ps.RefreshData();
  16. Thanks Paul for that info. I realize that you and Pete know a hell of a lot more about this than I do, but I wanted to mention some add-ons can create nested menus. I use the Opus Software camera utility and they create nested FSX menus. Obviously I don't know how after what you have stated. They must be doing something different with their software.
  17. >1. If you just read the centre tank without changing it, does it match the gauge on the 737? Yes. Both the PMDG 737NGX and the MS Default 737NGX center tank reads the correct fuel load in pounds. >2. Is the change from your program reflected in the FSX Fuel dialog from the Aircraft menu? MS Default 737NGX: Yes. PMDG 737NGX: No. Even with the MS Default 737NGX, my setting of 8000 pounds in the center tank shows up in the cockpit but not in str2 in my form title. >. Maybe they are using one of the other centre tanks - try Centre_2 and Centre_3. I tried all of these on the PMDG model and they returned 0. So, PMDG must be using their own tank codes eh? For the Default MS 737NGX, I can read and set the center tank values but my pull into str2 doesn't work for some reason. And BTW, this line: ps.GetFuelTank(FSFuelTanks.Left_Main).WeightLbs = 8000; This is a Get method, but we use it to also Set a value? // Get a reference to save so much typing later... PayloadServices ps = FSUIPCConnection.PayloadServices; // Get the latest data from FSUIPC ps.RefreshData(); // Display centre tank percentage string str1 = ps.GetFuelTank(FSFuelTanks.Centre_Main).WeightLbs.ToString("F0"); ps.GetFuelTank(FSFuelTanks.Centre_Main).WeightLbs = 8000; ps.WriteChanges(); ps.RefreshData(); string str2 = ps.GetFuelTank(FSFuelTanks.Centre_Main).WeightLbs.ToString("F0"); this.Text = str1 + " " + str2;
  18. Do you have any examples of how to create nested FSX menus? Your link to the new 2.4 features were absolutely great to show how some things are done.
  19. OK, saw page 3...thank you. Is there a refresh of some kind I need to do for FSX to show the updated center tank fuel load I set? (I set the center tank to 5000 pounds).
  20. Pete, What's the situation with my customers who will soon be using my FSX app that hooks into FSUIPC? They obviously have to down load it and install it but do they have to purchase/register it? Or can they just use the free version? I will register regardless of what parts I use since you've put in a lot of work on this module, but from the free version I currently have, it looks like I can't do much with it vs the paid version. So, I'm wondering what will my customers see or run into between the free vs paid versions?
  21. I do have 2.4 zip but the user guide doc says ver 2.0 and I don't see anything in this doc re PayLoadServices ??? I see the doc update further down on the webpage. Below I get the center tank fuel level in pounds and that displays correctly. Then I set it to 5000 pounds and do another read and correctly get back 5000 pounds...however, my center tank gauge (737NGX) in the center engine display does not show 5000 pounds...it still shows the original load. // Get a reference to save so much typing later... PayloadServices ps = FSUIPCConnection.PayloadServices; // Get the latest data from FSUIPC ps.RefreshData(); // Display centre tank percentage string str1 = ps.GetFuelTank(FSFuelTanks.Centre_Main).WeightLbs.ToString("F0"); ps.GetFuelTank(FSFuelTanks.Centre_Main).WeightLbs = 5000; string str2 = ps.GetFuelTank(FSFuelTanks.Centre_Main).WeightLbs.ToString("F0"); this.Text = str1 + " " + str2; ps.WriteChanges();
  22. Thanks for the detailed answer. I may have missed it but do you have a Donate link?
  23. Well, I'm back on one monitor for now. I can Open the connection OK. I was trying to read the fuel level in my PMDG 737NGX center fuel tank but I don't think I'm getting the right return value. Pete's offset table shows 0B74 as the offset for the center tank level. try { FSUIPCConnection.Open(); } catch (Exception ex) { MessageBox.Show(ex.Message, "FSUIPC Connetion Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } Offset<int> centerFuelTankLevel = new Offset<int>(0x0B74); FSUIPCConnection.Process(); this.Text = centerFuelTankLevel.ToString(); The title bar displays: FSUIPC.Offset 1 [system.Int32]
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.