Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ability to pause individual aircraft #114

Merged
merged 12 commits into from
Jul 6, 2017

Conversation

MichaelRThompson
Copy link
Contributor

As suggested by @jason-watkins in issue #112 , I added the capability to pause individual a/c in addition to keeping the original arguments. Now, as it stands, the pauseSim command should be able to accept arguments:

0: Unpause all a/c
1: Pause all a/c
2: Switch the pause state of all a/c
100:119: Pause a/c 0:19 individually
200:219: Unpause a/c 0:19 individually

@@ -573,7 +573,7 @@ namespace XPC

if (aircraftNumber > 0)
{
// Enable AI for the aircraftNumber we are setting
// Enable AI for the aircraftNumber we are setting: MRT COMMENT: ENABLE, OR DISABLE?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enable is correct. Setting the override_planepath dref disables AI (see this page). This is here to re-enable the AI after setting the position. It occurs to me that this could conflict if the user is manually disabling the AI, but that isn't a use-case that we have been asked to support yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, I see. I was looking for the AI disable within the code itself, which is why I was confused. This is a case that I'm actually looking to explore with my code. Not sure the plugin needs updating though, I just need to disable the AI after moving the a/c.

That could be something helpful to mention in the Wiki though. That the sendPOSI command automatically turns the AI autopilot back on.

DataManager::GetIntArray(DREF_Pause, value, 20);
value[v - 100] = 1;
}
else if ((v >= 200) && (v < 120))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v < 220

else if ((v >= 200) && (v < 120))
{
DataManager::GetIntArray(DREF_Pause, value, 20);
value[v - 100] = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v - 200

else
{
for (int i = 0; i < 20; ++i)
{
value[i] = v;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace

@jason-watkins
Copy link
Contributor

Looks good to me. Thank you very much for contributing!

Resolves #112

@jason-watkins jason-watkins merged commit eb59bd3 into nasa:develop Jul 6, 2017
@MichaelRThompson MichaelRThompson deleted the individual_pause_develop branch July 10, 2017 19:39
@jason-watkins jason-watkins mentioned this pull request Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants