Adding ability to pause individual aircraft #114
Adding ability to pause individual aircraft #114jason-watkins merged 12 commits intonasa:developfrom
Conversation
Update from head fork 7/5/17
Adds new cases such that: 0: Unpauses all a/c 1: Pauses all a/c 2: Switches case for all a/c 100:119: Pauses a/c 0:19 200:219: Unpauses a/c 0:19 Updates log messages. Keeps the 0,1,2 arguments as they previously were.
xpcPlugin/MessageHandlers.cpp
Outdated
| if (aircraftNumber > 0) | ||
| { | ||
| // Enable AI for the aircraftNumber we are setting | ||
| // Enable AI for the aircraftNumber we are setting: MRT COMMENT: ENABLE, OR DISABLE? |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
xpcPlugin/MessageHandlers.cpp
Outdated
| DataManager::GetIntArray(DREF_Pause, value, 20); | ||
| value[v - 100] = 1; | ||
| } | ||
| else if ((v >= 200) && (v < 120)) |
xpcPlugin/MessageHandlers.cpp
Outdated
| else if ((v >= 200) && (v < 120)) | ||
| { | ||
| DataManager::GetIntArray(DREF_Pause, value, 20); | ||
| value[v - 100] = 0; |
xpcPlugin/MessageHandlers.cpp
Outdated
| { | ||
| value[i] = v; | ||
| } | ||
| } |
There was a problem hiding this comment.
Remove trailing whitespace
|
Looks good to me. Thank you very much for contributing! Resolves #112 |
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