Jump to content
The simFlight Network Forums

jd

Members
  • Posts

    82
  • Joined

  • Last visited

Everything posted by jd

  1. fstarrc is a little program pete wrote that takes fstar flight plans, and creates a file that radar contact use. (that's what the rc is for at the end) jd
  2. vb is really easy to do things. use this formula heading = (hdg_you_want / 360 * 65536) and then do your write with heading jd
  3. here's my code. what aren't you happy with? how much difference is there? Public Function Ground_Altitude() As Single ' meters Altitude MSL of ground under plane. Dim x As Long Dim Y As Single Dim dwResult As Long Call FSUIPC_Read(&HB4C, 2, VarPtr(x), dwResult) Call FSUIPC_Process(dwResult) Y = x If Y > 32767 Then Y = Y - 65534 Ground_Altitude = Mtof(Y) End Function
  4. writing something from scratch here say you want a 12 byte string dim t as string dim s(12) as byte Call FSUIPC_Read(&H3D00, 12, VarPtr(s(1)), dwResult) Call FSUIPC_Process(dwResult) t = "" For j = 1 To 12 If s(j) = 0 Then Exit For t = t & Chr(s(j)) Next j MsgBox s
  5. writetxt - "test" writetxt = Left(writetxt , 127) writetxt = writetxt & vbNullChar j = 4 Call FSUIPC_WriteS(&H3380, Len(writetxt ), writetxt , dwResult) Call FSUIPC_Write(&H32FA, 2, VarPtr(j), dwResult) Call FSUIPC_Process(dwResult)
  6. Public Function Plane_Lat() As Double ' Planes latitude Dim fake64bit As Currency Dim dwResult As Long Call FSUIPC_Read(&H560, 8, VarPtr(fake64bit), dwResult) Call FSUIPC_Process(dwResult) Plane_Lat = fake64bit * 10000# Plane_Lat = Plane_Lat * 90# / (10001750# * 65536# * 65536#) End Function Public Function Plane_Lon() As Double ' Plane's longitude Dim fake64bit As Currency Dim dwResult As Long Call FSUIPC_Read(&H568, 8, VarPtr(fake64bit), dwResult) Call FSUIPC_Process(dwResult) Plane_Lon = fake64bit * 10000# Plane_Lon = Plane_Lon * 360# / (65536# * 65536# * 65536# * 65536#) End Function
  7. let's see the code. your read the center fuel capacity, not fuel in the center tank, you know? does your plane have a center fuel tank?
  8. if your fsuipc read is gettin a 2byte, use integer , 4byte use long. etc. seems my code should have used an integer. but, it works :-) y is single, because i'm returning ground altitude as single the if statement is for the occasional elevations below sea level. negative numbers are not represented as negative numbers, but really big numbers above 32767 try making cntrfuel a long jd
  9. your code is going to set gndalt to 0 (since the integer of (3.28084/ 256 = .01281578125) = 0) here is the code i've used for about 8 years Public Function Ground_Altitude() As Single ' meters Altitude MSL of ground under plane. Dim x As Long Dim y As Single Dim dwResult As Long Call FSUIPC_Read(&HB4C, 2, VarPtr(x), dwResult) Call FSUIPC_Process(dwResult) y = x If y > 32767 Then y = y - 65534 Ground_Altitude = Mtof(y) End Function Public Function Mtof(meters As Single) As Single ' Convert Meters units to Feet Mtof = (meters * 3.28083989501312) End Function
  10. the only thing i see is the extra set of parentheses in the next to the last line of code. everything else looks dandy
  11. the key is the & at the end change that, and it will probably work. jd
  12. you could also change the radar contact keys, 1-5 to ctrl-shift-1-5 jd
  13. all my flt's have pln's. i just assumed others would do a .pln before saving a .flt jd
  14. since you can get the .flt file name, you can read the .flt file, and look for [GPS_Engine] Filename=F:\jdekker\Documents\Flight Simulator Files\ktpa-kmlb then you can open that file up, and read the flight plan jd
  15. sorry i missed it here is my code snippet: Function adv_disp(Text As String, duration As Long) Dim dwResult As Long Dim j As Long Dim s As String s = Left(Text, 127) s = s & Chr$(0) Call FSUIPC_WriteS(&H3380, Len(s), s, dwResult) j = duration Call FSUIPC_Write(&H32FA, 2, VarPtr(j), dwResult) Call FSUIPC_Process(dwResult) End Function
  16. i have 3.253 and fs2000 installed and running. anything i can test for you?
  17. maybe you haven't heard of radar contact (http://www.jdtllc.com). no need to wait :lol:
  18. oh, i thought you needed to get the speed too. i'm off to my wife's foot surgery, i'll return later jd
  19. maybe this will help Public Function Velocity() As Single ' knots Plane's current groundspeed. Dim x As Long Dim dwResult As Long Call FSUIPC_Read(&H2B4, 4, VarPtr(x), dwResult) Call FSUIPC_Process(dwResult) Velocity = (x / 65536) * 3600 * 3.28084 / 5280 End Function Public Function Velocity_Indicated() As Single ' knots Indicated airspeed. Dim x As Long Dim dwResult As Long Call FSUIPC_Read(&H2BC, 4, VarPtr(x), dwResult) Call FSUIPC_Process(dwResult) Velocity_Indicated = x / 128 End Function Public Function Velocity_Y() As Single ' meters/second Vertical speed rate Dim x As Long Dim dwResult As Long Call FSUIPC_Read(&H2C8, 4, VarPtr(x), dwResult) Call FSUIPC_Process(dwResult) Velocity_Y = x * 60 * 3.28084 / 256 End Function
  20. as soon as i get back from work, i'll post my routine to read aircraft id
  21. someone posted on the rc forum that they docked the advdisp display to a pop up panel. (i'm paraphrasing). so when they want to see the advdisp display, the activate that panel, and deactivate it when they were done. jd
  22. here are two functions, one to read the pause state, the other to set it Public Function pause() As Boolean ' 0 if not, 1 if retractable Dim x As Integer Dim dwResult As Long Call FSUIPC_Read(&H264, 2, VarPtr(x), dwResult) 'updated 12/12/2002 per peter dowson Call FSUIPC_Process(dwResult) If x = 1 Then pause = True Else pause = False End If End Function Public Function set_pause(pause As Boolean) As Boolean Dim x As Integer Dim dwResult As Long If pause Then x = 1 Else x = 0 End If Call FSUIPC_Write(&H262, 2, VarPtr(x), dwResult) Call FSUIPC_Process(dwResult) End Function
×
×
  • 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.