Changeset 13954


Ignore:
Timestamp:
2012-11-19T02:05:30+01:00 (11 years ago)
Author:
hubert.thieriot
Message:
  • small omc function call improvment
Location:
trunk/OMOptim
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/OMOptim/Core/OMC/MOomc.cpp

    r13809 r13954  
    443443    InfoSender::instance()->sendNormal("Instantiating model "+modelName);
    444444    QString flatcmd = "instantiateModel("+modelName+")";
    445     QString flattened = evalCommand(flatcmd);
    446 
     445    QString errorString;
     446    QString flattened = evalCommand(flatcmd,errorString);
     447
     448    if(flattened=="\"\"")
     449        flattened.clear();
     450
     451    if(!errorString.isEmpty() && !flattened.isEmpty())
     452        InfoSender::instance()->sendWarning("Instantiating model warned ["+modelName+"]");
     453    else  if(!errorString.isEmpty() && flattened.isEmpty())
     454        InfoSender::instance()->sendError("Instantiating model failed ["+modelName+"]");
     455    else
     456        InfoSender::instance()->sendNormal("Instantiating model successful ["+modelName+"]");
    447457
    448458    return flattened;
  • trunk/OMOptim/GUI/Widgets/WidgetModelsList.cpp

    r12619 r13954  
    7979void WidgetModelsList::addModels(QStringList list)
    8080{
    81 
     81    bool addedOk;
    8282    for(int i=0;i<list.size();i++)
    8383    {
    84         if(!_problem->models().contains(list.at(i)))
    85         {
    86             _ui->filesList->addItem(list.at(i));
    87             _problem->addModel(list.at(i));
    88         }
     84        _problem->addModel(list.at(i));
    8985    }
    9086}
Note: See TracChangeset for help on using the changeset viewer.