NikolaiVChr / f16

General Dynamics F-16 for Flightgear flight simulator
GNU General Public License v2.0
122 stars 39 forks source link

Arms: WPN REL CCRP Automatic Release #576

Closed BobDotCom closed 1 year ago

BobDotCom commented 1 year ago

Description

This PR implements automatic release of A/G weapons in CCRP mode. Weapons can now be dropped as they would be IRL. Pickle button (WPN REL) is pressed and held a few seconds prior to the calculated bombing solution, and the computer will automatically release the bombs when ready.

Demonstration

You can see when the trigger is pressed/released in the nasal console.

https://youtu.be/JX2pNDZjxMs

TODO List

BobDotCom commented 1 year ago

Known bug: this prevents launching a/a weapons right now

SammySkycrafts commented 1 year ago

Known bug: this prevents launching a/a weapons right now

Implementing #448 may result in a somewhat simple fix for this, though implementing it could be more work than figuring a fix with the current system.


    if masterMode = A/G and releaseMode = CCRP:
           run ccrpAutoRel
     else
          don't run ccrpAutoRel```
BobDotCom commented 1 year ago

Two things to note:

  1. I applied the release system to unguided weapons too. If that's incorrect, it can be removed from the list I added in 42c7ca2e42ac994c505463283bc4c4dd58f5cdfd.
  2. Currently, it depends on code executed in the HUD. It shouldn't, but I haven't ported that code over to be used in the other spot yet. Should probably be changed before merging.

Otherwise, it should work now.

BobDotCom commented 1 year ago

Needs testing, but otherwise ready to merge.

NikolaiVChr commented 1 year ago

There is already code to blink the FPM for CCIP, I think it would be better if you modify that instead of adding new code inside the code. Why did you do it inside, you don't want the bank angle indicator to blink also, or?

NikolaiVChr commented 1 year ago

Is this tested with dropping pairs and/or rippling?

NikolaiVChr commented 1 year ago

Instead of checking all bomb types in firecontrol, its better to test if the weapon is in the CCIP_CCRP vector. That vector is a new addition I just committed.

SammySkycrafts commented 1 year ago

Not sure why the agm154 is in that list though..

Maybe we do that because we do not have side-by-side / tandem impact modelled, so we just allow dual release instead

NikolaiVChr commented 1 year ago

I did not think my commit, would trigger conflicts, sorry. I did it to prepare for this PR.

NikolaiVChr commented 1 year ago

Also the line print("tgt not found"); Could be changed to printDebug("CCRP: tgt not found");

SammySkycrafts commented 1 year ago

Is this tested with dropping pairs and/or rippling?

Ripple tested and working, @BobDotCom mentioned a pair release the other day so presumably that works too.

BobDotCom commented 1 year ago

There is already code to blink the FPM for CCIP, I think it would be better if you modify that instead of adding new code inside the code. Why did you do it inside, you don't want the bank angle indicator to blink also, or?

Moved the logic to that check.

Is this tested with dropping pairs and/or rippling?

Yes

Instead of checking all bomb types in firecontrol, its better to test if the weapon is in the CCIP_CCRP vector. That vector is a new addition I just committed.

Done

Also the line print("tgt not found"); Could be changed to printDebug("CCRP: tgt not found");

That line should pretty much never be called, only when the missile loses lock mid-function. I updated it though.

BobDotCom commented 1 year ago

Ready to merge