<commit_before>/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/


/// @file
///     @author <NAME> <<EMAIL>>

#include "FirmwarePluginManager.h"
#include "FirmwarePlugin.h"

FirmwarePluginManager::FirmwarePluginManager(QGCApplication* app)
    : QGCTool(app)
    , _genericFirmwarePlugin(NULL)
{

}

FirmwarePluginManager::~FirmwarePluginManager()
{
    delete _genericFirmwarePlugin;
}

QList<MAV_AUTOPILOT> FirmwarePluginManager::knownFirmwareTypes(void)
{
    if (_knownFirmwareTypes.isEmpty()) {
        QList<FirmwarePluginFactory*> factoryList = FirmwarePluginFactoryRegister::instance()->pluginFactories();

        for (int i=0; i<factoryList.count(); i++) {
            _knownFirmwareTypes.append(factoryList[i]->knownFirmwareTypes());
        }
    }

    _knownFirmwareTypes.append(MAV_AUTOPILOT_GENERIC);
<commit_msg>Add MAV_AUTOPILOT_GENERIC only once.<commit_after>/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/


/// @file
///     @author <NAME> <<EMAIL>>

#include "FirmwarePluginManager.h"
#include "FirmwarePlugin.h"

FirmwarePluginManager::FirmwarePluginManager(QGCApplication* app)
    : QGCTool(app)
    , _genericFirmwarePlugin(NULL)
{

}

FirmwarePluginManager::~FirmwarePluginManager()
{
    delete _genericFirmwarePlugin;
}

QList<MAV_AUTOPILOT> FirmwarePluginManager::knownFirmwareTypes(void)
{
    if (_knownFirmwareTypes.isEmpty()) {
        QList<FirmwarePluginFactory*> factoryList = FirmwarePluginFactoryRegister::instance()->pluginFactories();
        for (int i = 0; i < factoryList.count(); i++) {
            _knownFirmwareTypes.append(factoryList[i]->knownFirmwareTypes());
        }
        _knownFirmwareTypes.append(MAV_AUTOPILOT_GENERIC);
    }
{'fraction_non_alphanumeric': 0.23593073593073594, 'fraction_numerical': 0.007792207792207792, 'mean_word_length': 5.245945945945946, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7310122', 'n_tokens_mistral': 707, 'n_tokens_neox': 665, 'n_words': 113}