예제 #1
0
bool CQWW::validateExchange(Qso *qso)

// mult1=CQ Country
// mult2=CQ zone
// exchange same for all : RST zone
{
    if (!separateExchange(qso)) return(false);
    for (int ii = 0; ii < MMAX; ii++) qso->mult[ii] = -1;

    bool ok = false;
    if (exchElement.size() == 2) {
        finalExch[0] = exchElement[0];
        finalExch[1] = exchElement[1];
    } else if (exchElement.size() == 1) {
        fillDefaultRST(qso);
        finalExch[1] = exchElement[0];
    }
    int zone=finalExch[1].toInt(&ok);
    if (ok) {
        if (zone>0 && zone<41) {
            qso->zone=zone;
            qso->mult_name = finalExch[1];
            determineMultType(qso);
            // override for marine mobile stations: zone credit only
            if (qso->isMM) {
                qso->mult[0]    = -1;
                qso->isamult[0] = false;
            }
            copyFinalExch(ok, qso);
        } else {
            ok=false;
        }
    }
    return(ok);
}
예제 #2
0
bool ARRL10::validateExchange(Qso *qso)
{
    if (!separateExchange(qso)) return(false);
    fillDefaultRST(qso);

    finalExch[1].clear();
    qso->rcv_exch[0].clear();
    qso->rcv_exch[1].clear();
    bool ok = false;

    for (int ii = 0; ii < MMAX; ii++) qso->mult[ii] = -1;

    qso->pts = 0;
    determineMultType(qso);

    // mobile ITU regions (RST) R1, (RST) R2, (RST) R3
    // not using validator in contest.cpp since here R1/R2/R3 are
    // multipliers
    if (qso->isMM) {
        for (int i = exchElement.size() - 1; i >= 0; i--) {
            int r = 0;
            if (exchElement[i] == "R1") r = 1;
            if (exchElement[i] == "R2") r = 2;
            if (exchElement[i] == "R3") r = 3;
            if (r) {
                // make this count as "domestic mult" regardless of actual country of callsign
                qso->mult[1]    = -1;
                qso->isamult[0] = true;
                break;
            }
        }
    }
    if (qso->isamult[0]) {
        // Domestic call: (RST) state
        ok = valExch_rst_state(0, qso->mult[0]);
    } else if (qso->isamult[1]) {
        // DX: (RST) #
        // two things entered; assume first is rst
        int inr = 0;
        if (exchElement.size() == 2) {
            finalExch[0] = exchElement[0];
            inr          = 1;
        }

        // serial number; must be convertable to int
        bool iok = false;
        exchElement[inr].toInt(&iok, 10);
        if (iok) {
            ok           = true;
            finalExch[1] = exchElement[inr];
        }
    }
    copyFinalExch(ok, qso);
    return(ok);
}
예제 #3
0
bool ARRLDX::validateExchange(Qso *qso)
{
    if (!separateExchange(qso)) return(false);

    fillDefaultRST(qso);
    finalExch[1].clear();
    qso->rcv_exch[0].clear();
    qso->rcv_exch[1].clear();
    bool ok = false;

    for (int ii = 0; ii < MMAX; ii++) qso->mult[ii] = -1;

    // get the exchange
    determineMultType(qso);

    qso->pts = 0;

    // for US/VE stations
    if (usVe) {
        // mobile stations: /MM /AM qso credit but not a mult
        if (qso->isMM) {
            qso->mult[0]    = -1;
            qso->isamult[0] = true;
        }
        if (qso->isamult[0]) {
            ok = valExch_rst_name(qso);
            if (ok) {
                qso->pts = 3;
            }
        }
    } else {
        // DX stations
        if (qso->isamult[0]) {
            ok = valExch_rst_state(0, qso->mult[0]);
            if (ok) {
                qso->pts = 3;
            }
        }
    }
    if (qso->dupe) qso->pts = 0;
    copyFinalExch(ok, qso);
    return(ok);
}