-
Posts
82 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by jd
-
how to use fstarrc to make fs2004 .pln file
jd replied to sambucca's topic in FSUIPC Support Pete Dowson Modules
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 -
vb is really easy to do things. use this formula heading = (hdg_you_want / 360 * 65536) and then do your write with heading jd
-
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
-
Newbe with connection to FSUIPC (Via Visual Basic)
jd replied to efratomer's topic in FSUIPC Support Pete Dowson Modules
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 -
Newbe with connection to FSUIPC (Via Visual Basic)
jd replied to efratomer's topic in FSUIPC Support Pete Dowson Modules
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) -
Newbe with connection to FSUIPC (Via Visual Basic)
jd replied to efratomer's topic in FSUIPC Support Pete Dowson Modules
show me the code -
Newbe with connection to FSUIPC (Via Visual Basic)
jd replied to efratomer's topic in FSUIPC Support Pete Dowson Modules
use fsuipc_writes jd -
Newbe with connection to FSUIPC (Via Visual Basic)
jd replied to efratomer's topic in FSUIPC Support Pete Dowson Modules
don't know how to do that -
Newbe with connection to FSUIPC (Via Visual Basic)
jd replied to efratomer's topic in FSUIPC Support Pete Dowson Modules
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 -
Newbe with connection to FSUIPC (Via Visual Basic)
jd replied to efratomer's topic in FSUIPC Support Pete Dowson Modules
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? -
Newbe with connection to FSUIPC (Via Visual Basic)
jd replied to efratomer's topic in FSUIPC Support Pete Dowson Modules
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 -
Newbe with connection to FSUIPC (Via Visual Basic)
jd replied to efratomer's topic in FSUIPC Support Pete Dowson Modules
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 -
FS2004, WideFS, Visual Basic and Landing Gear.
jd replied to fokker70's topic in FSUIPC Support Pete Dowson Modules
the only thing i see is the extra set of parentheses in the next to the last line of code. everything else looks dandy -
FSUIPC programming, New Weather Interface
jd replied to Jive's topic in FSUIPC Support Pete Dowson Modules
the key is the & at the end change that, and it will probably work. jd -
you could also change the radar contact keys, 1-5 to ctrl-shift-1-5 jd
-
How to get path to current .PLN file
jd replied to jspringe's topic in FSUIPC Support Pete Dowson Modules
all my flt's have pln's. i just assumed others would do a .pln before saving a .flt jd -
How to get path to current .PLN file
jd replied to jspringe's topic in FSUIPC Support Pete Dowson Modules
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 -
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
-
Aircraft Exit and Parking Assignment
jd replied to Subotai's topic in FSUIPC Support Pete Dowson Modules
maybe you haven't heard of radar contact (http://www.jdtllc.com). no need to wait :lol: -
oh, i thought you needed to get the speed too. i'm off to my wife's foot surgery, i'll return later jd
-
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
-
VB Reading Strings - Lost and Confused
jd replied to UAL45's topic in FSUIPC Support Pete Dowson Modules
as soon as i get back from work, i'll post my routine to read aircraft id -
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
-
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