本文整理汇总了C++中CEvent::setPriorityExpression方法的典型用法代码示例。如果您正苦于以下问题:C++ CEvent::setPriorityExpression方法的具体用法?C++ CEvent::setPriorityExpression怎么用?C++ CEvent::setPriorityExpression使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEvent
的用法示例。
在下文中一共展示了CEvent::setPriorityExpression方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void CQEventWidget1::addEvent(UndoEventData *pSData)
{
assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
CCopasiDataModel* pDataModel = (*CCopasiRootContainer::getDatamodelList())[0];
assert(pDataModel != NULL);
CModel * pModel = pDataModel->getModel();
assert(pModel != NULL);
//reinsert the Event
CEvent *pEvent = pModel->createEvent(pSData->getName());
//set the expressions
pEvent->setTriggerExpression(pSData->getTriggerExpression());
pEvent->setDelayExpression(pSData->getDelayExpression());
pEvent->setPriorityExpression(pSData->getPriorityExpression());
QList <UndoEventAssignmentData *> *assignmentData = pSData->getEventAssignmentData();
QList <UndoEventAssignmentData *>::const_iterator i;
for (i = assignmentData->begin(); i != assignmentData->end(); ++i)
{
UndoEventAssignmentData * assignData = *i;
CCopasiObject * pObject = NULL;
bool speciesExist = false;
size_t ci;
for (ci = 0; ci < pModel->getCompartments().size(); ci++)
{
CCompartment * pCompartment = pModel->getCompartments()[ci];
if (pCompartment->getMetabolites().getIndex(assignData->getName()) != C_INVALID_INDEX)
speciesExist = true;
}
if (speciesExist)
{
size_t index = pModel->findMetabByName(assignData->getName());
pObject = pModel->getMetabolites()[index];
}
else if (pModel->getModelValues().getIndex(assignData->getName()) != C_INVALID_INDEX)
{
pObject = pModel->getModelValues()[assignData->getName()];
}
else if (pModel->getReactions().getIndex(assignData->getName()) != C_INVALID_INDEX)
{
pObject = pModel->getReactions()[assignData->getName()];
}
const CModelEntity * pEntity = dynamic_cast< const CModelEntity * >(pObject);
CEventAssignment *eventAssign = new CEventAssignment(pObject->getKey(), pEvent->getObjectParent());
eventAssign->setExpression(assignData->getExpression());
eventAssign->getExpressionPtr()->compile();
pEvent->getAssignments().add(eventAssign);
}
std::string key = pEvent->getKey();
protectedNotify(ListViews::EVENT, ListViews::ADD, key);
mpListView->switchToOtherWidget(C_INVALID_INDEX, key);
}