Jump to content
The simFlight Network Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About geodirk

  • Rank

Profile Information

  • Gender
    Not Telling
  • Location
  1. geodirk

    FSUIPCConnection.Process() Error

    Thanks Paul - It works as expected now.
  2. Hi Paul, Found a way to make your DLL crash. According to your docs, if I want to read a FSUIPC Offset with a size of 1, I should use 'byte' or 'sbyte'. I've not had any issues with using 'byte' however any 'sbyte' will throw an exception when you do the FSUIPCConnection.Process(); command. For instance, if you define this sbyte offset to be able to read the glideslope (0C49 1 NAV1 Glideslope Needle: –119 up to +119 down): private Offset<byte> glideslope = new Offset<byte>(0x0c49); Once the debugger hits, the Process() command, the exception of System.InvalidCastException: 'Specified cast is not valid.' Weird thing is it causes an exception not on the first time through but on subsequent runs. - Dirk
  3. I'll have to mess with that function to see if it takes the LocalDateTime of where the plane is currently at or whether or not it will update it to the destination airport that the plane is being moved to. With the date call right before the move call, it may not work out the way that I think it should. The UTC time will work though. I've got a database that I created as a dump from the MakeRunways program that I have georeferenced the airports lat/lon to determine all their country/state locales. Getting the correct UTC won't be a big deal.
  4. Thanks Paul for looking into this. Bummer that FSX/P3D don't have that move aircraft ability built-in. However based upon your suggestion, I tried this and it did indeed keep it to one load time: //set the time FSUIPCConnection.UTCDateTime = new DateTime(2018, 12, 25, 10, 0, 0); //Set the parameters for moving the plane // Set the OnGround flag bool onGround = false; // Set the heading (in degrees TRUE) double? heading = oPos.Heading_True; // IAS and Altitude set to null as we've set the OnGround flag double? ias = (int)oPos.Airspeed_IAS; FsAltitude? altitude = FsAltitude.FromFeet(oPos.Altitude); // Set level plane on the ground double? pitch = 4.21; double? bank = 0; // Call the method FSUIPCConnection.MoveAircraft(newPos, onGround, altitude, heading, pitch, bank, ias, true); I'll have to write a convertor to get the move-to airport date/time into UTC, but that appears to be relatively trivial once you use the .NET TimeZoneInfo class. I did have P3D lock up once right after the call and eventually crash so I'll need to test this a bunch to make sure that it will be reliable. But at least this does save another scenery load. Thanks!
  5. BTW - the P3D flags for time/season are: private Offset<short> season = new Offset<short>(0x0248); //Season: 0=Winter, 1=Spring, 2=Summer, 3=Fall private Offset<byte> hour = new Offset<byte>(0x0238); //local hour of the flight sim private Offset<int> sendControl = new Offset<int>(0x3110, true); // Offset for moving the plane private readonly int REFRESH_SCENERY = 65562; // Control number to refresh the scenery The calling code is: //set the time/season this.hour.Value = Convert.ToByte(iHour); this.season.Value = 0; sendControl.Value = REFRESH_SCENERY; FSUIPCConnection.Process();
  6. Hey Paul, Was working today with your FSUIPCConnection.MoveAircraft() function and was noticing that it is really missing one overload for it. I'm using the full form of: public static void MoveAircraft(FsLatLonPoint NewLocation, bool OnGround, FsAltitude? Alt, double? HeadingTrue, double? Pitch, double? Bank, double? IndicatedAirSpeedKnots, bool LeavePaused); And one thing that would be really nice is the ability to specify the time/season in there as well. Any chance that could be a part of the function? Right now, it takes two separate loads to first put the plane into position and then a second load to then change the time. It would be real handy, if possible, to move the plane and set the time/season in one call and eliminate the double scenery loading times. Possible?

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.