Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Paul,

I've been using your Beta of the V3 dll for several months and it performs flawlessly!

I saw on another post that you recompiled the v2.4 to x64, but it seems that the V3 was last compiled before that post and appears to be x86.

Any chance of putting a 64 bit version out.

Thanks,

Dave

Posted

Hi Paul.

I'm getting an error when calling the FSUIPC.AITrafficServices.RefreshAITrafficInformation.  I've tried limiting it to just Ground or Airborne traffic and still get this error:

Index was outside the bounds of the array.

   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at FSUIPC.FSUIPCConnection.AddOffset(Offset Offset)
   at FSUIPC.Offset.initDataInfo(String DataGroupName, Int32 Address, Int32 length, Boolean WriteOnly)
   at FSUIPC.Offset`1..ctor(String DataGroupName, Int32 Address, Int32 ArrayOrStringLength, Boolean WriteOnly)
   at FSUIPC.Offset`1..ctor(String DataGroupName, Int32 Address, Int32 ArrayOrStringLength)
   at FSUIPC.AITrafficServices.RefreshAITrafficInformation(Boolean UpdateGroundTraffic, Boolean UpdateAirbourneTraffic)
   at FSUIPC.AITrafficServices.RefreshAITrafficInformation()
   at P2ASim.P2ASimulatorFSUIPC.OnSecondTimerFired()

I believe there are about 28 AI aircraft airborne when this happened.

Thanks for your help,

Dave

 

Posted

I've tested it here and it works fine.

Usually when Dictonary<> throws this kind of error it's a threading problem. Is the call to RefreshTrafficInformation() on a background thread? I see it originates from some kind of timer.

If you can post the relevant code from your program it might help me see the problem or recreate it here.

Thanks,

Paul

Posted

Paul,

Thanks for your help on this.

I think the issue is that I was iterating through the TrafficServices.AirbourneTraffic collection directly and if that took longer than my One Second timer, I was getting the error.

I have changed the code to create a new collection and copy the traffic to that before iterating.  This seems to have stopped the errors.

Thanks again,

Dave

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.