Jump to content
The simFlight Network Forums

PhilippM

Members
  • Posts

    23
  • Joined

  • Last visited

PhilippM's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Good evening, I'm trying to figure out how to read the deflection of various control surfaces from FS. For the ailerons, offset 2ea8 (Aileron deflection, in radians, as a double (FLOAT64). Right turn positive, left turn negative.) seems to be appropriate. However, most modern aircraft have differential ailerons, where the upward deflection is larger than the downward deflection. That means, left and right aileron have different deflection angles, not only in sign, but in magnitude. How can I read the deflection for left and right ailerons separately? Regards, Philipp
  2. Hi folks, today I wrapped myself around a really daunting task: Porting my C++ project on Windows from MinGW to Visual C++ Express 2010. During this, I encountered the problem that the FSUIPC_User.lib that is shipped with the SDK causes a linker error, because it relies on libc.lib being linked as importlib. Unfortunately, libc.lib is not any longer part of Visual C++ since version 2008. The problem has been discussed without a solution here. Well, the solution is actually easy: You have to recompile the FSUIPC_User.lib itself using MSVC 2010. This can be done by creating a library project and importing the two files IPCUser.h and IPCUser.c out of the Lib_source.zip in the UIPC_SDK_C.zip. Then you build it, and use this library as a replacement for the FSUIPC_User.lib out of the UIPC_SDK_C.zip Then building with MSVC 2010 works flawlessly. If it's okay with Pete, I can also upload the VC2010-build FSUIPC_User.lib here. Regards, Philipp
  3. 'kay, thanks. :) Subject to further investigation, then.
  4. Hi Pete, I have a question regarding those two offsets. What is the relation between the "turn coordinator ball position" and the "side-slip angle". Theoretically, it is up to the gauge designer on how much sideslip means full scale on the gauge. One could vary the curvature of the glass tube to vary this relation. But I don't believe this is modelled in FS, so in some way there is an aircraft-independant correlation of 0x036e and 0x2ed8. Unfortunately, getting enough samples (by carefully trimming an aircraft in various amounts of sideslip) and plotting them is hard, especially if the correlation is a sine or tangent, which seems most natural to me. So, can you tell me the exact correlation in FS? Regards, Philipp
  5. Whew, you should be nominated for the "fastest support ever"-award. :)
  6. To tell this long story short, he found the option using my instruction. But he complained that the instruction was too short :)
  7. Ahhhh... I got the error. I didn't remeber the "contiguous memory" thing correctly. I had to look it up in my copy of "Effective STL". std::vector is guaranteed to be stored in contiguous memory, std::string is not. So the trick is to read the bytes into a std::vector and then construct the string from the iterators. What I was seeing was the result of undefined behaviour: std::string reserved a 256 character string made of whitespaces and then some of the bytes got overwritten by this call. Nevertheless, the string was 256 characters long from the C++ standpoint. Sorry for the hickup. I always stumble over those easy things at the border line between C and C++, because these languages ARE different. Thank you for the fast answer, good nite :) Philipp
  8. Hmm, apparently either me or my compiler misinterprets what "contiguous memory" means, cause this is what the string is guaranteed to be stored in, according to the C++03 Standard. I tried a strlen on title.c_str() and got 256. Hmm. Given the fact that substantially more people work on my compiler, I think the mistake is on my side :( Sounds reasonable, but apparantly I'm not getting this 0x0-character. This is all C++/STL. This is exactly what I expected. It's just that I don't get a terminating 0 when reading it into memory. Thanks for fast reply, I'm going to digg deeper.
  9. Erwin, Probier mal Projekt Eigenschaften -> Konfigurationseigenschaften -> Linker -> Eingabe -> Bestimmte Standardbibliotheken Ignorieren und dort die libc.lib eintragen. Ich würde aber vorschlagen, statt dem Monster Visual Studio beizubringen was du willst, schreib lieber ein Makefile, was dir die benötigten Libraries und Headers einbindet. Das sind keine 20 Zeilen Code und das versteht nmake genauso wie GNU make und du kannst es später auch nach MSVC importieren. Du lernst ja auch nicht auf einem A380 fliegen und steigst dann auf Cessna 152 um :) Gruß, Philipp (I told him where to find the option in the German version of MSVC, but suggested he should write a small Makefile instead of dealing with a monster like MSVC. Writing a Makefile is like learning to fly on a Cessna 152. Hacking this stuff into MSVC is like flying an A380).
  10. Hi Pete, simple question: how to obtian the string length of the aircraft name? At the moment, I'm doing something like this: std::string title; title.resize(256); FSUIPC_read(0x3d00, 256, &(title[0]), &error); which yields a string like title == "Cessna 172 (white space characters until 256) " Simple matter, just apply some trim function to the string and get rid of the spaces. I tried: #include boost::algorithm::trim(title); and also void trim(std::string& str) { std::string::size_type pos = str.find_last_not_of(' '); if(pos != std::string::npos) { str.erase(pos + 1); pos = str.find_first_not_of(' '); if(pos != std::string::npos) str.erase(0, pos); } else str.erase(str.begin(), str.end()); } trim(title); but whatever I try, title is always displayed as "Cessna Skyhawk (many spaces) ". What kind of padding characters are these, that fill up to byte 256? The fact that I can't get rid of them by trimming whitespaces, these appear to be not the ASCII " " character. Can you confirm the string is in fact a C-String? Philipp
  11. Hi, when using the run external program feature of FSUIPC, I'm unable to get it working with FSX. Iappended these two lines to the FSUIPC.ini in FS9 and the FSUIPC4.ini in FSX: [Programs] Run1=CLOSE,C:\Example\example.exe Strangely enough, FS9 startup triggers the exe to start up, FSX doesn't. Hugh? This is FSUIPC.log of FSX: ********* FSUIPC4, Version 4.60a by Pete Dowson ********* Reading options from "C:\FSX\Modules\FSUIPC4.ini" Trying to connect to SimConnect Acc/SP2 Oct07 ... User Name="" User Addr="" FSUIPC4 not user registered WIDEFS7 not user registered, or expired Running inside FSX on Windows 7 (using SimConnect Acc/SP2 Oct07) Module base=61000000 Wind smoothing fix is fully installed DebugStatus=0 172 System time = 26/06/2010 21:23:45 187 FLT UNC path = "\\NOTEBOOK3\Users\Philipp\Documents\Flight Simulator X Files\" 187 FS UNC path = "C:\FSX\" 1014 LogOptions=00000000 00000001 1014 SimConnect_Open succeeded: waiting to check version okay 3479 Running in "Microsoft Flight Simulator X", Version: 10.0.61637.0 (SimConnect: 10.0.61259.0) 3479 Initialising SimConnect data requests now 3479 FSUIPC Menu entry added 3526 C:\FSX\FLIGHTS\OTHER\FLTSIM.FLT 3526 C:\FSX\SimObjects\Airplanes\Aircreation_582SL\Aircreation_582SL.AIR 52744 System time = 26/06/2010 21:24:38, Simulator time = 21:23:49 (04:23Z) 53602 Advanced Weather Interface Enabled 76924 Sim stopped: average frame rate for last 24 secs = 19.9 fps 82993 System time = 26/06/2010 21:25:08, Simulator time = 21:24:07 (04:24Z) 82993 *** FSUIPC log file being closed Average frame rate for running time of 24 secs = 19.9 fps Memory managed: 14 Allocs, 13 Freed ********* FSUIPC Log file closed *********** Could it be that Program startup is restricted to the registered version of FSUIPC 4, but not in version 3 ? If this is the case, why a silent fail instead of an error message? Regards, Philipp
  12. Hi Pete, wow, I appreciate your offer to enhance FSUIPC just for me :) But I just managed to create an invisible window that catches your close message and it WORKS! So I consider this problem solved now. Thanks for your help! Philipp
×
×
  • 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.