80 std::string name =
"event_1";
91 name +=
TO_UTF8(QString::number(i));
110 connect(mpComboBoxDelay, SIGNAL(currentIndexChanged(
int)),
this, SLOT(
slotChooseDelay(
int)));
114 mpExpressionTrigger->mpExpressionWidget->setBoolean(
true);
127 mpLabelEA->setEnabled(
false);
128 mpExpressionEA->setEnabled(
false);
147 if (pObject == NULL)
return;
151 if (pME == NULL)
return;
169 QListWidgetItem * pItem = mpLBTarget->takeItem((
int) ToBeDeleted);
180 if (
mpEvent == NULL)
return false;
185 if (pModel == NULL)
return false;
189 mpExpressionTrigger->updateWidget();
193 mpExpressionDelay->updateWidget();
197 mpComboBoxDelay->setCurrentIndex(0);
201 mpComboBoxDelay->setCurrentIndex(2);
205 mpComboBoxDelay->setCurrentIndex(1);
217 for (; it != end; ++it, ijk++)
227 #ifdef XXXX // Add type dependent information
229 if (sObjectName ==
"Compartment")
234 if (sObjectName ==
"Metabolite")
239 if (sObjectName.contains(
"ModelValue"))
250 mpLBTarget->insertItems(0, Targets);
260 mpLBTarget->setCurrentRow((
int) NewTarget);
275 if (pModel == NULL)
return;
283 switch (mpComboBoxDelay->currentIndex())
343 for (; it != end; ++it)
345 Found = OldAssignments.
getIndex((*it)->getTargetKey());
349 OldAssignments.
add(**it);
352 else if (OldAssignments[Found]->getExpression() != (*it)->getExpression())
354 OldAssignments[Found]->setExpression((*it)->getExpression());
363 size_t DeleteCount = 0;
370 std::vector< std::string > ToBeDeleted;
372 for (; itOld != endOld && DeleteCount > 0; ++itOld)
374 const std::string & key = (*itOld)->getTargetKey();
378 if (key == (*it)->getTargetKey())
break;
383 ToBeDeleted.push_back(key);
390 std::vector< std::string >::const_iterator itDelete = ToBeDeleted.begin();
391 std::vector< std::string >::const_iterator endDelete = ToBeDeleted.end();
393 for (; itDelete != endDelete; ++itDelete)
395 OldAssignments.
remove(*itDelete);
466 if (pObject == NULL)
return;
470 if (pME == NULL)
return;
482 size_t NewTarget = (size_t) index;
502 mpLabelEA->setEnabled(
false);
503 mpExpressionEA->setEnabled(
false);
510 mpLabelEA->setEnabled(
true);
511 mpExpressionEA->setEnabled(
true);
514 mpExpressionEA->updateWidget();
523 mpLabelDelayExpression->show();
524 mpExpressionDelay->show();
528 mpLabelDelayExpression->hide();
529 mpExpressionDelay->hide();
CCopasiContainer * getObjectAncestor(const std::string &type) const
const CCopasiVectorN< CEventAssignment > & getAssignments() const
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
const bool & getDelayAssignment() const
void switchToOtherWidget(const size_t &id, const std::string &key)
virtual size_t size() const
CCopasiObject * get(const std::string &key)
std::string getTriggerExpression() const
virtual size_t getIndex(const std::string &name) const
virtual bool add(const CType &src)
virtual const std::string & getKey() const
bool setTriggerExpression(const std::string &expression)
virtual bool add(const CType &src)
static const QIcon & icon(const IconID &id)
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
void setDelayAssignment(const bool &delayCalculation)
std::string getDelayExpression() const
virtual void remove(const std::string &name)
virtual void remove(const size_t &index)
static CKeyFactory * getKeyFactory()
bool setDelayExpression(const std::string &expression)
Header file of class CEvent.
bool setExpression(const std::string &expression)
static const CCopasiObject * getObjectSingle(QWidget *pParent, const CQSimpleSelectionTree::ObjectClasses &classes, const CCopasiObject *pCurrentObject=NULL)
CCopasiContainer * getObjectParent() const
bool removeEvent(const size_t index, const bool &recursive=true)