COPASI API  4.16.103
CQSpeciesDetail.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2015 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 #include "CQSpeciesDetail.h"
12 #include "CQMessageBox.h"
13 #include "CQNameSelectionDialog.h" // for Copy button compartment options
14 #include "qtUtilities.h"
15 
16 #include "model/CModel.h"
17 #include "model/CChemEqInterface.h"
19 #include "model/CModelExpansion.h" //for Copy button and options
20 
21 /*
22  * Constructs a CQSpeciesDetail which is a child of 'parent', with the
23  * name 'name'.'
24  */
25 CQSpeciesDetail::CQSpeciesDetail(QWidget* parent, const char* name) :
26  CopasiWidget(parent, name),
27  mChanged(false),
28  mpMetab(NULL),
29  mpCurrentCompartment(NULL),
30  mItemToType(),
31  mInitialNumber(0.0),
32  mInitialConcentration(0.0),
33  mExpressionValid(false),
34  mInitialExpressionValid(false)
35 {
36  setupUi(this);
37 
38  mpComboBoxType->insertItem(mpComboBoxType->count(), FROM_UTF8(CModelEntity::StatusName[CModelEntity::REACTIONS]));
39  mpComboBoxType->insertItem(mpComboBoxType->count(), FROM_UTF8(CModelEntity::StatusName[CModelEntity::FIXED]));
40  mpComboBoxType->insertItem(mpComboBoxType->count(), FROM_UTF8(CModelEntity::StatusName[CModelEntity::ASSIGNMENT]));
41  mpComboBoxType->insertItem(mpComboBoxType->count(), FROM_UTF8(CModelEntity::StatusName[CModelEntity::ODE]));
42 
43  mItemToType.push_back(CModelEntity::REACTIONS);
44  mItemToType.push_back(CModelEntity::FIXED);
45  mItemToType.push_back(CModelEntity::ASSIGNMENT);
46  mItemToType.push_back(CModelEntity::ODE);
47 
48 // assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
49 // int Width = fontMetrics().width("Concentration (" +
50 // FROM_UTF8((*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getConcentrationUnitsDisplayString()) +
51 // ")");
52 //
53 
54 // mpLblValue->setMinimumWidth(Width);
55 
56  mpExpressionEMW->mpExpressionWidget->setExpressionType(CQExpressionWidget::TransientExpression);
57 
58  mpInitialExpressionEMW->mpExpressionWidget->setExpressionType(CQExpressionWidget::InitialExpression);
59 
60  mpReactionTable->verticalHeader()->hide();
61  mpReactionTable->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
62  mpReactionTable->horizontalHeader()->hide();
63  mpReactionTable->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
64 }
65 
67 {
68 }
69 
71 {
72  if ((CModelEntity::Status) mItemToType[mpComboBoxType->currentIndex()] != CModelEntity::FIXED &&
73  (CModelEntity::Status) mItemToType[mpComboBoxType->currentIndex()] != CModelEntity::REACTIONS)
74  {
75  // -- Expression --
76  mpExpressionEMW->updateWidget();
77  }
78 
79  if (mpBoxUseInitialExpression->isChecked())
80  {
81  // -- Initial Expression --
82  mpInitialExpressionEMW->updateWidget();
83  }
84 
85  save();
86 
87  return true;
88 }
89 
91  ListViews::Action action,
92  const std::string & key)
93 {
94  switch (objectType)
95  {
96  case ListViews::MODEL:
97 
98  // For a new model we need to remove references to no longer existing metabolites
99  if (action == ListViews::ADD)
100  {
101  mKey = "";
102  mpObject = NULL;
103  mpMetab = NULL;
104  }
105 
106  break;
107 
109 
110  // If the currently displayed metabolite is deleted we need to remove its references.
111  if (action == ListViews::DELETE && mKey == key)
112  {
113  mKey = "";
114  mpObject = NULL;
115  mpMetab = NULL;
116  }
117 
118  break;
119 
120  case ListViews::STATE:
122  break;
123 
124  default:
125  return true;
126  break;
127  }
128 
129  if (isVisible() && !mIgnoreUpdates)
130  load();
131 
132  return true;
133 }
134 
135 void CQSpeciesDetail::setFramework(int framework)
136 {
137  CopasiWidget::setFramework(framework);
138 
139  const CModel * pModel = NULL;
140 
141  if (mpMetab)
142  pModel = mpMetab->getModel();
143 
144  QString ValueUnits;
145 
146  if (pModel)
147  ValueUnits = FROM_UTF8(pModel->getConcentrationUnitsDisplayString());
148 
149  if (!ValueUnits.isEmpty())
150  ValueUnits = " (" + ValueUnits + ")";
151 
152  QString RateUnits;
153 
154  if (pModel)
155  RateUnits = FROM_UTF8(pModel->getConcentrationRateUnitsDisplayString());
156 
157  if (!RateUnits.isEmpty())
158  RateUnits = " (" + RateUnits + ")";
159 
160  QString FrequencyUnits;
161 
162  if (pModel)
163  FrequencyUnits = FROM_UTF8(pModel->getFrequencyUnitsDisplayString());
164 
165  if (!FrequencyUnits.isEmpty())
166  FrequencyUnits = " (" + FrequencyUnits + ")";
167 
168  switch (mFramework)
169  {
170  case 0:
171  mpLblValue->setText("Concentration" + ValueUnits);
172 
173  if (mpMetab != NULL &&
174  (CModelEntity::Status) mItemToType[mpComboBoxType->currentIndex()] == CModelEntity::ASSIGNMENT)
175  mpLblExpression->setText("Expression" + ValueUnits);
176  else
177  mpLblExpression->setText("Expression" + RateUnits);
178 
179  mpLblRate->setText("Rate" + RateUnits);
180 
181  ValueUnits.replace(0, 1, '\n'); // Line break instead of space
182  mpLblInitialValue->setText("Initial Concentration" + ValueUnits);
183  mpLblInitialExpression->setText("Initial Expression" + ValueUnits);
184 
185  mpEditInitialValue->setText(QString::number(mInitialConcentration, 'g', 10));
186 
187  if (mpMetab != NULL)
188  {
189  mpEditInitialValue->setReadOnly(!mpMetab->isInitialConcentrationChangeAllowed());
190  mpEditCurrentValue->setText(QString::number(mpMetab->getConcentration(), 'g', 10));
191  mpEditRate->setText(QString::number(mpMetab->getConcentrationRate(), 'g', 10));
192  }
193  else
194  {
195  mpEditInitialValue->setReadOnly(false);
196  mpEditCurrentValue->setText("");
197  mpEditRate->setText("");
198  }
199 
200  break;
201 
202  case 1:
203  mpLblInitialValue->setText("Initial Particle Number");
204 
205  ValueUnits.replace(0, 1, '\n'); // Line break instead of space
206  mpLblInitialExpression->setText("Initial Expression" + ValueUnits);
207 
208  if (mpMetab != NULL &&
210  mpLblExpression->setText("Expression" + ValueUnits);
211  else
212  mpLblExpression->setText("Expression" + RateUnits);
213 
214  mpLblValue->setText("Particle Number");
215  mpLblRate->setText("Rate" + FrequencyUnits);
216 
217  mpEditInitialValue->setText(QString::number(mInitialNumber, 'g', 10));
218  mpEditInitialValue->setReadOnly(false);
219 
220  if (mpMetab != NULL)
221  {
222  mpEditCurrentValue->setText(QString::number(mpMetab->getValue(), 'g', 10));
223  mpEditRate->setText(QString::number(mpMetab->getRate(), 'g', 10));
224  }
225  else
226  {
227  mpEditCurrentValue->setText("");
228  mpEditRate->setText("");
229  }
230 
231  break;
232  }
233 }
234 
236 {
237  mpMetab = dynamic_cast< CMetab * >(mpObject);
238 
239  if (!mpMetab)
240  {
241 
243  return false;
244  }
245 
246  load();
247 
248  return true;
249 }
250 
252 {
253  if (mpMetab == NULL) return;
254 
255  const CModel * pModel = NULL;
256 
257  if (mpMetab)
258  pModel = mpMetab->getModel();
259 
260  QString TimeUnits;
261 
262  if (pModel)
263  TimeUnits = FROM_UTF8(pModel->getTimeUnitsDisplayString());
264 
265  if (!TimeUnits.isEmpty())
266  TimeUnits = " (" + TimeUnits + ")";
267 
268  // Update the labels to reflect the model units
269  mpLblTransitionTime->setText("Transition Time " + TimeUnits);
270 
271  // Compartment
272  const CCopasiVectorNS< CCompartment > & Compartments = pModel->getCompartments();
273  const CCompartment * pCompartment;
274  mpComboBoxCompartment->clear();
275 
276  mpComboBoxCompartment->setDuplicatesEnabled(false);
277  size_t m;
278 
279  for (m = 0; m < Compartments.size(); m++)
280  {
281  pCompartment = Compartments[m];
282  mpComboBoxCompartment->insertItem(mpComboBoxCompartment->count(), FROM_UTF8(pCompartment->getObjectName()));
283  }
284 
286  mpComboBoxCompartment->setCurrentIndex(mpComboBoxCompartment->findText(FROM_UTF8(mpCurrentCompartment->getObjectName())));
287 
288  // Simulation Type
289  mpComboBoxType->setCurrentIndex(mpComboBoxType->findText(FROM_UTF8(CModelEntity::StatusName[mpMetab->getStatus()])));
290 
291  // Initial Concentration handled in slotTypeChanged
293 
294  // Initial Number handled in slotTypeChanged
296 
297  // Transition Time
298  mpEditTransitionTime->setText(QString::number(mpMetab->getTransitionTime(), 'g', 10));
299 
300  // Expression
301  mpExpressionEMW->mpExpressionWidget->setExpression(mpMetab->getExpression());
302  mpExpressionEMW->updateWidget();
303 
304  // Initial Expression
305  mpInitialExpressionEMW->mpExpressionWidget->setExpression(mpMetab->getInitialExpression());
306  mpInitialExpressionEMW->updateWidget();
307 
308  // Type dependent display of values
309  slotTypeChanged(mpComboBoxType->currentIndex());
310 
311  // Use Initial Expression
313  mpMetab->getInitialExpression() == "")
314  {
315  mpBoxUseInitialExpression->setChecked(false);
316  // slotInitialTypeChanged(false);
317  }
318  else
319  {
320  mpBoxUseInitialExpression->setChecked(true);
321  // slotInitialTypeChanged(true);
322  }
323 
325 
326  // Update the units and values accordingly
328 
329  mChanged = false;
330  return;
331 }
332 
334 {
335  if (mpMetab == NULL) return;
336 
337  CModel * pModel = const_cast< CModel * >(mpMetab->getModel());
338 
339  if (pModel == NULL) return;
340 
341  // Compartment
343  {
344  QString Compartment = mpComboBoxCompartment->currentText();
345  std::string CompartmentToRemove = mpMetab->getCompartment()->getObjectName();
346 
347  if (!pModel->getCompartments()[TO_UTF8(Compartment)]->addMetabolite(mpMetab))
348  {
349  QString msg;
350  msg = "Unable to move species '" + FROM_UTF8(mpMetab->getObjectName()) + "'\n"
351  + "from compartment '" + FROM_UTF8(CompartmentToRemove) + "' to compartment '" + Compartment + "'\n"
352  + "since a species with that name already exist in the target compartment.";
353 
355  "Unable to move Species",
356  msg,
357  QMessageBox::Ok, QMessageBox::Ok);
358 
359  // Revert the changes
360  mpComboBoxCompartment->setCurrentIndex(mpComboBoxCompartment->findText(FROM_UTF8(CompartmentToRemove)));
361 
362  slotCompartmentChanged(mpComboBoxCompartment->currentIndex());
363  }
364  else
365  {
366  pModel->getCompartments()[CompartmentToRemove]->getMetabolites().remove(mpMetab->getObjectName());
367  pModel->setCompileFlag();
368  pModel->initializeMetabolites();
370  mChanged = true;
371  }
372  }
373 
374  // Type
375  if (mpMetab->getStatus() != (CModelEntity::Status) mItemToType[mpComboBoxType->currentIndex()])
376  {
377  mpMetab->setStatus((CModelEntity::Status) mItemToType[mpComboBoxType->currentIndex()]);
378  mChanged = true;
379  }
380 
381  // Initial Concentration and Initial Number
382  switch (mFramework)
383  {
384  case 0:
385 
387  {
389  mChanged = true;
390  }
391 
392  break;
393 
394  case 1:
395 
397  {
399  mChanged = true;
400  }
401 
402  break;
403  }
404 
405  // Expression
406  if (mpMetab->getExpression() != mpExpressionEMW->mpExpressionWidget->getExpression())
407  {
408  mpMetab->setExpression(mpExpressionEMW->mpExpressionWidget->getExpression());
409  mChanged = true;
410  }
411 
412  // Initial Expression
413  if ((CModelEntity::Status) mItemToType[mpComboBoxType->currentIndex()] != CModelEntity::ASSIGNMENT)
414  {
415  if (mpBoxUseInitialExpression->isChecked() &&
416  mpMetab->getInitialExpression() != (mpInitialExpressionEMW->mpExpressionWidget->getExpression()))
417  {
418  mpMetab->setInitialExpression(mpInitialExpressionEMW->mpExpressionWidget->getExpression());
419  mChanged = true;
420  }
421  else if (!mpBoxUseInitialExpression->isChecked() &&
422  mpMetab->getInitialExpression() != "")
423  {
425  mChanged = true;
426  }
427  }
428 
429  if (mChanged)
430  {
431  if (mpDataModel)
432  mpDataModel->changed();
433 
435  }
436 
437  mChanged = false;
438 }
439 
441 {
442  if (mpMetab == NULL) return;
443 
444  CModel * pModel = const_cast< CModel * >(mpMetab->getModel());
445 
446  if (pModel == NULL) return;
447 
448  std::set< const CCopasiObject * > Reactions;
449  pModel->appendDependentReactions(mpMetab->getDeletedObjects(), Reactions);
450 
451  mpReactionTable->setRowCount((int) Reactions.size());
452 
453  std::set< const CCopasiObject * >::const_iterator it = Reactions.begin();
454  std::set< const CCopasiObject * >::const_iterator end = Reactions.end();
455  int i = 0;
456  const CReaction * pReaction;
457 
458  for (; it != end; ++it, ++i)
459  {
460  pReaction = static_cast< const CReaction * >(*it);
461  mpReactionTable->setItem(i, 0, new QTableWidgetItem(FROM_UTF8(pReaction->getObjectName()) + ":"));
462  mpReactionTable->setItem(i, 1, new QTableWidgetItem(FROM_UTF8(CChemEqInterface::getChemEqString(pModel, *pReaction, false))));
463  }
464 
465  if (i == 0)
466  mpReactionTable->setItem(i, 0, new QTableWidgetItem("none"));
467 
468  // Provide count of reactions, in label.
469  mpLblReactions->setText("Involved in \n" + QString::number(mpReactionTable->rowCount()) + " Reactions");
470 
471  return;
472 }
473 
475 {
476  if (mpMetab == NULL) return;
477 
478  CModel * pModel = const_cast< CModel *>(mpMetab->getModel());
479 
480  if (pModel == NULL) return;
481 
482  QMessageBox::StandardButton choice =
483  CQMessageBox::confirmDelete(this, "species",
486 
487  switch (choice)
488  {
489  case QMessageBox::Ok:
490  {
491  pModel->removeMetabolite(mKey);
492 
493 #undef DELETE
495  protectedNotify(ListViews::METABOLITE, ListViews::DELETE, "");//Refresh all as there may be dependencies.
496  //TODO notify about reactions
497  break;
498  }
499 
500  default:
501  break;
502  }
503 }
504 
506 {
507  if (mpMetab == NULL) return;
508 
509  CModel * pModel = NULL;
510 
511  if (mpMetab) pModel = mpDataModel->getModel();
512 
513  if (pModel == NULL) return; // for getting compartments and initializing cModelExpObj
514 
515  // Create and customize compartment choices dialog
516  CQNameSelectionDialog * pDialog = new CQNameSelectionDialog(this);
517  pDialog->setWindowTitle("Choose a compartment");
518  pDialog->mpLblName->setText("compartment");
519  pDialog->mpSelectionBox->clear();
520  pDialog->mpSelectionBox->setDuplicatesEnabled(false);
521  pDialog->mpSelectionBox->setEditable(false); // at least for now, unless we want to add new compartment creation here.
522 
523  // Use CModelExpansion for duplication
524  CModelExpansion cModelExpObj = CModelExpansion(pModel);
526  CModelExpansion::ElementsMap origToCopyMapping;
527 
528  // for comboBox compartment list and setting compartment
529  CCopasiVectorNS< CCompartment > & Compartments = pModel->getCompartments();
530 
533  QStringList SelectionList;
534 
535  // Collect and load list of compartment names in comboBox
536  for (; it != end; ++it)
537  {
538  SelectionList.append(FROM_UTF8((*it)->getObjectName()));
539  }
540 
541  pDialog->setSelectionList(SelectionList);
542 
543  //Set the current compartment as the default
545  // to use here, and for testing if compartment changed after executing the dialog
546  int origCompartmentIndex = pDialog->mpSelectionBox->findText(FROM_UTF8(mpCurrentCompartment->getObjectName()));
547  pDialog->mpSelectionBox->setCurrentIndex(origCompartmentIndex);
548 
549  it = Compartments.begin(); // Reuse Compartments iterator to set compartment choice
550 
551  if (pDialog->exec() != QDialog::Rejected)
552  {
553  // Put species in different compartment (without name modification) by making
554  // duplicateMetab think the other compartment was duplicated from the original
555  if (origCompartmentIndex != pDialog->mpSelectionBox->currentIndex())
556  {
557  sourceObjects.addCompartment(mpMetab->getCompartment());
558  origToCopyMapping.add(mpMetab->getCompartment(), *(it + pDialog->mpSelectionBox->currentIndex()));
559  }
560 
561  sourceObjects.addMetab(mpMetab);
562  cModelExpObj.duplicateMetab(mpMetab, "_copy", sourceObjects, origToCopyMapping);
563 
568  }
569 
570  pdelete(pDialog);
571 }
572 
574 {
575  leave();
576 
577  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
579  assert(pDataModel != NULL);
580 
581  CModel * pModel = pDataModel->getModel();
582 
583  if (pModel == NULL)
584  return;
585 
586  if (pModel->getCompartments().size() == 0)
587  pModel->createCompartment("compartment");
588 
589  std::string name = "species_1";
590  int i = 1;
591 
592  while (!(mpMetab = pModel->createMetabolite(name, "", 1.0, CModelEntity::REACTIONS)))
593  {
594  i++;
595  name = "species_";
596  name += TO_UTF8(QString::number(i));
597  }
598 
599  switch (mFramework)
600  {
601  case 0:
603  break;
604 
605  case 1:
606  mpMetab->setInitialValue(100.0);
607  break;
608  }
609 
610  std::string key = mpMetab->getKey();
613 }
614 
616 {
617  if (!mpMetab || !mpCurrentCompartment) return;
618 
619  const CModel * pModel = mpMetab->getModel();
620 
621  if (pModel == NULL)
622  return;
623 
624  QString Compartment = mpComboBoxCompartment->itemText(compartment);
625  const CCompartment * pNewCompartment =
626  pModel->getCompartments()[TO_UTF8(Compartment)];
627 
628  if (pNewCompartment == mpCurrentCompartment ||
629  pNewCompartment == NULL) return;
630 
632 
633  if (mFramework == 1)
634  mpEditInitialValue->setText(QString::number(mInitialNumber, 'g', 10));
635 
636  mpCurrentCompartment = pNewCompartment;
637 }
638 
640 {
641  mExpressionValid = valid;
642 }
643 
645 {
646  mInitialExpressionValid = valid;
647 }
648 
649 void CQSpeciesDetail::slotInitialTypeChanged(bool useInitialExpression)
650 {
651  if (useInitialExpression)
652  {
653  mpLblInitialExpression->show();
654  mpInitialExpressionEMW->show();
655 
656  mpEditInitialValue->setEnabled(false);
657  mpInitialExpressionEMW->updateWidget();
658  }
659  else
660  {
661  mpLblInitialExpression->hide();
662  mpInitialExpressionEMW->hide();
663 
664  mpEditInitialValue->setEnabled((CModelEntity::Status) mItemToType[mpComboBoxType->currentIndex()] != CModelEntity::ASSIGNMENT);
665  }
666 }
667 
669 {
670  if (!mpMetab || !mpCurrentCompartment) return;
671 
672  const CModel * pModel = mpMetab->getModel();
673 
674  if (pModel == NULL)
675  return;
676 
677  switch (mFramework)
678  {
679  case 0:
680 
681  if (QString::number(mInitialConcentration, 'g', 10) == mpEditInitialValue->text())
682  return;
683 
684  mInitialConcentration = mpEditInitialValue->text().toDouble();
687  *pModel);
688  break;
689 
690  case 1:
691 
692  if (QString::number(mInitialNumber, 'g', 10) == mpEditInitialValue->text())
693  return;
694 
695  mInitialNumber = mpEditInitialValue->text().toDouble();
698  *pModel);
699  break;
700  }
701 }
702 
704 {}
705 
706 void CQSpeciesDetail::slotSwitchToReaction(int row, int /* column */)
707 {
708  if (mpMetab == NULL) return;
709 
710  const CModel * pModel = mpMetab->getModel();
711 
712  if (pModel == NULL) return;
713 
714  std::set< const CCopasiObject * > Reactions;
715  pModel->appendDependentReactions(mpMetab->getDeletedObjects(), Reactions);
716 
717  std::string s1, s2;
718  s1 = TO_UTF8(mpReactionTable->item(row, 0)->text());
719  s1 = s1.substr(0, s1.length() - 1);
720 
721  C_INT32 i = 0;
722  std::set< const CCopasiObject * >::const_iterator it = Reactions.begin();
723  std::set< const CCopasiObject * >::const_iterator end = Reactions.end();
724  const CReaction * pReaction;
725 
726  for (; it != end; ++it, ++i)
727  {
728  pReaction = static_cast< const CReaction * >(*it);
729  s2 = pReaction->getObjectName();
730 
731  if (s1 == s2)
733  }
734 }
735 
737 {
738  switch ((CModelEntity::Status) mItemToType[type])
739  {
740  case CModelEntity::FIXED:
741  mpLblExpression->hide();
742  mpExpressionEMW->hide();
743 
744  mpBoxUseInitialExpression->setEnabled(true);
745  slotInitialTypeChanged(mpBoxUseInitialExpression->isChecked());
746  break;
747 
749  mpLblExpression->show();
750  mpExpressionEMW->show();
751 
752  mpBoxUseInitialExpression->setEnabled(false);
753  slotInitialTypeChanged(false);
754 
755  mpExpressionEMW->updateWidget();
756  break;
757 
758  case CModelEntity::ODE:
759  mpLblExpression->show();
760  mpExpressionEMW->show();
761 
762  mpBoxUseInitialExpression->setEnabled(true);
763  slotInitialTypeChanged(mpBoxUseInitialExpression->isChecked());
764 
765  mpExpressionEMW->updateWidget();
766  break;
767 
769  mpLblExpression->hide();
770  mpExpressionEMW->hide();
771 
772  mpBoxUseInitialExpression->setEnabled(true);
773  slotInitialTypeChanged(mpBoxUseInitialExpression->isChecked());
774  break;
775 
776  default:
777  break;
778  }
779 
780  // This will update the unit display.
782 }
void setSelectionList(const QStringList &selectionList)
const CCompartment * mpCurrentCompartment
void setInitialConcentration(const C_FLOAT64 &initialConcentration)
Definition: CMetab.cpp:257
void slotSwitchToReaction(int row, int column)
virtual void setFramework(int framework)
#define pdelete(p)
Definition: copasi.h:215
objectType
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
std::string getTimeUnitsDisplayString() const
Definition: CModel.cpp:4531
static const std::string StatusName[]
Definition: CModelValue.h:67
void switchToOtherWidget(const size_t &id, const std::string &key)
Definition: listviews.cpp:926
const C_FLOAT64 & getRate() const
std::string getConcentrationRateUnitsDisplayString() const
Definition: CModel.cpp:4607
const std::string & getObjectName() const
std::string getFrequencyUnitsDisplayString() const
Definition: CModel.cpp:4539
void slotCompartmentChanged(int compartment)
virtual void setStatus(const CModelEntity::Status &status)
Definition: CMetab.cpp:291
double mInitialConcentration
virtual size_t size() const
const C_FLOAT64 & getInitialConcentration() const
Definition: CMetab.cpp:220
bool removeMetabolite(const std::string &key, const bool &recursive=true)
Definition: CModel.cpp:2667
virtual const std::string & getKey() const
Definition: CReaction.cpp:190
iterator begin()
CCopasiObject * mpObject
Definition: copasiWidget.h:64
bool setInitialExpression(const std::string &expression)
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
#define C_INVALID_INDEX
Definition: copasi.h:222
void slotInitialTypeChanged(bool useInitialExpression)
std::string getExpression() const
void changed(const bool &changed=true)
#define C_INT32
Definition: copasi.h:90
void duplicateMetab(const CMetab *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap)
Definition: CMetab.h:178
virtual ~CQSpeciesDetail()
CQSpeciesDetail(QWidget *parent=0, const char *name=0)
bool mIgnoreUpdates
Definition: copasiWidget.h:67
virtual DataObjectSet getDeletedObjects() const
Definition: CMetab.cpp:806
void slotInitialExpressionValid(bool valid)
bool appendDependentReactions(std::set< const CCopasiObject * > candidates, std::set< const CCopasiObject * > &dependents) const
Definition: CModel.cpp:2472
const C_FLOAT64 & getInitialValue() const
virtual bool enterProtected()
iterator end()
ListViews * mpListView
Definition: copasiWidget.h:62
const bool & isInitialConcentrationChangeAllowed() const
Definition: CMetab.cpp:664
virtual bool update(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)
virtual const std::string & getKey() const
static StandardButton confirmDelete(QWidget *parent, const QString &objectType, const QString &objects, const std::set< const CCopasiObject * > &deletedObjects)
const CModel * getModel() const
Definition: CMetab.cpp:224
void add(const CCopasiObject *source, CCopasiObject *copy)
add a source->duplicate mapping
std::string getInitialExpression() const
virtual bool leave()
void initializeMetabolites()
Definition: CModel.cpp:942
std::string getDuplicateKey(const std::string &sourceKey) const
find the key of the duplicated object from the source object (if it exists)
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
std::string getChemEqString(bool expanded) const
static C_FLOAT64 convertToNumber(const C_FLOAT64 &concentration, const CCompartment &compartment, const CModel &model)
Definition: CMetab.cpp:35
virtual bool protectedNotify(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key="")
void setCompileFlag(bool flag=true)
Definition: CModel.cpp:607
virtual void remove(const std::string &name)
CCopasiDataModel * mpDataModel
Definition: copasiWidget.h:65
std::string getConcentrationUnitsDisplayString() const
Definition: CModel.cpp:4587
CCopasiVectorNS< CCompartment > & getCompartments()
Definition: CModel.cpp:1145
const C_FLOAT64 & getValue() const
void addCompartment(const CCompartment *x)
bool mInitialExpressionValid
std::vector< int > mItemToType
#define TO_UTF8(__x)
Definition: qtUtilities.h:74
void slotInitialValueLostFocus()
const C_FLOAT64 & getConcentration() const
Definition: CMetab.cpp:218
virtual void setInitialValue(const C_FLOAT64 &initialValue)
Definition: CModel.h:50
const CModelEntity::Status & getStatus() const
void slotExpressionValid(bool valid)
bool setExpression(const std::string &expression)
const C_FLOAT64 & getTransitionTime() const
Definition: CMetab.cpp:229
C_FLOAT64 getConcentrationRate() const
Definition: CMetab.cpp:870
virtual void setFramework(int framework)
static C_FLOAT64 convertToConcentration(const C_FLOAT64 &number, const CCompartment &compartment, const CModel &model)
Definition: CMetab.cpp:41
std::string mKey
Definition: copasiWidget.h:63
void slotTypeChanged(int type)
const CCompartment * getCompartment() const
Definition: CMetab.cpp:222
CCompartment * createCompartment(const std::string &name, const C_FLOAT64 &volume=1.0)
Definition: CModel.cpp:2698
CMetab * createMetabolite(const std::string &name, const std::string &compartment, const C_FLOAT64 &iconc=1.0, const CModelEntity::Status &status=CModelEntity::REACTIONS)
Definition: CModel.cpp:2622