Jump to content
The simFlight Network Forums

Rhysa

Members
  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Rhysa

  • Rank
    Member
  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://

Profile Information

  • Location
    Australia
  1. I have to say a purpose built module for .Net like this has been long overdue. Its great to see that someone who really knowns their stuff has put together a great module for the community. Its going to make coding for FSUIPC much more efficient. As developer of a few small addon's I'm happy to say I can discard the old methods and will be using this module from now on. So thanks, and keep up the good work! :D :D :D
  2. I had a similar problem, and the solution I use can be found here http://mathforum.org/library/drmath/view/54386.html. I use the matrix method down the bottom of the page, it works great for simple polygons.
  3. Rhysa

    Radar Contact

    Its actually possible in vb. I managed to connect to a FS2002 session as an observer. It took a little while to figure out the C SDK but its possible. However, I lost interest and can no longer find the code.
  4. Rhysa

    Data Conversion Problem

    I had this problem too trying to read an Unsigned Int32 in VB.Net. So I too added another Get method that looked like this: Overloads Function FSUIPC_Get(ByRef Token As Integer, ByRef Result As UInt32) As Boolean Dim Size As Integer = 8 ' 8 bytes in a Double Dim InBuf(8) As Byte Dim i As Integer If (Token < 0) Or (Token > IPC_BUFFER_SIZE - (4 + Size)) Then 'Token out of range Result = Convert.ToUInt32(0) FSUIPC_Get = False Exit Function End If Result = BitConverter.ToUInt32(IPC, Token + 4) If IPCdr(Token) Then IPCdr(Token) = False FSUIPC_Get = True Else ' If data ready flag not set, function returns FALSE and value found FSUIPC_Get = False End If End Function Now the only lines that I had to chage was Overloads Function FSUIPC_Get(ByRef Token As Integer, ByRef Result As UInt32) As Boolean Result = BitConverter.ToUInt32(IPC, Token + 4) Now C# and Vb.net are pretty similar and the only Get method in my code that uses Marshal.Copy is the string handler. It seems the VB.net and C# sdks are very different.
  5. Rhysa

    VB.Net Basic Code

    I also develop in vb.Net and made a *few* apps in VB. It does take a while for .net apps to load, but this is mostly due to the Just In Time compiler I believe. Anyhow I was a bit worred about performance loss, but there doesn't seem to be much if any.
  6. Its easy. Once you have connected to read stuff just call these functions: FSUIPC_Read(offset, size, token, result) FSUIPC_Process(result) FSUIPC_Get(token, value) Offset (ie &H2342) and size are from the SDK and relate to the variable you are trying to read. Value is the actual final value. You need a different token for each variable you want to read. Multi-reads: FSUIPC_Read(offset1, size1, token1, result) FSUIPC_Read(offset2, size2, token2, result) FSUIPC_Process(result) FSUIPC_Get(token1, value1) FSUIPC_Get(token2, value2) And writes are simply: FSUIPC_Write(offset, value, token, result) FSUIPC_Process(result) Email if you want my .Net dll. MOST important, remember to declare your variables as the same data type as specified in the SDK. ie if it says integer with length 2 then use int16 data type. BONUS FUNCTION ( :D :D ) To register your app with FSUIPC Dim token As Integer Dim bytecode() As Byte Dim a As New System.Text.ASCIIEncoding 'Insert your key in this line bytecode = a.GetBytes("A4729AOCNPVU") FSUIPC_Write(&H8001, bytecode.Length, bytecode, token, dwresult) 'if Process returns true then success else failed to register If FSUIPC_Process(dwresult) = True Then '...success code Else 'failure End If
  7. Rhysa

    VB.Net Basic Code

    Ive made a .Net dll that you can use. There were some errors I think in the SDK which I cleaned up and now it works fine. Ive used in a few programs, including 3Wire. Email me and Ill send it over. Also see here for a simple intro - http://forums.simflight.com/viewtopic.p258#218258
  8. Rhysa

    New data

    Much appreciated Pete :D
  9. Rhysa

    New data

    The wing fold is similar to the tailhook funtion - press a key and it animates. By default there is no key assigned,you have to set this up. Then you need an aircraft that uses it, Daisuke Yamamoto's F/A-18E Superhornet (http://flightinfo.ens.ne.jp/FS_KBT/dai.htm) has wing folding. I would only need to know if they are fully folded, or unfolded. The rate of folding varies per aircraft and is specified in the aircraft.cfg. ie: [folding_wings] wing_fold_system_type=4 ;0=None fold_rates=0.12,0.11 ;Percent per second Its not a quick change, it could be read every second, there is no need for the position to be read at every interval.
  10. Pete is it possible to get any of these from FS: - Tailhook available, ie configured in aircraft.cfg - Wing fold position? It would be handy to have this information for my program. Also I found another reason VB.NET is not a good language for interfacing with FS, there is no native signed byte data type. Can work around it by doing: If val >= 128 Then newval = -(255 - Value + 1) But it still caused a few hours of frustration :evil: Good news is this type is in .NET v2.0
  11. Ive released my first add on for FS, 3Wire Aircraft Carrier Simulator. This version features: - Launch and recover any aircraft aboard aircraft carriers - Launch holdback - Adjustable forces - Optional require hook down - Cable holdback, raise the hook before taxiing! - Optional steam effect included - 8 page operating handbook - Ready to use with default and ArrCab carriers - Cable Zone Assistant, makes creating zones easy Its freeware, you can grap it at AVSIM and Aussim.com.au. Big thanks to Pete for FSUIPC, for giving me a key over a year ago (took some time but its here :D ) and for helping out with a few problems.
  12. Rhysa

    Fractional Altitude

    Yes its a bit dodgy when you cant even perform basic math on unsigned integers, such as divide, I had to convert to double first! Oh well its all sorted :lol:
  13. Rhysa

    Fractional Altitude

    Ok i got it working finally. As you said the value is unsigned, and represents the number of 2^32 parts. Anyway was continually reading negative numbers, and soon found out that the VB.NET SDK does not have the capability to handle unsigned numbers. Anyway I added some code which I wil post here for anyone else who ever runs into such a problem. Overloads Function FSUIPC_Get(ByRef Token As Integer, ByRef Result As UInt32) As Boolean Dim Size As Integer = 8 ' 8 bytes in a Double Dim InBuf(8) As Byte Dim i As Integer If (Token < 0) Or (Token > IPC_BUFFER_SIZE - (4 + Size)) Then 'Token out of range Result = Convert.ToUInt32(0) 'This line changed FSUIPC_Get = False Exit Function End If Result = BitConverter.ToUInt32(IPC, Token + 4) If IPCdr(Token) Then IPCdr(Token) = False FSUIPC_Get = True Else ' If data ready flag not set, function returns FALSE and value found FSUIPC_Get = False End If End Function The change is: Result = BitConverter.ToUInt32(IPC, Token + 4) Which converts to unsigned 32bit integer. You may have to do a conversion back to double or signed integer in your code to perform any calculations. Hope this helps someone.
  14. Rhysa

    Fractional Altitude

    Ah, I didnt see it that way but now you have explained its all clear. Thanks
  15. Im having trouble getting the fractional part of the altitude at offset 0570. I can read the unit part at 0574, however im unsure of how to convert the fractional part at 0570. At the moment ive tried dividing by 10^9 then adding to the unit part. This gives an approximate value. But when I write to the fractional value and try to multiply by 10^9 I get an overflow (VB.NET). How do I handle the fractional part?
×

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.