本文整理汇总了C++中CCompartment::getStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ CCompartment::getStatus方法的具体用法?C++ CCompartment::getStatus怎么用?C++ CCompartment::getStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCompartment
的用法示例。
在下文中一共展示了CCompartment::getStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: redo
void InsertCompartmentRowsCommand::redo()
{
if (firstTime)
{
mpCompartmentDM->insertNewCompartmentRow(mPosition, mRows, QModelIndex());
assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
CCopasiDataModel* pDataModel = (*CCopasiRootContainer::getDatamodelList())[0];
assert(pDataModel != NULL);
CModel * pModel = pDataModel->getModel();
assert(pModel != NULL);
CCompartment *pCompartment = pModel->getCompartments()[mPosition];
mpCompartmentData->setName(pCompartment->getObjectName());
mpCompartmentData->setStatus(pCompartment->getStatus());
mpCompartmentData->setInitialValue(pCompartment->getInitialValue());
firstTime = false;
}
else
{
mpCompartmentDM->addCompartmentRow(mpCompartmentData);
}
setUndoState(true);
setAction("Add to list");
setName(mpCompartmentData->getName());
}
示例2: preprocess
bool CODEExporterC::preprocess(const CModel* copasiModel)
{
size_t n[3] = {0, 0, 0};
size_t n_c[3] = {0, 0, 0};
size_t i, j;
size_t dependent;
setReservedNames();
NameMap[timeKey] = translateTimeVariableName();
const CCopasiVector< CMetab > & metabs = copasiModel->getMetabolitesX();
size_t metabs_size = metabs.size();
for (i = 0; i < metabs_size; i++)
{
CMetab * metab = metabs[i];
//if (metab->isUsed())
{
std::string smname;
std::string name;
dependent = metab->isDependent();
smname = setExportName(metab->getStatus(), n, dependent);
name = setConcentrationName(metab->getStatus(), n_c, dependent);
NameMap[metab->getKey()] = name;
std::ostringstream smKey;
smKey << "sm_" << metab->getKey();
NameMap[smKey.str()] = smname;
if ((metab->getStatus() == CModelEntity::REACTIONS && !metab->isDependent()) || metab->getStatus() == CModelEntity::ODE)
{
std::ostringstream odeKey;
odeKey << "ode_" << metab->getKey();
NameMap[odeKey.str()] = setODEName(smname);
}
}
}
size_t comps_size = copasiModel->getCompartments().size();
const CCopasiVector< CCompartment > & comps = copasiModel->getCompartments();
for (i = 0; i < comps_size; i++)
{
CCompartment * comp = comps[i];
std::string name;
dependent = 0;
name = setExportName(comp->getStatus(), n, dependent);
NameMap[comp->getKey()] = name;
if (comp->getStatus() == CModelEntity::ODE)
{
std::ostringstream odeKey;
odeKey << "ode_" << comp->getKey();
NameMap[odeKey.str()] = setODEName(name);
}
}
size_t modvals_size = copasiModel->getModelValues().size();
const CCopasiVector< CModelValue > & modvals = copasiModel->getModelValues();
for (i = 0; i < modvals_size; i++)
{
CModelValue* modval = modvals[i];
std::string name = setExportName(modval->getStatus(), n, 0);
NameMap[modval->getKey()] = name;
if (modval->getStatus() == CModelEntity::ODE)
{
std::ostringstream odeKey;
odeKey << "ode_" << modval->getKey();
NameMap[odeKey.str()] = setODEName(name);
}
}
size_t reacs_size = copasiModel->getReactions().size();
const CCopasiVector< CReaction > & reacs = copasiModel->getReactions();
std::set<std::string> tmpset;
for (i = 0; i < reacs_size; ++i)
{
size_t params_size;
params_size = reacs[i]->getParameters().size();
for (j = 0; j < params_size; ++j)
{
if (!reacs[i]->isLocalParameter(reacs[i]->getParameters().getParameter(j)->getObjectName()))
continue;
//.........这里部分代码省略.........