Jump to content
The simFlight Network Forums

scruffyduck

Members
  • Posts

    146
  • Joined

  • Last visited

Everything posted by scruffyduck

  1. I have a program which needs to determine the co-ordinates of a point at a given distance and bearing from the user aircraft. I have a routine which does it up to a point and works tolderably well at low latitudes. I am sure there is a better algorithm out there like the one to calculate the distance and bearing between two points but I have not found it yet. Would be most appreciative it anyone can point me in the right direction. There are a couple of websites which do it but do not say how :?
  2. Hi Pete I am trying to figure out how I might force scenery to reload from scratch. I am trying to emulate EZ-Scenery in a small way. Clearly there is some way to get FS to recognize dynamic changes to scenery. I have tried sending the scenery refresh control value 65562 to offset 3110. I get the scenery reload dialog but I can remove all the bgls associated with the scenery and FS still reloads the object - clearly they are being taken from memory and not from disk. I know there are some other scenery offsets from 0DD6 but I can't find any documentation on them. Any pointers on how I might force a reload from disk would be much appreciated
  3. Well question 1 is do you have the latest version of FSUIPC? this is version 3.47 which can be gotten from Pete's website page http://www.schiratti.com/dowson.html If you do not have this version then the one you have in your modules folder is out of date an may well not work with FS9.1 If thatdoes not solve the problem (which it should) then you can disable FSUIPC by going to the modules folder of your FS9 application and either moving FSUIPC.dll out of the modules folder or renaming it. It will not load and FS9 should work fine. It should not be corrupted in any way
  4. David I have not come from VB6 so I do not have a comparison. I like VB.Net because it is a pretty good implementation of OOP (well what I think of as OOP). I like to be able to parcel stuff away and forget about it once it is working :D I stayed away from dotNET when it first appeared and really until the end of last year because of the overhead of getting users to download the framework (at 23Mb) that seemed an imposition. Right now I do not see that as an issue - most simmers are on broadband - or at least are used to downloading large files. It certainly does just about everything I need and better than my previous language,
  5. use many read requests and one process request. Pete will advise but my undersatnding is that FSUIPC operates at the framerate of the host FS system so you could read that many times per second. I read a lot of positional and aircraft data in my program and do it twice per second on a 2.6GHz machine with no problems to date and this give a pretty smoot output on my display window
  6. Thanks Pete Yes I am refering to 3380 - also it is marked as 128 bytes in the programmers guide which I assumed was the space to the next offset, but seems to be 240 bytes since the next entry is at 3470 and if my maths has not failed me that is 240. I was writing 252 bytes so I filled the 240 plus another 12 which would, as I understand things, write to the ambient wind components which start at 3470. Assuming that writing to the wind components would not casue an exit crash or crash when I try to load a flight then whatever I wrote to in the space between 3400 and 3470 was causing the problem. As you say they are untested and I will avoid them in the future :wink:
  7. Pete I have found the problem - mea culpa - it was nothing to do with the flight loading itself but with the writing messages. I was right padding the message string to 255 instead of 127 :oops: so overwriting the next 127 bytes with (presumably) 32. This did not show up unitl I either shut down the flight sim, or tried to load a new flight. Sorry to send you off chasing red herrings. A bunch of the offsets after the write string are read only but presumably one or more of them sets FS into an error condition which does not show up until either the flight is changed or the sim is shut down. I knew that the string length was a max of 127 but must just have gotten 255 in my head when I wrote the padding code. Edit: Pete - just re-read the documentation from the SDK which suggests that either FSUIPC or FS truncate the string to 127 so maybe there is a funny in there somewhere as far as FS9 is concerned?
  8. Pete This makes no sense to me but it is repeatable 100% on my setup. If I load a flight using offsets 3F04 and 3F00 it loads fine. Then I write a text message using 3380 for the text and 32Fa for the time/style. I disconnect, close my program and then start it again I then try to repeat the flight load and the crash occurs. Clearly there does not seem to be a connection between the flight load offsets and message writing offsets - I'm not over-writing one with the other as they are far apart. Nevertheless it happens each time. I have a bunch of 3rd party dlls in my modules folder and I will disable them one at a time to see if any one of those is the culprit. I have no add-ons running that I am aware of
  9. Thanks Pete got the interim and I'll put that in for further testing
  10. Thanks Pete At least this has clarified how FS9 behaves :D Here is what I have found out. There is something that I am doing to FS with my program which will cause the load to fail with a crash. I put the call to load the flight file right at the top of my initialization routine and ti worked fine. Moving it down below other functions which make FSUIPC reads or writes started to cause the crash again. Eventually I made sure that both the call was at the top and also that there is a delay built into the loading routine to make sure the load has a chance to finish. since I am using FS9 I started with a 10 sec wait then tested the ready to fly indicator every second until it went 'green' Flight loaded fine and my program ran. Unfortunately I am not over it because when I stop the flight and try to exit FS it crashes with the same error. What also happens is that if I stop the flight and then run the load flight routine again it crashes. This also happens if I run a flight script which does not call a flt file. If I then try to call a flight file FS crashes. This happens even if I shut my program down and re-start it. My conclusion at the moment is that I am leaving FS in a state which screws up loading a flight file and I am doing this whether I have previously loaded one or not. FS must be doing certain things when it starts the load and is reading data which I am leaving behind or which I am setting and abending in this obscure SP2 dll :? I will go back and look but at the minimum I am doing a bunch of reads which are obviously not changing any data and the other thing I am doing is using hotkeys and writing messages to the screen. I will go back to my test rig and try to build up a series of writes to try and pinpoint it.
  11. OK Pete it is something my program is doing. I ran my stripped down test program and it works fine. I need to get into my code and figure out what is causing the problem. Thanks for your help :)
  12. Pete As you see I hqve found the dll which is causeing the crash but it is not much help as it seems just to be a message handler for SP2 - so I guess something else is calling it and sending it duff info - as far as I know I am not going anywhere near it myself. I have a temporary program that does nothing except test the connection with FSUIPC. I will try everything stripped down to see if I can get it to work. There must be a conflict somewhere as you say - what I don't understand is why I can load it from within FS just fine - if my program is sending the same instructions as the internal menu then it should work . Must be my program somewhere but at the moment I have no idea where
  13. Right just tried again with the same results - FS is opening and closing normally. If I load the flight from within FS it loads fine. If I try to load it via FSUIPC then I get the same crash and exactly the same log entries. :? Bit more info Fatal Error in module xpsp2res.dll Offset 00202113 It seems to be something to do with service pack 2. It is described in the properties as 'Service Pack 2 Messages' and is obvisouly being called somehow when I try the load from my program
  14. Yep that is what I am doing - write the file name to 3F04 then write the action digit to 3F00 then call process. Thanks Pete - that is what I suspected. Well the flight sim screen sat there for a few sceonds - no sign of activity via the cursor showing busy. Then MS helpful little window came up saying that FS had done something nasty and needed to be closed down and would I like to let MS know what had happened. I am now starting to suspect that it may be related to other stuff in my FS setup - recently it has not been closing properly so perhaps I have other conflicts. Having said that I have no problem loading the flight from the FS menu so I can't see a link right now. From what you are saying FS reported that it was loading a new flight - the correct one so it is not the way I am calling it via FSUIPC but something else?
  15. Hi Pete I have done some tests and the results are puzzling. First I set 3F00 to '1' and wrote the flight name and 1. Sure enough the flight was saved in My Documents\Flight Simulator Files as we suspected. I then moved my aircraft and did no more that write the flight name again and this time '0' to 3F00. This did not load the flight and FS9 crashed. I have repeated it a couple of times with the same result. I must be missing something here - any suggestions much appreciated This is the relevant bit of the log: 185172 WRITE0 [P2524] 3F04, 18 bytes: 4D 79 46 69 72 73 74 46 6C 69 67 68 74 2E 46 4C 185172 54 00 185172 WRITE0 [P2524] 3F00, 2 bytes: 00 00 185390 C:\Documents and Settings\Jon\My Documents\Flight Simulator Files\MyFirstFlight.flt 207703 System time = 12:23:34, FS2004 time = 12:23:11 (17:23Z) That is the flight name that I am trying to load. Looks fine to me??
  16. Hi Pete Sorry to hear you have come down with something :cry: :cry: I will experiment with different path settings and see if I can get a hit - I will let you know what I find
  17. Hi Pete I hope that you had a good holiday :D :D I am trying to cause FS9 to load a .FLT file using offsets 3F00 and 3F04. As per the programmers guide I am writing the file name to 3F04 and 0 to 3F00. Checking the log I can see the writes being made but the flight is not being loaded. I am wondering if I have defined the path correctly. in the guide you say to use a relative path so that if I want to load the file which is Flights\FCFlights\My First Flight.flt then I write "flights\FCFlights\My First Flight.flt" + chr(0) to 3F04 and 0 to 3F00. I am doing these in the same process with the write to 3F04 first. The flight is not loading so I am doing something wrong. Can you confirm that I am writing the pathc correctly - should there be a \ at the front? Is this relative to the main FS9 folder for FS9 or the flight data in my documents? Is the file name case sensitive? and is there anything coming back to indicate success or why it might have failed? thanks in advance
  18. .NET is the underlying set of classes etc which interface with Windows. You can use one of three languages (at least) on top of it - Visual Basic, C# and some form of Java I think. It is quite different from the previous version of Visual Basic however.
  19. probably not unless the guage in question is using FSUIPC to interface with FS. AS far as I know the FS log only logs events which pass thrus FSUIPC.
  20. Hi Eric If you just rename it to FSUIPC.old then run FS - you will have effectively removed FSUIPC from your FS system. Program which use it will not work but you can test if the keyboard problem has gone - if it is still there then it is nothing to do with FSUIPC and you will need to look elsewhere. Once you have tested it then you can rename it back to FSUIPC.dll and it will load with FS and everything that uses it will find it again. If the problem is caused by FSUIPC then I cannot really help but Pete should be back by Monday.
  21. It depends what you want to do. If you plan to create a program to interface with the flight simulator then you use FSUIPC. If you just want to use the functions that FSUIPC itself provides then you just go to FSUIPC's dialog window in FS. FSUIPC acts as a gateway so that you can read and write information to affect the way that FS operates. The gateway is in the form ofd a series of memory offsets which are listed in the SDK. You need to create you own interface to connect to FSUIPC but these are already done for most common programming languages and are included in the SDK. These allow you to make or break a connection to FS and read or write the data. To develop such a program you will need a registered version of FSUIPC otherwise you will not have access to most of the data offsets. If you create a program which you then want to make available to others you may want to get an access code for it so that you users do not need a registered version themselves. This is also explained in the SDK. When Pete says that FSUIPC is part of the FS process - technically it runs inside FS and is in the same meory space as FS. Thus when you access it you are accessing something that runs as part of FS. You do not actually need to understand how this works - I don't. just how to get to FS through FSUIPC which is all in the SDK. Hope that helps
  22. If you read the announcement that Pete placed at the top of this forum entitled Pete Dowson away on Holiday until April 2nd you will have your answer.
  23. ReadOnly Property COM1() As Integer Get Return CInt(Hex(myCOM1)) End Get End Property This is how I do it. I have a separate class which reads all the FS data I need on a regular cycle. myCOM1 is a private vriable of type Int16 and I place the data I get via FSUIPC into myCOM1. This returns the com frequency * 1000 but without the starting 1. for example if property COM1 returns 2346 then the actual com1 frequency is 123.46 Same works for COM2 and I presume the Nav frequencies altho I do not currently collect them Hope this helps
  24. Pete is away until April 2nd. Have you tried to rename FSUIPC.dll or take it out of the modules directory? Do the problems you mention then go away and come back if you put FSUIPC.dll back into the modules directory?
×
×
  • 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.