示例#1
0
DialogConfig::DialogConfig(FX3Config* cfg, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogConfig),
    cfg( cfg )
{
    ui->setupUi(this);
    QObject::connect(ui->pushButtonOK, SIGNAL(clicked(bool)), this, SLOT(accept()));
    QObject::connect(this, SIGNAL(accepted()), this, SLOT(setConfigValues()));
    QObject::connect(ui->comboBoxBoardType, SIGNAL(currentIndexChanged(int)), this, SLOT(boardChanged(int)));
    QObject::connect(ui->pushButtonFileImg, SIGNAL(clicked(bool)), this, SLOT(openFileImg(bool)));
    QObject::connect(ui->pushButtonFileAddFw, SIGNAL(clicked(bool)), this, SLOT(openFileAddFw(bool)));
    QObject::connect(ui->checkBoxHaveSubs, SIGNAL(stateChanged(int)), this, SLOT(changedSubs(int)));


    int dtm = 0;
    bool have_cypress = false;
    int cypress_idx = 0;
#ifndef NO_CY_API
    have_cypress = true;
    drivers_combobox_map[DrvTypeCypress] = dtm;
    ui->comboBoxDriverType->insertItem( dtm++, "Cypress API", QVariant(DrvTypeCypress));
#endif
    drivers_combobox_map[DrvTypeLibUsb] = dtm;
    ui->comboBoxDriverType->insertItem( dtm++, "LibUsb API", QVariant(DrvTypeLibUsb));

    drivers_combobox_map[DrvTypeFileSim] = dtm;
    ui->comboBoxDriverType->insertItem( dtm++, "File Sim", QVariant(DrvTypeFileSim));

    if ( have_cypress ) {
        ui->comboBoxDriverType->setCurrentIndex(drivers_combobox_map[DrvTypeCypress]);
    } else {
        ui->comboBoxDriverType->setCurrentIndex(drivers_combobox_map[DrvTypeLibUsb]);
    }
    //ui->comboBoxDriverType->setCurrentIndex(drivers_combobox_map[DrvTypeFileSim]);

    for ( int dtm = 0; dtm < ( int ) ADC_Types_Count; dtm++ ) {
        #ifdef NO_GPS
        if ( ( ADCType ) dtm == ADC_4ch_2bit ) {
            ui->comboBoxBoardType->insertItem( dtm, "DISABLED" ), QVariant( ( ADCType ) dtm ) );
            continue;
        }
        #endif
        ui->comboBoxBoardType->insertItem( dtm, FX3Config::GetAdcString( ( ADCType ) dtm ), QVariant( ( ADCType ) dtm ) );
    }
示例#2
0
文件: position.c 项目: dsteuer/laska
void Position::readConfig	(const std::string file_name) { setConfigValues (optim.getValues()); }