int InputDriverAbstract::initialize() { int ret; ret = openDevice(); if (ret < 0) { finalize(); return ret; } ret = guessDeviceType(); if (ret < 0) { finalize(); return ret; } ret = initMapping(); if (ret < 0) { finalize(); return ret; } ret = validate(); if (ret < 0) { finalize(); return ret; } return 0; }
/* Constructors */ SoundConfig::SoundConfig(const Colour3f &colour, unsigned int sampleId, bool isEnabled) { this->colour = colour; this->sampleId = sampleId; this->isEnabled = isEnabled; initMapping(); }
void CReactionInterface::setFunctionWithEmptyMapping(const std::string & fn) { if ((fn == "") || (fn == "undefined")) {clearFunction(); return;} //get the function mpFunction = dynamic_cast<CFunction *> (CCopasiRootContainer::getFunctionList()->findLoadFunction(fn)); if (!mpFunction) fatalError(); pdelete(mpParameters); initMapping(); //empty mapping }
DediArkMainWindow::DediArkMainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::DediArkMainWindow) { ui->setupUi(this); container = SettingContainer::DefaultSettings(); initMapping(); mapSettings(); ui->scrollAreaWidgetContents->setLayout(ui->verticalSettings); ui->tabServerSetting->setLayout(ui->layoutSettings); }
tags::Tags::Tags(QString path) { initMapping(); initGenres(); FILE *fd = fopen(qPrintable(path), "rb"); if (fd) { qDebug() << "parsing tags of" << path; parse(fd); fclose(fd); } else { qDebug() << "error opening file" << path; } }
void CReactionInterface::copyMapping() { if (!mpParameters) //nothing to copy { initMapping(); return; } // save the old information CFunctionParameters *oldParameters = mpParameters; std::vector<std::vector<std::string> > oldMap = mNameMap; std::vector<C_FLOAT64> oldValues = mValues; std::vector<bool> oldIsLocal = mIsLocal; //create new mapping initMapping(); //try to preserve as much information from the old mapping as possible size_t j, jmax = oldParameters->size(); size_t i, imax = size(); for (i = 0; i < imax; ++i) { //find parameter with same name in old parameters for (j = 0; j < jmax; ++j) if ((*oldParameters)[j]->getObjectName() == getParameterName(i)) break; if (j == jmax) continue; //see if usage matches if (getUsage(i) != (*oldParameters)[j]->getUsage()) continue; //see if vector property matches if (isVector(i) != ((*oldParameters)[j]->getType() == CFunctionParameter::VFLOAT64)) continue; mIsLocal[i] = oldIsLocal[j]; mValues[i] = oldValues[j]; switch (getUsage(i)) { case CFunctionParameter::SUBSTRATE: case CFunctionParameter::PRODUCT: //TODO: check with chemeq mNameMap[i] = oldMap[j]; break; case CFunctionParameter::MODIFIER: //TODO: check existence? mNameMap[i] = oldMap[j]; //TODO: add to chemeq break; case CFunctionParameter::PARAMETER: case CFunctionParameter::VOLUME: case CFunctionParameter::TIME: //TODO: check existence? mNameMap[i] = oldMap[j]; break; default: break; } } pdelete(oldParameters); }
CompactTxFinder::CompactTxFinder(const CTxMemPool& m, uint64_t idk0, uint64_t idk1) : mempool(m) { initMapping(idk0, idk1); }