21#include "SALOME_ResourcesManager.hxx"
22#include "SALOME_LifeCycleCORBA.hxx"
33#include "ServiceUnreachable.hxx"
35#include "SALOME_ModuleCatalog.hxx"
36#include "SALOME_ModuleCatalog.hh"
37#include "SALOMEDS_Tool.hxx"
72#define WEXITSTATUS(w) ((int) ((w) & 0x40000000))
97 srand((
unsigned)time(0));
101 string iconPath = getenv(
"YACS_ROOT_DIR");
102 iconPath +=
"/share/salome/resources/yacs";
104 QDir::addSearchPath(
"icons", iconPath.c_str());
120 CORBA::Object_ptr obj = namingService.
Resolve(
"/Kernel/ModulCatalog");
121 SALOME_ModuleCatalog::ModuleCatalog_var aModuleCatalog =
122 SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj);
123 if (! CORBA::is_nil(aModuleCatalog))
125 DEBTRACE(
"SALOME_ModuleCatalog::ModuleCatalog found");
126 std::string anIOR =
orb->object_to_string( aModuleCatalog );
130 std::map< std::string, YACS::ENGINE::ComponentDefinition * >::iterator it;
133 DEBTRACE(
"Component: " <<(*it).first);
136 std::map< std::string, YACS::ENGINE::TypeCode*>::iterator it;
140 <<
" " << (*it).second->getKindRepr()
141 <<
" " << (*it).second->name()
142 <<
" " << (*it).second->shortName()
143 <<
" " << (*it).second->id() );
149 catch(ServiceUnreachable& e)
156 _dwTree->setWindowTitle(
"Tree View: edition mode");
157 _dwTree->setObjectName(
"yacsTreeViewDock");
162 _dwStacked->setObjectName(
"yacsInputPanelDock");
203 tr(
"New Schema"), tr(
"Create a new YACS Schema"),
205 _newSchemaAct->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_N);
208 tr(
"Import Schema"), tr(
"Import a YACS Schema for edition"),
213 tr(
"Import SUPERV Schema"), tr(
"Import a SUPERV Schema for edition"),
217 tr(
"Save Schema"), tr(
"Save the current YACS Schema"),
222 tr(
"Save Schema As"), tr(
"Save the current YACS Schema As..."),
227 tr(
"Import Catalog"), tr(
"Import a Schema as a Catalog"),
232 tr(
"Run Current Schema"), tr(
"Prepare the current edited schema for run"),
236 tr(
"Load Run State"), tr(
"Load a previous run state for this schema, prepare to run"),
240 tr(
"Load Schema to run"), tr(
"Load a schema for run"),
244 tr(
"Choose Batch Job to watch"), tr(
"Choose Batch Job to watch"),
248 tr(
"Start/Resume execution"), tr(
"Start or Resume Schema execution"),
252 tr(
"Abort execution"), tr(
"Abort the current execution"),
256 tr(
"Suspend execution"), tr(
"Suspend the current execution"),
260 tr(
"Restart execution"), tr(
"Restart the current execution with reset of error nodes"),
265 tr(
"Save State"), tr(
"Save the current run state"),
269 tr(
"Edit Again"), tr(
"Edit again the current schema in a new context"),
274 tr(
"YACS Container Log"), tr(
"get YACS container log"),
278 tr(
"Node Error Report"), tr(
"get Node Error Report"),
282 tr(
"Node Error Details"), tr(
"get Node Error Details"),
286 tr(
"Node Container Log"), tr(
"get Node Container Log"),
290 tr(
"Shutdown Proc"), tr(
"Shutdown Proc"),
295 tr(
"Edit Data Types"), tr(
"Edit Data Types"),
299 tr(
"Create Data Types"), tr(
"Create Data Types"),
303 tr(
"Import Data Types"), tr(
"Import Data Types, use drag and drop from catalog"),
307 tr(
"Create Container"), tr(
"Create a New Container"),
311 tr(
"Create HP Container"), tr(
"Create a New Homogeneous Pool Container."),
315 tr(
"Select a Component Instance"), tr(
"Select a Component Instance"),
319 tr(
"Create Component Instance"), tr(
"Create a New SALOME Component Instance"),
323 tr(
"SALOME Python Component"), tr(
"Create a New SALOME Python Component"),
327 tr(
"CORBA Component"), tr(
"Create a New CORBA Component"),
331 tr(
"SALOME Service Node"), tr(
"Create a New SALOME Service Node"),
335 tr(
"Inline Service Node"), tr(
"Create a New Inline Service Node"),
339 tr(
"CORBA Node"), tr(
"Create a New CORBA Service Node"),
343 tr(
"Ref on Node"), tr(
"Create a New Node referencing a Node"),
347 tr(
"Cpp Node"), tr(
"Create a New C++ Node"),
351 tr(
"Input Data Node"), tr(
"Create a New Input data Node"),
355 tr(
"Output Data Node"), tr(
"Create a New Output data Node"),
359 tr(
"Input Study Node"), tr(
"Create a New Input Study Node"),
363 tr(
"Output Study Node"), tr(
"Create a New Output Study Node"),
367 tr(
"Inline Script Node"), tr(
"Create a New Inline Python Script Node"),
371 tr(
"Inline Function Node"), tr(
"Create a New Inline Python Function Node"),
375 tr(
"bloc Node"), tr(
"Create a New Bloc Node"),
379 tr(
"For Loop Node"), tr(
"Create a New For Loop Node"),
383 tr(
"For Each Loop Node"), tr(
"Create a New For Each Loop Node"),
387 tr(
"While Loop Node"), tr(
"Create a New While Loop Node"),
391 tr(
"Switch Node"), tr(
"Create a New Switch Node"),
395 tr(
"Optimizer Loop"), tr(
"Create a New Optimizer Loop"),
399 tr(
"Node from Catalog"), tr(
"Create a New Node from Catalog, use drag and drop from catalog"),
403 tr(
"Delete Item"), tr(
"Delete a Schema Item"),
408 tr(
"Cut Item"), tr(
"Cut a Schema Item"),
413 tr(
"Copy Item"), tr(
"Copy a Schema Item"),
418 tr(
"Paste Item"), tr(
"Paste a Schema Item"),
423 tr(
"Put node in block"), tr(
"Put node in block"),
427 tr(
"Bloc"), tr(
"Bloc"),
431 tr(
"For Loop"), tr(
"For Loop"),
435 tr(
"While Loop"), tr(
"While Loop"),
439 tr(
"Optimizer Loop"), tr(
"Optimizer Loop"),
443 tr(
"arrange local nodes"), tr(
"arrange nodes on that bloc level, without recursion"),
447 tr(
"arrange nodes recursion"), tr(
"arrange nodes on that bloc level, with recursion"),
451 tr(
"compute links"), tr(
"compute orthogonal links"),
455 tr(
"zoom to bloc"), tr(
"zoom 2D view to the selected composed node"),
459 tr(
"center on node"), tr(
"center 2D view on selected node"),
464 tr(
"shrink/expand"), tr(
"shrink or expand the selected node"),
468 tr(
"shrink/expand children"), tr(
"shrink or expand direct children of the selected node"),
472 tr(
"shrink/expand elementary"), tr(
"shrink or expand elementary nodes of the selected node recursively"),
476 tr(
"straight/orthogonal"), tr(
"draw straight or orthogonal links"),
483 tr(
"automatic link"), tr(
"compute othogonal links automatically when nodes move"),
490 tr(
"simplify links"), tr(
"simplify links by removing unnecessary direction changes"),
496 tr(
"force ortho links"), tr(
"force orthogonal links by adding an edge on simples links"),
501 tr(
"separate links"), tr(
"allow more path for the links, for a better separation"),
507 tr(
"select reference"), tr(
"select reference"),
511 tr(
"whatsThis Mode"), tr(
"active whatsThis Mode to get help on widgets"),
516 tr(
"mode without stop"), tr(
"set execution mode without stop"),
520 tr(
"mode breakpoints"), tr(
"set execution mode with stop on breakpoints"),
524 tr(
"mode step by step"), tr(
"set execution mode step by step"),
528 tr(
"stop on error"), tr(
"Force stop on first error during execution"),
532 tr(
"visible/hidden"), tr(
"toggle 2D scene item visibility"),
538 tr(
"show all links"), tr(
"Show all the links"),
542 tr(
"hide all links"), tr(
"Hide all the links"),
547 tr(
"show only links"), tr(
"Show only links from/to this port"),
551 tr(
"show links"), tr(
"Show links from/to this port"),
555 tr(
"hide links"), tr(
"Hide links from/to this port"),
560 tr(
"show only Control links"), tr(
"Show only control links from/to this node"),
564 tr(
"show control links"), tr(
"Show control links from/to this node"),
568 tr(
"hide control links"), tr(
"Hide control links from/to this node"),
573 tr(
"show only"), tr(
"Show only this link"),
577 tr(
"show"), tr(
"Show this link"),
581 tr(
"hide"), tr(
"Hide this link"),
586 tr(
"emphasize links"), tr(
"emphasis on links from/to this port"),
590 tr(
"emphasize control links"), tr(
"emphasis on control links from/to this node"),
594 tr(
"emphasize"), tr(
"emphasis on this link"),
598 tr(
"remove all emphasis"), tr(
"remove all emphasis"),
603 tr(
"undo"), tr(
"undo last action"),
605 _undoAct->setShortcut(QKeySequence::Undo);
608 tr(
"redo"), tr(
"redo last action"),
610 _redoAct->setShortcut(QKeySequence::Redo);
613 tr(
"show undo"), tr(
"show undo commands"),
617 tr(
"show redo"), tr(
"show redo commands"),
685 int aToolId =
_wrapper->
createTool ( tr(
"YACS Toolbar" ), QString(
"YACSToolbar" ) );
745 DEBTRACE(
"GenericGui::showBaseMenus " << show);
761 DEBTRACE(
"GenericGui::showEditionMenus " << show);
782 DEBTRACE(
"GenericGui::showExecMenus " << show);
807 DEBTRACE(
"GenericGui::showCommonMenus " << show);
826 DEBTRACE(
"GenericGui::switchContext " << view);
858 if (
_dwTree)
_dwTree->setWindowTitle(
"Tree View: execution mode");
865 DEBTRACE(
"GenericGui::closeContext " << onExit);
871 bool tryToSave =
false;
878 msgBox.setText(
"Some elements are modified and not taken into account.");
879 string info =
"do you want to apply your changes ?\n";
880 info +=
" - Save : do not take into account edition in progress,\n";
881 info +=
" but if there are other modifications, select a file name for save\n";
882 info +=
" - Discard : discard all modifications and close the schema";
884 info +=
"\n - Cancel : do not close the schema, return to edition";
885 msgBox.setInformativeText(info.c_str());
888 msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
889 msgBox.setDefaultButton(QMessageBox::Cancel);
893 msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard);
894 msgBox.setDefaultButton(QMessageBox::Save);
896 int ret = msgBox.exec();
899 case QMessageBox::Save:
902 case QMessageBox::Discard:
905 case QMessageBox::Cancel:
916 msgBox.setWindowTitle(
"Close the active schema");
917 msgBox.setText(
"The schema has been modified");
918 string info =
"do you want to save the schema ?\n";
919 info +=
" - Save : select a file name for save\n";
920 info +=
" - Discard : discard all modifications and close the schema";
922 info +=
"\n - Cancel : do not close the schema, return to edition";
923 msgBox.setInformativeText(info.c_str());
926 msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
927 msgBox.setDefaultButton(QMessageBox::Cancel);
931 msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard);
932 msgBox.setDefaultButton(QMessageBox::Save);
934 int ret = msgBox.exec();
937 case QMessageBox::Save:
940 case QMessageBox::Discard:
943 case QMessageBox::Cancel:
959 map<QWidget*, YACS::HMI::QtGuiContext*>::iterator it =
_mapViewContext.begin();
964 if ((*it).second != context)
966 newView = (*it).first;
967 newContext = (*it).second;
975 exec->closeContext();
985 DEBTRACE(
"GenericGui::showDockWidgets " << isVisible);
1008 SALOME_LifeCycleCORBA lcc(&namingService);
1010 CORBA::Object_var obj =
1011 namingService.
Resolve(SALOME_ResourcesManager::_ResourcesManagerNameInNS);
1014 Engines::ResourcesManager_var resManager = Engines::ResourcesManager::_narrow(obj);
1017 Engines::ResourceParameters params;
1020 Engines::ResourceList* resourceList =
1021 resManager->GetFittingResources(params);
1023 for (
int i = 0;
i < resourceList->length();
i++)
1025 const char* aResource = (*resourceList)[
i];
1044 const QString& schemaName,
1045 const QString& runName,
1048 DEBTRACE(
"GenericGui::createContext");
1056 central->setFocus();
1064 fileName = schemaName;
1089 gView->setScene(scene);
1090 gView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
1107 editTree->setMinimumHeight(400);
1111 editTree->tv_schema->setModel(schemaModel);
1115 QObject::connect(editTree->tv_schema->selectionModel(),
1116 SIGNAL(selectionChanged(
const QItemSelection &,
const QItemSelection &)),
1118 SLOT(updateSelection(
const QItemSelection &,
const QItemSelection &)));
1122 QStackedWidget *stacked =
new QStackedWidget(
_dwStacked);
1130 QObject::connect(schemaModel,
1131 SIGNAL(signalSelection(
const QModelIndex &)),
1132 editTree->tv_schema,
1133 SLOT(viewSelection(
const QModelIndex &)));
1141 double passe = (end_t -start_t);
1142 passe = passe/CLOCKS_PER_SEC;
1143 DEBTRACE(
"create context -1- : " << passe);
1154 double passe = (end_t -start_t);
1155 passe = passe/CLOCKS_PER_SEC;
1156 DEBTRACE(
"create context - load proc- : " << passe);
1184 editTree->setMinimumHeight(40);
1201 if (
_dwTree)
_dwTree->setWindowTitle(
"Tree View: execution mode");
1207 double passe = (end_t -start_t);
1208 passe = passe/CLOCKS_PER_SEC;
1209 DEBTRACE(
"create context - end - : " << passe);
1218 DEBTRACE(
"GenericGui::setLoadedPresentation");
1220 map<SceneNodeItem*, QPointF> nodesToMove;
1222 if (!presNodes.empty())
1224 map<YACS::ENGINE::Node*, PrsData>::iterator it = presNodes.begin();
1225 for (; it!= presNodes.end(); ++it)
1234 inode->setPos(QPointF(pres.
_x, pres.
_y));
1238 QPointF anExpandedPos = QPointF(pres.
_expx, pres.
_expy);
1239 if (anExpandedPos.isNull())
1240 anExpandedPos = inode->pos();
1247 qreal anX = inode->x();
1248 qreal anY = inode->y();
1253 if (anY < inode->getParent()->getHeaderBottom())
1263 map<SceneNodeItem*, QPointF>::iterator it = nodesToMove.begin();
1264 for (; it!= nodesToMove.end(); ++it)
1266 (*it).first->setTopLeft((*it).second);
1285 DEBTRACE(
"GenericGui::onNewSchema");
1287 std::stringstream name;
1295 QString fileName = name.str().c_str();
1309 QString fn=QString::fromUtf8(filename.c_str());
1314 if (arrangeLocalNodes)
1325 DEBTRACE(
"GenericGui::onImportSchema");
1327 "Choose a filename to load" ,
1329 tr(
"XML-Files (*.xml);;All Files (*)" ));
1334 QStringList fileNames;
1337 fileNames = dialog.selectedFiles();
1338 if (!fileNames.isEmpty())
1339 fn = fileNames.first();
1342 if ( !fn.isEmpty() )
1346 if (!fi.exists() && fi.suffix() !=
"xml")
1349 DEBTRACE(
"file loaded : " <<fn.toUtf8().constData());
1360 double passe = (end_t -start_t);
1361 passe = passe/CLOCKS_PER_SEC;
1362 DEBTRACE(
"load xml file : " << passe);
1368 QMessageBox msgBox(QMessageBox::Critical,
1369 "Import YACS Schema, native YACS XML format",
1370 "The file has not the native YACS XML format or is not readable.");
1385 DEBTRACE(
"GenericGui::onImportSupervSchema");
1387 "Choose a SUPERV filename to load" ,
1389 tr(
"XML-Files (*.xml);;All Files (*)" ));
1394 QStringList fileNames;
1397 fileNames = dialog.selectedFiles();
1398 if (!fileNames.isEmpty())
1399 fn = fileNames.first();
1402 if (fn.isEmpty())
return;
1406 if (!fi.exists() && fi.suffix() !=
"xml")
1409 DEBTRACE(
"file loaded : " <<fn.toStdString());
1410 QString tmpFileName;
1414 QString tmpDir = getenv(
"TEMP");
1415 QString fileExt =
"bat";
1417 QString tmpDir =
"/tmp";
1418 QString fileExt =
"sh";
1420 QDir aTmpDir(tmpDir);
1421 aTmpDir.mkdir(QString(
"YACS_") + getenv(
"USER"));
1422 YASSERT(aTmpDir.cd(QString(
"YACS_") + getenv(
"USER")));
1423 QDateTime curTime = QDateTime::currentDateTime();
1424 tmpFileName =
"SUPERV_import_" + curTime.toString(
"yyyyMMdd_hhmmss") +
".xml";
1425 QString tmpOutput =
"salomeloader_output";
1426 tmpFileName = aTmpDir.absoluteFilePath(tmpFileName);
1427 DEBTRACE(tmpFileName.toStdString());
1429 QString aCall =
"salomeloader."+ fileExt+
" "+ fn +
" " + tmpFileName +
" > " + tmpOutput;
1432 int ret = system(aCall.toLatin1());
1436 fstream
f(tmpOutput.toLatin1());
1442 int status=WEXITSTATUS(ret);
1445 QString mes =
"Problems in conversion: some errors but an incomplete proc has nevertheless been created.\n\n";
1446 mes += QString(hfile.str().c_str());
1447 QMessageBox msgBox(QMessageBox::Warning,
1448 "Import YACS Schema, SUPERV XML format",
1452 else if(status == 2)
1454 QString mes =
"Problems in conversion: a fatal error has been encountered. The proc can't be created.\n\n";
1455 mes += QString(hfile.str().c_str());
1456 QMessageBox msgBox(QMessageBox::Critical,
1457 "Import YACS Schema, SUPERV XML format",
1464 DEBTRACE(
"Unknown problem: " << ret );
1465 QMessageBox msgBox(QMessageBox::Critical,
1466 "Import YACS Schema, SUPERV XML format",
1467 "Unexpected exception in salomeloader.");
1475 QMessageBox msgBox(QMessageBox::Critical,
1476 "Import YACS Schema, SUPERV XML format",
1477 "Unexpected exception in convertSupervFile");
1483 if (fn.isEmpty())
return;
1485 DEBTRACE(
"file loaded : " <<fn.toStdString());
1489 QMessageBox msgBox(QMessageBox::Critical,
1490 "Import YACS Schema, SUPERV file converted in native YACS XML format",
1491 "The file has not the native YACS XML format or is not readable.");
1506 QFileDialog dialog(
_parent,
"Save schema", fileName);
1507 QStringList filters;
1508 filters <<
"XML files (*.xml)"
1510 dialog.setFileMode(QFileDialog::AnyFile);
1511 dialog.setNameFilters(filters);
1512 dialog.selectNameFilter(
"(*.xml)");
1513 dialog.setDefaultSuffix(
"xml");
1514 dialog.setConfirmOverwrite(
true);
1516 dialog.setAcceptMode(QFileDialog::AcceptSave);
1517 QString selectedFile;
1518 QStringList fileNames;
1520 if (
bool ret = dialog.exec())
1522 DEBTRACE(ret <<
" " << dialog.confirmOverwrite());
1523 fileNames = dialog.selectedFiles();
1524 if (!fileNames.isEmpty())
1525 selectedFile = fileNames.first();
1528 DEBTRACE(filteredName.toStdString());
1529 return filteredName;
1534 DEBTRACE(
"GenericGui::onExportSchema");
1540 if (fo.startsWith(
"newSchema_"))
1545 if (fn.isEmpty())
return;
1547 DEBTRACE(
"GenericGui::onExportSchema: " << fn.toUtf8().constData());
1563 DEBTRACE(
"GenericGui::onExportSchemaAs");
1569 if (fo.startsWith(
"newSchema_")) fo.clear();
1571 if (fn.isEmpty())
return;
1573 DEBTRACE(
"GenericGui::onExportSchemaAs: " << fn.toUtf8().constData());
1588 DEBTRACE(
"GenericGui::onImportCatalog");
1590 "Choose a YACS Schema to load as a Catalog" ,
1592 tr(
"XML-Files (*.xml);;All Files (*)" ));
1597 QStringList fileNames;
1600 fileNames = dialog.selectedFiles();
1601 if (!fileNames.isEmpty())
1602 fn = fileNames.first();
1605 if ( !fn.isEmpty() )
1611 DEBTRACE(
"GenericGui::onRunLoadedSchema");
1623 (*it)->select(
true);
1649 double passe = (end_t -start_t);
1650 passe = passe/CLOCKS_PER_SEC;
1651 cerr <<
"run schema -1- : " << passe << endl;
1657 QString procName = fo.baseName();
1660 QString tmpDir = getenv(
"TEMP");
1662 QString tmpDir =
"/tmp";
1664 QDir aTmpDir(tmpDir);
1665 aTmpDir.mkdir(QString(
"YACS_") + getenv(
"USER"));
1666 YASSERT(aTmpDir.cd(QString(
"YACS_") + getenv(
"USER")));
1667 QDateTime curTime = QDateTime::currentDateTime();
1668 QString aRunName = procName +
"_" + curTime.toString(
"yyyyMMdd_hhmmss") +
".xml";
1669 aRunName = aTmpDir.absoluteFilePath(aRunName);
1682 double passe = (end_t -start_t);
1683 passe = passe/CLOCKS_PER_SEC;
1684 cerr <<
"run schema -2- : " << passe << endl;
1692 if (!executor)
return;
1695 QString fn = QFileDialog::getOpenFileName(
_parent,
1696 "Choose a previous run state to load" ,
1698 tr(
"XML-Files (*.xml);;All Files (*)" ));
1701 DEBTRACE(
"run state to load: " <<fn.toStdString());
1712 DEBTRACE(
"GenericGui::onLoadRunStateSchema");
1718 DEBTRACE(
"GenericGui::onLoadAndRunSchema");
1719 QString fn = QFileDialog::getOpenFileName(
_parent,
1720 "Choose a filename to load" ,
1722 tr(
"XML-Files (*.xml);;All Files (*)" ));
1723 if ( !fn.isEmpty() )
1727 if (!fi.exists() && fi.suffix() !=
"xml")
1730 DEBTRACE(
"file loaded : " <<fn.toStdString());
1741 QMessageBox msgBox(QMessageBox::Critical,
1742 "Import YACS Schema, native YACS XML format",
1743 "The file has not the native YACS XML format or is not readable.");
1758 DEBTRACE(
"GenericGui::onChooseBatchJob");
1771 DEBTRACE(
"GenericGui::onStartResume");
1803 DEBTRACE(
"GenericGui::onSaveRunState");
1806 QDateTime curTime = QDateTime::currentDateTime();
1808 QString stateName = procName.baseName();
1810 stateName +=
"_state_" + curTime.toString(
"yyyyMMdd_hhmmss") +
".xml";
1814 if (!stateName.isEmpty())
1820 DEBTRACE(
"GenericGui::onNewEdition");
1828 DEBTRACE(
"GenericGui::onGetYacsContainerLog");
1839 DEBTRACE(
"GenericGui::onGetErrorReport");
1861 DEBTRACE(
"GenericGui::onGetErrorDetails");
1883 DEBTRACE(
"GenericGui::onGetContainerLog");
1897 info +=
"The container log of this node\n";
1898 info +=
"is not stored in a file and \n";
1899 info +=
"can't be displayed here, \n";
1900 info +=
"but you can have a look at \n";
1901 info +=
"the SALOME standard output,\n";
1902 info +=
"on your terminal...";
1906 info +=
"See YACS Container log \n";
1907 info +=
"(on main proc menu) \n";
1908 info +=
"for all inline nodes";
1919 DEBTRACE(
"GenericGui::onShutdownProc");
1927 DEBTRACE(
"GenericGui::onEditDataTypes");
1932 DEBTRACE(
"GenericGui::onCreateDataType");
1937 DEBTRACE(
"GenericGui::onImportDataType");
1943 DEBTRACE(
"GenericGui::onSelectComponentInstance");
1954 DEBTRACE(
"GenericGui::onNewContainer");
1960 DEBTRACE(
"GenericGui::onNewHPContainer");
1966 DEBTRACE(
"GenericGui::onNewSalomeComponent");
1972 DEBTRACE(
"GenericGui::onNewSalomePythonComponent");
1977 DEBTRACE(
"GenericGui::onNewCorbaComponent");
1983 DEBTRACE(
"GenericGui::onSalomeServiceNode");
1989 DEBTRACE(
"GenericGui::onServiceInlineNode");
1995 DEBTRACE(
"GenericGui::onCORBAServiceNode");
2001 DEBTRACE(
"GenericGui::onNodeNodeServiceNode");
2018 DEBTRACE(
"GenericGui::onInDataNode");
2024 DEBTRACE(
"GenericGui::onOutDataNode");
2030 DEBTRACE(
"GenericGui::onInStudyNode");
2036 DEBTRACE(
"GenericGui::onOutStudyNode");
2042 DEBTRACE(
"GenericGui::onInlineScriptNode");
2048 DEBTRACE(
"GenericGui::onInlineFunctionNode");
2054 DEBTRACE(
"GenericGui::onBlockNode");
2066 DEBTRACE(
"GenericGui::onFOREACHNode");
2072 DEBTRACE(
"GenericGui::createForEachLoop");
2078 DEBTRACE(
"GenericGui::onWHILENode");
2084 DEBTRACE(
"GenericGui::onSWITCHNode");
2090 DEBTRACE(
"GenericGui::onOptimizerLoop");
2096 DEBTRACE(
"GenericGui::onNodeFromCatalog");
2102 DEBTRACE(
"GenericGui::onDeleteItem");
2114 DEBTRACE(
"GenericGui::onCopyItem");
2120 DEBTRACE(
"GenericGui::onPasteItem");
2131 DEBTRACE(
"GenericGui::onPutGraphInBloc");
2138 DEBTRACE(
"GenericGui::onPutGraphInForLoop");
2144 DEBTRACE(
"GenericGui::PutGraphInForeachLoop");
2150 DEBTRACE(
"GenericGui::onPutGraphInWhileLoop");
2156 DEBTRACE(
"GenericGui::onPutGraphInOptimizerLoop");
2162 DEBTRACE(
"GenericGui::onArrangeLocalNodes");
2168 DEBTRACE(
"GenericGui::onArrangeRecurseNodes");
2174 DEBTRACE(
"GenericGui::onRebuildLinks");
2180 DEBTRACE(
"GenericGui::onZoomToBloc");
2186 DEBTRACE(
"GenericGui::onCenterOnNode");
2191 DEBTRACE(
"GenericGui::onShrinkExpand");
2196 DEBTRACE(
"GenericGui::onShrinkExpandChildren");
2201 DEBTRACE(
"GenericGui::onShrinkExpandElementaryRecursively");
2208 DEBTRACE(
"Scene::_straightLinks=" << checked);
2222 DEBTRACE(
"Scene::_autoComputeLinks=" << checked);
2228 DEBTRACE(
"Scene::_simplifyLinks=" << checked);
2234 DEBTRACE(
"Scene::_force2NodesLink=" << checked);
2240 DEBTRACE(
"Scene::_addRowCols=" << checked);
2255 DEBTRACE(
"GenericGui::onWhatsThis");
2256 QWhatsThis::enterWhatsThisMode();
2261 DEBTRACE(
"GenericGui::onWithoutStopMode " << checked);
2269 DEBTRACE(
"GenericGui::onWithoutStopMode " << checked);
2277 DEBTRACE(
"GenericGui::onWithoutStopMode " << checked);
2285 DEBTRACE(
"GenericGui::onToggleStopOnError " << checked);
2296 DEBTRACE(
"GenericGui::onToggleSceneItemVisible " << checked);
2305 item->setVisible(checked);
2319 item->setVisible(isShown);
2334 item->setVisible(isShown);
2347 list<SubjectLink*>::const_iterator it = linkList.begin();
2348 for( ; it != linkList.end(); ++it)
2353 item->setVisible(isShown);
2362 list<SubjectControlLink*>::const_iterator it = linkList.begin();
2363 for( ; it != linkList.end(); ++it)
2368 item->setVisible(isShown);
2379 item->setVisible(isShown);
2384 DEBTRACE(
"GenericGui::onShowAllLinks");
2391 DEBTRACE(
"GenericGui::onHideAllLinks");
2398 DEBTRACE(
"GenericGui::onShowOnlyPortLinks");
2405 DEBTRACE(
"GenericGui::onShowPortLinks");
2411 DEBTRACE(
"GenericGui::onHidePortLinks");
2417 DEBTRACE(
"GenericGui::onEmphasisPortLinks");
2439 list<SubjectInputPort*>::const_iterator it = linkList.begin();
2440 for( ; it != linkList.end(); ++it)
2449 list<SubjectOutputPort*>::const_iterator it = linkList.begin();
2450 for( ; it != linkList.end(); ++it)
2463 DEBTRACE(
"GenericGui::onShowOnlyCtrlLinks");
2470 DEBTRACE(
"GenericGui::onShowCtrlLinks");
2476 DEBTRACE(
"GenericGui::onHideCtrlLinks");
2482 DEBTRACE(
"GenericGui::onEmphasisCtrlLinks");
2492 list<SubjectControlLink*>::const_iterator it = linkList.begin();
2493 for( ; it != linkList.end(); ++it)
2509 DEBTRACE(
"GenericGui::onShowOnlyLink");
2516 DEBTRACE(
"GenericGui::onShowLink");
2522 DEBTRACE(
"GenericGui::onHideLink");
2528 DEBTRACE(
"GenericGui::onEmphasisLink");
2537 DEBTRACE(
"GenericGui::onDeEmphasizeAll");
2555 else Message(
"undo not possible when there are local modifications not confirmed");
2567 else Message(
"redo not possible when there are local modifications not confirmed");
2582 DEBTRACE(
"GenericGui::onCleanOnExit");
2583 map<QWidget*, YACS::HMI::QtGuiContext*> mapViewContextCopy =
_mapViewContext;
2584 map<QWidget*, YACS::HMI::QtGuiContext*>::iterator it = mapViewContextCopy.begin();
2585 for (; it != mapViewContextCopy.end(); ++it)
2595 list<SubjectLink*>::const_iterator it = linkList.begin();
2596 for( ; it != linkList.end(); ++it)
2599 if (!subli)
continue;
#define YASSERT(val)
YASSERT macro is always defined, used like assert, but throw a YACS::Exception instead of abort.
virtual void readFile(std::string fileName)
void setText(std::string text)
virtual void readFile(std::string fileName)
CORBA::Object_ptr Resolve(const char *Path) override
std::map< std::string, ComponentDefinition * > _componentMap
std::map< std::string, TypeCode * > _typeMap
Base class for all component instances.
const std::string & getCompoName() const
void checkConsistency(LinkInfo &info) const
Class that deal with list of semantics links for high level analysis.
static const unsigned char ALL_STOP_ASAP
bool areWarningsOrErrors() const
Class for logging error messages.
virtual std::string getStr()
Base class for all nodes.
virtual std::string getErrorReport()
returns a string that contains an error report if the node is in error
virtual std::string getErrorDetails() const
virtual int isValid()
indicates if the node is valid (returns 1) or not (returns 0)
Base class for all schema objects.
virtual void setEdition(bool edition)
virtual Logger * getLogger(const std::string &name)
static void setRuntime(long flags=UsePython+UseCorba+UseXml+UseCpp+UseSalome, int argc=0, char *argv[]=NULL)
virtual Proc * createProc(const std::string &name)
CORBA::ORB_ptr getOrb() const
Catalog * getBuiltinCatalog()
Get the catalog of base nodes (elementary and composed)
virtual void addCatalog(Catalog *catalog)
Add a catalog of types and nodes to the runtime.
virtual Catalog * loadCatalog(const std::string &sourceKind, const std::string &path)
Load a catalog of calculation to use as factory.
Class for calculation node associated with a component service.
void openFileSchema(std::string xmlDump)
std::list< std::string > _machineList
void onLoadRunStateSchema()
QAction * _CORBAServiceNodeAct
QAction * _stepByStepModeAct
void onNodeNodeServiceNode()
QAction * _getErrorReportAct
void onNewSalomePythonComponent()
QAction * _OptimizerLoopAct
QAction * _nodeNodeServiceNodeAct
QAction * _inlineScriptNodeAct
std::map< QWidget *, YACS::HMI::QtGuiContext * > _mapViewContext
void showEditionMenus(bool show)
void onEmphasisPortLinks()
void switchContext(QWidget *view, bool onExit=false)
void emphasizePortLink(YACS::HMI::SubjectDataPort *sub, bool emphasize)
QAction * _arrangeRecurseNodesAct
void onPutGraphInWhileLoop()
void onEmphasisCtrlLinks()
void onPutGraphInForLoop()
QAction * _getYacsContainerLogAct
YACS::HMI::GuiEditor * _guiEditor
QAction * _getContainerLogAct
bool closeContext(QWidget *view, bool onExit=false)
QAction * _importSupervSchemaAct
QAction * _showCtrlLinksAct
QString getSaveFileName(const QString &fileName=QString())
bug confirmOverwrite : correction Qt 4.3.5
QAction * _emphasisPortLinksAct
QAction * _newCorbaComponentAct
virtual void loadSchema(const std::string &filename, bool edit=true, bool arrangeLocalNodes=false)
QAction * _putGraphInForLoopAct
void putGraphInForeachLoop(std::string type)
QAction * _withoutStopModeAct
void onImportSupervSchema()
QAction * _selectReferenceAct
QAction * _inlineFunctionNodeAct
QAction * _startResumeAct
QAction * _toggleSceneItemVisibleAct
QAction * _toggleStopOnErrorAct
QAction * _inStudyNodeAct
void onToggleStopOnError(bool checked)
void onServiceInlineNode()
void onCORBAServiceNode()
void onLoadAndRunSchema()
QAction * _breakpointsModeAct
QAction * _getErrorDetailsAct
void onShowOnlyCtrlLinks()
QAction * _newHPContainerAct
void createContext(YACS::ENGINE::Proc *proc, const QString &schemaName, const QString &runName, bool forEdition)
void showExecMenus(bool show)
QAction * _hideCtrlLinksAct
YACS::ENGINE::Catalog * _builtinCatalog
void onStepByStepMode(bool checked)
QAction * _emphasisLinkAct
QAction * _chooseBatchJobAct
QAction * _importSchemaAct
void onWithoutStopMode(bool checked)
QActionGroup * _execModeGroup
QAction * _putGraphInBlocAct
QAction * _FOREACHNodeAct
QAction * _emphasisCtrlLinksAct
QAction * _showOnlyCtrlLinksAct
void onRunLoadedSchema(bool withState=false)
QAction * _salomeServiceNodeAct
void onArrangeLocalNodes()
void onToggleForce2NodesLinks(bool checked)
QAction * _hidePortLinksAct
QAction * _serviceInlineNodeAct
void onNewSalomeComponent()
QAction * _importDataTypeAct
QAction * _newSalomeComponentAct
QAction * _toggleAutomaticComputeLinkAct
void onPutGraphInOptimizerLoop()
QAction * _editDataTypesAct
QAction * _toggleSimplifyLinkAct
void displayControlLinks(bool isShown)
QAction * _runLoadedSchemaAct
void onSelectComponentInstance()
void createForEachLoop(std::string type="double")
void onInlineFunctionNode()
void onBreakpointsMode(bool checked)
QAction * _outStudyNodeAct
void displayPortLinks(bool isShown)
QAction * _shrinkExpandElementaryRecursively
void onSalomeServiceNode()
void showBaseMenus(bool show)
CatalogWidget * _catalogsWidget
void onToggleSimplifyLinks(bool checked)
void onToggleAutomaticComputeLinks(bool checked)
void onArrangeRecurseNodes()
std::list< std::string > getMachineList()
QAction * _nodeFromCatalogAct
QAction * _saveRunStateAct
QAction * _hideAllLinksAct
void displayLinks(bool isShown)
QAction * _arrangeLocalNodesAct
QAction * _loadAndRunSchemaAct
QAction * _shrinkExpandChildren
void displayALink(bool isShown)
void onShrinkExpandElementaryRecursively()
QAction * _putGraphInWhileLoopAct
QAction * _toggleStraightLinksAct
QAction * _toggleForce2NodesLinkAct
QAction * _showOnlyLinkAct
QAction * _exportSchemaAct
QAction * _showOnlyPortLinksAct
QAction * _computeLinkAct
QAction * _shutdownProcAct
void onToggleAddRowCols(bool checked)
QAction * _selectComponentInstanceAct
QAction * _centerOnNodeAct
QAction * _deEmphasizeAllAct
QAction * _showAllLinksAct
QAction * _importCatalogAct
QAction * _toggleAddRowColsAct
QAction * _newContainerAct
BatchJobsListDialog * _BJLdialog
QAction * _outDataNodeAct
QAction * _newSalomePythonComponentAct
void showDockWidgets(bool isVisible)
void onShowOnlyPortLinks()
void onToggleSceneItemVisible(bool checked)
void showCommonMenus(bool show)
void onShrinkExpandChildren()
void setLoadedPresentation(YACS::ENGINE::Proc *proc)
QAction * _showPortLinksAct
QAction * _putGraphInOptimizerLoopAct
QAction * _exportSchemaAsAct
void onNewCorbaComponent()
QAction * _createDataTypeAct
YACS::ENGINE::Catalog * _sessionCatalog
virtual void onHelpContextModule(const QString &, const QString &, const QString &=QString())
void onGetYacsContainerLog()
void onInlineScriptNode()
void onToggleStraightLinks(bool checked)
QDockWidget * _dwCatalogs
QAction * _loadRunStateSchemaAct
virtual void onCenterOnNode()
virtual void onZoomToBloc()
void setSessionCatalog(YACS::ENGINE::Catalog *cata)
void setCurrentCatalog(YACS::ENGINE::Catalog *cata)
void setNotSaved(bool isNotSaved)
YACS::HMI::ProcInvoc * getInvoc()
void setLoading(bool isLoading)
std::map< std::pair< YACS::ENGINE::OutPort *, YACS::ENGINE::InPort * >, YACS::HMI::SubjectLink * > _mapOfSubjectLink
std::map< std::string, YACS::ENGINE::ComponentInstance * > _mapOfLastComponentInstance
std::map< std::pair< YACS::ENGINE::Node *, YACS::ENGINE::Node * >, YACS::HMI::SubjectControlLink * > _mapOfSubjectControlLink
std::map< YACS::ENGINE::Node *, YACS::HMI::SubjectNode * > _mapOfSubjectNode
YACS::HMI::SubjectProc * getSubjectProc()
YACS::ENGINE::Proc * getProc()
void shrinkExpand(Qt::KeyboardModifiers kbModifiers=Qt::NoModifier)
void showRedo(QWidget *parent=0)
QString asciiFilter(const QString &name)
SubjectNode * CreateNode(std::string typeNode)
void arrangeNodes(bool isRecursive)
void CreateForEachLoop(std::string type)
void showUndo(QWidget *parent=0)
std::string PutGraphInBloc()
void CreateComponentInstance()
void CreateOptimizerLoop()
void PutGraphInNode(std::string typeNode)
std::string getErrorReport(YACS::ENGINE::Node *node)
std::string getContainerLog()
void startResumeDataflow(bool initialize=false)
void setLoadStateFile(std::string xmlFile)
void saveState(const std::string &xmlFile)
void setStopOnError(bool aMode)
std::string getErrorDetails(YACS::ENGINE::Node *node)
static void setEventMap()
static TypeOfElem getTypeOfNode(YACS::ENGINE::Node *node)
FormEditTree * getEditTree()
void setEditionRoot(YACS::HMI::ItemEditionRoot *re)
QStackedWidget * getStackedWidget()
void setSelectionModel(QItemSelectionModel *selmod)
void setView(YACS::HMI::GraphicsView *view)
std::map< YACS::HMI::Subject *, YACS::HMI::SchemaItem * > _mapOfSchemaItem
void setEditTree(FormEditTree *editTree)
std::set< YACS::HMI::Subject * > _setOfModifiedSubjects
static QtGuiContext * getQtCurrent()
void setStackedWidget(QStackedWidget *sw)
void setWindow(QWidget *window)
void setGuiExecutor(YACS::HMI::GuiExecutor *guiEx)
void setFileName(const QString &fileName)
void setScene(QGraphicsScene *scene)
void setLoadingPresentation(bool isLoadpres)
YACS::HMI::Subject * getSelectedSubject()
YACS::HMI::GuiExecutor * getGuiExecutor()
void setEdition(bool isEdition)
void setSchemaModel(YACS::HMI::SchemaModel *model)
std::map< YACS::HMI::Subject *, YACS::HMI::SceneItem * > _mapOfSceneItem
static counters * _counters
void setSubjectToCopy(YACS::HMI::Subject *sub)
virtual void setProc(YACS::ENGINE::Proc *proc)
YACS::HMI::GraphicsView * getView()
static void setQtCurrent(QtGuiContext *context)
static bool straightLinks
static QString userCatalog
static bool autoComputeLinks
virtual qreal getHeaderBottom()
virtual void setHeight(qreal height)
AbstractSceneItem cannot be resized (only ComposedNodeItem can)
virtual void updateLinks()
virtual SceneComposedNodeItem * getParent()
shownState getShownState()
virtual void setShownState(shownState ss)
void setExpandedPos(QPointF epos)
virtual void setWidth(qreal width)
AbstractSceneItem cannot be resized (only ComposedNodeItem can)
static bool _autoComputeLinks
static bool _simplifyLinks
static bool _straightLinks
static bool _force2NodesLink
void setEdition(bool isEdition=true)
SubjectNode * getSubjectInNode()
SubjectNode * getSubjectOutNode()
std::list< SubjectLink * > getListOfSubjectLink()
virtual std::string getName()
SubjectDataPort * getSubjectInPort()
SubjectDataPort * getSubjectOutPort()
std::list< SubjectControlLink * > getSubjectControlLinks() const
virtual std::string getName()
std::list< SubjectInputPort * > getSubjectInputPorts() const
virtual void update(GuiEvent event, int type, Subject *son)
virtual YACS::ENGINE::Node * getNode()
std::list< SubjectOutputPort * > getSubjectOutputPorts() const
virtual void update(GuiEvent event, int type, Subject *son)
virtual std::string getName()
virtual void select(bool isSelected)
viewer QGraphicsScene: deriver SUIT_ViewModel comme QxGraph_Viewer
void AssociateViewToWindow(QGraphicsView *gView, QWidget *viewWindow)
void createNewRun(const QString &schemaName, const QString &runName, QWidget *refWindow, QWidget *viewWindow)
bool deleteSchema(QWidget *viewWindow)
QAction * createAction(const int id, const QString &toolTip, const QIcon &icon, const QString &menu, const QString &status, const int shortCut, QObject *parent=0, bool checkable=false, QObject *receiver=0, const char *member=0)
int createMenu(const QString &subMenu, const int parentMenuId, const int menuId=-1, const int groupId=-1, const int index=-1)
virtual void onHelpContextModule(const QString &, const QString &, const QString &=QString())
void setMenuShown(QAction *act, bool show)
QDockWidget * objectBrowser()
QWidget * getNewWindow(QGraphicsScene *scene)
static QAction * separator()
void createNewSchema(const QString &schemaName, QWidget *viewWindow)
int createTool(const QString &title, const QString &name=QString())
bool renameSchema(const QString &oldName, const QString &newName, QWidget *viewWindow)
QStringList getQuickDirList()
void setToolShown(QAction *act, bool show)
std::map< YACS::ENGINE::Node *, PrsData > getPrsData(YACS::ENGINE::Proc *proc)
virtual YACS::ENGINE::Proc * load(const char *filename)
void registerProcCataLoader()
YACSRUNTIMESALOME_EXPORT RuntimeSALOME * getSALOMERuntime()
def ref(target, callback=None)