Jump to content
The simFlight Network Forums

DocNZ

Members
  • Posts

    11
  • Joined

  • Last visited

About DocNZ

  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://

Profile Information

  • Location
    Gisborne, New Zealand

DocNZ's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Excuse me if Im wrong, but isnt the total fuel weight at any particular time = Gross wt - Zero Fuel wt (assuming during flight you are not throwing passengers out of the plane). This is how I do it in delphi. Seems to work, but possibly wrong. function TFormMain.FuelWeight:double; var CLW:double; ZFW:integer; dwResult:DWORD; FW:double; begin if FSUIPC_Read($30C0,8, @CLW, dwResult) then begin if FSUIPC_Process(dwResult) then begin end end else DoCantConnect(dwResult); if FSUIPC_Read($3BFC,4, @ZFW, dwResult) then begin if FSUIPC_Process(dwResult) then begin ZFW:=ZFW div 256; end end else DoCantConnect(dwResult); FW:=CLW-ZFW; FuelWeight:=FW; end;
  2. yes @ is the delphi pointer operand. I dont think Delphi makes the distinction between whether a pointer points to a string or an integer etc. In Delphi a pointer is a pointer. The distenction is made by the variable you declare. If I declared ACTailNum as an integer, then what whould be returned is a 12byte number, and not a null terminated string. In your code I noticed that you declared RTNString as a string, whereas I decalre ACTailNum as an array of 12 characters. I think I would get an error if I declared it as a string in delphi too, becaue that @ACTailNum points to is not actually a string. I just dont know, but isnt there an example of this very thing for VB in the FSUIPC SDK?
  3. This is how I do it in Borland Delphi Pascal. The translation to VB should be very straigt forward. var dwResult:DWord; Aircraft:array[0..256] of char; ACTailNum:array[0..12] of char; begin if FSUIPC_Read($3d00, 256, @aircraft, dwResult) then begin if FSUIPC_Process(dwResult) then Label1.Caption := aircraft else DoCantConnect(dwResult); end; if FSUIPC_Read($313C, 12, @ACTailNum, dwResult) then begin if FSUIPC_Process(dwResult) then Label2.Caption := ACTailNum else DoCantConnect(dwResult); end; end; I hope this helps. (PS DoCantConnect is a procedure to handle errors reading from FSUIPC) Paul T.
  4. Hi. Sometime back I asked Pete about this, and he came up with the above solution at offset 3365. While I was working with windows message techniques myself, Pete being the brilliant programmer he is, came to solution alot quicker than I. While I was working out my own technique I discovered this little trick, which will determine if FS is pause on menu select, or modal dialog. I use this technique now personally. Its ugly, to fast, but works.. Gobal variables A,B. Set A=0 on application initiation within a timer (500ms) //====================================== if FSUIPC_Read($0314,4,@FTimer,dwResult) then begin if FSUIPC_Process(dwResult) then begin B:=FTimer; if (A=B) then begin //FS Paused end else begin //FS Not Paused A=B; end; end else DoCantConnect(dwResult); end; //================================ I discovered that the value at 0314 stops on menu or modal pause.
  5. Bl***y hell Pete, absolutely brilliant!! Just what I need. I hope you get paid well for this in some form or another!! Im impressed with your dedication. I look forward to playing with 3.202.
  6. Pete, thanks for your prompt reply and experimentation. You've got alittle further than me. Only today did I discover the modal dialog problem, so that kinda throws another spanner in the works. I didnt know the second timer (assuming it the $0368 one) halts because the first one certainly doesnt. I'll still work on the windows messaging technique, but I think the answer (for my application) probably lies in the second timer. I'll experiment and return with some results. Ultimately it would be great to have an FSUIPC flag that indicates a pause in all situations. If I find a way, Pete, you'll be the first to know.
  7. Im writing an application to record flight times. In every situation in which the sim is paused (pause, replay etc), my application pauses the recordings. ie when the user presses 'p', FS pauses, and by monitoring offset 0264 flag, I'll pause my applications own internal timings and recordings. However there is one situation in which a user can"pause" the sim, but my application doesnt pick it up and will continue timing; that is when a menu item is being selected. Ive search through the offset list, and there doesnt appear to be a flag to monitor menu selection. Ive used offset 32f0 to disable all the menus, but even "hovering' over a disabled menu item still pauses the sim, and my app will still keep recording. Any help would be great. I would like my app to know when a user activates an FS menu, somy app can pause, then know when the user is out of the menu, so my app can resume timings. Can FSUIPC flag this? Or do I need to capture windows messages from FS?
  8. Pete, None of your suggestions helped. It got so frustrating I stopped using the "aircraft on ground" flag to monitor this. I changed to Radar altitide instead. I did read that this flag is not altered in slew mode, but hey, it certainly does on my system. All I was monitoring was the slew flag and the AC on ground/air flag, and displaying them. On slew (pressing Y) AC popped up, AC is now flying. Oh well
  9. When the aircraft is on the ground, and I press 'Y' for SLEW, I notice the aircraft pops up into the air about 24 feet. and FSUIPC offest for plane airborne becomes TRUE. UNSLEWING, plane drops to ground, and offset becomes FALSE IS there anyway of preventing this change in altitide, and to keep the plane on the ground when the user presses SLEW, if the aircraft is already on the ground.
  10. In Delphi, Im trying to disable the FS menu using the offset at $32F0. Ive written this procedure procedure TFormMain.DisableMenu(); var dwResult:DWORD; dwDisable:DWORD; begin dwDisable:=$0100FF00; FSUIPC_Write($32F0,4,@dwDisable,dwResult); end; FF is the Hi byte for the timer 01 is the Hi byte for 2^15 disable all menus I cant seem to get it to work. Am I missing the obvious??
  11. Could some kind person write a quick example of how to display text to FS in Delphi. Thxs
×
×
  • 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.