# Posts by Chrisoft

• ## DLL Project - Aircraft Wind XYZ Vector 3D

I tried here but It is not exact.

Message Aircraft.Wind :

__wind=message.GetVector3d();

Message Aircraft.Position :

__position=message.GetVector3d();

Code
1. double __wind_spd = sqrt(__wind.x*__wind.x + __wind.y*__wind.y + __wind.z*__wind.z); // m/s
2. tm_vector3d east = __wind * tmcoordinates_GetEastAt(__position);
3. tm_vector3d north = __wind * tmcoordinates_GetNorthAt(__position);
4. __wind_cap = 90.0 - (atan2(east.x, north.y)) * 180.0 / M_PI;

for 180° wind direction, __wind_cap gives me 57°, there is something wrong.

Regards,

Chris.

• ## DLL Project - Aircraft Wind XYZ Vector 3D

Hi Jan

Thanks for this reply, in this line

wind_heading = ( atan2( wind * GetEastAt( position ), wind * GetNorthAt( position )) ) * 180.0 / PI - 90.0

I tried this formula but wind, GetEastAt and GetNorthAt return tm_vector3d variable.

So for funtion atan2 need double variable.

I don't know which x y or z I have to use.

Sorry my lack of understanding.

Regards,

Chris.

• ## DLL Project - Aircraft Wind XYZ Vector 3D

Hi,

I'd like to have correct formula to calculate speed and direction wind from data 3D vector Aircraft.Wind in 3 components (U, V, W) or XYZ.

I managed to calculate speed = _wind_speed = sqrt(pow(_wind.x,2.0) + pow(_wind.y,2.0) + pow(_wind.z,2.0));

But to calculate direction, I don't found for the moment, I tried this formula : _wind_dir = (atan2(_wind.y, _wind.x)*180.0) / M_PI;

Regards,

Chris.

• ## DLL project - Some trouble on data message list

In fact, the best way for case "OnGround" :

Code
1. _fs_onground = 0;
2. ...
3. ...
4. ...
5. else if (sh == MessageAircraftOnGround.GetID()) {
6. _fs_onground = 1;
7. }

It works finally. I searched more complication with flags. lol

Regards,

Chris.

• ## DLL project - Some trouble on data message list

I found other data don't give us results.

Here is some concerned data :

- "Aircraft.Category.Jet", TYPE_DOUBLE, gives always 0.0 (with different aircraft)

- "Aircraft.Category.Glider" , TYPE_DOUBLE, gives always 0.0 (with different aircraft)

- "Aircraft.OnGround", TYPE_DOUBLE, gives always 1.0 or 0.0 (aircraft onground or not)

- "Aircraft.OnRunway", TYPE_DOUBLE, gives always 0.0 (on message list debug, it displays "void" I don't know exactly what data type is)

- "Aircraft.Crashed", TYPE_DOUBLE, gives always 0.0 (trying crash but come back quickly)

I don't know you have also same problem. I tried this code :

Regards,

Chris.

• ## DLL project - Some trouble on data message list

Hi Jan,

Thank you for your nice tip. it's better.

Regards,

Chris.

• ## DLL project - Some trouble on data message list

Hi,

In fact, I found soluce.

For data "Flaps", there are 3 different Flags.

So I add condition to obtain an exact result from data.

Here is :

Code
1. ...
2. else if ((sh == MessageAircraftFlaps.GetID()) && (message.GetFlags().GetFlags() == 65540)) {
3. _fs_flaps = message.GetDouble();
4. }
5. ...
• ## DLL project - Some trouble on data message list

Hi,

I'm making a little external DLL.

I remark on data "Flaps", some aircraft like Boeing 747 shows always same value 0.523560 after changing flaps position.

For Airbus A320, it works. It displays different position from 0.0 to 1.0.

For data "Gear", it works no problem, it shows position from 0.0 to 1.0.

Here is my code :