Skip to content

Commit

Permalink
Bug 3231: Changed value to CRegisteredCommonName for parameter "Object "
Browse files Browse the repository at this point in the history
  • Loading branch information
shoops committed May 4, 2024
1 parent 2296fd2 commit ecd5970
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
8 changes: 4 additions & 4 deletions copasi/UI/CScanWidgetRandom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void CScanWidgetRandom::load(const CCopasiParameterGroup * pItem)
if (mpData->getValue< unsigned C_INT32 >("Type") != CScanProblem::SCAN_RANDOM)
return;

const std::string String = mpData->getValue< std::string >("Object");
const std::string String = mpData->getValue< CRegisteredCommonName >("Object");

if (String == "")
mpObject = NULL;
Expand All @@ -188,7 +188,7 @@ void CScanWidgetRandom::load(const CCopasiParameterGroup * pItem)
if (mpObject)
lineEditObject->setText(FROM_UTF8(mpObject->getObjectDisplayName()));
else
lineEditObject->setText("");
lineEditObject->setText("Not Found");

comboBoxType->setCurrentIndex(mpData->getValue< unsigned C_INT32 >("Distribution type"));
changeType();
Expand All @@ -211,11 +211,11 @@ bool CScanWidgetRandom::save(CCopasiParameterGroup * pItem) const

if (mpObject != NULL)
{
mpData->setValue("Object", mpObject->getStringCN());
mpData->setValue("Object", mpObject->getCN());
}
else
{
mpData->setValue("Object", std::string(""));
mpData->setValue("Object", CRegisteredCommonName());
}

if (pItem != NULL)
Expand Down
8 changes: 4 additions & 4 deletions copasi/UI/CScanWidgetScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void CScanWidgetScan::load(const CCopasiParameterGroup * pItem)
slotIntervalsChecked();

lineEditNumber->setText(QString::number(mpData->getValue< C_INT32 >("Number of steps")));
std::string tmpString = mpData->getValue< std::string >("Object");
std::string tmpString = mpData->getValue< CRegisteredCommonName >("Object");

if (tmpString == "")
mpObject = NULL;
Expand All @@ -217,7 +217,7 @@ void CScanWidgetScan::load(const CCopasiParameterGroup * pItem)
if (mpObject)
lineEditObject->setText(FROM_UTF8(mpObject->getObjectDisplayName()));
else
lineEditObject->setText("");
lineEditObject->setText("Not Found");

lineEditMin->setText(convertToQString(mpData->getValue< C_FLOAT64 >("Minimum")));
lineEditMax->setText(convertToQString(mpData->getValue< C_FLOAT64 >("Maximum")));
Expand All @@ -237,11 +237,11 @@ bool CScanWidgetScan::save(CCopasiParameterGroup * pItem) const

if (mpObject != NULL)
{
mpData->setValue("Object", mpObject->getStringCN());
mpData->setValue("Object", mpObject->getCN());
}
else
{
mpData->setValue("Object", std::string(""));
mpData->setValue("Object", CRegisteredCommonName());
}

if (!mpData->getParameter("Values"))
Expand Down
8 changes: 4 additions & 4 deletions copasi/scan/CScanMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ CScanItem::CScanItem(CCopasiParameterGroup* si):

if (pProblem != NULL)
{
mpObject = pProblem->getMathContainer()->getObject(si->getValue< CCommonName >("Object"));
mpObject = pProblem->getMathContainer()->getObject(si->getValue< CRegisteredCommonName >("Object"));
}

if (mpObject != NULL)
Expand Down Expand Up @@ -716,8 +716,8 @@ CScanItemParameterSet::CScanItemParameterSet(CCopasiParameterGroup * si)
if (!parameter)
continue;

auto cn = parameter->getValue<CCommonName>();
auto* pSet = dynamic_cast<const CModelParameterSet*>(dm->getObjectFromCN(cn));
auto cn = parameter->getValue< CRegisteredCommonName >();
auto* pSet = dynamic_cast< const CModelParameterSet * >(dm->getObjectFromCN(cn));

if (!pSet)
continue;
Expand All @@ -733,7 +733,7 @@ void CScanItemParameterSet::step()
mFlagFinished = true;
else
{
auto* pSet = const_cast<CModelParameterSet* >(mSets[mIndex]);
auto* pSet = const_cast< CModelParameterSet * >(mSets[mIndex]);
pSet->updateModel();
}

Expand Down
6 changes: 5 additions & 1 deletion copasi/xml/parser/ParameterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ CXMLHandler * ParameterHandler::processStart(const XML_Char * pszName,
break;

case CCopasiParameter::Type::CN:
mpData->pCurrentParameter->setValue(CRegisteredCommonName(sValue, mpData->pDataModel));
if (sValue.empty())
mpData->pCurrentParameter->setValue(CRegisteredCommonName());
else
mpData->pCurrentParameter->setValue(CRegisteredCommonName(sValue, mpData->pDataModel));

break;

default:
Expand Down

0 comments on commit ecd5970

Please sign in to comment.