Opened 6 years ago

Closed 6 years ago

#5251 closed defect (fixed)

OMEdit on Ubuntu 16.04 LTS does not open the plotting perspective after simulation

Reported by: Adrian Pop Owned by: Adeel Asghar
Priority: blocker Milestone: 1.13.0
Component: OMEdit Version: v1.14.0-dev-nightly
Keywords: Cc:

Description

See the discussion on:
https://stackoverflow.com/questions/53787681/openmodelica-no-output-variables-or-solution-file

Simulation finishes fine but after that the result file is not read and the plotting perspective is not activated.

Tested this with 1.14.0-dev on build.openmodelica.org.

Change History (7)

comment:1 by Adrian Pop, 6 years ago

This fails miserably on Ubuntu 16.04 LTS:

  if (regExp.indexIn(simulationOptions.getFullResultFileName()) != -1 &&
      resultFileInfo.exists() && resultFileLastModifiedDateTime <= resultFileInfo.lastModified() &&
      MainWindow::instance()->getOMCProxy()->readSimulationResultSize(resultFileInfo.absoluteFilePath()) > 0) {

I assume is the new addition with the time check.

comment:2 by Adrian Pop, 6 years ago

1727      resultFileInfo.setCaching(false);
(gdb)
1728      QRegExp regExp("\\b(mat|plt|csv)\\b");
(gdb)
1732      QDateTime resultFileModificationTime = resultFileInfo.lastModified();
(gdb)
1734      bool resultFileKnown = regExp.indexIn(simulationOptions.getFullResultFileName()) != -1;
(gdb)
1735      bool resultFileExists = resultFileInfo.exists();
(gdb)
1736      bool resultFileNewer = resultFileLastModifiedDateTime <= resultFileModificationTime;
(gdb)
1737      bool resultFileNonZeroSize = MainWindow::instance()->getOMCProxy()->readSimulationResultSize(resultFileInfo.absoluteFilePath()) > 0;
(gdb)
1739      const char *timeBefore = resultFileLastModifiedDateTime.toString("hh:mm:ss:zzz").toStdString().c_str();
(gdb)
1740      const char *after = resultFileModificationTime.toString("hh:mm:ss:zzz").toStdString().c_str();
(gdb)
1742      if (resultFileKnown && resultFileExists &&  resultFileNewer && resultFileNonZeroSize)
(gdb) p timeBefore
$1 = 0x7fffffffd8f0 "04:10:34:329"
(gdb) p after
$2 = 0x7fffffffd8b8 "04:10:34:000"

And there you have it, resultFileInfo.lastModified() truncates to seconds, QDateTime::currentDateTime() does not and you actually get a false for resultFileNewer :)

comment:3 by Adrian Pop, 6 years ago

Should be fixed by PR: https://github.com/OpenModelica/OMEdit/pull/197.
@adeas31: please have a look.

comment:4 by Adrian Pop, 6 years ago

Resolution: fixed
Status: newclosed

comment:5 by Adrian Pop, 6 years ago

Resolution: fixed
Status: closedreopened

I'll keep it open until @adeas31 has a quick look and if is fine we should port it to maintenance/v1.13 branch.

in reply to:  5 comment:6 by Francesco Casella, 6 years ago

Priority: highblocker

Replying to adrpo:

I'll keep it open until @adeas31 has a quick look and if is fine we should port it to maintenance/v1.13 branch.

Marked it as blocker so we don't forget about it

comment:7 by Adeel Asghar, 6 years ago

Resolution: fixed
Status: reopenedclosed

Looks good. Ported it to maintenance/v1.13.

Note: See TracTickets for help on using tickets.