Author Topic: How to programmatically detect “You control” feature is available  (Read 7766 times)

FS++

  • Newbie
  • *
  • Posts: 12
As you probably know we have a voice interface to GSX, which is working great.
And we really don’t see a need for an SDK.

My question,

For those airports where “You control” feature is enabled, is there a way to reliably check that the feature is active (or enabled)?

It’s mainly to know what kind of menu to expect first.

Thanks

Ian

Bruce Hamilton

  • Beta tester
  • Hero Member
  • *****
  • Posts: 1768
Re: How to programmatically detect “You control” feature is available
« Reply #1 on: October 21, 2012, 02:13:59 pm »
Who is "we", do you have a mouse in your pocket?   ;D
Not all of us use FS2Crew, my voice interface doesn't recognize anything but the ATC menu.  We do need the SDK.
Intel Core i7-4790 Haswell 4.0 GHz EVGA Z97 Classified EVGA Supernova 850 G2 G.Skill Ripjaws 16GB Western Digital 1TB GeForce GTX 780 Superclock

FS++

  • Newbie
  • *
  • Posts: 12
Re: How to programmatically detect “You control” feature is available
« Reply #2 on: October 21, 2012, 04:50:24 pm »
"We" have nothing to do with FS2Crew. ;D

Since you asked...

Here we are: http://www.multicrewxp.com


Bruce Hamilton

  • Beta tester
  • Hero Member
  • *****
  • Posts: 1768
Re: How to programmatically detect “You control” feature is available
« Reply #3 on: October 21, 2012, 05:37:58 pm »
Copilot sounds too robotic for me, prefer being able to change voices like IYP.
Intel Core i7-4790 Haswell 4.0 GHz EVGA Z97 Classified EVGA Supernova 850 G2 G.Skill Ripjaws 16GB Western Digital 1TB GeForce GTX 780 Superclock

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 50683
    • VIRTUALI Sagl
Re: How to programmatically detect “You control” feature is available
« Reply #4 on: October 21, 2012, 09:50:29 pm »
For those airports where “You control” feature is enabled, is there a way to reliably check that the feature is active (or enabled)?

It's an interesting question, I'll have a look at it and, if there isn't any other way, we could set an FSX variable that your addon can read, which will be set only if the scenery uses the YouControl menu.

FS++

  • Newbie
  • *
  • Posts: 12
Re: How to programmatically detect “You control” feature is available
« Reply #5 on: October 23, 2012, 12:19:24 am »
OK, thanks Umberto.

As an interim solution would it be possible to check for the presence of a particular file (within FSX folder) that would imply one of your detailed sceneries for a specific airport is installed (Geneva Cointrin for example)?

And is that enough to assume "You control" will be available?

Ian

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 50683
    • VIRTUALI Sagl
Re: How to programmatically detect “You control” feature is available
« Reply #6 on: October 23, 2012, 10:18:49 am »
As an interim solution would it be possible to check for the presence of a particular file (within FSX folder) that would imply one of your detailed sceneries for a specific airport is installed (Geneva Cointrin for example)?

No, it's not (I would told you that, if that was possible), since the file that enables YouControl it's the same that enables some scenery objects, docking systems, GSX customization AND YouControl so, there's no way for you to tell YouControl it's available or not, just by its presence.

Of course, you can just keep a list of known FSDT sceneries (that will have to be kept updated when we release a new scenery) and a file that has to be checked.

In this case, you should check the fsdreamteam\Couatl folder, inside you'll find several folders with the scenery names (it's usually the ICAO, but not always), each one containing a file named __init__.pye, if that file exists, that means the scenery has at least some special interactive scenery objects OR some docking systems OR a YouControl menu.

Not all FSDT sceneries have a YouControl menu, KORD doesn't have one for example, and the Hawaii1 and 2 are "multi-area" products, so each one will handle two airports, so you'll have to handle this special case too.

I think it's a bit cumbersome and not automatically reliable, because we might change this at any time, so it would be MUCH better if we publish an FSX variable to check as soon as any airport creates the YouControl menu, so this will always work, will not require any checks, will never be broken by new releases and it will be trivial to code too.

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 50683
    • VIRTUALI Sagl
Re: How to programmatically detect “You control” feature is available
« Reply #7 on: October 23, 2012, 12:15:32 pm »
Try the attached youcontrol.pye file, to be put in the following folder:

FSX\fsdreamteam\Couatl\common

This will set the following FSX custom variable:

FSDT_VAR_YouControlIsAvailable

to be 0.0 (double) if there's no YouControl menu or 1.0 if there's a YouControl menu before the GSX menu. Note that the variable is updated immediately AFTER the user has pressed the GSX/YouControl Hotkey (CTRL+F12), which means you shouldn't rely on its value until after the menu has been opened.

It's possible to read this variable both in C and/or XML from a gauge, for example, in C:

double* value;
execute_calculator_code( "(L:FSDT_VAR_YouControlIsAvailable, number)", &value, NULL, NULL);



Let me know if it works for you, so we can insert this file in the regular distribution, and this will hopefully be a first step towards a GSX SDK.
« Last Edit: October 23, 2012, 12:18:17 pm by virtuali »

FS++

  • Newbie
  • *
  • Posts: 12
Re: How to programmatically detect “You control” feature is available
« Reply #8 on: October 23, 2012, 01:57:32 pm »

Excellent!

Our module “fsInsider.dll” running inside the FSX process should be able to read that using “execute_calculator_code” FSX SDK API.

Will let you know the outcome by Friday.

Thanks.

FS++

  • Newbie
  • *
  • Posts: 12
Re: How to programmatically detect “You control” feature is available
« Reply #9 on: October 25, 2012, 01:38:46 pm »
Is the custom variable "FSDT_VAR_YouControlIsAvailable" already in version 1.7.4, or shall I wait until you upload the next revision?

Thanks

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 50683
    • VIRTUALI Sagl
Re: How to programmatically detect “You control” feature is available
« Reply #10 on: October 25, 2012, 01:51:50 pm »
Is the custom variable "FSDT_VAR_YouControlIsAvailable" already in version 1.7.4, or shall I wait until you upload the next revision?

Right now, you have to use the youcontrol.pye file I've attached, it's not available in any other version. I wanted to hear some feedback before including in the regular distribution. It it works, it will appear as a minor Live Update, that can be applied without reinstalling GSX or restarting FSX.

FS++

  • Newbie
  • *
  • Posts: 12
Re: How to programmatically detect “You control” feature is available
« Reply #11 on: October 25, 2012, 04:25:39 pm »
Is the custom variable "FSDT_VAR_YouControlIsAvailable" already in version 1.7.4, or shall I wait until you upload the next revision?

Right now, you have to use the youcontrol.pye file I've attached, it's not available in any other version. I wanted to hear some feedback before including in the regular distribution. It it works, it will appear as a minor Live Update, that can be applied without reinstalling GSX or restarting FSX.

After relacing the file, I am pleased to report it's working. The var isn't there intially. But as soon as the hotkey is pressed it becomes available. Just as you mentioned above.

Tested with both Geneva Demo scenery and default EDDM. It gives a 1 at LSGG and 0 at EDDM as expected.

Thanks a million.

Ian


virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 50683
    • VIRTUALI Sagl
Re: How to programmatically detect “You control” feature is available
« Reply #12 on: November 19, 2012, 01:24:03 pm »
We have opened a section for developers in this forum, and would like to hear their suggestions:

http://www.fsdreamteam.com/forum/index.php?topic=7585.0