A password will be e-mailed to you.

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.

Pages: 1 [2]
Author Topic: SimConnect_RequestGroundInfo() - no results
MikeSchroe-
ter
Lockheed Martin
Posts: 95
Send Message
Post Re: SimConnect_RequestGroundInfo() - no results
on: June 5, 2012, 12:35

That is correct. Use this for "non-realtime" moves.

Mike

DevSim
Professional
Posts: 138
Send Message
Post Re: SimConnect_RequestGroundInfo() - no results
on: June 5, 2012, 12:39

Thank you Mike,

I'll do that. My other question remains. How can I make sure from a SimConnect point of view, that I can let the user fly the plane again? As said, the SimStart Event isn't in synch with what is received altitude wise and also not in synch loading bar wise.

Thanks,
Devsim

MikeSchroe-
ter
Lockheed Martin
Posts: 95
Send Message
Post Re: SimConnect_RequestGroundInfo() - no results
on: June 5, 2012, 13:57

I believe your high level dispatch callback should only recieve the SIMCONNECT_RECV_ID_EXTERNAL_SIM_SIMULATE data when you should be simulating. I believe this is how the SDK's ExternalSim sample is setup.

Mike

DevSim
Professional
Posts: 138
Send Message
Post Re: SimConnect_RequestGroundInfo() - no results
on: June 5, 2012, 14:08

Mike,

I tried to follow the example with the ExternalSim earlier and here's another thread I opened for that a while ago: http://www.prepar3d.com/forum-5/?mingleforumaction=viewtopic&t=601 Unfortunately, the thread stopped there and I couldn't get it to work. I receive other events I'm subscribed to - not the sim_simulate though.

Short: I couldn't get the callback to work inside my own DLL, connecting via SimConnect (connection method is TCP/IP V4).

Regards,
DevSim

MikeSchroe-
ter
Lockheed Martin
Posts: 95
Send Message
Post Re: SimConnect_RequestGroundInfo() - no results
on: June 5, 2012, 14:33

Ok, I'm a little confused. Your other thread implies your dispatch callback function never gets called, but here you say you are actually receiving at least some events. My suggestion would be to investigate any differences between your implementation and the sample, which appears to handle your scenario appropriately as far as I can tell.

Mike

DevSim
Professional
Posts: 138
Send Message
Post Re: SimConnect_RequestGroundInfo() - no results
on: June 5, 2012, 14:39

Sorry, I wasn't 100% accurate in my statement.

What works: SimConnect_CallDispatch() from my own loop
What didn't work: Getting called by after registering the callback routine.

Might it be an issue, that my code runs in its own DLL, implemented in a C++ class within my own namespace? Or is the callback only being called if the DLL is loaded via DLL.XML on the machine running P3D?

Regards
DevSim

MikeSchroe-
ter
Lockheed Martin
Posts: 95
Send Message
Post Re: SimConnect_RequestGroundInfo() - no results
on: June 5, 2012, 16:00

My assumption is that it shouldn't matter, as long as the function being registered in SimConnect_CallDispatch() is static.

Mike

DevSim
Professional
Posts: 138
Send Message
Post Re: SimConnect_RequestGroundInfo() - no results
on: June 6, 2012, 03:27

Here's what I just tried:

- I added the E.S.F.O Aircraft and selected it.
- I disabled the ExternalSimModule parameters in sim.cfg
- I compiled my externally running SimConnect dll with the same GUID as per sim.cfg
- I connected and registered as an external sim (SUCCESS) via TCP/IP v4
- I registered my static callback routine (SUCCESS)
- I didn't get a single call to the callback routine
- I got exceptions for all other SimConnect calls which I left as previously

I think I'm doing something wrong.

DevSim
Professional
Posts: 138
Send Message
Post Re: SimConnect_RequestGroundInfo() - no results
on: June 6, 2012, 09:47

Following up on SIMCONNECT_DATATYPE_INITPOSITION: I added this to the example code from ExternalSim.cpp upon receving on the create notification.

1st:

SimConnect_AddToDataDefinition(g_hSimConnect, INIT_DEF, "Initial Position", "NULL", SIMCONNECT_DATATYPE_INITPOSITION, 0);

2nd:

SIMCONNECT_DATA_INITPOSITION Init;
Init.Altitude = 5000.0;
Init.Latitude = 47.64210;
Init.Longitude = -122.13010;
Init.Pitch = 0.0;
Init.Bank = 0.0;
Init.Heading = 180.0;
Init.OnGround = 1;
Init.Airspeed = 0;

SimConnect_SetDataOnSimObject(g_hSimConnect, INIT_DEF, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(Init), &Init );

SimConnect_AddToDataDefinition() throws SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED followod by IMCONNECT_EXCEPTION_BLOCK_TIMEOUT.

What is SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED complaining about?

MikeSchroe-
ter
Lockheed Martin
Posts: 95
Send Message
Post Re: SimConnect_RequestGroundInfo() - no results
on: June 6, 2012, 14:05

Not sure. There is nothing that strikes me as being obviously wrong. You didn't say whter the call to SimConnect_SetDataOnSimObject worked or not.

My suggestion would be to compile the ExternalSim project and get it to work there, then compare what you are doing differently.

Mike

DevSim
Professional
Posts: 138
Send Message
Post Re: SimConnect_RequestGroundInfo() - no results
on: June 6, 2012, 16:25

Hi Mike,

If the SimConnect_AddToDataDefinition() call throws, the init must throw, and yes, it did too.

I worked from the compiled ExternalSim.cpp, loaded it completely as in the SDK. It worked 100%. Then I removed the dll loading from the sim.cfg and compiled ExternalSim.cpp as an external standalone EXE. Then as described.

Next I'll try to load the new code via the sim.cfg as a DLL....

Pages: 1 [2]
Mingle Forum by cartpauj
Version: 1.0.31 ; Page loaded in: 0.112 seconds.