Exemple #1
0
// Return string list of usage types
const QStringList AnemDesc::metekModelStringList()
{
    return (QStringList()
            << getANEM_MODEL_STRING_9()
            << getANEM_MODEL_STRING_10()
            << getANEM_MODEL_STRING_12());
}
Exemple #2
0
// Return string list of usage types
const QStringList AnemDesc::campbellModelStringList()
{
    return (QStringList()
            << getANEM_MODEL_STRING_0()
            << getANEM_MODEL_STRING_13()
            << getANEM_MODEL_STRING_12());
}
Exemple #3
0
// Return string list of usage types
const QStringList AnemDesc::gillModelStringList()
{
    return (QStringList()
            << getANEM_MODEL_STRING_1()
            << getANEM_MODEL_STRING_2()
            << getANEM_MODEL_STRING_3()
            << getANEM_MODEL_STRING_4()
            << getANEM_MODEL_STRING_5()
            << getANEM_MODEL_STRING_6()
            << getANEM_MODEL_STRING_7()
            << getANEM_MODEL_STRING_8()
            << getANEM_MODEL_STRING_12());
}
Exemple #4
0
bool AnemDesc::isGoodAnemometer(AnemDesc anem)
{
    const QString manufacturer = anem.manufacturer();
    const QString model = anem.model();
    qreal height = anem.height();
    const QString windFormat = anem.windFormat();
    const QString northAlignment = anem.northAlignment();

    // 1
    bool isGoodManufacturer = !manufacturer.isEmpty();

    // 2
    bool isGoodModel = false;
    if (!model.isEmpty())
    {
        if (manufacturer == getANEM_MANUFACTURER_STRING_0())
        {
            isGoodModel = (model == getANEM_MODEL_STRING_0())
                           || (model == getANEM_MODEL_STRING_12());
        }
        else if (manufacturer == getANEM_MANUFACTURER_STRING_1())
        {
            isGoodModel = (model == getANEM_MODEL_STRING_1())
                || (model == getANEM_MODEL_STRING_2())
                || (model == getANEM_MODEL_STRING_3())
                || (model == getANEM_MODEL_STRING_4())
                || (model == getANEM_MODEL_STRING_5())
                || (model == getANEM_MODEL_STRING_6())
                || (model == getANEM_MODEL_STRING_7())
                || (model == getANEM_MODEL_STRING_8())
                || (model == getANEM_MODEL_STRING_12());
        }
        else if (manufacturer == getANEM_MANUFACTURER_STRING_2())
        {
            isGoodModel = (model == getANEM_MODEL_STRING_9())
                           || (model == getANEM_MODEL_STRING_10())
                           || (model == getANEM_MODEL_STRING_12());
        }
        else if (manufacturer == getANEM_MANUFACTURER_STRING_3())
        {
            isGoodModel = (model == getANEM_MODEL_STRING_11())
                           || (model == getANEM_MODEL_STRING_12());
        }
        else if (manufacturer == getANEM_MANUFACTURER_STRING_4())
        {
            isGoodModel = (model == getANEM_MODEL_STRING_12());
        }
    }

    // 3
    // always true by min value
    bool isGoodHeight = height > 0.0;

    // 4
    bool isGoodWindFormat = false;
    if (manufacturer != getANEM_MANUFACTURER_STRING_1())
    {
        isGoodWindFormat = (windFormat == getANEM_WIND_FORMAT_STRING_0())
                            || (windFormat == getANEM_WIND_FORMAT_STRING_1());
    }
    else
    {
        isGoodWindFormat = true;
    }

    // 5
    bool isGoodNorthAlignment = false;
    if (manufacturer == getANEM_MANUFACTURER_STRING_1())
    {
        isGoodNorthAlignment = (northAlignment == getANEM_NORTH_ALIGN_STRING_0())
                                || (northAlignment == getANEM_NORTH_ALIGN_STRING_1());
    }
    else
    {
        isGoodNorthAlignment = northAlignment.isEmpty()
                                || (northAlignment == getANEM_NORTH_ALIGN_STRING_2());
    }

    // 6
    // always true by min value
    bool isGoodGeneric = false;
    if ((model == getANEM_MODEL_STRING_12()))
        isGoodGeneric = (anem.hPathLength() > 0) && (anem.vPathLength() > 0) && (anem.tau() > 0);
    else
        isGoodGeneric = true;

    qDebug() << ">> isGoodManufacturer" << isGoodManufacturer;
    qDebug() << ">> isGoodModel" << isGoodModel;
    qDebug() << ">> isGoodHeight" << isGoodHeight;
    qDebug() << ">> isGoodWindFormat" << isGoodWindFormat;
    qDebug() << ">> isGoodNorthAlignment" << isGoodNorthAlignment;
    qDebug() << ">> isGoodGeneric" << isGoodGeneric;

    // all
    return (isGoodManufacturer
            && isGoodModel
            && isGoodHeight
            && isGoodWindFormat
            && isGoodNorthAlignment
            && isGoodGeneric);
}
Exemple #5
0
// Return string list of usage types
const QStringList AnemDesc::otherModelStringList()
{
    return (QStringList()
            << getANEM_MODEL_STRING_12());
}