<commit_before>#include "icp.h"
#include "simdrive.h"
#include "aircrft.h"
#include "navsystem.h"
#include "fcc.h"
#include "hud.h"
#include "weather.h"
#include "find.h"
#include "flightdata.h"

#define S_IN_M		60
#define S_IN_H		3600

extern bool g_bIFF;

void ICPClass::PushedSame(int LastMode)
{
    AircraftClass *playerAC = SimDriver.GetPlayerAircraft();
    ClearStrings();
    ClearFlags();
    ResetSubPages();
    Manual_Input = FALSE;
    ClearCount = 0;
    InputsMade = 0;
    MadeInput = FALSE;
    playerAC->FCC->SetStptMode(FireControlComputer::FCCWaypoint);
    playerAC->FCC->waypointStepCmd = 127;

    switch (LastMode)
    {
        case NONE_MODE:
            mICPTertiaryMode = CNI_MODE;
            SetICPFlag(ICPClass::MODE_CNI);
            SetICPFlag(ICPClass::EDIT_STPT);
            ExecCNIMode();
            break;

        case CNI_MODE:
            mICPTertiaryMode = CNI_MODE;
            SetICPFlag(ICPClass::MODE_CNI);
            SetICPFlag(ICPClass::EDIT_STPT);
            ExecCNIMode();
            break;

        case COMM1_MODE:
            mICPTertiaryMode = COMM1_MODE;
            SetICPFlag(ICPClass::MODE_COMM1);
            ExecCOMM1Mode();
            break;

        case COMM2_MODE:
            mICPTertiaryMode = COMM2_MODE;
            SetICPFlag(ICPClass::MODE_COMM2);
            ExecCOMM2Mode();
            break;

        case LIST_MODE:
            mICPTertiaryMode = LIST_MODE;
            SetICPFlag(ICPClass::MODE_LIST);
            mICPSecondaryMode = 0;
            ExecLISTMode();
            break;

        case IFF_MODE:
            mICPTertiaryMode = IFF_MODE;
            SetICPFlag(ICPClass::MODE_IFF);
            ExecIFFMode();
            break;

        default:
            break;
    }
}
int ICPClass::ManualInput(void)
{
    if (Manual_Input)
        return TRUE;

    if ((IsICPSet(ICPClass::MODE_CNI) && mICPSecondaryMode == ONE_BUTTON &&
         ILSPageSel == 0) ||
        (IsICPSet(ICPClass::MODE_CNI) && mICPSecondaryMode == TWO_BUTTON) ||
        (IsICPSet(ICPClass::MODE_CNI) && mICPSecondaryMode == FOUR_BUTTON) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == ONE_BUTTON) ||
        (IsICPSet(ICPClass::EDIT_LAT)) || (IsICPSet(ICPClass::EDIT_LONG)) ||
        (IsICPSet(ICPClass::FLARE_BINGO)) || (IsICPSet(ICPClass::CHAFF_BINGO)) ||
        (BQ || BI || SQ || SI || OA1 || OA2) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == TWO_BUTTON) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == THREE_BUTTON) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == FIFE_BUTTON) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == NINE_BUTTON) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == 100) || //INTG
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == SIX_BUTTON) || //INS
        IsICPSet(ICPClass::MODE_IFF) || (IsICPSet(ICPClass::MISC_MODE) &&
                                         mICPSecondaryMode == FIFE_BUTTON))
    {
        if (OA1 && OA_BRG)
            tempvar1 = fOA_BRG;
        else if (OA2 && OA_BRG)
            tempvar1 = fOA_BRG2;

        if (VIP_BRG)
            tempvar1 = fVIP_BRG;

        if (VRP_BRG)
            tempvar1 = VRP_BRG;

        if (PGMChaff)
        {
            if (BI)
                tempvar1 = fCHAFF_BI[CPI];
            else if (SI)
                tempvar1 = fCHAFF_SI[CPI];
        }

        if (PGMFlare)
        {
            if (BI)
                tempvar1 = fFLARE_BI[FPI];
            else if (SI)
                tempvar1 = fFLARE_SI[FPI];
        }

        return TRUE;
    }
    else
        return FALSE;
}
int ICPClass::CheckMode(void)
{
    AircraftClass *playerAC = SimDriver.GetPlayerAircraft();

    if ((IsICPSet(ICPClass::MODE_CNI) && mICPSecondaryMode == FIFE_BUTTON) && !IsICPSet(ICPClass::BLOCK_MODE))
    {
        StepCruise();
        return TRUE;
    }

    if (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == EWS_MODE && !EWSMain)
    {
        //you can only change progs if you're in STBY
        if (playerAC &&
            playerAC->EWSPGM() != AircraftClass::EWSPGMSwitch::Stby)
            return TRUE;
    }

    if (!g_bIFF)
    {
        //Don't do anything for now when in COMM (temporary)/IFF/DLINK/FACK/MARK/INTG mode
        if (IsICPSet(ICPClass::MODE_COMM1) || IsICPSet(ICPClass::MODE_COMM2) ||
            IsICPSet(ICPClass::MODE_IFF) || IsICPSet(ICPClass::MODE_DLINK) ||
            IsICPSet(ICPClass::MODE_FACK) || IsICPSet(ICPClass::BLOCK_MODE) ||
            (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == 100) ||	//INTG
            mICPSecondaryMode == MARK_MODE)
            return TRUE;
        else
            return FALSE;
    }
    else
    {
        //Don't do anything for now when in COMM (temporary)/IFF/DLINK/FACK/MARK/INTG mode
        if (IsICPSet(ICPClass::MODE_COMM1) || IsICPSet(ICPClass::MODE_COMM2) ||
            IsICPSet(ICPClass::MODE_DLINK) || IsICPSet(ICPClass::MODE_FACK) ||<commit_msg>Fix enum warning in ICP project<commit_after>#include "icp.h"
#include "simdrive.h"
#include "aircrft.h"
#include "navsystem.h"
#include "fcc.h"
#include "hud.h"
#include "weather.h"
#include "find.h"
#include "flightdata.h"

#define S_IN_M		60
#define S_IN_H		3600

extern bool g_bIFF;

void ICPClass::PushedSame(int LastMode)
{
    AircraftClass *playerAC = SimDriver.GetPlayerAircraft();
    ClearStrings();
    ClearFlags();
    ResetSubPages();
    Manual_Input = FALSE;
    ClearCount = 0;
    InputsMade = 0;
    MadeInput = FALSE;
    playerAC->FCC->SetStptMode(FireControlComputer::FCCWaypoint);
    playerAC->FCC->waypointStepCmd = 127;

    switch (LastMode)
    {
        case NONE_MODE:
            mICPTertiaryMode = CNI_MODE;
            SetICPFlag(ICPClass::MODE_CNI);
            SetICPFlag(ICPClass::EDIT_STPT);
            ExecCNIMode();
            break;

        case CNI_MODE:
            mICPTertiaryMode = CNI_MODE;
            SetICPFlag(ICPClass::MODE_CNI);
            SetICPFlag(ICPClass::EDIT_STPT);
            ExecCNIMode();
            break;

        case COMM1_MODE:
            mICPTertiaryMode = COMM1_MODE;
            SetICPFlag(ICPClass::MODE_COMM1);
            ExecCOMM1Mode();
            break;

        case COMM2_MODE:
            mICPTertiaryMode = COMM2_MODE;
            SetICPFlag(ICPClass::MODE_COMM2);
            ExecCOMM2Mode();
            break;

        case LIST_MODE:
            mICPTertiaryMode = LIST_MODE;
            SetICPFlag(ICPClass::MODE_LIST);
            mICPSecondaryMode = 0;
            ExecLISTMode();
            break;

        case IFF_MODE:
            mICPTertiaryMode = IFF_MODE;
            SetICPFlag(ICPClass::MODE_IFF);
            ExecIFFMode();
            break;

        default:
            break;
    }
}
int ICPClass::ManualInput(void)
{
    if (Manual_Input)
        return TRUE;

    if ((IsICPSet(ICPClass::MODE_CNI) && mICPSecondaryMode == ONE_BUTTON &&
         ILSPageSel == 0) ||
        (IsICPSet(ICPClass::MODE_CNI) && mICPSecondaryMode == TWO_BUTTON) ||
        (IsICPSet(ICPClass::MODE_CNI) && mICPSecondaryMode == FOUR_BUTTON) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == ONE_BUTTON) ||
        (IsICPSet(ICPClass::EDIT_LAT)) || (IsICPSet(ICPClass::EDIT_LONG)) ||
        (IsICPSet(ICPClass::FLARE_BINGO)) || (IsICPSet(ICPClass::CHAFF_BINGO)) ||
        (BQ || BI || SQ || SI || OA1 || OA2) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == TWO_BUTTON) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == THREE_BUTTON) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == FIFE_BUTTON) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == NINE_BUTTON) ||
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == 100) || //INTG
        (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == SIX_BUTTON) || //INS
        IsICPSet(ICPClass::MODE_IFF) || (IsICPSet(ICPClass::MISC_MODE) &&
                                         mICPSecondaryMode == FIFE_BUTTON))
    {
        if (OA1 && OA_BRG)
            tempvar1 = fOA_BRG;
        else if (OA2 && OA_BRG)
            tempvar1 = fOA_BRG2;

        if (VIP_BRG)
            tempvar1 = fVIP_BRG;

        if (VRP_BRG)
            tempvar1 = VRP_BRG;

        if (PGMChaff)
        {
            if (BI)
                tempvar1 = fCHAFF_BI[CPI];
            else if (SI)
                tempvar1 = fCHAFF_SI[CPI];
        }

        if (PGMFlare)
        {
            if (BI)
                tempvar1 = fFLARE_BI[FPI];
            else if (SI)
                tempvar1 = fFLARE_SI[FPI];
        }

        return TRUE;
    }
    else
        return FALSE;
}
int ICPClass::CheckMode(void)
{
    AircraftClass *playerAC = SimDriver.GetPlayerAircraft();

    if ((IsICPSet(ICPClass::MODE_CNI) && mICPSecondaryMode == FIFE_BUTTON) && !IsICPSet(ICPClass::BLOCK_MODE))
    {
        StepCruise();
        return TRUE;
    }

    if (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == EWS_MODE && !EWSMain)
    {
        //you can only change progs if you're in STBY
        if (playerAC &&
            playerAC->EWSPGM() != AircraftClass::Stby)
            return TRUE;
    }

    if (!g_bIFF)
    {
        //Don't do anything for now when in COMM (temporary)/IFF/DLINK/FACK/MARK/INTG mode
        if (IsICPSet(ICPClass::MODE_COMM1) || IsICPSet(ICPClass::MODE_COMM2) ||
            IsICPSet(ICPClass::MODE_IFF) || IsICPSet(ICPClass::MODE_DLINK) ||
            IsICPSet(ICPClass::MODE_FACK) || IsICPSet(ICPClass::BLOCK_MODE) ||
            (IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == 100) ||	//INTG
            mICPSecondaryMode == MARK_MODE)
            return TRUE;
        else
            return FALSE;
    }
    else
    {
        //Don't do anything for now when in COMM (temporary)/IFF/DLINK/FACK/MARK/INTG mode
        if (IsICPSet(ICPClass::MODE_COMM1) || IsICPSet(ICPClass::MODE_COMM2) ||
            IsICPSet(ICPClass::MODE_DLINK) || IsICPSet(ICPClass::MODE_FACK) ||
{'fraction_non_alphanumeric': 0.12111553784860558, 'fraction_numerical': 0.008764940239043825, 'mean_word_length': 2.2203335471456063, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5422343', 'n_tokens_mistral': 3755, 'n_tokens_neox': 3546, 'n_words': 559}