Skip to content

Commit

Permalink
- Fix build,
Browse files Browse the repository at this point in the history
- Don't use Qt threads with OpenModelicaCompiler shared library.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25699 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Apr 22, 2015
1 parent 5a13db8 commit 6a15f12
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
3 changes: 1 addition & 2 deletions OMNotebook/OMNotebookGUI/OMNotebookGUI.pro
Expand Up @@ -145,7 +145,7 @@ HEADERS += \
FORMS += ImageSizeDlg.ui \
OtherDlg.ui \
searchform.ui
# -------For OMNIorb

win32 {
QMAKE_LFLAGS += -enable-auto-import
DEFINES += IMPORT_INTO=1
Expand All @@ -157,7 +157,6 @@ win32 {
} else {
include(OMNotebook.config)
}
#---------End OMNIorb

LIBS += $${PLOTLIBS} \
$${OMCLIBS}
Expand Down
4 changes: 2 additions & 2 deletions OMNotebook/OMNotebookGUI/cellapplication.cpp
Expand Up @@ -225,8 +225,8 @@ namespace IAEX
{
// 2006-02-27 AF, use environment variable to find DrModelica
// 2006-03-24 AF, First try to find DrModelica.onb, then .nb
QString drmodelica = OmcInteractiveEnvironment::OpenModelicaHome() + "/share/omnotebook/drmodelica/DrModelica.onb";
//QString drmodelica = OmcInteractiveEnvironment::OpenModelicaHome() + "/share/omnotebook/drmodelica/QuickTour/HelloWorld.onb";
//QString drmodelica = OmcInteractiveEnvironment::OpenModelicaHome() + "/share/omnotebook/drmodelica/DrModelica.onb";
QString drmodelica = OmcInteractiveEnvironment::OpenModelicaHome() + "/share/omnotebook/drmodelica/QuickTour/HelloWorld.onb";

if( dir.exists( drmodelica ))
open(drmodelica);
Expand Down
21 changes: 13 additions & 8 deletions OMNotebook/OMNotebookGUI/graphcell.cpp
Expand Up @@ -1440,23 +1440,28 @@ namespace IAEX {
// the commands should be sent to OMC in the same sequence
// they appear in the notebook, otherwise a simulate command
// might finish later than a plot!
EvalThread* et = new EvalThread(getDelegate(), expr);
connect(et, SIGNAL(finished()), this, SLOT(delegateFinished()));
et->start();

/*! @todo we can't use Qt threads with OpenModelica shared library. Use pthreads here.
* for now just call it without threads.
*/
// EvalThread* et = new EvalThread(getDelegate(), expr);
// connect(et, SIGNAL(finished()), this, SLOT(delegateFinished()));
// et->start();
getDelegate()->evalExpression(expr);
delegateFinished(getDelegate());
}

input_->blockSignals(false);
output_->blockSignals(false);
}
}

void GraphCell::delegateFinished()
void GraphCell::delegateFinished(InputCellDelegate *delegate)
{
EvalThread* et = static_cast<EvalThread*>(sender());
QString res = et->getResult();
QString error = et->getError();
QString res = delegate->getResult();
QString error = delegate->getError();

delete sender();
//delete sender();
guard->unlock();

if( res.isEmpty() && (error.isEmpty() || error.size() == 0) )
Expand Down
2 changes: 1 addition & 1 deletion OMNotebook/OMNotebookGUI/graphcell.h
Expand Up @@ -131,7 +131,7 @@ namespace IAEX
void setExpr(QString);
void showVariableButton(bool);

void delegateFinished();
void delegateFinished(InputCellDelegate *delegate);
void setState(int state);

protected:
Expand Down

0 comments on commit 6a15f12

Please sign in to comment.