plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.

Please take a moment to read the platform’s guidelines before you get started!

question

szm99 avatar image
szm99 asked FlyingRaccoon answered

issues about read data and gdi+

Hi guys, when I try put my p3d gau code to fs2020, I find 2 issues.


1. I can't read GENERAL_ENGINE1_FUEL_VALVE, GENERAL_ENGINE2_FUEL_VALVE, TURB_ENGINE_1_TANK_SELECTOR, TURB_ENGINE_2_TANK_SELECTOR via lookup_var(), The "var_value.n" always 0. The data from simconnect is right, I can get the right value.


2. If I use GDI+ GraphicsPath.AddArc() , and then call SetClip(), it will fail. I try DrawPath() before SetClip() and I can get the right path. If I remove AddArc(), SetClip() works well. So I think there are something wrong in the SetClip().

simconnectgaugeswasmgdi+
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

szm99 avatar image
szm99 answered

SetClip() does not return any error, but all my following drawline/drawstring.... can't be display.

10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

FlyingRaccoon avatar image
FlyingRaccoon answered

Hello.

1. I've tried to read those variables editing the GdiplusAircraft sample and had no issues getting the correct values in var_value.n, matching those retrieved via SimConnect and changing on events so I'm not sure what's going wrong in your case...

2. Are you sure you're not already having an active clip when calling AddArc ?
Can you try to call ResetClip before AddArc just to make sure ?

If you provide me with your package sources, I'll be able to tell you what's going wrong.

Regards,
Sylvain

10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.