Version: 8.3.0
YACS::HMI::GenericGui Class Reference

#include <GenericGui.hxx>

Inheritance diagram for YACS::HMI::GenericGui:
Collaboration diagram for YACS::HMI::GenericGui:

Public Slots

void onCleanOnExit ()
 

Public Member Functions

 GenericGui (YACS::HMI::SuitWrapper *wrapper, QMainWindow *parent=0)
 
virtual ~GenericGui ()
 
void createActions ()
 
void createMenus ()
 
void createTools ()
 
void initialMenus ()
 
void hideAllMenus ()
 
void showBaseMenus (bool show)
 
void showEditionMenus (bool show)
 
void showExecMenus (bool show)
 
void showCommonMenus (bool show)
 
void switchContext (QWidget *view, bool onExit=false)
 
bool closeContext (QWidget *view, bool onExit=false)
 
void showDockWidgets (bool isVisible)
 
void raiseStacked ()
 
CatalogWidgetgetCatalogWidget ()
 
std::list< std::string > getMachineList ()
 
void createForEachLoop (std::string type="double")
 
void putGraphInForeachLoop (std::string type)
 
virtual void loadSchema (const std::string &filename, bool edit=true, bool arrangeLocalNodes=false)
 
virtual void onHelpContextModule (const QString &, const QString &, const QString &=QString())
 
void createContext (YACS::ENGINE::Proc *proc, const QString &schemaName, const QString &runName, bool forEdition)
 
YACSGuiLoadergetLoader ()
 
void setLoadedPresentation (YACS::ENGINE::Proc *proc)
 

Public Attributes

QAction * _newSchemaAct
 
QAction * _importSchemaAct
 
QAction * _chooseBatchJobAct
 
QAction * _importSupervSchemaAct
 
QAction * _exportSchemaAct
 
QAction * _exportSchemaAsAct
 
QAction * _importCatalogAct
 
QAction * _runLoadedSchemaAct
 
QAction * _loadRunStateSchemaAct
 
QAction * _loadAndRunSchemaAct
 
QAction * _startResumeAct
 
QAction * _abortAct
 
QAction * _pauseAct
 
QAction * _resetAct
 
QAction * _saveRunStateAct
 
QAction * _newEditionAct
 
QActionGroup * _execModeGroup
 
QAction * _withoutStopModeAct
 
QAction * _breakpointsModeAct
 
QAction * _stepByStepModeAct
 
QAction * _toggleStopOnErrorAct
 
QAction * _getYacsContainerLogAct
 
QAction * _getErrorReportAct
 
QAction * _getErrorDetailsAct
 
QAction * _getContainerLogAct
 
QAction * _shutdownProcAct
 
QAction * _editDataTypesAct
 
QAction * _createDataTypeAct
 
QAction * _importDataTypeAct
 
QAction * _newContainerAct
 
QAction * _newHPContainerAct
 
QAction * _selectComponentInstanceAct
 
QAction * _newSalomeComponentAct
 
QAction * _newSalomePythonComponentAct
 
QAction * _newCorbaComponentAct
 
QAction * _salomeServiceNodeAct
 
QAction * _serviceInlineNodeAct
 
QAction * _CORBAServiceNodeAct
 
QAction * _nodeNodeServiceNodeAct
 
QAction * _cppNodeAct
 
QAction * _XMLNodeAct
 
QAction * _inDataNodeAct
 
QAction * _outDataNodeAct
 
QAction * _inStudyNodeAct
 
QAction * _outStudyNodeAct
 
QAction * _inlineScriptNodeAct
 
QAction * _inlineFunctionNodeAct
 
QAction * _blockNodeAct
 
QAction * _FORNodeAct
 
QAction * _FOREACHNodeAct
 
QAction * _WHILENodeAct
 
QAction * _SWITCHNodeAct
 
QAction * _OptimizerLoopAct
 
QAction * _nodeFromCatalogAct
 
QAction * _deleteItemAct
 
QAction * _cutItemAct
 
QAction * _copyItemAct
 
QAction * _pasteItemAct
 
QAction * _putInBlocAct
 
QAction * _putGraphInBlocAct
 
QAction * _putGraphInForLoopAct
 
QAction * _putGraphInWhileLoopAct
 
QAction * _putGraphInOptimizerLoopAct
 
QAction * _arrangeLocalNodesAct
 
QAction * _arrangeRecurseNodesAct
 
QAction * _computeLinkAct
 
QAction * _zoomToBlocAct
 
QAction * _centerOnNodeAct
 
QAction * _shrinkExpand
 
QAction * _shrinkExpandChildren
 
QAction * _shrinkExpandElementaryRecursively
 
QAction * _toggleStraightLinksAct
 
QAction * _toggleAutomaticComputeLinkAct
 
QAction * _toggleSimplifyLinkAct
 
QAction * _toggleForce2NodesLinkAct
 
QAction * _toggleAddRowColsAct
 
QAction * _toggleSceneItemVisibleAct
 
QAction * _selectReferenceAct
 
QAction * _whatsThisAct
 
QAction * _showAllLinksAct
 
QAction * _hideAllLinksAct
 
QAction * _showOnlyPortLinksAct
 
QAction * _showPortLinksAct
 
QAction * _hidePortLinksAct
 
QAction * _emphasisPortLinksAct
 
QAction * _showOnlyCtrlLinksAct
 
QAction * _showCtrlLinksAct
 
QAction * _hideCtrlLinksAct
 
QAction * _emphasisCtrlLinksAct
 
QAction * _showOnlyLinkAct
 
QAction * _showLinkAct
 
QAction * _hideLinkAct
 
QAction * _emphasisLinkAct
 
QAction * _deEmphasizeAllAct
 
QAction * _undoAct
 
QAction * _redoAct
 
QAction * _showUndoAct
 
QAction * _showRedoAct
 
YACS::HMI::GuiEditor_guiEditor
 

Protected Member Functions

int getMenuId ()
 
QString getSaveFileName (const QString &fileName=QString())
 bug confirmOverwrite : correction Qt 4.3.5 More...
 

Protected Attributes

YACSGuiLoader_loader
 
SuitWrapper_wrapper
 
QMainWindow_parent
 
QDockWidget * _dwTree
 
QDockWidget * _dwStacked
 
QDockWidget * _dwCatalogs
 
BatchJobsListDialog_BJLdialog
 
YACS::ENGINE::Catalog_builtinCatalog
 
YACS::ENGINE::Catalog_sessionCatalog
 
CatalogWidget_catalogsWidget
 
std::map< QWidget
*, YACS::HMI::QtGuiContext * > 
_mapViewContext
 
int _menuId
 
int _toolId
 
int _schemaCnt
 
bool _isSaved
 
std::list< std::string > _machineList
 

Private Slots

void onNewSchema ()
 
void onImportSchema ()
 
void onChooseBatchJob ()
 
void onImportSupervSchema ()
 
void onExportSchema ()
 
void onExportSchemaAs ()
 
void onImportCatalog ()
 
void onRunLoadedSchema (bool withState=false)
 
void onLoadRunStateSchema ()
 
void onLoadAndRunSchema ()
 
void onStartResume ()
 
void onAbort ()
 
void onPause ()
 
void onReset ()
 
void onSaveRunState ()
 
void onNewEdition ()
 
void onWithoutStopMode (bool checked)
 
void onBreakpointsMode (bool checked)
 
void onStepByStepMode (bool checked)
 
void onToggleStopOnError (bool checked)
 
void onGetYacsContainerLog ()
 
void onGetErrorReport ()
 
void onGetErrorDetails ()
 
void onGetContainerLog ()
 
void onShutdownProc ()
 
void onEditDataTypes ()
 
void onCreateDataType ()
 
void onImportDataType ()
 
void onNewContainer ()
 
void onNewHPContainer ()
 
void onSelectComponentInstance ()
 
void onNewSalomeComponent ()
 
void onNewSalomePythonComponent ()
 
void onNewCorbaComponent ()
 
void onSalomeServiceNode ()
 
void onServiceInlineNode ()
 
void onCORBAServiceNode ()
 
void onNodeNodeServiceNode ()
 
void onCppNode ()
 
void onXMLNode ()
 
void onInDataNode ()
 
void onOutDataNode ()
 
void onInStudyNode ()
 
void onOutStudyNode ()
 
void onInlineScriptNode ()
 
void onInlineFunctionNode ()
 
void onBlockNode ()
 
void onFORNode ()
 
void onFOREACHNode ()
 
void onWHILENode ()
 
void onSWITCHNode ()
 
void onOptimizerLoop ()
 
void onNodeFromCatalog ()
 
void onDeleteItem ()
 
void onCutItem ()
 
void onCopyItem ()
 
void onPasteItem ()
 
void onPutInBloc ()
 
void onPutGraphInBloc ()
 
void onPutGraphInForLoop ()
 
void onPutGraphInWhileLoop ()
 
void onPutGraphInOptimizerLoop ()
 
void onArrangeLocalNodes ()
 
void onArrangeRecurseNodes ()
 
void onRebuildLinks ()
 
void onZoomToBloc ()
 
void onCenterOnNode ()
 
void onShrinkExpand ()
 
void onShrinkExpandChildren ()
 
void onShrinkExpandElementaryRecursively ()
 
void onToggleStraightLinks (bool checked)
 
void onToggleAutomaticComputeLinks (bool checked)
 
void onToggleSimplifyLinks (bool checked)
 
void onToggleForce2NodesLinks (bool checked)
 
void onToggleAddRowCols (bool checked)
 
void onToggleSceneItemVisible (bool checked)
 
void onShowAllLinks ()
 
void onHideAllLinks ()
 
void onShowOnlyPortLinks ()
 
void onShowPortLinks ()
 
void onHidePortLinks ()
 
void onEmphasisPortLinks ()
 
void onShowOnlyCtrlLinks ()
 
void onShowCtrlLinks ()
 
void onHideCtrlLinks ()
 
void onEmphasisCtrlLinks ()
 
void onShowOnlyLink ()
 
void onShowLink ()
 
void onHideLink ()
 
void onEmphasisLink ()
 
void onDeEmphasizeAll ()
 
void onSelectReference ()
 
void onWhatsThis ()
 
void onUndo ()
 
void onRedo ()
 
void onShowUndo ()
 
void onShowRedo ()
 

Private Member Functions

void displayLinks (bool isShown)
 
void displayControlLinks (bool isShown)
 
void displayPortLinks (bool isShown)
 
void displayALink (bool isShown)
 
void emphasizePortLink (YACS::HMI::SubjectDataPort *sub, bool emphasize)
 

Detailed Description

Definition at line 56 of file GenericGui.hxx.

Constructor & Destructor Documentation

GenericGui::GenericGui ( YACS::HMI::SuitWrapper wrapper,
QMainWindow parent = 0 
)

Definition at line 80 of file GenericGui.cxx.

References YACS::ENGINE::Runtime::addCatalog(), DEBTRACE, YACS::ENGINE::Runtime::getBuiltinCatalog(), YACS::ENGINE::RuntimeSALOME::getOrb(), YACS::ENGINE::getSALOMERuntime(), YACS::ENGINE::Runtime::loadCatalog(), orb, and YACS::ENGINE::RuntimeSALOME::setRuntime().

81 {
82  _wrapper = wrapper;
83  _parent = parent;
84  _dwTree = 0;
85  _dwStacked = 0;
86  _dwCatalogs = 0;
87  _catalogsWidget = 0;
88  _sessionCatalog = 0;
89  _schemaCnt = 0;
90  _isSaved = false;
91  _mapViewContext.clear();
92  _machineList.clear();
93  _menuId = 190;
94  _BJLdialog = NULL;
96  srand((unsigned)time(0));
97 
99 
100  string iconPath = getenv("YACS_ROOT_DIR");
101  iconPath += "/share/salome/resources/yacs";
102  DEBTRACE(iconPath);
103  QDir::addSearchPath("icons", iconPath.c_str());
104 
105  _guiEditor = new GuiEditor();
106 
108  _loader = new YACSGuiLoader();
111 
112  try
113  {
115  CORBA::ORB_ptr orb = runTime->getOrb();
116  if (orb)
117  {
118  SALOME_NamingService namingService(orb);
119  CORBA::Object_ptr obj = namingService.Resolve("/Kernel/ModulCatalog");
120  SALOME_ModuleCatalog::ModuleCatalog_var aModuleCatalog =
121  SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj);
122  if (! CORBA::is_nil(aModuleCatalog))
123  {
124  DEBTRACE("SALOME_ModuleCatalog::ModuleCatalog found");
125  std::string anIOR = orb->object_to_string( aModuleCatalog );
126  _sessionCatalog = runTime->loadCatalog( "session", anIOR );
127  runTime->addCatalog(_sessionCatalog);
128  {
129  std::map< std::string, YACS::ENGINE::ComponentDefinition * >::iterator it;
130  for (it = _sessionCatalog->_componentMap.begin();
131  it != _sessionCatalog->_componentMap.end(); ++it)
132  DEBTRACE("Component: " <<(*it).first);
133  }
134  {
135  std::map< std::string, YACS::ENGINE::TypeCode*>::iterator it;
136  for (it = _sessionCatalog->_typeMap.begin();
137  it != _sessionCatalog->_typeMap.end(); ++it)
138  DEBTRACE("Type : " <<(*it).first
139  << " " << (*it).second->getKindRepr()
140  << " " << (*it).second->name()
141  << " " << (*it).second->shortName()
142  << " " << (*it).second->id() );
143  }
144  DEBTRACE("_sessionCatalog " << _sessionCatalog);
145  }
146  }
147  }
148  catch(ServiceUnreachable& e)
149  {
150  DEBTRACE("Caught Exception. "<<e);
151  }
152 
153  _dwTree = new QDockWidget(_parent);
154  _dwTree->setVisible(false);
155  _dwTree->setWindowTitle("Tree View: edition mode");
156  _dwTree->setObjectName("yacsTreeViewDock");
157  _parent->addDockWidget(Qt::LeftDockWidgetArea, _dwTree);
158  _dwStacked = new QDockWidget(_parent);
159  _dwStacked->setVisible(false);
160  _dwStacked->setWindowTitle("Input Panel");
161  _dwStacked->setObjectName("yacsInputPanelDock");
162  _dwStacked->setMinimumWidth(270); // --- force a minimum until display
163  _parent->addDockWidget(Qt::RightDockWidgetArea, _dwStacked);
164  _dwCatalogs = new QDockWidget(_parent);
165  _dwCatalogs->setVisible(false);
166  _dwCatalogs->setWindowTitle("Catalogs");
167  _dwCatalogs->setObjectName("yacsCatalogsDock");
168  _parent->addDockWidget(Qt::RightDockWidgetArea, _dwCatalogs);
172  _dwCatalogs->setWidget(_catalogsWidget);
173 
174  _parent->tabifyDockWidget(_dwStacked, _dwCatalogs);
175  if (_wrapper->objectBrowser())
176  _parent->tabifyDockWidget(_dwTree, _wrapper->objectBrowser());
177 #if QT_VERSION >= 0x040500
178  _parent->setTabPosition(Qt::AllDockWidgetAreas, Resource::tabPanelsUp? QTabWidget::North: QTabWidget::South);
179 #endif
180  //Import user catalog
181  std::string usercata=Resource::userCatalog.toStdString();
183 }
GenericGui::~GenericGui ( )
virtual

Definition at line 185 of file GenericGui.cxx.

186 {
187  if(_BJLdialog) delete _BJLdialog;
188 }

Member Function Documentation

bool GenericGui::closeContext ( QWidget view,
bool  onExit = false 
)

Definition at line 864 of file GenericGui.cxx.

References DEBTRACE, YACS::HMI::Subject::erase(), YACS::HMI::QtGuiContext::getGuiExecutor(), YACS::HMI::QtGuiContext::getStudyId(), and PMMLBasicsTestLauncher::ret.

Referenced by Yacsgui::onTryClose().

865 {
866  DEBTRACE("GenericGui::closeContext " << onExit);
867  if (! _mapViewContext.count(view))
868  return true;
869  QtGuiContext* context = _mapViewContext[view];
870  switchContext(view);
871 
872  bool tryToSave = false;
873 
874  if (QtGuiContext::getQtCurrent()->isEdition())
875  {
876  if (!QtGuiContext::getQtCurrent()->_setOfModifiedSubjects.empty())
877  {
878  QMessageBox msgBox;
879  msgBox.setText("Some elements are modified and not taken into account.");
880  string info = "do you want to apply your changes ?\n";
881  info += " - Save : do not take into account edition in progress,\n";
882  info += " but if there are other modifications, select a file name for save\n";
883  info += " - Discard : discard all modifications and close the schema";
884  if (!onExit)
885  info += "\n - Cancel : do not close the schema, return to edition";
886  msgBox.setInformativeText(info.c_str());
887  if (!onExit)
888  {
889  msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
890  msgBox.setDefaultButton(QMessageBox::Cancel);
891  }
892  else
893  {
894  msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard);
895  msgBox.setDefaultButton(QMessageBox::Save);
896  }
897  int ret = msgBox.exec();
898  switch (ret)
899  {
900  case QMessageBox::Save:
901  tryToSave = true;
902  break;
903  case QMessageBox::Discard:
904  tryToSave = false;
905  break;
906  case QMessageBox::Cancel:
907  default:
908  DEBTRACE("Cancel or default");
909  return false;
910  break;
911  }
912  }
913  else
914  if (QtGuiContext::getQtCurrent()->isNotSaved())
915  {
916  QMessageBox msgBox;
917  msgBox.setWindowTitle("Close the active schema");
918  msgBox.setText("The schema has been modified");
919  string info = "do you want to save the schema ?\n";
920  info += " - Save : select a file name for save\n";
921  info += " - Discard : discard all modifications and close the schema";
922  if (!onExit)
923  info += "\n - Cancel : do not close the schema, return to edition";
924  msgBox.setInformativeText(info.c_str());
925  if (!onExit)
926  {
927  msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
928  msgBox.setDefaultButton(QMessageBox::Cancel);
929  }
930  else
931  {
932  msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard);
933  msgBox.setDefaultButton(QMessageBox::Save);
934  }
935  int ret = msgBox.exec();
936  switch (ret)
937  {
938  case QMessageBox::Save:
939  tryToSave = true;
940  break;
941  case QMessageBox::Discard:
942  tryToSave = false;
943  break;
944  case QMessageBox::Cancel:
945  DEBTRACE("Cancel or default");
946  default:
947  return false;
948  break;
949  }
950  }
951 
952  if (tryToSave)
953  {
955  if ((!onExit) && (!_isSaved)) // --- probably, user has cancelled the save dialog. Do not close
956  return false;
957  }
958  }
959 
960  map<QWidget*, YACS::HMI::QtGuiContext*>::iterator it = _mapViewContext.begin();
961  QtGuiContext* newContext = 0;
962  QWidget* newView = 0;
963  for (; it != _mapViewContext.end(); ++it)
964  {
965  if ((*it).second != context)
966  {
967  newView = (*it).first;
968  newContext = (*it).second;
969  break;
970  }
971  }
972  int studyId = _wrapper->activeStudyId();
973  if (context->getStudyId() == studyId)
974  {
975  _wrapper->deleteSchema(view);
976  DEBTRACE("delete context");
977  if (GuiExecutor* exec = context->getGuiExecutor())
978  {
979  exec->closeContext();
980  }
981  delete context;
982  _mapViewContext.erase(view);
983  switchContext(newView, onExit);
984  }
985  return true;
986 }
void GenericGui::createActions ( )

Definition at line 190 of file GenericGui.cxx.

Referenced by Yacsgui::initialize().

191 {
192  // QAction* createAction(const int id,
193  // const QString& toolTip,
194  // const QIcon& icon,
195  // const QString& menu,
196  // const QString& status,
197  // const int shortCut,
198  // QObject* parent =0,
199  // bool checkable = false,
200  // QObject* receiver =0,
201  // const char* member =0);
202 
203  _newSchemaAct = _wrapper->createAction(getMenuId(), tr("Create a new YACS Schema"), QIcon("icons:schema.png"),
204  tr("New Schema"), tr("Create a new YACS Schema"),
205  0, _parent, false, this, SLOT(onNewSchema()));
206  _newSchemaAct->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_N); // --- QKeySequence::New ambiguous in SALOME
207 
208  _importSchemaAct = _wrapper->createAction(getMenuId(), tr("Import a YACS Schema for edition"), QIcon("icons:import_dataflow.png"),
209  tr("Import Schema"), tr("Import a YACS Schema for edition"),
210  0, _parent, false, this, SLOT(onImportSchema()));
211  _importSchemaAct->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_O); // --- QKeySequence::Open ambiguous in SALOME
212 
213  _importSupervSchemaAct = _wrapper->createAction(getMenuId(), tr("Import a SUPERV Schema for edition"), QIcon("icons:import_superv_dataflow.png"),
214  tr("Import SUPERV Schema"), tr("Import a SUPERV Schema for edition"),
215  0, _parent, false, this, SLOT(onImportSupervSchema()));
216 
217  _exportSchemaAct = _wrapper->createAction(getMenuId(), tr("Save the current YACS Schema"), QIcon("icons:save_dataflow.png"),
218  tr("Save Schema"), tr("Save the current YACS Schema"),
219  0, _parent, false, this, SLOT(onExportSchema()));
220  _exportSchemaAct->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_S); // --- QKeySequence::Save ambiguous in SALOME
221 
222  _exportSchemaAsAct = _wrapper->createAction(getMenuId(), tr("Save the current YACS Schema As..."), QIcon("icons:export_dataflow.png"),
223  tr("Save Schema As"), tr("Save the current YACS Schema As..."),
224  0, _parent, false, this, SLOT(onExportSchemaAs()));
225  //_exportSchemaAsAct->setShortcut(QKeySequence::SaveAs); // --- ambiguous in SALOME
226 
227  _importCatalogAct = _wrapper->createAction(getMenuId(), tr("Import a Schema as a Catalog"), QIcon("icons:insert_file.png"),
228  tr("Import Catalog"), tr("Import a Schema as a Catalog"),
229  0, _parent, false, this, SLOT(onImportCatalog()));
230 
231 
232  _runLoadedSchemaAct = _wrapper->createAction(getMenuId(), tr("Prepare the current edited schema for run"), QIcon("icons:run_active.png"),
233  tr("Run Current Schema"), tr("Prepare the current edited schema for run"),
234  0, _parent, false, this, SLOT(onRunLoadedSchema()));
235 
236  _loadRunStateSchemaAct = _wrapper->createAction(getMenuId(), tr("Load a previous run state for this schema, prepare to run"), QIcon("icons:load_execution_state.png"),
237  tr("Load Run State"), tr("Load a previous run state for this schema, prepare to run"),
238  0, _parent, false, this, SLOT(onLoadRunStateSchema()));
239 
240  _loadAndRunSchemaAct = _wrapper->createAction(getMenuId(), tr("Load a schema for run"), QIcon("icons:run.png"),
241  tr("Load Schema to run"), tr("Load a schema for run"),
242  0, _parent, false, this, SLOT(onLoadAndRunSchema()));
243 
244  _chooseBatchJobAct = _wrapper->createAction(getMenuId(), tr("Choose Batch Job to watch"), QIcon("icons:batch.png"),
245  tr("Choose Batch Job to watch"), tr("Choose Batch Job to watch"),
246  0, _parent, false, this, SLOT(onChooseBatchJob()));
247 
248  _startResumeAct = _wrapper->createAction(getMenuId(), tr("Start or Resume Schema execution"), QIcon("icons:suspend_resume.png"),
249  tr("Start/Resume execution"), tr("Start or Resume Schema execution"),
250  0, _parent, false, this, SLOT(onStartResume()));
251 
252  _abortAct = _wrapper->createAction(getMenuId(), tr("Abort the current execution"), QIcon("icons:kill.png"),
253  tr("Abort execution"), tr("Abort the current execution"),
254  0, _parent, false, this, SLOT(onAbort()));
255 
256  _pauseAct = _wrapper->createAction(getMenuId(), tr("Suspend the current execution"), QIcon("icons:pause.png"),
257  tr("Suspend execution"), tr("Suspend the current execution"),
258  0, _parent, false, this, SLOT(onPause()));
259 
260  _resetAct = _wrapper->createAction(getMenuId(), tr("Reset error nodes and restart the current execution"), QIcon("icons:reset.png"),
261  tr("Restart execution"), tr("Restart the current execution with reset of error nodes"),
262  0, _parent, false, this, SLOT(onReset()));
263 
264 
265  _saveRunStateAct = _wrapper->createAction(getMenuId(), tr("Save the current run state"), QIcon("icons:save_dataflow_state.png"),
266  tr("Save State"), tr("Save the current run state"),
267  0, _parent, false, this, SLOT(onSaveRunState()));
268 
269  _newEditionAct = _wrapper->createAction(getMenuId(), tr("Edit again the current schema in a new context"), QIcon("icons:new_edition.png"),
270  tr("Edit Again"), tr("Edit again the current schema in a new context"),
271  0, _parent, false, this, SLOT(onNewEdition()));
272 
273 
274  _getYacsContainerLogAct = _wrapper->createAction(getMenuId(), tr("get YACS container log"), QIcon("icons:change_informations.png"),
275  tr("YACS Container Log"), tr("get YACS container log"),
276  0, _parent, false, this, SLOT(onGetYacsContainerLog()));
277 
278  _getErrorReportAct = _wrapper->createAction(getMenuId(), tr("get Node Error Report"), QIcon("icons:filter_notification.png"),
279  tr("Node Error Report"), tr("get Node Error Report"),
280  0, _parent, false, this, SLOT(onGetErrorReport()));
281 
282  _getErrorDetailsAct = _wrapper->createAction(getMenuId(), tr("get Node Error Details"), QIcon("icons:icon_text.png"),
283  tr("Node Error Details"), tr("get Node Error Details"),
284  0, _parent, false, this, SLOT(onGetErrorDetails()));
285 
286  _getContainerLogAct = _wrapper->createAction(getMenuId(), tr("get Node Container Log"), QIcon("icons:change_informations.png"),
287  tr("Node Container Log"), tr("get Node Container Log"),
288  0, _parent, false, this, SLOT(onGetContainerLog()));
289 
290  _shutdownProcAct = _wrapper->createAction(getMenuId(), tr("Shutdown Proc"), QIcon("icons:kill.png"),
291  tr("Shutdown Proc"), tr("Shutdown Proc"),
292  0, _parent, false, this, SLOT(onShutdownProc()));
293 
294 
295  _editDataTypesAct = _wrapper->createAction(getMenuId(), tr("Edit Data Types"), QIcon("icons:kill.png"),
296  tr("Edit Data Types"), tr("Edit Data Types"),
297  0, _parent, false, this, SLOT(onEditDataTypes()));
298 
299  _createDataTypeAct = _wrapper->createAction(getMenuId(), tr("Create Data Types"), QIcon("icons:kill.png"),
300  tr("Create Data Types"), tr("Create Data Types"),
301  0, _parent, false, this, SLOT(onCreateDataType()));
302 
303  _importDataTypeAct = _wrapper->createAction(getMenuId(), tr("Import Data Types, use drag and drop from catalog"), QIcon("icons:folder_cyan.png"),
304  tr("Import Data Types"), tr("Import Data Types, use drag and drop from catalog"),
305  0, _parent, false, this, SLOT(onImportDataType()));
306 
307  _newContainerAct = _wrapper->createAction(getMenuId(), tr("Create a New Container"), QIcon("icons:container.png"),
308  tr("Create Container"), tr("Create a New Container"),
309  0, _parent, false, this, SLOT(onNewContainer()));
310 
311  _newHPContainerAct = _wrapper->createAction(getMenuId(), tr("Create a New HP Container"), QIcon("icons:container.png"),
312  tr("Create HP Container"), tr("Create a New Homogeneous Pool Container."),
313  0, _parent, false, this, SLOT(onNewHPContainer()));
314 
315  _selectComponentInstanceAct = _wrapper->createAction(getMenuId(), tr("Select a Component Instance"), QIcon("icons:icon_select.png"),
316  tr("Select a Component Instance"), tr("Select a Component Instance"),
317  0, _parent, false, this, SLOT(onSelectComponentInstance()));
318 
319  _newSalomeComponentAct = _wrapper->createAction(getMenuId(), tr("Create a New SALOME Component Instance"), QIcon("icons:new_salome_component.png"),
320  tr("Create Component Instance"), tr("Create a New SALOME Component Instance"),
321  0, _parent, false, this, SLOT(onNewSalomeComponent()));
322 
323  _newSalomePythonComponentAct = _wrapper->createAction(getMenuId(), tr("Create a New SALOME Python Component"), QIcon("icons:new_salomepy_component.png"),
324  tr("SALOME Python Component"), tr("Create a New SALOME Python Component"),
325  0, _parent, false, this, SLOT(onNewSalomePythonComponent()));
326 
327  _newCorbaComponentAct = _wrapper->createAction(getMenuId(), tr("Create a New CORBA Component"), QIcon("icons:new_corba_component.png"),
328  tr("CORBA Component"), tr("Create a New CORBA Component"),
329  0, _parent, false, this, SLOT(onNewCorbaComponent()));
330 
331  _salomeServiceNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New SALOME Service Node"), QIcon("icons:new_salome_service_node.png"),
332  tr("SALOME Service Node"), tr("Create a New SALOME Service Node"),
333  0, _parent, false, this, SLOT(onSalomeServiceNode()));
334 
335  _serviceInlineNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New Inline Service Node"), QIcon("icons:new_service_inline_node.png"),
336  tr("Inline Service Node"), tr("Create a New Inline Service Node"),
337  0, _parent, false, this, SLOT(onServiceInlineNode()));
338 
339  _CORBAServiceNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New CORBA Service Node"), QIcon("icons:new_corba_service_node.png"),
340  tr("CORBA Node"), tr("Create a New CORBA Service Node"),
341  0, _parent, false, this, SLOT(onCORBAServiceNode()));
342 
343  _nodeNodeServiceNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New Node referencing a Node"), QIcon("icons:new_nodenode_service_node.png"),
344  tr("Ref on Node"), tr("Create a New Node referencing a Node"),
345  0, _parent, false, this, SLOT(onNodeNodeServiceNode()));
346 
347  _cppNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New C++ Node"), QIcon("icons:new_cpp_node.png"),
348  tr("Cpp Node"), tr("Create a New C++ Node"),
349  0, _parent, false, this, SLOT(onCppNode()));
350 
351  _inDataNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New Input data Node"), QIcon("icons:node.png"),
352  tr("Input Data Node"), tr("Create a New Input data Node"),
353  0, _parent, false, this, SLOT(onInDataNode()));
354 
355  _outDataNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New Output data Node"), QIcon("icons:node.png"),
356  tr("Output Data Node"), tr("Create a New Output data Node"),
357  0, _parent, false, this, SLOT(onOutDataNode()));
358 
359  _inStudyNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New Input Study Node"), QIcon("icons:node.png"),
360  tr("Input Study Node"), tr("Create a New Input Study Node"),
361  0, _parent, false, this, SLOT(onInStudyNode()));
362 
363  _outStudyNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New Output Study Node"), QIcon("icons:node.png"),
364  tr("Output Study Node"), tr("Create a New Output Study Node"),
365  0, _parent, false, this, SLOT(onOutStudyNode()));
366 
367  _inlineScriptNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New Inline Python Script Node"), QIcon("icons:new_inline_script_node.png"),
368  tr("Inline Script Node"), tr("Create a New Inline Python Script Node"),
369  0, _parent, false, this, SLOT(onInlineScriptNode()));
370 
371  _inlineFunctionNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New Inline Python Function Node"), QIcon("icons:new_inline_function_node.png"),
372  tr("Inline Function Node"), tr("Create a New Inline Python Function Node"),
373  0, _parent, false, this, SLOT(onInlineFunctionNode()));
374 
375  _blockNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New Bloc Node"), QIcon("icons:new_block_node.png"),
376  tr("bloc Node"), tr("Create a New Bloc Node"),
377  0, _parent, false, this, SLOT(onBlockNode()));
378 
379  _FORNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New For Loop Node"), QIcon("icons:new_for_loop_node.png"),
380  tr("For Loop Node"), tr("Create a New For Loop Node"),
381  0, _parent, false, this, SLOT(onFORNode()));
382 
383  _FOREACHNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New For Each Loop Node"), QIcon("icons:new_foreach_loop_node.png"),
384  tr("For Each Loop Node"), tr("Create a New For Each Loop Node"),
385  0, _parent, false, this, SLOT(onFOREACHNode()));
386 
387  _WHILENodeAct = _wrapper->createAction(getMenuId(), tr("Create a New While Loop Node"), QIcon("icons:new_while_loop_node.png"),
388  tr("While Loop Node"), tr("Create a New While Loop Node"),
389  0, _parent, false, this, SLOT(onWHILENode()));
390 
391  _SWITCHNodeAct = _wrapper->createAction(getMenuId(), tr("Create a New Switch Node"), QIcon("icons:new_switch_loop_node.png"),
392  tr("Switch Node"), tr("Create a New Switch Node"),
393  0, _parent, false, this, SLOT(onSWITCHNode()));
394 
395  _OptimizerLoopAct = _wrapper->createAction(getMenuId(), tr("Create a New Optimizer Loop Node"), QIcon("icons:new_for_loop_node.png"),
396  tr("Optimizer Loop"), tr("Create a New Optimizer Loop"),
397  0, _parent, false, this, SLOT(onOptimizerLoop()));
398 
399  _nodeFromCatalogAct = _wrapper->createAction(getMenuId(), tr("Create a New Node from Catalog, use drag and drop from catalog"), QIcon("icons:new_from_library_node.png"),
400  tr("Node from Catalog"), tr("Create a New Node from Catalog, use drag and drop from catalog"),
401  0, _parent, false, this, SLOT(onNodeFromCatalog()));
402 
403  _deleteItemAct = _wrapper->createAction(getMenuId(), tr("Delete a Schema Item"), QIcon("icons:delete.png"),
404  tr("Delete Item"), tr("Delete a Schema Item"),
405  0, _parent, false, this, SLOT(onDeleteItem()));
406  _deleteItemAct->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_D); // --- QKeySequence::Delete dangerous...
407 
408  _cutItemAct = _wrapper->createAction(getMenuId(), tr("Cut a Schema Item"), QIcon("icons:cut.png"),
409  tr("Cut Item"), tr("Cut a Schema Item"),
410  0, _parent, false, this, SLOT(onCutItem()));
411  _cutItemAct->setShortcut(QKeySequence::Cut);
412 
413  _copyItemAct = _wrapper->createAction(getMenuId(), tr("Copy a Schema Item"), QIcon("icons:copy.png"),
414  tr("Copy Item"), tr("Copy a Schema Item"),
415  0, _parent, false, this, SLOT(onCopyItem()));
416  _copyItemAct->setShortcut(QKeySequence::Copy);
417 
418  _pasteItemAct = _wrapper->createAction(getMenuId(), tr("Paste a Schema Item"), QIcon("icons:paste.png"),
419  tr("Paste Item"), tr("Paste a Schema Item"),
420  0, _parent, false, this, SLOT(onPasteItem()));
421  _pasteItemAct->setShortcut(QKeySequence::Paste);
422 
423  _putInBlocAct = _wrapper->createAction(getMenuId(), tr("Put node in block"), QIcon("icons:paste.png"),
424  tr("Put node in block"), tr("Put node in block"),
425  0, _parent, false, this, SLOT(onPutInBloc()));
426 
427  _putGraphInBlocAct = _wrapper->createAction(getMenuId(), tr("Bloc"), QIcon("icons:new_block_node.png"),
428  tr("Bloc"), tr("Bloc"),
429  0, _parent, false, this, SLOT(onPutGraphInBloc()));
430 
431  _putGraphInForLoopAct = _wrapper->createAction(getMenuId(), tr("For Loop"), QIcon("icons:new_for_loop_node.png"),
432  tr("For Loop"), tr("For Loop"),
433  0, _parent, false, this, SLOT(onPutGraphInForLoop()));
434 
435  _putGraphInWhileLoopAct = _wrapper->createAction(getMenuId(), tr("While Loop"), QIcon("icons:new_while_loop_node.png"),
436  tr("While Loop"), tr("While Loop"),
437  0, _parent, false, this, SLOT(onPutGraphInWhileLoop()));
438 
439  _putGraphInOptimizerLoopAct = _wrapper->createAction(getMenuId(), tr("Optimizer Loop"), QIcon("icons:new_for_loop_node.png"),
440  tr("Optimizer Loop"), tr("Optimizer Loop"),
441  0, _parent, false, this, SLOT(onPutGraphInOptimizerLoop()));
442 
443  _arrangeLocalNodesAct = _wrapper->createAction(getMenuId(), tr("arrange nodes on that bloc level, without recursion"), QIcon("icons:arrange_nodes.png"),
444  tr("arrange local nodes"), tr("arrange nodes on that bloc level, without recursion"),
445  0, _parent, false, this, SLOT(onArrangeLocalNodes()));
446 
447  _arrangeRecurseNodesAct = _wrapper->createAction(getMenuId(), tr("arrange nodes on that bloc level, with recursion"), QIcon("icons:sample.png"),
448  tr("arrange nodes recursion"), tr("arrange nodes on that bloc level, with recursion"),
449  0, _parent, false, this, SLOT(onArrangeRecurseNodes()));
450 
451  _computeLinkAct = _wrapper->createAction(getMenuId(), tr("compute orthogonal links"), QIcon("icons:rebuild_links.png"),
452  tr("compute links"), tr("compute orthogonal links"),
453  0, _parent, false, this, SLOT(onRebuildLinks()));
454 
455  _zoomToBlocAct = _wrapper->createAction(getMenuId(), tr("zoom 2D view to selected bloc"), QIcon("icons:zoomToBloc.png"),
456  tr("zoom to bloc"), tr("zoom 2D view to the selected composed node"),
457  0, _parent, false, this, SLOT(onZoomToBloc()));
458 
459  _centerOnNodeAct = _wrapper->createAction(getMenuId(), tr("center 2D view on selected node"), QIcon("icons:centerOnNode.png"),
460  tr("center on node"), tr("center 2D view on selected node"),
461  0, _parent, false, this, SLOT(onCenterOnNode()));
462  _centerOnNodeAct->setShortcut(QKeySequence::Find);
463 
464  _shrinkExpand = _wrapper->createAction(getMenuId(), tr("shrink or expand the selected node"), QIcon("icons:shrinkExpand.png"),
465  tr("shrink/expand"), tr("shrink or expand the selected node"),
466  0, _parent, false, this, SLOT(onShrinkExpand()));
467 
468  _shrinkExpandChildren = _wrapper->createAction(getMenuId(), tr("shrink or expand direct children of the selected node"), QIcon("icons:shrinkExpand.png"),
469  tr("shrink/expand children"), tr("shrink or expand direct children of the selected node"),
470  0, _parent, false, this, SLOT(onShrinkExpandChildren()));
471 
472  _shrinkExpandElementaryRecursively = _wrapper->createAction(getMenuId(), tr("shrink or expand elementary nodes of the selected node recursively"), QIcon("icons:shrinkExpand.png"),
473  tr("shrink/expand elementary"), tr("shrink or expand elementary nodes of the selected node recursively"),
474  0, _parent, false, this, SLOT(onShrinkExpandElementaryRecursively()));
475 
476  _toggleStraightLinksAct = _wrapper->createAction(getMenuId(), tr("draw straight or orthogonal links"), QIcon("icons:straightLink.png"),
477  tr("straight/orthogonal"), tr("draw straight or orthogonal links"),
478  0, _parent, true, this, SLOT(onToggleStraightLinks(bool)));
479 
482 
483  _toggleAutomaticComputeLinkAct = _wrapper->createAction(getMenuId(), tr("compute othogonal links automatically when nodes move"), QIcon("icons:autoComputeLink.png"),
484  tr("automatic link"), tr("compute othogonal links automatically when nodes move"),
485  0, _parent, true, this, SLOT(onToggleAutomaticComputeLinks(bool)));
486 
489 
490  _toggleSimplifyLinkAct = _wrapper->createAction(getMenuId(), tr("simplify links by removing unnecessary direction changes"), QIcon("icons:simplifyLink.png"),
491  tr("simplify links"), tr("simplify links by removing unnecessary direction changes"),
492  0, _parent, true, this, SLOT(onToggleSimplifyLinks(bool)));
495 
496  _toggleForce2NodesLinkAct = _wrapper->createAction(getMenuId(), tr("force orthogonal links by adding an edge on simples links"), QIcon("icons:force2nodeLink.png"),
497  tr("force ortho links"), tr("force orthogonal links by adding an edge on simples links"),
498  0, _parent, true, this, SLOT(onToggleForce2NodesLinks(bool)));
499  _toggleForce2NodesLinkAct->setChecked(true);
500 
501  _toggleAddRowColsAct = _wrapper->createAction(getMenuId(), tr("allow more path for the links, for a better separation"), QIcon("icons:addRowCols.png"),
502  tr("separate links"), tr("allow more path for the links, for a better separation"),
503  0, _parent, true, this, SLOT(onToggleAddRowCols(bool)));
506 
507  _selectReferenceAct = _wrapper->createAction(getMenuId(), tr("select reference"), QIcon("icons:ob_service_node.png"),
508  tr("select reference"), tr("select reference"),
509  0, _parent, false, this, SLOT(onSelectReference()));
510 
511  _whatsThisAct = _wrapper->createAction(getMenuId(), tr("active whatsThis Mode to get help on widgets"), QIcon("icons:whatsThis.png"),
512  tr("whatsThis Mode"), tr("active whatsThis Mode to get help on widgets"),
513  0, _parent, false, this, SLOT(onWhatsThis()));
514  _whatsThisAct->setShortcut(QKeySequence::WhatsThis);
515 
516  _withoutStopModeAct = _wrapper->createAction(getMenuId(), tr("set execution mode without stop"), QIcon("icons:run_active.png"),
517  tr("mode without stop"), tr("set execution mode without stop"),
518  0, _parent, true, this, SLOT(onWithoutStopMode(bool)));
519 
520  _breakpointsModeAct = _wrapper->createAction(getMenuId(), tr("set execution mode with stop on breakpoints"), QIcon("icons:breakpoints_active.png"),
521  tr("mode breakpoints"), tr("set execution mode with stop on breakpoints"),
522  0, _parent, true, this, SLOT(onBreakpointsMode(bool)));
523 
524  _stepByStepModeAct = _wrapper->createAction(getMenuId(), tr("set execution mode step by step"), QIcon("icons:step_by_step_active.png"),
525  tr("mode step by step"), tr("set execution mode step by step"),
526  0, _parent, true, this, SLOT(onStepByStepMode(bool)));
527 
528  _toggleStopOnErrorAct = _wrapper->createAction(getMenuId(), tr("Force stop on first error during execution"), QIcon("icons:toggle_stop_on_error.png"),
529  tr("stop on error"), tr("Force stop on first error during execution"),
530  0, _parent, true, this, SLOT(onToggleStopOnError(bool)));
531 
532  _toggleSceneItemVisibleAct = _wrapper->createAction(getMenuId(), tr("toggle 2D scene item visibility"), QIcon("icons:toggleVisibility.png"),
533  tr("visible/hidden"), tr("toggle 2D scene item visibility"),
534  0, _parent, true, this, SLOT(onToggleSceneItemVisible(bool)));
535 
536 
537 
538  _showAllLinksAct = _wrapper->createAction(getMenuId(), tr("Show all the links"), QIcon("icons:showLink.png"),
539  tr("show all links"), tr("Show all the links"),
540  0, _parent, false, this, SLOT(onShowAllLinks()));
541 
542  _hideAllLinksAct = _wrapper->createAction(getMenuId(), tr("Hide all the links"), QIcon("icons:hideLink.png"),
543  tr("hide all links"), tr("Hide all the links"),
544  0, _parent, false, this, SLOT(onHideAllLinks()));
545 
546 
547  _showOnlyPortLinksAct = _wrapper->createAction(getMenuId(), tr("Show only links from/to this port"), QIcon("icons:showLink.png"),
548  tr("show only links"), tr("Show only links from/to this port"),
549  0, _parent, false, this, SLOT(onShowOnlyPortLinks()));
550 
551  _showPortLinksAct = _wrapper->createAction(getMenuId(), tr("Show links from/to this port"), QIcon("icons:showLink.png"),
552  tr("show links"), tr("Show links from/to this port"),
553  0, _parent, false, this, SLOT(onShowPortLinks()));
554 
555  _hidePortLinksAct = _wrapper->createAction(getMenuId(), tr("Hide links from/to this port"), QIcon("icons:hideLink.png"),
556  tr("hide links"), tr("Hide links from/to this port"),
557  0, _parent, false, this, SLOT(onHidePortLinks()));
558 
559 
560  _showOnlyCtrlLinksAct = _wrapper->createAction(getMenuId(), tr("Show only control links from/to this node"), QIcon("icons:showLink.png"),
561  tr("show only Control links"), tr("Show only control links from/to this node"),
562  0, _parent, false, this, SLOT(onShowOnlyCtrlLinks()));
563 
564  _showCtrlLinksAct = _wrapper->createAction(getMenuId(), tr("Show control links from/to this node"), QIcon("icons:showLink.png"),
565  tr("show control links"), tr("Show control links from/to this node"),
566  0, _parent, false, this, SLOT(onShowCtrlLinks()));
567 
568  _hideCtrlLinksAct = _wrapper->createAction(getMenuId(), tr("Hide control links from/to this node"), QIcon("icons:hideLink.png"),
569  tr("hide control links"), tr("Hide control links from/to this node"),
570  0, _parent, false, this, SLOT(onHideCtrlLinks()));
571 
572 
573  _showOnlyLinkAct = _wrapper->createAction(getMenuId(), tr("Show only this link"), QIcon("icons:showLink.png"),
574  tr("show only"), tr("Show only this link"),
575  0, _parent, false, this, SLOT(onShowOnlyLink()));
576 
577  _showLinkAct = _wrapper->createAction(getMenuId(), tr("Show this link"), QIcon("icons:showLink.png"),
578  tr("show"), tr("Show this link"),
579  0, _parent, false, this, SLOT(onShowLink()));
580 
581  _hideLinkAct = _wrapper->createAction(getMenuId(), tr("Hide this link"), QIcon("icons:hideLink.png"),
582  tr("hide"), tr("Hide this link"),
583  0, _parent, false, this, SLOT(onHideLink()));
584 
585 
586  _emphasisPortLinksAct = _wrapper->createAction(getMenuId(), tr("emphasis on links from/to this port"), QIcon("icons:emphasisLink.png"),
587  tr("emphasize links"), tr("emphasis on links from/to this port"),
588  0, _parent, false, this, SLOT(onEmphasisPortLinks()));
589 
590  _emphasisCtrlLinksAct = _wrapper->createAction(getMenuId(), tr("emphasis on control links from/to this node"), QIcon("icons:emphasisLink.png"),
591  tr("emphasize control links"), tr("emphasis on control links from/to this node"),
592  0, _parent, false, this, SLOT(onEmphasisCtrlLinks()));
593 
594  _emphasisLinkAct = _wrapper->createAction(getMenuId(), tr("emphasis on this link"), QIcon("icons:emphasisLink.png"),
595  tr("emphasize"), tr("emphasis on this link"),
596  0, _parent, false, this, SLOT(onEmphasisLink()));
597 
598  _deEmphasizeAllAct = _wrapper->createAction(getMenuId(), tr("remove all emphasis"), QIcon("icons:deEmphasisLink.png"),
599  tr("remove all emphasis"), tr("remove all emphasis"),
600  0, _parent, false, this, SLOT(onDeEmphasizeAll()));
601 
602 
603  _undoAct = _wrapper->createAction(getMenuId(), tr("undo last action"), QIcon("icons:undo.png"),
604  tr("undo"), tr("undo last action"),
605  0, _parent, false, this, SLOT(onUndo()));
606  _undoAct->setShortcut(QKeySequence::Undo);
607 
608  _redoAct = _wrapper->createAction(getMenuId(), tr("redo last action"), QIcon("icons:redo.png"),
609  tr("redo"), tr("redo last action"),
610  0, _parent, false, this, SLOT(onRedo()));
611  _redoAct->setShortcut(QKeySequence::Redo);
612 
613  _showUndoAct = _wrapper->createAction(getMenuId(), tr("show undo commands"), QIcon("icons:undo.png"),
614  tr("show undo"), tr("show undo commands"),
615  0, _parent, false, this, SLOT(onShowUndo()));
616 
617  _showRedoAct = _wrapper->createAction(getMenuId(), tr("show redo commands"), QIcon("icons:redo.png"),
618  tr("show redo"), tr("show redo commands"),
619  0, _parent, false, this, SLOT(onShowRedo()));
620 
621 
622  _execModeGroup = new QActionGroup(this);
626  _withoutStopModeAct->setChecked(true);
627 }
void GenericGui::createContext ( YACS::ENGINE::Proc proc,
const QString &  schemaName,
const QString &  runName,
bool  forEdition 
)

a QtGuiContext instance is created for each schema in edition or each execution or run of a schema. The context stores references of a lot of objects related to the edition or execution.

Parameters
procthe schema to run or edit, loaded from file or just created empty.
schemaNamefilename of the schema in edition, also used in execution to publish a run under the edition name in Salome object browser.
runNamefilename of the schema in execution, not used in edition.
forEditionif true, edition mode, if false, execution mode.

Definition at line 1048 of file GenericGui.cxx.

References DEBTRACE, YACS::HMI::Subject::getName(), YACS::HMI::TreeView::resizeColumns(), YACS::HMI::GuiContext::setCurrentCatalog(), YACS::HMI::SchemaModel::setEdition(), YACS::HMI::QtGuiContext::setEdition(), YACS::ENGINE::Proc::setEdition(), YACS::HMI::QtGuiContext::setEditionRoot(), YACS::HMI::QtGuiContext::setEditTree(), YACS::HMI::QtGuiContext::setFileName(), YACS::HMI::QtGuiContext::setGuiExecutor(), YACS::HMI::GuiContext::setLoading(), YACS::HMI::QtGuiContext::setProc(), YACS::ENGINE::Node::setProperty(), YACS::HMI::QtGuiContext::setScene(), YACS::HMI::QtGuiContext::setSchemaModel(), YACS::HMI::QtGuiContext::setSelectionModel(), YACS::HMI::GuiContext::setSessionCatalog(), YACS::HMI::QtGuiContext::setStackedWidget(), YACS::HMI::QtGuiContext::setStudyId(), YACS::HMI::QtGuiContext::setView(), YACS::HMI::QtGuiContext::setWindow(), YACS::HMI::UPDATE, and YASSERT.

Referenced by YACS::HMI::BatchJobsListDialog::userOK().

1052 {
1053  DEBTRACE("GenericGui::createContext");
1054  clock_t start_t;
1055  clock_t end_t;
1056  start_t = clock();
1057 
1058 
1059  QWidget* central = _parent->centralWidget();
1060  if (central)
1061  central->setFocus();
1062  else
1063  DEBTRACE("No Central Widget");
1064 
1065  QString fileName;
1066  QWidget* refWindow = 0; // --- used only on run to refer to the schema in edition
1067  if (forEdition)
1068  {
1069  fileName = schemaName;
1070  }
1071  else
1072  {
1073  fileName = runName;
1075  refWindow = QtGuiContext::getQtCurrent()->getWindow();
1076  }
1077 
1078  QtGuiContext* context = new QtGuiContext(this);
1079  QtGuiContext::setQtCurrent(context);
1080 
1081  // --- catalogs
1082 
1083  context->setEdition(forEdition);
1085  context->setFileName(fileName);
1087 
1088  // --- scene, viewWindow & GraphicsView
1089 
1090  Scene *scene = new Scene();
1091  QWidget *viewWindow = _wrapper->getNewWindow(scene);
1092  _mapViewContext[viewWindow] = context;
1093  GraphicsView* gView = new GraphicsView(viewWindow);
1094  gView->setScene(scene);
1095  gView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
1096  int studyId = _wrapper->AssociateViewToWindow(gView, viewWindow);
1097  context->setStudyId(studyId);
1098  std::ostringstream value;
1099  value << studyId;
1100  proc->setProperty("DefaultStudyID",value.str());
1101  context->setScene(scene);
1102  context->setView(gView);
1103  context->setWindow(viewWindow);
1104  gView->show();
1105 
1106  // --- Schema Model
1107 
1108  SchemaModel *schemaModel = new SchemaModel(context, viewWindow);
1109  schemaModel->setEdition(forEdition);
1110  context->setSchemaModel(schemaModel);
1111  RootSceneItem *rootSceneItem = new RootSceneItem(context);
1112 
1113  // --- tree associated to model
1114 
1115  FormEditTree *editTree = new FormEditTree(_dwTree);
1116  editTree->setMinimumHeight(400);
1117  _dwTree->setWidget(editTree);
1118  editTree->show();
1119  context->setEditTree(editTree);
1120  editTree->tv_schema->setModel(schemaModel);
1121  context->setSelectionModel(editTree->tv_schema->selectionModel());
1122  _dwTree->raise();
1123 
1124  QObject::connect(editTree->tv_schema->selectionModel(),
1125  SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
1126  schemaModel,
1127  SLOT(updateSelection(const QItemSelection &, const QItemSelection &)));
1128 
1129  // --- stacked widget
1130 
1131  QStackedWidget *stacked = new QStackedWidget(_dwStacked);
1132  _dwStacked->setWidget(stacked);
1133  context->setStackedWidget(stacked);
1135  0,
1136  context->getName().c_str());
1137  context->setEditionRoot(rootEdit);
1138 
1139  QObject::connect(schemaModel,
1140  SIGNAL(signalSelection(const QModelIndex &)),
1141  editTree->tv_schema,
1142  SLOT(viewSelection(const QModelIndex &)));
1143 
1144  // --- load schema
1145 
1146  proc->setEdition(forEdition);
1147 
1148  {
1149  end_t = clock();
1150  double passe = (end_t -start_t);
1151  passe = passe/CLOCKS_PER_SEC;
1152  DEBTRACE("create context -1- : " << passe);
1153  start_t = end_t;
1154  }
1155 
1156  context->setLoading(true);
1157 
1158  context->setProc(proc);
1159  setLoadedPresentation(proc);
1160 
1161  {
1162  end_t = clock();
1163  double passe = (end_t -start_t);
1164  passe = passe/CLOCKS_PER_SEC;
1165  DEBTRACE("create context - load proc- : " << passe);
1166  start_t = end_t;
1167  }
1168 
1169  context->setLoading(false);
1170 
1171  if (forEdition && _wrapper) // --- Edition mode
1172  {
1173  _wrapper->createNewSchema(fileName, viewWindow);
1174  }
1175  else if (_wrapper) // --- Execution Mode
1176  {
1177  GuiExecutor *guiExec = new GuiExecutor(proc);
1178  context->setGuiExecutor(guiExec);
1179  _wrapper->createNewRun(schemaName, fileName, refWindow, viewWindow);
1180  }
1181 
1182 
1185  0); // --- force validity check
1186 
1187  // --- adjust widgets
1188 
1189  TreeView *vtree = dynamic_cast<TreeView*>(editTree->tv_schema);
1190  YASSERT(vtree);
1191  vtree->resizeColumns();
1192  _catalogsWidget->setMinimumWidth(10); // --- reset the constraint on width
1193  editTree->setMinimumHeight(40);
1194  _dwStacked->setMinimumWidth(10);
1195  // --- show menus
1196 
1197  if (forEdition)
1198  {
1199  showExecMenus(false);
1200  showEditionMenus(true);
1201  showCommonMenus(true);
1202  if (_dwTree) _dwTree->setWindowTitle("Tree View: edition mode");
1203  }
1204  else
1205  {
1206  showEditionMenus(false);
1207  showExecMenus(true);
1208  showCommonMenus(true);
1209  _withoutStopModeAct->setChecked(true);
1210  if (_dwTree) _dwTree->setWindowTitle("Tree View: execution mode");
1211  }
1212 
1214  {
1215  end_t = clock();
1216  double passe = (end_t -start_t);
1217  passe = passe/CLOCKS_PER_SEC;
1218  DEBTRACE("create context - end - : " << passe);
1219  start_t = end_t;
1220  }
1221 }
void GenericGui::createForEachLoop ( std::string  type = "double")

Definition at line 2079 of file GenericGui.cxx.

References DEBTRACE.

Referenced by YACS::HMI::MenusBase::foreachAction().

2080 {
2081  DEBTRACE("GenericGui::createForEachLoop");
2083 }
void GenericGui::createMenus ( )

Definition at line 629 of file GenericGui.cxx.

Referenced by Yacsgui::initialize().

630 {
631  int aMenuId;
632  aMenuId = _wrapper->createMenu( tr( "File" ), -1, -1 );
633  _wrapper->createMenu( _wrapper->separator(), aMenuId, -1, 10 );
634  aMenuId = _wrapper->createMenu( "YACS", aMenuId, -1, 10 );
635  _wrapper->createMenu( _newSchemaAct, aMenuId );
636  _wrapper->createMenu( _importSchemaAct, aMenuId );
637 
638  aMenuId = _wrapper->createMenu( "YACS", -1, -1, 30 );
639  _wrapper->createMenu( _newSchemaAct, aMenuId );//, 10
640  _wrapper->createMenu( _importSchemaAct, aMenuId );
642  _wrapper->createMenu( _wrapper->separator(), aMenuId);
643  _wrapper->createMenu( _exportSchemaAct, aMenuId );
645  _wrapper->createMenu( _wrapper->separator(), aMenuId);
650  _wrapper->createMenu( _wrapper->separator(), aMenuId);
651  _wrapper->createMenu( _undoAct, aMenuId );
652  _wrapper->createMenu( _redoAct, aMenuId );
653  _wrapper->createMenu( _showUndoAct, aMenuId );
654  _wrapper->createMenu( _showRedoAct, aMenuId );
655  _wrapper->createMenu( _wrapper->separator(), aMenuId);
656  _wrapper->createMenu( _startResumeAct, aMenuId );
657  _wrapper->createMenu( _abortAct, aMenuId );
658  _wrapper->createMenu( _pauseAct, aMenuId );
659  _wrapper->createMenu( _resetAct, aMenuId );
660  _wrapper->createMenu( _wrapper->separator(), aMenuId);
661  _wrapper->createMenu( _saveRunStateAct, aMenuId );
662  //_wrapper->createMenu( _newEditionAct, aMenuId );
663  _wrapper->createMenu( _wrapper->separator(), aMenuId);
667  _wrapper->createMenu( _wrapper->separator(), aMenuId);
669  _wrapper->createMenu( _wrapper->separator(), aMenuId);
671  _wrapper->createMenu( _wrapper->separator(), aMenuId);
677  _wrapper->createMenu( _wrapper->separator(), aMenuId);
678  _wrapper->createMenu( _showAllLinksAct, aMenuId );
679  _wrapper->createMenu( _hideAllLinksAct, aMenuId );
680  _wrapper->createMenu( _wrapper->separator(), aMenuId);
681  _wrapper->createMenu( _whatsThisAct, aMenuId );
682 }
void GenericGui::createTools ( )

Definition at line 684 of file GenericGui.cxx.

Referenced by Yacsgui::initialize().

685 {
686  int aToolId = _wrapper->createTool ( tr( "YACS Toolbar" ), QString( "YACSToolbar" ) );
687  _wrapper->createTool( _newSchemaAct, aToolId );
688  _wrapper->createTool( _importSchemaAct, aToolId );
689  _wrapper->createTool( _wrapper->separator(), aToolId );
690  _wrapper->createTool( _exportSchemaAct, aToolId );
692  _wrapper->createTool( _wrapper->separator(), aToolId);
697  _wrapper->createTool( _wrapper->separator(), aToolId );
698  _wrapper->createTool( _undoAct, aToolId );
699  _wrapper->createTool( _redoAct, aToolId );
700  _wrapper->createTool( _wrapper->separator(), aToolId );
701  _wrapper->createTool( _startResumeAct, aToolId );
702  _wrapper->createTool( _abortAct, aToolId );
703  _wrapper->createTool( _pauseAct, aToolId );
704  _wrapper->createTool( _resetAct, aToolId );
705  _wrapper->createTool( _wrapper->separator(), aToolId );
706  _wrapper->createTool( _saveRunStateAct, aToolId );
707  //_wrapper->createTool( _newEditionAct, aToolId );
711  _wrapper->createTool( _wrapper->separator(), aToolId );
713  _wrapper->createTool( _wrapper->separator(), aToolId );
715  _wrapper->createTool( _wrapper->separator(), aToolId );
719  //_wrapper->createTool( _toggleForce2NodesLinkAct, aToolId );
721  _wrapper->createTool( _wrapper->separator(), aToolId );
722  _wrapper->createTool( _showAllLinksAct, aToolId );
723  _wrapper->createTool( _hideAllLinksAct, aToolId );
724  _wrapper->createTool( _wrapper->separator(), aToolId );
725  _wrapper->createTool( _whatsThisAct, aToolId );
726 }
void GenericGui::displayALink ( bool  isShown)
private

Definition at line 2383 of file GenericGui.cxx.

2384 {
2386  if (! QtGuiContext::getQtCurrent()->_mapOfSceneItem.count(sub)) return;
2388  item->setVisible(isShown);
2389 }
void GenericGui::displayControlLinks ( bool  isShown)
private

Definition at line 2332 of file GenericGui.cxx.

2333 {
2334  if (!QtGuiContext::getQtCurrent()) return;
2335  map<pair<YACS::ENGINE::Node*, YACS::ENGINE::Node*>,YACS::HMI::SubjectControlLink*>::const_iterator it;
2336  for (it = QtGuiContext::getQtCurrent()->_mapOfSubjectControlLink.begin();
2338  ++it)
2339  {
2340  YACS::HMI::SubjectControlLink* sub = (*it).second;
2341  if (!sub) continue;
2343  item->setVisible(isShown);
2344  }
2345 }
void GenericGui::displayLinks ( bool  isShown)
private

Definition at line 2317 of file GenericGui.cxx.

2318 {
2319  if (!QtGuiContext::getQtCurrent()) return;
2320  map<pair<YACS::ENGINE::OutPort*, YACS::ENGINE::InPort*>,YACS::HMI::SubjectLink*>::const_iterator it;
2321  for (it = QtGuiContext::getQtCurrent()->_mapOfSubjectLink.begin();
2323  ++it)
2324  {
2325  YACS::HMI::SubjectLink* sub = (*it).second;
2326  if (!sub) continue;
2328  item->setVisible(isShown);
2329  }
2330 }
void GenericGui::displayPortLinks ( bool  isShown)
private

Definition at line 2347 of file GenericGui.cxx.

References DEBTRACE, YACS::HMI::Subject::getName(), YACS::HMI::SubjectNode::getName(), and YACS::HMI::SubjectNode::getSubjectControlLinks().

2348 {
2350  DEBTRACE("displayPortLinks, subject : " << sub->getName());
2351  SubjectDataPort *sport = dynamic_cast<SubjectDataPort*>(sub);
2352  if (sport)
2353  {
2354  DEBTRACE("dataPort : " << sport->getName());
2355  list<SubjectLink*> linkList = sport->getListOfSubjectLink();
2356  list<SubjectLink*>::const_iterator it = linkList.begin();
2357  for( ; it != linkList.end(); ++it)
2358  {
2359  YACS::HMI::SubjectLink* sub = (*it);
2360  if (!sub) continue;
2362  item->setVisible(isShown);
2363  }
2364  return;
2365  }
2366  SubjectNode *snode = dynamic_cast<SubjectNode*>(sub);
2367  if (snode)
2368  {
2369  DEBTRACE("Node : " << snode->getName());
2370  list<SubjectControlLink*> linkList = snode->getSubjectControlLinks();
2371  list<SubjectControlLink*>::const_iterator it = linkList.begin();
2372  for( ; it != linkList.end(); ++it)
2373  {
2374  YACS::HMI::SubjectControlLink* sub = (*it);
2375  if (!sub) continue;
2377  item->setVisible(isShown);
2378  }
2379  return;
2380  }
2381 }
void GenericGui::emphasizePortLink ( YACS::HMI::SubjectDataPort sub,
bool  emphasize 
)
private

Definition at line 2601 of file GenericGui.cxx.

References DEBTRACE, YACS::HMI::EMPHASIZE, YACS::HMI::SubjectDataPort::getListOfSubjectLink(), YACS::HMI::SubjectDataPort::getName(), YACS::HMI::SubjectLink::getSubjectInPort(), YACS::HMI::SubjectLink::getSubjectOutPort(), and YACS::HMI::Subject::update().

2602 {
2603  DEBTRACE("dataPort : " << sub->getName());
2604  list<SubjectLink*> linkList = sub->getListOfSubjectLink();
2605  list<SubjectLink*>::const_iterator it = linkList.begin();
2606  for( ; it != linkList.end(); ++it)
2607  {
2608  YACS::HMI::SubjectLink* subli = (*it);
2609  if (!subli) continue;
2610  subli->update(EMPHASIZE, emphasize, sub);
2611  Subject *sin = subli->getSubjectInPort();
2612  Subject *sout = subli->getSubjectOutPort();
2613  sin->update(EMPHASIZE, emphasize, sub);
2614  sout->update(EMPHASIZE, emphasize, sub);
2615  }
2616 }
CatalogWidget* YACS::HMI::GenericGui::getCatalogWidget ( )
inline
YACSGuiLoader* YACS::HMI::GenericGui::getLoader ( )
inline

Definition at line 87 of file GenericGui.hxx.

Referenced by YACS::HMI::BatchJobsListDialog::userOK().

87 { return _loader; };
std::list< std::string > GenericGui::getMachineList ( )

Definition at line 1004 of file GenericGui.cxx.

References YACS::ENGINE::RuntimeSALOME::getOrb(), YACS::ENGINE::getSALOMERuntime(), CORBAEngineTest::i, and orb.

1005 {
1006  if (!_machineList.empty()) return _machineList;
1007 
1009  CORBA::ORB_ptr orb = runTime->getOrb();
1010  if (!orb) return _machineList;
1011 
1012  SALOME_NamingService namingService(orb);
1013  SALOME_LifeCycleCORBA lcc(&namingService);
1014 
1015  CORBA::Object_var obj =
1016  namingService.Resolve(SALOME_ResourcesManager::_ResourcesManagerNameInNS);
1017  if (CORBA::is_nil(obj)) return _machineList;
1018 
1019  Engines::ResourcesManager_var resManager = Engines::ResourcesManager::_narrow(obj);
1020  if(!resManager) return _machineList;
1021 
1022  Engines::ResourceParameters params;
1023  lcc.preSet(params);
1024 
1025  Engines::ResourceList* resourceList =
1026  resManager->GetFittingResources(params);
1027 
1028  for (int i = 0; i < resourceList->length(); i++)
1029  {
1030  const char* aResource = (*resourceList)[i];
1031  _machineList.push_back(aResource);
1032  }
1033 
1034  return _machineList;
1035 }
int YACS::HMI::GenericGui::getMenuId ( )
inlineprotected

Definition at line 208 of file GenericGui.hxx.

208 { return _menuId++; }
QString GenericGui::getSaveFileName ( const QString &  fileName = QString())
protected

bug confirmOverwrite : correction Qt 4.3.5

Definition at line 1513 of file GenericGui.cxx.

References DEBTRACE, and PMMLBasicsTestLauncher::ret.

1514 {
1515  QFileDialog dialog(_parent, "Save schema", fileName);
1516  QStringList filters;
1517  filters << "XML files (*.xml)"
1518  << "Any files (*)";
1519  dialog.setFileMode(QFileDialog::AnyFile);
1520  dialog.setNameFilters(filters);
1521  dialog.selectNameFilter("(*.xml)");
1522  dialog.setDefaultSuffix("xml");
1523  dialog.setConfirmOverwrite(true);
1524  //dialog.setConfirmOverwrite(false); // bug Qt4.3.3
1525  dialog.setAcceptMode(QFileDialog::AcceptSave);
1526  QString selectedFile;
1527  QStringList fileNames;
1528  fileNames.clear();
1529  if (bool ret = dialog.exec())
1530  {
1531  DEBTRACE(ret << " " << dialog.confirmOverwrite());
1532  fileNames = dialog.selectedFiles();
1533  if (!fileNames.isEmpty())
1534  selectedFile = fileNames.first();
1535  }
1536  QString filteredName = _guiEditor->asciiFilter(selectedFile);
1537  DEBTRACE(filteredName.toStdString());
1538  return filteredName;
1539 }
void GenericGui::hideAllMenus ( )

Definition at line 736 of file GenericGui.cxx.

737 {
738  showBaseMenus (false);
739  showCommonMenus (false);
740  showEditionMenus(false);
741  showExecMenus (false);
742 }
void GenericGui::initialMenus ( )

Definition at line 728 of file GenericGui.cxx.

729 {
730  showEditionMenus(false);
731  showExecMenus(false);
732  showCommonMenus(false);
733  showBaseMenus(true);
734 }
void GenericGui::loadSchema ( const std::string &  filename,
bool  edit = true,
bool  arrangeLocalNodes = false 
)
virtual

Definition at line 1308 of file GenericGui.cxx.

References DEBTRACE, YACS::ENGINE::Proc::getLogger(), YACS::ENGINE::Logger::getStr(), and YACS::ENGINE::Logger::isEmpty().

Referenced by Yacsgui::loadSchema().

1309 {
1310  YACS::ENGINE::Proc *proc = _loader->load(filename.c_str());
1311  if (!proc)
1312  return;
1313  YACS::ENGINE::Logger* logger= proc->getLogger("parser");
1314  if(!logger->isEmpty())
1315  {
1316  DEBTRACE(logger->getStr());
1317  }
1318  QString fn=QString::fromUtf8(filename.c_str());
1319  if(edit)
1320  createContext(proc, fn, "", true);
1321  else
1322  createContext(proc, fn, fn, false);
1323  if (arrangeLocalNodes)
1324  {
1326  }
1327 }
void GenericGui::onAbort ( )
privateslot

Definition at line 1786 of file GenericGui.cxx.

References DEBTRACE.

1787 {
1788  DEBTRACE("GenericGui::onAbort");
1789  if (!QtGuiContext::getQtCurrent()) return;
1790  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
1792 }
void GenericGui::onArrangeLocalNodes ( )
privateslot

Definition at line 2169 of file GenericGui.cxx.

References DEBTRACE.

2170 {
2171  DEBTRACE("GenericGui::onArrangeLocalNodes");
2172  _guiEditor->arrangeNodes(false);
2173 }
void GenericGui::onArrangeRecurseNodes ( )
privateslot

Definition at line 2175 of file GenericGui.cxx.

References DEBTRACE.

2176 {
2177  DEBTRACE("GenericGui::onArrangeRecurseNodes");
2178  _guiEditor->arrangeNodes(true);
2179 }
void GenericGui::onBlockNode ( )
privateslot

Definition at line 2061 of file GenericGui.cxx.

References DEBTRACE.

2062 {
2063  DEBTRACE("GenericGui::onBlockNode");
2065 }
void GenericGui::onBreakpointsMode ( bool  checked)
privateslot

Definition at line 2276 of file GenericGui.cxx.

References DEBTRACE.

2277 {
2278  DEBTRACE("GenericGui::onWithoutStopMode " << checked);
2279  if (!QtGuiContext::getQtCurrent()) return;
2280  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
2282 }
void GenericGui::onCenterOnNode ( )
privateslot

Definition at line 2193 of file GenericGui.cxx.

References DEBTRACE.

2194 {
2195  DEBTRACE("GenericGui::onCenterOnNode");
2197 }
void GenericGui::onChooseBatchJob ( )
privateslot

Definition at line 1766 of file GenericGui.cxx.

References DEBTRACE.

1766  {
1767  DEBTRACE("GenericGui::onChooseBatchJob");
1768 
1769  // Show the Batch Jobs list
1770  if(_BJLdialog) delete _BJLdialog;
1771  _BJLdialog = new BatchJobsListDialog(tr("Select one Batch Job to watch"),this);
1772  _BJLdialog->show();
1773  _BJLdialog->move(300,200);
1774  _BJLdialog->resize(450,200);
1775 
1776 }
void GenericGui::onCleanOnExit ( )
slot

Definition at line 2589 of file GenericGui.cxx.

References DEBTRACE.

Referenced by Yacsgui::onCleanOnExit().

2590 {
2591  DEBTRACE("GenericGui::onCleanOnExit");
2592  int studyId = _wrapper->activeStudyId();
2593  map<QWidget*, YACS::HMI::QtGuiContext*> mapViewContextCopy = _mapViewContext;
2594  map<QWidget*, YACS::HMI::QtGuiContext*>::iterator it = mapViewContextCopy.begin();
2595  for (; it != mapViewContextCopy.end(); ++it)
2596  {
2597  closeContext((*it).first, true);
2598  }
2599 }
void GenericGui::onCopyItem ( )
privateslot

Definition at line 2121 of file GenericGui.cxx.

References DEBTRACE.

2122 {
2123  DEBTRACE("GenericGui::onCopyItem");
2125 }
void GenericGui::onCORBAServiceNode ( )
privateslot

Definition at line 2002 of file GenericGui.cxx.

References DEBTRACE.

2003 {
2004  DEBTRACE("GenericGui::onCORBAServiceNode");
2005  _guiEditor->CreateNode("CORBANode");
2006 }
void GenericGui::onCppNode ( )
privateslot

Definition at line 2013 of file GenericGui.cxx.

References DEBTRACE.

2014 {
2015  DEBTRACE("GenericGui::onCppNode");
2016  _guiEditor->CreateNode("CppNode");
2017 }
void GenericGui::onCreateDataType ( )
privateslot

Definition at line 1939 of file GenericGui.cxx.

References DEBTRACE.

1940 {
1941  DEBTRACE("GenericGui::onCreateDataType");
1942 }
void GenericGui::onCutItem ( )
privateslot

Definition at line 2115 of file GenericGui.cxx.

References DEBTRACE.

2116 {
2117  DEBTRACE("GenericGui::onCutItem");
2119 }
void GenericGui::onDeEmphasizeAll ( )
privateslot

Definition at line 2544 of file GenericGui.cxx.

References DEBTRACE, YACS::HMI::EMPHASIZE, and YACS::HMI::Subject::update().

2545 {
2546  DEBTRACE("GenericGui::onDeEmphasizeAll");
2547  map<Subject*, SchemaItem*>::const_iterator it = QtGuiContext::getQtCurrent()->_mapOfSchemaItem.begin();
2548  for( ; it != QtGuiContext::getQtCurrent()->_mapOfSchemaItem.end(); ++it)
2549  {
2550  Subject* sub = (*it).first;
2551  sub->update(EMPHASIZE, false, sub);
2552  }
2553 }
void GenericGui::onDeleteItem ( )
privateslot

Definition at line 2109 of file GenericGui.cxx.

References DEBTRACE.

2110 {
2111  DEBTRACE("GenericGui::onDeleteItem");
2113 }
void GenericGui::onEditDataTypes ( )
privateslot

Definition at line 1934 of file GenericGui.cxx.

References DEBTRACE.

1935 {
1936  DEBTRACE("GenericGui::onEditDataTypes");
1937 }
void GenericGui::onEmphasisCtrlLinks ( )
privateslot

Definition at line 2489 of file GenericGui.cxx.

References DEBTRACE, YACS::HMI::EMPHASIZE, YACS::HMI::Subject::getName(), YACS::HMI::SubjectNode::getName(), YACS::HMI::SubjectNode::getSubjectControlLinks(), YACS::HMI::SubjectControlLink::getSubjectInNode(), YACS::HMI::SubjectControlLink::getSubjectOutNode(), and YACS::HMI::Subject::update().

2490 {
2491  DEBTRACE("GenericGui::onEmphasisCtrlLinks");
2493  DEBTRACE("Emphasize Ctrl Links, subject : " << sub->getName());
2494  if (!sub)
2495  return;
2496  SubjectNode *snode = dynamic_cast<SubjectNode*>(sub);
2497  if (snode)
2498  {
2499  DEBTRACE("Node : " << snode->getName());
2500  list<SubjectControlLink*> linkList = snode->getSubjectControlLinks();
2501  list<SubjectControlLink*>::const_iterator it = linkList.begin();
2502  for( ; it != linkList.end(); ++it)
2503  {
2504  YACS::HMI::SubjectControlLink* sub = (*it);
2505  if (!sub) continue;
2506  sub->update(EMPHASIZE, true, sub);
2507  Subject *sin = sub->getSubjectInNode();
2508  Subject *sout = sub->getSubjectOutNode();
2509  sin->update(EMPHASIZE, true, sub);
2510  sout->update(EMPHASIZE, true, sub);
2511  }
2512  return;
2513  }
2514 }
void GenericGui::onEmphasisLink ( )
privateslot

Definition at line 2535 of file GenericGui.cxx.

References DEBTRACE, YACS::HMI::EMPHASIZE, and YACS::HMI::Subject::update().

2536 {
2537  DEBTRACE("GenericGui::onEmphasisLink");
2539  if (!sub)
2540  return;
2541  sub->update(EMPHASIZE, true, sub);
2542 }
void GenericGui::onEmphasisPortLinks ( )
privateslot

Definition at line 2424 of file GenericGui.cxx.

References DEBTRACE, YACS::HMI::Subject::getName(), YACS::HMI::SubjectNode::getName(), YACS::HMI::SubjectNode::getSubjectInputPorts(), and YACS::HMI::SubjectNode::getSubjectOutputPorts().

2425 {
2426  DEBTRACE("GenericGui::onEmphasisPortLinks");
2427  if (!QtGuiContext::getQtCurrent()) return;
2429  DEBTRACE("EmphasizePortLinks, subject : " << sub->getName());
2430  if (!sub)
2431  return;
2432 
2433  SubjectDataPort *sport = dynamic_cast<SubjectDataPort*>(sub);
2434  if (sport)
2435  {
2436  emphasizePortLink(sport, true);
2437  return;
2438  }
2439 
2440  // --- if a Node, explore all data ports
2441 
2442  SubjectNode *snode = dynamic_cast<SubjectNode*>(sub);
2443  if (snode)
2444  {
2445  DEBTRACE("Node : " << snode->getName());
2446  {
2447  list<SubjectInputPort*> linkList = snode->getSubjectInputPorts();
2448  list<SubjectInputPort*>::const_iterator it = linkList.begin();
2449  for( ; it != linkList.end(); ++it)
2450  {
2451  YACS::HMI::SubjectInputPort* sub = (*it);
2452  if (!sub) continue;
2453  emphasizePortLink(sub, true);
2454  }
2455  }
2456  {
2457  list<SubjectOutputPort*> linkList = snode->getSubjectOutputPorts();
2458  list<SubjectOutputPort*>::const_iterator it = linkList.begin();
2459  for( ; it != linkList.end(); ++it)
2460  {
2461  YACS::HMI::SubjectOutputPort* sub = (*it);
2462  if (!sub) continue;
2463  emphasizePortLink(sub, true);
2464  }
2465  }
2466  return;
2467  }
2468 }
void GenericGui::onExportSchema ( )
privateslot

Definition at line 1541 of file GenericGui.cxx.

References YACS::ENGINE::VisitorSaveSchema::closeFileSchema(), DEBTRACE, YACS::ENGINE::Proc::getProc(), YACS::ENGINE::VisitorSaveSchema::openFileSchema(), and YACS::HMI::VisitorSaveGuiSchema::visitProc().

1542 {
1543  DEBTRACE("GenericGui::onExportSchema");
1544  if (!QtGuiContext::getQtCurrent()) return;
1546  QString fo = QtGuiContext::getQtCurrent()->getFileName();
1547  QString foo = fo;
1548  QString fn = fo;
1549  if (fo.startsWith("newSchema_"))
1550  {
1551  fo.clear();
1552  fn = getSaveFileName(fo);
1553  }
1554  if (fn.isEmpty()) return;
1555 
1556  DEBTRACE("GenericGui::onExportSchema: " << fn.toUtf8().constData());
1557  //to be sure that all pending changes are effective
1558  _parent->setFocus();
1560  VisitorSaveGuiSchema aWriter(proc);
1561  aWriter.openFileSchema( fn.toUtf8().constData() );
1562  aWriter.visitProc();
1563  aWriter.closeFileSchema();
1565 
1566  if (fn.compare(foo) && _wrapper)
1568 }
void GenericGui::onExportSchemaAs ( )
privateslot

Definition at line 1570 of file GenericGui.cxx.

References YACS::ENGINE::VisitorSaveSchema::closeFileSchema(), DEBTRACE, YACS::ENGINE::Proc::getProc(), YACS::ENGINE::VisitorSaveSchema::openFileSchema(), and YACS::HMI::VisitorSaveGuiSchema::visitProc().

1571 {
1572  DEBTRACE("GenericGui::onExportSchemaAs");
1573  _isSaved = false;
1574  if (!QtGuiContext::getQtCurrent()) return;
1576  QString fo = QtGuiContext::getQtCurrent()->getFileName();
1577  QString foo = fo;
1578  if (fo.startsWith("newSchema_")) fo.clear();
1579  QString fn = getSaveFileName(fo);
1580  if (fn.isEmpty()) return;
1581 
1582  DEBTRACE("GenericGui::onExportSchemaAs: " << fn.toUtf8().constData());
1584  VisitorSaveGuiSchema aWriter(proc);
1585  aWriter.openFileSchema(fn.toUtf8().constData());
1586  aWriter.visitProc();
1587  aWriter.closeFileSchema();
1588  _isSaved = true;
1590 
1591  if (fn.compare(foo) && _wrapper)
1593 }
void GenericGui::onFOREACHNode ( )
privateslot

Definition at line 2073 of file GenericGui.cxx.

References DEBTRACE.

2074 {
2075  DEBTRACE("GenericGui::onFOREACHNode");
2076  createForEachLoop("double");
2077 }
void GenericGui::onFORNode ( )
privateslot

Definition at line 2067 of file GenericGui.cxx.

References DEBTRACE.

2068 {
2069  DEBTRACE("GenericGui::onFORNode");
2071 }
void GenericGui::onGetContainerLog ( )
privateslot

Definition at line 1890 of file GenericGui.cxx.

References DEBTRACE, YACS::HMI::SubjectNode::getNode(), gui.logview::log, LogViewer::readFile(), and LogViewer::setText().

1891 {
1892  DEBTRACE("GenericGui::onGetContainerLog");
1893  if (!QtGuiContext::getQtCurrent()) return;
1894  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
1896  SubjectElementaryNode *snode = dynamic_cast<SubjectElementaryNode*>(sub);
1897  if (!snode) return;
1899 
1900  LogViewer *lv = new LogViewer("Node Container Log", _parent);
1901  if (log.empty())
1902  {
1903  string info = "\n";
1904  if (dynamic_cast<YACS::ENGINE::ServiceNode*>(snode->getNode()))
1905  {
1906  info +="The container log of this node\n";
1907  info += "is not stored in a file and \n";
1908  info += "can't be displayed here, \n";
1909  info += "but you can have a look at \n";
1910  info += "the SALOME standard output,\n";
1911  info += "on your terminal...";
1912  }
1913  else
1914  {
1915  info += "See YACS Container log \n";
1916  info += "(on main proc menu) \n";
1917  info += "for all inline nodes";
1918  }
1919  lv->setText(info);
1920  }
1921  else
1922  lv->readFile(log);
1923  lv->show();
1924 }
void GenericGui::onGetErrorDetails ( )
privateslot

Definition at line 1868 of file GenericGui.cxx.

References DEBTRACE, YACS::ENGINE::Node::getErrorDetails(), YACS::HMI::SubjectNode::getNode(), gui.logview::log, and LogViewer::setText().

1869 {
1870  DEBTRACE("GenericGui::onGetErrorDetails");
1871  if (!QtGuiContext::getQtCurrent()) return;
1873  SubjectNode *snode = dynamic_cast<SubjectNode*>(sub);
1874  if (!snode) return;
1875  string log;
1877  {
1879  }
1880  else
1881  {
1882  log = snode->getNode()->getErrorDetails();
1883  }
1884 
1885  LogViewer *lv = new LogViewer("Node Error Details", _parent);
1886  lv->setText(log);
1887  lv->show();
1888 }
void GenericGui::onGetErrorReport ( )
privateslot

Definition at line 1846 of file GenericGui.cxx.

References DEBTRACE, YACS::ENGINE::Node::getErrorReport(), YACS::HMI::SubjectNode::getNode(), gui.logview::log, and LogViewer::setText().

1847 {
1848  DEBTRACE("GenericGui::onGetErrorReport");
1849  if (!QtGuiContext::getQtCurrent()) return;
1851  SubjectNode *snode = dynamic_cast<SubjectNode*>(sub);
1852  if (!snode) return;
1853  string log;
1855  {
1857  }
1858  else
1859  {
1860  log = snode->getNode()->getErrorReport();
1861  }
1862 
1863  LogViewer *lv = new LogViewer("Node error report", _parent);
1864  lv->setText(log);
1865  lv->show();
1866 }
void GenericGui::onGetYacsContainerLog ( )
privateslot

Definition at line 1835 of file GenericGui.cxx.

References DEBTRACE, gui.logview::log, and ContainerLogViewer::readFile().

1836 {
1837  DEBTRACE("GenericGui::onGetYacsContainerLog");
1838  if (!QtGuiContext::getQtCurrent()) return;
1839  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
1841  ContainerLogViewer *lv = new ContainerLogViewer("YACS Container Log", _parent);
1842  lv->readFile(log);
1843  lv->show();
1844 }
void GenericGui::onHelpContextModule ( const QString &  theComponentName,
const QString &  theFileName,
const QString &  theContext = QString() 
)
virtual

Definition at line 2618 of file GenericGui.cxx.

Referenced by YACS::HMI::TreeView::event().

2619 {
2620  _wrapper->onHelpContextModule(theComponentName,theFileName,theContext);
2621 }
void GenericGui::onHideAllLinks ( )
privateslot

Definition at line 2398 of file GenericGui.cxx.

References DEBTRACE.

2399 {
2400  DEBTRACE("GenericGui::onHideAllLinks");
2401  displayLinks(false);
2402  displayControlLinks(false);
2403 }
void GenericGui::onHideCtrlLinks ( )
privateslot

Definition at line 2483 of file GenericGui.cxx.

References DEBTRACE.

2484 {
2485  DEBTRACE("GenericGui::onHideCtrlLinks");
2486  displayPortLinks(false);
2487 }
void GenericGui::onHideLink ( )
privateslot

Definition at line 2529 of file GenericGui.cxx.

References DEBTRACE.

2530 {
2531  DEBTRACE("GenericGui::onHideLink");
2532  displayALink(false);
2533 }
void GenericGui::onHidePortLinks ( )
privateslot

Definition at line 2418 of file GenericGui.cxx.

References DEBTRACE.

2419 {
2420  DEBTRACE("GenericGui::onHidePortLinks");
2421  displayPortLinks(false);
2422 }
void GenericGui::onImportCatalog ( )
privateslot

Definition at line 1595 of file GenericGui.cxx.

References DEBTRACE.

1596 {
1597  DEBTRACE("GenericGui::onImportCatalog");
1598  QFileDialog dialog(_parent,
1599  "Choose a YACS Schema to load as a Catalog" ,
1600  QString::null,
1601  tr( "XML-Files (*.xml);;All Files (*)" ));
1602 
1603  dialog.setHistory(_wrapper->getQuickDirList());
1604 
1605  QString fn;
1606  QStringList fileNames;
1607  if (dialog.exec())
1608  {
1609  fileNames = dialog.selectedFiles();
1610  if (!fileNames.isEmpty())
1611  fn = fileNames.first();
1612  }
1613 
1614  if ( !fn.isEmpty() )
1615  _catalogsWidget->addCatalogFromFile(fn.toStdString());
1616 }
void GenericGui::onImportDataType ( )
privateslot

Definition at line 1944 of file GenericGui.cxx.

References DEBTRACE.

1945 {
1946  DEBTRACE("GenericGui::onImportDataType");
1947  if (_dwCatalogs) _dwCatalogs->raise();
1948 }
void GenericGui::onImportSchema ( )
privateslot

Definition at line 1329 of file GenericGui.cxx.

References DEBTRACE, YACS::ENGINE::Logger::getStr(), and YACS::ENGINE::Logger::isEmpty().

1330 {
1331  clock_t start_t;
1332  clock_t end_t;
1333  start_t = clock();
1334  DEBTRACE("GenericGui::onImportSchema");
1335  QFileDialog dialog(_parent,
1336  "Choose a filename to load" ,
1337  QString::null,
1338  tr( "XML-Files (*.xml);;All Files (*)" ));
1339 
1340  dialog.setHistory(_wrapper->getQuickDirList());
1341 
1342  QString fn;
1343  QStringList fileNames;
1344  if (dialog.exec())
1345  {
1346  fileNames = dialog.selectedFiles();
1347  if (!fileNames.isEmpty())
1348  fn = fileNames.first();
1349  }
1350 
1351  if ( !fn.isEmpty() )
1352  {
1353  // add ".xml" suffix
1354  QFileInfo fi(fn);
1355  if (!fi.exists() && fi.suffix() != "xml")
1356  fn += ".xml";
1357 
1358  DEBTRACE("file loaded : " <<fn.toUtf8().constData());
1359  YACS::ENGINE::Proc *proc = 0;
1360 
1361  try {
1362  proc = _loader->load(fn.toUtf8().constData());
1363  }
1364  catch (...) {
1365  }
1366 
1367  {
1368  end_t = clock();
1369  double passe = (end_t -start_t);
1370  passe = passe/CLOCKS_PER_SEC;
1371  DEBTRACE("load xml file : " << passe);
1372  start_t = end_t;
1373  }
1374 
1375  if (!proc)
1376  {
1377  QMessageBox msgBox(QMessageBox::Critical,
1378  "Import YACS Schema, native YACS XML format",
1379  "The file has not the native YACS XML format or is not readable.");
1380  msgBox.exec();
1381  return;
1382  }
1383  YACS::ENGINE::Logger* logger= proc->getLogger("parser");
1384  if(!logger->isEmpty())
1385  {
1386  DEBTRACE(logger->getStr());
1387  }
1388  createContext(proc, fn, "", true);
1389  }
1390 }
void GenericGui::onImportSupervSchema ( )
privateslot

Definition at line 1392 of file GenericGui.cxx.

References DEBTRACE, gui.CONNECTOR::f(), YACS::ENGINE::Logger::getStr(), YACS::ENGINE::Logger::isEmpty(), PMMLBasicsTestLauncher::ret, and YASSERT.

1393 {
1394  DEBTRACE("GenericGui::onImportSupervSchema");
1395  QFileDialog dialog(_parent,
1396  "Choose a SUPERV filename to load" ,
1397  QString::null,
1398  tr( "XML-Files (*.xml);;All Files (*)" ));
1399 
1400  dialog.setHistory(_wrapper->getQuickDirList());
1401 
1402  QString fn;
1403  QStringList fileNames;
1404  if (dialog.exec())
1405  {
1406  fileNames = dialog.selectedFiles();
1407  if (!fileNames.isEmpty())
1408  fn = fileNames.first();
1409  }
1410 
1411  if (fn.isEmpty()) return;
1412 
1413  // add ".xml" suffix
1414  QFileInfo fi(fn);
1415  if (!fi.exists() && fi.suffix() != "xml")
1416  fn += ".xml";
1417 
1418  DEBTRACE("file loaded : " <<fn.toStdString());
1419  QString tmpFileName;
1420  try
1421  {
1422 #ifdef WIN32
1423  QString tmpDir = getenv("TEMP");
1424  QString fileExt = "bat";
1425 #else
1426  QString tmpDir = "/tmp";
1427  QString fileExt = "sh";
1428 #endif
1429  QDir aTmpDir(tmpDir);
1430  aTmpDir.mkdir(QString("YACS_") + getenv("USER"));
1431  YASSERT(aTmpDir.cd(QString("YACS_") + getenv("USER")));
1432  QDateTime curTime = QDateTime::currentDateTime();
1433  tmpFileName = "SUPERV_import_" + curTime.toString("yyyyMMdd_hhmmss") + ".xml";
1434  QString tmpOutput = "salomeloader_output";
1435  tmpFileName = aTmpDir.absoluteFilePath(tmpFileName);
1436  DEBTRACE(tmpFileName.toStdString());
1437 
1438  QString aCall = "salomeloader."+ fileExt+ " "+ fn + " " + tmpFileName + " > " + tmpOutput;
1439  DEBTRACE(aCall.toStdString());
1440 
1441  int ret = system(aCall.toLatin1());
1442  if(ret != 0)
1443  {
1444  // --- read file with logs
1445  fstream f(tmpOutput.toLatin1());
1446  stringstream hfile;
1447  hfile << f.rdbuf();
1448  f.close();
1449 
1450  // --- Problem in execution
1451  int status=WEXITSTATUS(ret);
1452  if(status == 1)
1453  {
1454  QString mes = "Problems in conversion: some errors but an incomplete proc has nevertheless been created.\n\n";
1455  mes += QString(hfile.str().c_str());
1456  QMessageBox msgBox(QMessageBox::Warning,
1457  "Import YACS Schema, SUPERV XML format",
1458  mes);
1459  msgBox.exec();
1460  }
1461  else if(status == 2)
1462  {
1463  QString mes = "Problems in conversion: a fatal error has been encountered. The proc can't be created.\n\n";
1464  mes += QString(hfile.str().c_str());
1465  QMessageBox msgBox(QMessageBox::Critical,
1466  "Import YACS Schema, SUPERV XML format",
1467  mes);
1468  msgBox.exec();
1469  return;
1470  }
1471  else
1472  {
1473  DEBTRACE("Unknown problem: " << ret );
1474  QMessageBox msgBox(QMessageBox::Critical,
1475  "Import YACS Schema, SUPERV XML format",
1476  "Unexpected exception in salomeloader.");
1477  msgBox.exec();
1478  return;
1479  }
1480  }
1481  }
1482  catch(...)
1483  {
1484  QMessageBox msgBox(QMessageBox::Critical,
1485  "Import YACS Schema, SUPERV XML format",
1486  "Unexpected exception in convertSupervFile");
1487  msgBox.exec();
1488  return;
1489  }
1490 
1491  fn = tmpFileName;
1492  if (fn.isEmpty()) return; // must not happen
1493 
1494  DEBTRACE("file loaded : " <<fn.toStdString());
1495  YACS::ENGINE::Proc *proc = _loader->load(fn.toLatin1());
1496  if (!proc)
1497  {
1498  QMessageBox msgBox(QMessageBox::Critical,
1499  "Import YACS Schema, SUPERV file converted in native YACS XML format",
1500  "The file has not the native YACS XML format or is not readable.");
1501  msgBox.exec();
1502  return;
1503  }
1504  YACS::ENGINE::Logger* logger= proc->getLogger("parser");
1505  if(!logger->isEmpty())
1506  {
1507  DEBTRACE(logger->getStr());
1508  }
1509  createContext(proc, fn, "", true);
1510 }
void GenericGui::onInDataNode ( )
privateslot

Definition at line 2025 of file GenericGui.cxx.

References DEBTRACE.

2026 {
2027  DEBTRACE("GenericGui::onInDataNode");
2028  _guiEditor->CreateNode("PresetNode");
2029 }
void GenericGui::onInlineFunctionNode ( )
privateslot

Definition at line 2055 of file GenericGui.cxx.

References DEBTRACE.

2056 {
2057  DEBTRACE("GenericGui::onInlineFunctionNode");
2058  _guiEditor->CreateNode("PyFunction");
2059 }
void GenericGui::onInlineScriptNode ( )
privateslot

Definition at line 2049 of file GenericGui.cxx.

References DEBTRACE.

2050 {
2051  DEBTRACE("GenericGui::onInlineScriptNode");
2052  _guiEditor->CreateNode("PyScript");
2053 }
void GenericGui::onInStudyNode ( )
privateslot

Definition at line 2037 of file GenericGui.cxx.

References DEBTRACE.

2038 {
2039  DEBTRACE("GenericGui::onInStudyNode");
2040  _guiEditor->CreateNode("StudyInNode");
2041 }
void GenericGui::onLoadAndRunSchema ( )
privateslot

Definition at line 1725 of file GenericGui.cxx.

References DEBTRACE, YACS::ENGINE::Logger::getStr(), and YACS::ENGINE::Logger::isEmpty().

1726 {
1727  DEBTRACE("GenericGui::onLoadAndRunSchema");
1728  QString fn = QFileDialog::getOpenFileName( _parent,
1729  "Choose a filename to load" ,
1730  QString::null,
1731  tr( "XML-Files (*.xml);;All Files (*)" ));
1732  if ( !fn.isEmpty() )
1733  {
1734  // add ".xml" suffix
1735  QFileInfo fi(fn);
1736  if (!fi.exists() && fi.suffix() != "xml")
1737  fn += ".xml";
1738 
1739  DEBTRACE("file loaded : " <<fn.toStdString());
1740  YACS::ENGINE::Proc *proc =0;
1741 
1742  try {
1743  proc = _loader->load(fn.toLatin1());
1744  }
1745  catch (...) {
1746  }
1747 
1748  if (!proc)
1749  {
1750  QMessageBox msgBox(QMessageBox::Critical,
1751  "Import YACS Schema, native YACS XML format",
1752  "The file has not the native YACS XML format or is not readable.");
1753  msgBox.exec();
1754  return;
1755  }
1756  YACS::ENGINE::Logger* logger= proc->getLogger("parser");
1757  if(!logger->isEmpty())
1758  {
1759  DEBTRACE(logger->getStr());
1760  }
1761  createContext(proc, fn, "", true);
1763  }
1764 }
void GenericGui::onLoadRunStateSchema ( )
privateslot

Definition at line 1719 of file GenericGui.cxx.

References DEBTRACE.

1720 {
1721  DEBTRACE("GenericGui::onLoadRunStateSchema");
1722  onRunLoadedSchema(true);
1723 }
void GenericGui::onNewContainer ( )
privateslot

Definition at line 1961 of file GenericGui.cxx.

References DEBTRACE.

1962 {
1963  DEBTRACE("GenericGui::onNewContainer");
1965 }
void GenericGui::onNewCorbaComponent ( )
privateslot

Definition at line 1984 of file GenericGui.cxx.

References DEBTRACE.

1985 {
1986  DEBTRACE("GenericGui::onNewCorbaComponent");
1987 }
void GenericGui::onNewEdition ( )
privateslot

Definition at line 1827 of file GenericGui.cxx.

References DEBTRACE.

1828 {
1829  DEBTRACE("GenericGui::onNewEdition");
1830  // if (!QtGuiContext::getQtCurrent()) return;
1831  // if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
1832  // QtGuiContext::getQtCurrent()->getGuiExecutor()->resetDataflow();
1833 }
void GenericGui::onNewHPContainer ( )
privateslot

Definition at line 1967 of file GenericGui.cxx.

References DEBTRACE.

1968 {
1969  DEBTRACE("GenericGui::onNewHPContainer");
1971 }
void GenericGui::onNewSalomeComponent ( )
privateslot

Definition at line 1973 of file GenericGui.cxx.

References DEBTRACE.

1974 {
1975  DEBTRACE("GenericGui::onNewSalomeComponent");
1977 }
void GenericGui::onNewSalomePythonComponent ( )
privateslot

Definition at line 1979 of file GenericGui.cxx.

References DEBTRACE.

1980 {
1981  DEBTRACE("GenericGui::onNewSalomePythonComponent");
1982 }
void GenericGui::onNewSchema ( )
privateslot

Definition at line 1292 of file GenericGui.cxx.

References YACS::ENGINE::RuntimeSALOME::createProc(), DEBTRACE, and YACS::ENGINE::getSALOMERuntime().

1293 {
1294  DEBTRACE("GenericGui::onNewSchema");
1295 
1296  std::stringstream name;
1297  name << "newSchema_" << ++_schemaCnt;
1298 
1300  YACS::ENGINE::Proc *proc = runTime->createProc(name.str());
1301 
1302  _loader->reset();
1303 
1304  QString fileName = name.str().c_str();
1305  createContext(proc, fileName, "", true);
1306 }
void GenericGui::onNodeFromCatalog ( )
privateslot

Definition at line 2103 of file GenericGui.cxx.

References DEBTRACE.

2104 {
2105  DEBTRACE("GenericGui::onNodeFromCatalog");
2106  if (_dwCatalogs) _dwCatalogs->raise();
2107 }
void GenericGui::onNodeNodeServiceNode ( )
privateslot

Definition at line 2008 of file GenericGui.cxx.

References DEBTRACE.

2009 {
2010  DEBTRACE("GenericGui::onNodeNodeServiceNode");
2011 }
void GenericGui::onOptimizerLoop ( )
privateslot

Definition at line 2097 of file GenericGui.cxx.

References DEBTRACE.

2098 {
2099  DEBTRACE("GenericGui::onOptimizerLoop");
2101 }
void GenericGui::onOutDataNode ( )
privateslot

Definition at line 2031 of file GenericGui.cxx.

References DEBTRACE.

2032 {
2033  DEBTRACE("GenericGui::onOutDataNode");
2034  _guiEditor->CreateNode("OutNode");
2035 }
void GenericGui::onOutStudyNode ( )
privateslot

Definition at line 2043 of file GenericGui.cxx.

References DEBTRACE.

2044 {
2045  DEBTRACE("GenericGui::onOutStudyNode");
2046  _guiEditor->CreateNode("StudyOutNode");
2047 }
void GenericGui::onPasteItem ( )
privateslot

Definition at line 2127 of file GenericGui.cxx.

References DEBTRACE.

2128 {
2129  DEBTRACE("GenericGui::onPasteItem");
2131 }
void GenericGui::onPause ( )
privateslot

Definition at line 1794 of file GenericGui.cxx.

References DEBTRACE.

1795 {
1796  DEBTRACE("GenericGui::onPause");
1797  if (!QtGuiContext::getQtCurrent()) return;
1798  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
1800 }
void GenericGui::onPutGraphInBloc ( )
privateslot

Definition at line 2138 of file GenericGui.cxx.

References DEBTRACE.

2139 {
2140  DEBTRACE("GenericGui::onPutGraphInBloc");
2142  _guiEditor->arrangeNodes(false);
2143 }
void GenericGui::onPutGraphInForLoop ( )
privateslot

Definition at line 2145 of file GenericGui.cxx.

References DEBTRACE.

2146 {
2147  DEBTRACE("GenericGui::onPutGraphInForLoop");
2148  _guiEditor->PutGraphInNode("ForLoop");
2149 }
void GenericGui::onPutGraphInOptimizerLoop ( )
privateslot

Definition at line 2163 of file GenericGui.cxx.

References DEBTRACE.

2164 {
2165  DEBTRACE("GenericGui::onPutGraphInOptimizerLoop");
2166  _guiEditor->PutGraphInNode("OptimizerLoop");
2167 }
void GenericGui::onPutGraphInWhileLoop ( )
privateslot

Definition at line 2157 of file GenericGui.cxx.

References DEBTRACE.

2158 {
2159  DEBTRACE("GenericGui::onPutGraphInWhileLoop");
2160  _guiEditor->PutGraphInNode("WhileLoop");
2161 }
void GenericGui::onPutInBloc ( )
privateslot

Definition at line 2133 of file GenericGui.cxx.

2134 {
2136 }
void GenericGui::onRebuildLinks ( )
privateslot

Definition at line 2181 of file GenericGui.cxx.

References DEBTRACE.

2182 {
2183  DEBTRACE("GenericGui::onRebuildLinks");
2185 }
void GenericGui::onRedo ( )
privateslot

Definition at line 2567 of file GenericGui.cxx.

References DEBTRACE.

2568 {
2569  DEBTRACE("GenericGui::onRedo");
2570  if (QtGuiContext::getQtCurrent()->_setOfModifiedSubjects.empty())
2571  {
2573  // Empty the clipboard in order to avoid the copy of a destroyed object.
2575  }
2576  else Message("redo not possible when there are local modifications not confirmed");
2577 }
void GenericGui::onReset ( )
privateslot

Definition at line 1802 of file GenericGui.cxx.

References DEBTRACE.

1803 {
1804  DEBTRACE("GenericGui::onReset");
1805  if (!QtGuiContext::getQtCurrent()) return;
1806  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
1808 }
void GenericGui::onRunLoadedSchema ( bool  withState = false)
privateslot

Definition at line 1618 of file GenericGui.cxx.

References YACS::ENGINE::LinkInfo::ALL_STOP_ASAP, YACS::ENGINE::LinkInfo::areWarningsOrErrors(), YACS::ENGINE::ComposedNode::checkConsistency(), DEBTRACE, YACS::ENGINE::Proc::getProc(), YACS::ENGINE::Node::isValid(), YACS::HMI::GuiExecutor::setLoadStateFile(), YACS::HMI::GuiExecutor::setStopOnError(), YACS::HMI::GuiExecutor::startResumeDataflow(), YACS::Exception::what(), and YASSERT.

1619 {
1620  DEBTRACE("GenericGui::onRunLoadedSchema");
1621  if (!QtGuiContext::getQtCurrent()) return;
1622 
1623  clock_t start_t;
1624  clock_t end_t;
1625  start_t = clock();
1626 
1627  // --- check proc state (cf. editionProc)
1628 
1629  if (!QtGuiContext::getQtCurrent()->_setOfModifiedSubjects.empty())
1630  {
1631  set<Subject*>::iterator it = QtGuiContext::getQtCurrent()->_setOfModifiedSubjects.begin();
1632  (*it)->select(true);
1633  return;
1634  }
1635 
1637  if (!proc->isValid())
1638  {
1640  return;
1641  }
1642 
1644  try
1645  {
1646  proc->checkConsistency(info);
1647  }
1648  catch (Exception &ex)
1649  {
1650  DEBTRACE(ex.what());
1652  return;
1653  }
1654  if (info.areWarningsOrErrors()) return;
1655 
1656  {
1657  end_t = clock();
1658  double passe = (end_t -start_t);
1659  passe = passe/CLOCKS_PER_SEC;
1660  cerr <<"run schema -1- : " << passe << endl;
1661  start_t = end_t;
1662  }
1663  // --- save proc under a run name
1664 
1665  QFileInfo fo = QtGuiContext::getQtCurrent()->getFileName();
1666  QString procName = fo.baseName();
1667  //QString tmpDir = SALOMEDS_Tool::GetTmpDir().c_str();
1668 #ifdef WIN32
1669  QString tmpDir = getenv("TEMP");
1670 #else
1671  QString tmpDir = "/tmp";
1672 #endif
1673  QDir aTmpDir(tmpDir);
1674  aTmpDir.mkdir(QString("YACS_") + getenv("USER"));
1675  YASSERT(aTmpDir.cd(QString("YACS_") + getenv("USER")));
1676  QDateTime curTime = QDateTime::currentDateTime();
1677  QString aRunName = procName + "_" + curTime.toString("yyyyMMdd_hhmmss") + ".xml";
1678  aRunName = aTmpDir.absoluteFilePath(aRunName);
1679  DEBTRACE(aRunName.toStdString());
1680 
1681  VisitorSaveGuiSchema aWriter(proc);
1682  aWriter.openFileSchema(aRunName.toStdString());
1683  aWriter.visitProc();
1684  aWriter.closeFileSchema();
1685 
1686  // --- create a run context
1687 
1688  YACS::ENGINE::Proc *procrun = _loader->load(aRunName.toLatin1());
1689  {
1690  end_t = clock();
1691  double passe = (end_t -start_t);
1692  passe = passe/CLOCKS_PER_SEC;
1693  cerr <<"run schema -2- : " << passe << endl;
1694  start_t = end_t;
1695  }
1696  createContext(procrun, QtGuiContext::getQtCurrent()->getFileName(), aRunName, false);
1697 
1698  // load state if required
1699 
1701  if (!executor) return;
1702  if (withState)
1703  {
1704  QString fn = QFileDialog::getOpenFileName( _parent,
1705  "Choose a previous run state to load" ,
1706  QString::null,
1707  tr( "XML-Files (*.xml);;All Files (*)" ));
1708  if (!fn.isEmpty())
1709  {
1710  DEBTRACE("run state to load: " <<fn.toStdString());
1711  executor->setLoadStateFile(fn.toStdString());
1712  }
1713  }
1714  executor->startResumeDataflow(true); // --- initialise gui state
1715  if(_toggleStopOnErrorAct->isChecked())
1716  executor->setStopOnError(false);
1717 }
void GenericGui::onSalomeServiceNode ( )
privateslot

Definition at line 1990 of file GenericGui.cxx.

References DEBTRACE.

1991 {
1992  DEBTRACE("GenericGui::onSalomeServiceNode");
1993  _guiEditor->CreateNode("SalomeNode");
1994 }
void GenericGui::onSaveRunState ( )
privateslot

Definition at line 1810 of file GenericGui.cxx.

References DEBTRACE.

1811 {
1812  DEBTRACE("GenericGui::onSaveRunState");
1813  if (!QtGuiContext::getQtCurrent()) return;
1814  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
1815  QDateTime curTime = QDateTime::currentDateTime();
1816  QFileInfo procName = QtGuiContext::getQtCurrent()->getFileName();
1817  QString stateName = procName.baseName();
1818  DEBTRACE(stateName.toStdString());
1819  stateName += "_state_" + curTime.toString("yyyyMMdd_hhmmss") + ".xml";
1820  DEBTRACE(stateName.toStdString());
1821  stateName = getSaveFileName(stateName);
1822  DEBTRACE(stateName.toStdString());
1823  if (!stateName.isEmpty())
1824  QtGuiContext::getQtCurrent()->getGuiExecutor()->saveState(stateName.toStdString());
1825 }
void GenericGui::onSelectComponentInstance ( )
privateslot

Definition at line 1950 of file GenericGui.cxx.

References DEBTRACE, YACS::ENGINE::ComponentInstance::getCompoName(), YACS::HMI::SubjectComponent::getComponent(), gui.CONNECTOR::ref(), and YASSERT.

1951 {
1952  DEBTRACE("GenericGui::onSelectComponentInstance");
1954  if (!sub) return;
1955  SubjectComponent *ref = dynamic_cast<SubjectComponent*>(sub);
1956  YASSERT(ref);
1959 }
void GenericGui::onSelectReference ( )
privateslot

Definition at line 2252 of file GenericGui.cxx.

References YACS::HMI::SubjectReference::getReference(), gui.CONNECTOR::ref(), YACS::HMI::Subject::select(), and YASSERT.

2253 {
2255  if (!sub) return;
2256  SubjectReference *ref = dynamic_cast<SubjectReference*>(sub);
2257  YASSERT(ref);
2258  SubjectServiceNode *snode = dynamic_cast<SubjectServiceNode*>(ref->getReference());
2259  snode->select(true);
2260 }
void GenericGui::onServiceInlineNode ( )
privateslot

Definition at line 1996 of file GenericGui.cxx.

References DEBTRACE.

1997 {
1998  DEBTRACE("GenericGui::onServiceInlineNode");
1999  _guiEditor->CreateNode("SalomePythonNode");
2000 }
void GenericGui::onShowAllLinks ( )
privateslot

Definition at line 2391 of file GenericGui.cxx.

References DEBTRACE.

2392 {
2393  DEBTRACE("GenericGui::onShowAllLinks");
2394  displayLinks(true);
2395  displayControlLinks(true);
2396 }
void GenericGui::onShowCtrlLinks ( )
privateslot

Definition at line 2477 of file GenericGui.cxx.

References DEBTRACE.

2478 {
2479  DEBTRACE("GenericGui::onShowCtrlLinks");
2480  displayPortLinks(true);
2481 }
void GenericGui::onShowLink ( )
privateslot

Definition at line 2523 of file GenericGui.cxx.

References DEBTRACE.

2524 {
2525  DEBTRACE("GenericGui::onShowLink");
2526  displayALink(true);
2527 }
void GenericGui::onShowOnlyCtrlLinks ( )
privateslot

Definition at line 2470 of file GenericGui.cxx.

References DEBTRACE.

2471 {
2472  DEBTRACE("GenericGui::onShowOnlyCtrlLinks");
2473  onHideAllLinks();
2474  displayPortLinks(true);
2475 }
void GenericGui::onShowOnlyLink ( )
privateslot

Definition at line 2516 of file GenericGui.cxx.

References DEBTRACE.

2517 {
2518  DEBTRACE("GenericGui::onShowOnlyLink");
2519  onHideAllLinks();
2520  displayALink(true);
2521 }
void GenericGui::onShowOnlyPortLinks ( )
privateslot

Definition at line 2405 of file GenericGui.cxx.

References DEBTRACE.

2406 {
2407  DEBTRACE("GenericGui::onShowOnlyPortLinks");
2408  onHideAllLinks();
2409  displayPortLinks(true);
2410 }
void GenericGui::onShowPortLinks ( )
privateslot

Definition at line 2412 of file GenericGui.cxx.

References DEBTRACE.

2413 {
2414  DEBTRACE("GenericGui::onShowPortLinks");
2415  displayPortLinks(true);
2416 }
void GenericGui::onShowRedo ( )
privateslot

Definition at line 2584 of file GenericGui.cxx.

2585 {
2587 }
void GenericGui::onShowUndo ( )
privateslot

Definition at line 2579 of file GenericGui.cxx.

2580 {
2582 }
void GenericGui::onShrinkExpand ( )
privateslot

Definition at line 2199 of file GenericGui.cxx.

References DEBTRACE.

2199  {
2200  DEBTRACE("GenericGui::onShrinkExpand");
2202 }
void GenericGui::onShrinkExpandChildren ( )
privateslot

Definition at line 2204 of file GenericGui.cxx.

References DEBTRACE.

2204  {
2205  DEBTRACE("GenericGui::onShrinkExpandChildren");
2206  _guiEditor->shrinkExpand(Qt::ControlModifier|Qt::ShiftModifier);
2207 }
void GenericGui::onShrinkExpandElementaryRecursively ( )
privateslot

Definition at line 2209 of file GenericGui.cxx.

References DEBTRACE.

2209  {
2210  DEBTRACE("GenericGui::onShrinkExpandElementaryRecursively");
2211  _guiEditor->shrinkExpand(Qt::ControlModifier);
2212 }
void GenericGui::onShutdownProc ( )
privateslot

Definition at line 1926 of file GenericGui.cxx.

References DEBTRACE.

1927 {
1928  DEBTRACE("GenericGui::onShutdownProc");
1929  if (!QtGuiContext::getQtCurrent()) return;
1930  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
1932 }
void GenericGui::onStartResume ( )
privateslot

Definition at line 1778 of file GenericGui.cxx.

References DEBTRACE.

1779 {
1780  DEBTRACE("GenericGui::onStartResume");
1781  if (!QtGuiContext::getQtCurrent()) return;
1782  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
1784 }
void GenericGui::onStepByStepMode ( bool  checked)
privateslot

Definition at line 2284 of file GenericGui.cxx.

References DEBTRACE.

2285 {
2286  DEBTRACE("GenericGui::onWithoutStopMode " << checked);
2287  if (!QtGuiContext::getQtCurrent()) return;
2288  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
2290 }
void GenericGui::onSWITCHNode ( )
privateslot

Definition at line 2091 of file GenericGui.cxx.

References DEBTRACE.

2092 {
2093  DEBTRACE("GenericGui::onSWITCHNode");
2095 }
void GenericGui::onToggleAddRowCols ( bool  checked)
privateslot

Definition at line 2246 of file GenericGui.cxx.

References DEBTRACE.

2247 {
2248  Scene::_addRowCols = checked;
2249  DEBTRACE("Scene::_addRowCols=" << checked);
2250 }
void GenericGui::onToggleAutomaticComputeLinks ( bool  checked)
privateslot

Definition at line 2228 of file GenericGui.cxx.

References DEBTRACE.

2229 {
2230  Scene::_autoComputeLinks = checked;
2231  DEBTRACE("Scene::_autoComputeLinks=" << checked);
2232 }
void GenericGui::onToggleForce2NodesLinks ( bool  checked)
privateslot

Definition at line 2240 of file GenericGui.cxx.

References DEBTRACE.

2241 {
2242  Scene::_force2NodesLink = checked;
2243  DEBTRACE("Scene::_force2NodesLink=" << checked);
2244 }
void GenericGui::onToggleSceneItemVisible ( bool  checked)
privateslot

Definition at line 2303 of file GenericGui.cxx.

References DEBTRACE.

2304 {
2305  DEBTRACE("GenericGui::onToggleSceneItemVisible " << checked);
2306  if (!QtGuiContext::getQtCurrent()) return;
2308  SubjectNode *snode = dynamic_cast<SubjectNode*>(sub);
2309  if (!snode) return;
2310  DEBTRACE("---");
2311  if (!QtGuiContext::getQtCurrent()->_mapOfSceneItem.count(sub)) return;
2312  DEBTRACE("---");
2314  item->setVisible(checked);
2315 }
void GenericGui::onToggleSimplifyLinks ( bool  checked)
privateslot

Definition at line 2234 of file GenericGui.cxx.

References DEBTRACE.

2235 {
2236  Scene::_simplifyLinks = checked;
2237  DEBTRACE("Scene::_simplifyLinks=" << checked);
2238 }
void GenericGui::onToggleStopOnError ( bool  checked)
privateslot

Definition at line 2292 of file GenericGui.cxx.

References DEBTRACE.

2293 {
2294  DEBTRACE("GenericGui::onToggleStopOnError " << checked);
2295  if (!QtGuiContext::getQtCurrent()) return;
2296  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
2297  if(checked)
2299  else
2301 }
void GenericGui::onToggleStraightLinks ( bool  checked)
privateslot

Definition at line 2214 of file GenericGui.cxx.

References DEBTRACE, YACS::HMI::SWITCHSHAPE, and YACS::HMI::Subject::update().

2215 {
2216  Scene::_straightLinks = checked;
2217  DEBTRACE("Scene::_straightLinks=" << checked);
2219  return;
2220  map<Subject*, SchemaItem*>::const_iterator it = QtGuiContext::getQtCurrent()->_mapOfSchemaItem.begin();
2221  for( ; it != QtGuiContext::getQtCurrent()->_mapOfSchemaItem.end(); ++it)
2222  {
2223  Subject* sub = (*it).first;
2224  sub->update(SWITCHSHAPE, 0, 0);
2225  }
2226 }
void GenericGui::onUndo ( )
privateslot

Definition at line 2555 of file GenericGui.cxx.

References DEBTRACE.

2556 {
2557  DEBTRACE("GenericGui::onUndo");
2558  if (QtGuiContext::getQtCurrent()->_setOfModifiedSubjects.empty())
2559  {
2561  // Empty the clipboard in order to avoid the copy of a destroyed object.
2563  }
2564  else Message("undo not possible when there are local modifications not confirmed");
2565 }
void GenericGui::onWhatsThis ( )
privateslot

Definition at line 2262 of file GenericGui.cxx.

References DEBTRACE.

2263 {
2264  DEBTRACE("GenericGui::onWhatsThis");
2265  QWhatsThis::enterWhatsThisMode();
2266 }
void GenericGui::onWHILENode ( )
privateslot

Definition at line 2085 of file GenericGui.cxx.

References DEBTRACE.

2086 {
2087  DEBTRACE("GenericGui::onWHILENode");
2089 }
void GenericGui::onWithoutStopMode ( bool  checked)
privateslot

Definition at line 2268 of file GenericGui.cxx.

References DEBTRACE.

2269 {
2270  DEBTRACE("GenericGui::onWithoutStopMode " << checked);
2271  if (!QtGuiContext::getQtCurrent()) return;
2272  if (!QtGuiContext::getQtCurrent()->getGuiExecutor()) return;
2274 }
void GenericGui::onXMLNode ( )
privateslot

Definition at line 2019 of file GenericGui.cxx.

References DEBTRACE.

2020 {
2021  DEBTRACE("GenericGui::onXMLNode");
2022  _guiEditor->CreateNode("XmlNode");
2023 }
void GenericGui::onZoomToBloc ( )
privateslot

Definition at line 2187 of file GenericGui.cxx.

References DEBTRACE.

2188 {
2189  DEBTRACE("GenericGui::onZoomToBloc");
2191 }
void GenericGui::putGraphInForeachLoop ( std::string  type)

Definition at line 2151 of file GenericGui.cxx.

References DEBTRACE.

Referenced by YACS::HMI::MenusBase::putGraphInForeachAction().

2152 {
2153  DEBTRACE("GenericGui::PutGraphInForeachLoop");
2154  _guiEditor->PutGraphInNode("ForEachLoop_"+type);
2155 }
void GenericGui::raiseStacked ( )

Definition at line 999 of file GenericGui.cxx.

1000 {
1001  if (_dwStacked) _dwStacked->raise();
1002 }
void GenericGui::setLoadedPresentation ( YACS::ENGINE::Proc proc)

Definition at line 1225 of file GenericGui.cxx.

References YACS::HMI::PrsData::_expanded, YACS::HMI::PrsData::_expHeight, YACS::HMI::PrsData::_expWidth, YACS::HMI::PrsData::_expx, YACS::HMI::PrsData::_expy, YACS::HMI::PrsData::_height, YACS::HMI::PrsData::_shownState, YACS::HMI::PrsData::_width, YACS::HMI::PrsData::_x, YACS::HMI::PrsData::_y, DEBTRACE, YACS::HMI::SceneNodeItem::getExpandedX(), YACS::HMI::SceneNodeItem::getExpandedY(), YACS::HMI::SceneNodeItem::getHeaderBottom(), YACS::HMI::SceneNodeItem::getParent(), YACS::HMI::SceneNodeItem::getShownState(), YACS::HMI::SceneNodeItem::setExpanded(), YACS::HMI::SceneNodeItem::setExpandedPos(), YACS::HMI::SceneNodeItem::setExpandedWH(), YACS::HMI::SceneNodeItem::setHeight(), YACS::HMI::SceneNodeItem::setShownState(), YACS::HMI::SceneNodeItem::setWidth(), YACS::HMI::shrinkHidden, YACS::HMI::SceneNodeItem::updateLinks(), and YASSERT.

1226 {
1227  DEBTRACE("GenericGui::setLoadedPresentation");
1229  map<SceneNodeItem*, QPointF> nodesToMove;
1230  map<YACS::ENGINE::Node*, PrsData> presNodes = _loader->getPrsData(proc);
1231  if (!presNodes.empty())
1232  {
1233  map<YACS::ENGINE::Node*, PrsData>::iterator it = presNodes.begin();
1234  for (; it!= presNodes.end(); ++it)
1235  {
1236  YACS::ENGINE::Node* node = (*it).first;
1237  PrsData pres = (*it).second;
1240  YASSERT(item);
1241  SceneNodeItem *inode = dynamic_cast<SceneNodeItem*>(item);
1242  YASSERT(inode);
1243  inode->setPos(QPointF(pres._x, pres._y));
1244  inode->setWidth(pres._width);
1245  inode->setHeight(pres._height);
1246  inode->setExpanded(pres._expanded);
1247  QPointF anExpandedPos = QPointF(pres._expx, pres._expy);
1248  if (anExpandedPos.isNull())
1249  anExpandedPos = inode->pos();
1250  inode->setExpandedPos(anExpandedPos);
1251  inode->setExpandedWH(pres._expWidth, pres._expHeight);
1252  inode->setShownState(shownState(pres._shownState));
1253 
1254  // collect nodes to correct it's Y-position if this collides with parent's header
1255  if (inode->getParent() ) {
1256  qreal anX = inode->x();
1257  qreal anY = inode->y();
1258  if (inode->getShownState() == shrinkHidden) {
1259  anX = inode->getExpandedX();
1260  anY = inode->getExpandedY();
1261  }
1262  if (anY < inode->getParent()->getHeaderBottom())
1263  nodesToMove[inode] = QPointF(anX, inode->getParent()->getHeaderBottom()+1);
1264  }
1265  }
1266  }
1268 
1269  //after loading of presentation:
1270 
1271  //move nodes because of progress bar, if any was added
1272  map<SceneNodeItem*, QPointF>::iterator it = nodesToMove.begin();
1273  for (; it!= nodesToMove.end(); ++it)
1274  {
1275  (*it).first->setTopLeft((*it).second);
1276  }
1277 
1278  //update links
1281  else
1282  {
1285  SceneComposedNodeItem *proc = dynamic_cast<SceneComposedNodeItem*>(item);
1286  proc->updateLinks();
1287  }
1288 }
void GenericGui::showBaseMenus ( bool  show)

Definition at line 744 of file GenericGui.cxx.

References DEBTRACE.

void GenericGui::showCommonMenus ( bool  show)

Definition at line 806 of file GenericGui.cxx.

References DEBTRACE.

void GenericGui::showDockWidgets ( bool  isVisible)

Definition at line 988 of file GenericGui.cxx.

References DEBTRACE.

Referenced by Yacsgui::activateModule(), and Yacsgui::deactivateModule().

989 {
990  DEBTRACE("GenericGui::showDockWidgets " << isVisible);
991  if (_dwTree) _dwTree->setVisible(isVisible);
992  if (_dwTree) _dwTree->toggleViewAction()->setVisible(isVisible);
993  if (_dwStacked) _dwStacked->setVisible(isVisible);
994  if (_dwStacked) _dwStacked->toggleViewAction()->setVisible(isVisible);
995  if (_dwCatalogs) _dwCatalogs->setVisible(isVisible);
996  if (_dwCatalogs) _dwCatalogs->toggleViewAction()->setVisible(isVisible);
997 }
void GenericGui::showEditionMenus ( bool  show)
void GenericGui::showExecMenus ( bool  show)

Definition at line 781 of file GenericGui.cxx.

References DEBTRACE.

782 {
783  DEBTRACE("GenericGui::showExecMenus " << show);
794  //_wrapper->setMenuShown(_newEditionAct, show);
795  //_wrapper->setToolShown(_newEditionAct, show);
804 }
void GenericGui::switchContext ( QWidget view,
bool  onExit = false 
)

Definition at line 825 of file GenericGui.cxx.

References DEBTRACE, YACS::HMI::QtGuiContext::getEditTree(), YACS::HMI::QtGuiContext::getStackedWidget(), and YACS::HMI::QtGuiContext::isEdition().

Referenced by YACS::HMI::GraphicsView::mousePressEvent(), and Yacsgui::onWindowActivated().

826 {
827  DEBTRACE("GenericGui::switchContext " << view);
828  if (! _mapViewContext.count(view))
829  {
830  onExit ? hideAllMenus() : initialMenus();
831  _dwTree->setWidget(0);
832  _dwStacked->setWidget(0);
833  return;
834  }
835  QtGuiContext* newContext = _mapViewContext[view];
836 
837  _dwTree->setWidget(newContext->getEditTree());
838  _dwTree->widget()->show();
839  _dwTree->raise();
840  _dwStacked->setWidget(newContext->getStackedWidget());
841 
842  QtGuiContext::setQtCurrent(newContext);
843 
844  if (newContext->isEdition())
845  {
846  showExecMenus(false);
847  showBaseMenus(true);
848  showEditionMenus(true);
849  showCommonMenus(true);
850  if (_dwTree) _dwTree->setWindowTitle("Tree View: edition mode");
851  }
852  else
853  {
854  showEditionMenus(false);
855  showBaseMenus(true);
856  showExecMenus(true);
857  showCommonMenus(true);
858  _withoutStopModeAct->setChecked(true);
859  if (_dwTree) _dwTree->setWindowTitle("Tree View: execution mode");
860  }
861  _dwStacked->setMinimumWidth(10);
862 }

Member Data Documentation

QAction* YACS::HMI::GenericGui::_abortAct

Definition at line 102 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_arrangeLocalNodesAct
QAction* YACS::HMI::GenericGui::_arrangeRecurseNodesAct
BatchJobsListDialog* YACS::HMI::GenericGui::_BJLdialog
protected

Definition at line 217 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_blockNodeAct
QAction* YACS::HMI::GenericGui::_breakpointsModeAct

Definition at line 111 of file GenericGui.hxx.

YACS::ENGINE::Catalog* YACS::HMI::GenericGui::_builtinCatalog
protected

Definition at line 218 of file GenericGui.hxx.

CatalogWidget* YACS::HMI::GenericGui::_catalogsWidget
protected

Definition at line 220 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_chooseBatchJobAct

Definition at line 91 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_computeLinkAct
QAction* YACS::HMI::GenericGui::_copyItemAct
QAction* YACS::HMI::GenericGui::_CORBAServiceNodeAct

Definition at line 133 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_cppNodeAct

Definition at line 135 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_createDataTypeAct

Definition at line 123 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_cutItemAct
QDockWidget* YACS::HMI::GenericGui::_dwCatalogs
protected

Definition at line 216 of file GenericGui.hxx.

QDockWidget* YACS::HMI::GenericGui::_dwStacked
protected

Definition at line 215 of file GenericGui.hxx.

QDockWidget* YACS::HMI::GenericGui::_dwTree
protected

Definition at line 214 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_editDataTypesAct

Definition at line 122 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_emphasisCtrlLinksAct
QAction* YACS::HMI::GenericGui::_emphasisLinkAct

Definition at line 193 of file GenericGui.hxx.

Referenced by YACS::HMI::LinkMenu::popupMenu().

QActionGroup* YACS::HMI::GenericGui::_execModeGroup

Definition at line 109 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_exportSchemaAct

Definition at line 93 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_exportSchemaAsAct

Definition at line 94 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_FOREACHNodeAct

Definition at line 145 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_FORNodeAct
QAction* YACS::HMI::GenericGui::_getContainerLogAct

Definition at line 119 of file GenericGui.hxx.

Referenced by YACS::HMI::ElementaryNodeMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_getErrorDetailsAct
QAction* YACS::HMI::GenericGui::_getErrorReportAct
QAction* YACS::HMI::GenericGui::_getYacsContainerLogAct

Definition at line 116 of file GenericGui.hxx.

Referenced by YACS::HMI::ProcMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_hideAllLinksAct

Definition at line 178 of file GenericGui.hxx.

Referenced by YACS::HMI::ProcMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_hideLinkAct

Definition at line 192 of file GenericGui.hxx.

Referenced by YACS::HMI::LinkMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_hidePortLinksAct
QAction* YACS::HMI::GenericGui::_importCatalogAct

Definition at line 95 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_importDataTypeAct

Definition at line 124 of file GenericGui.hxx.

Referenced by YACS::HMI::ProcMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_importSchemaAct

Definition at line 90 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_importSupervSchemaAct

Definition at line 92 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_inDataNodeAct
QAction* YACS::HMI::GenericGui::_inlineFunctionNodeAct
QAction* YACS::HMI::GenericGui::_inlineScriptNodeAct
QAction* YACS::HMI::GenericGui::_inStudyNodeAct
bool YACS::HMI::GenericGui::_isSaved
protected

Definition at line 225 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_loadAndRunSchemaAct

Definition at line 99 of file GenericGui.hxx.

YACSGuiLoader* YACS::HMI::GenericGui::_loader
protected

Definition at line 211 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_loadRunStateSchemaAct

Definition at line 98 of file GenericGui.hxx.

std::list<std::string> YACS::HMI::GenericGui::_machineList
protected

Definition at line 226 of file GenericGui.hxx.

std::map<QWidget*, YACS::HMI::QtGuiContext*> YACS::HMI::GenericGui::_mapViewContext
protected

Definition at line 221 of file GenericGui.hxx.

int YACS::HMI::GenericGui::_menuId
protected

Definition at line 222 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_newContainerAct
QAction* YACS::HMI::GenericGui::_newCorbaComponentAct

Definition at line 130 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_newEditionAct

Definition at line 107 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_newHPContainerAct
QAction* YACS::HMI::GenericGui::_newSalomeComponentAct

Definition at line 128 of file GenericGui.hxx.

Referenced by YACS::HMI::ComponentInstanceMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_newSalomePythonComponentAct

Definition at line 129 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_newSchemaAct

Definition at line 87 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_nodeFromCatalogAct
QAction* YACS::HMI::GenericGui::_nodeNodeServiceNodeAct

Definition at line 134 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_OptimizerLoopAct
QAction* YACS::HMI::GenericGui::_outDataNodeAct
QAction* YACS::HMI::GenericGui::_outStudyNodeAct
QMainWindow* YACS::HMI::GenericGui::_parent
protected

Definition at line 213 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_pauseAct

Definition at line 103 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_putGraphInBlocAct

Definition at line 155 of file GenericGui.hxx.

Referenced by YACS::HMI::ProcMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_putGraphInForLoopAct

Definition at line 156 of file GenericGui.hxx.

Referenced by YACS::HMI::ProcMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_putGraphInOptimizerLoopAct

Definition at line 158 of file GenericGui.hxx.

Referenced by YACS::HMI::ProcMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_putGraphInWhileLoopAct

Definition at line 157 of file GenericGui.hxx.

Referenced by YACS::HMI::ProcMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_putInBlocAct
QAction* YACS::HMI::GenericGui::_redoAct

Definition at line 197 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_resetAct

Definition at line 104 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_runLoadedSchemaAct

Definition at line 97 of file GenericGui.hxx.

Referenced by YACS::HMI::ProcMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_salomeServiceNodeAct

Definition at line 131 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_saveRunStateAct

Definition at line 106 of file GenericGui.hxx.

int YACS::HMI::GenericGui::_schemaCnt
protected

Definition at line 224 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_selectComponentInstanceAct

Definition at line 127 of file GenericGui.hxx.

Referenced by YACS::HMI::ComponentInstanceMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_selectReferenceAct

Definition at line 174 of file GenericGui.hxx.

Referenced by YACS::HMI::ReferenceMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_serviceInlineNodeAct

Definition at line 132 of file GenericGui.hxx.

YACS::ENGINE::Catalog* YACS::HMI::GenericGui::_sessionCatalog
protected

Definition at line 219 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_showAllLinksAct

Definition at line 177 of file GenericGui.hxx.

Referenced by YACS::HMI::ProcMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_showLinkAct

Definition at line 191 of file GenericGui.hxx.

Referenced by YACS::HMI::LinkMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_showOnlyLinkAct

Definition at line 190 of file GenericGui.hxx.

Referenced by YACS::HMI::LinkMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_showOnlyPortLinksAct
QAction* YACS::HMI::GenericGui::_showPortLinksAct
QAction* YACS::HMI::GenericGui::_showRedoAct

Definition at line 199 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_showUndoAct

Definition at line 198 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_shrinkExpand
QAction* YACS::HMI::GenericGui::_shrinkExpandChildren
QAction* YACS::HMI::GenericGui::_shrinkExpandElementaryRecursively
QAction* YACS::HMI::GenericGui::_shutdownProcAct

Definition at line 120 of file GenericGui.hxx.

Referenced by YACS::HMI::ProcMenu::popupMenu().

QAction* YACS::HMI::GenericGui::_startResumeAct

Definition at line 101 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_stepByStepModeAct

Definition at line 112 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_SWITCHNodeAct
QAction* YACS::HMI::GenericGui::_toggleAddRowColsAct

Definition at line 172 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_toggleAutomaticComputeLinkAct

Definition at line 169 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_toggleForce2NodesLinkAct

Definition at line 171 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_toggleSceneItemVisibleAct

Definition at line 173 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_toggleSimplifyLinkAct

Definition at line 170 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_toggleStopOnErrorAct

Definition at line 114 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_toggleStraightLinksAct

Definition at line 168 of file GenericGui.hxx.

int YACS::HMI::GenericGui::_toolId
protected

Definition at line 223 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_undoAct

Definition at line 196 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_whatsThisAct

Definition at line 175 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_WHILENodeAct
QAction* YACS::HMI::GenericGui::_withoutStopModeAct

Definition at line 110 of file GenericGui.hxx.

SuitWrapper* YACS::HMI::GenericGui::_wrapper
protected

Definition at line 212 of file GenericGui.hxx.

QAction* YACS::HMI::GenericGui::_XMLNodeAct

Definition at line 136 of file GenericGui.hxx.


The documentation for this class was generated from the following files: