}
void SUPERVGUI::reloadDataflow() {
- Trace("SUPERVGUI::reloadDataflow")
- if (main==0) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_RELOAD"));
- } else {
- main->sync();
- };
+ Trace("SUPERVGUI::reloadDataflow");
+ if ( main )
+ main->sync();
+ else
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_RELOAD"));
}
void SUPERVGUI::runDataflow() {
- Trace("SUPERVGUI::runDataflow")
- if (main==0) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_RUN"));
- } else {
- main->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
- main->run();
- };
+ Trace("SUPERVGUI::runDataflow");
+ if ( main )
+ main->run( /*andSuspend=*/false );
+ else
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_RUN"));
}
void SUPERVGUI::stepByStep() {
- Trace("SUPERVGUI::stepByStep")
- if (main==0) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_RUN"));
- } else {
- main->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
- main->startExecute();
- }
+ Trace("SUPERVGUI::stepByStep");
+ if ( main )
+ main->run( /*andSuspend=*/true );
+ else
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_RUN"));
}
void SUPERVGUI::killDataflow() {
- Trace("SUPERVGUI::killDataflow")
- if (main==0) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_KILL"));
- } else {
- main->kill();
- };
+ Trace("SUPERVGUI::killDataflow");
+ if ( main )
+ main->kill();
+ else
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_KILL"));
}
void SUPERVGUI::suspendResumeDataflow() {
- Trace("SUPERVGUI::suspendResumeDataflow")
- if (main==0) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_SUSPEND"));
- } else {
- main->suspendResume();
- };
+ Trace("SUPERVGUI::suspendResumeDataflow");
+ if ( main )
+ main->suspendResume();
+ else
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_SUSPEND"));
}
void SUPERVGUI::showComponents() {
Trace("SUPERVGUI::showComponents");
- if (main==0) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_ADD"));
- } else {
- if (main->isEditable())
+ if ( main ) {
+ if ( main->isEditable() )
main->addNode();
else
QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOTEDITABLE"));
}
+ else
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_ADD"));
+
}
}
}
-void SUPERVGUI_Main::run() {
+void SUPERVGUI_Main::run( const bool andSuspend ) {
Trace("SUPERVGUI_Main::run");
- if ((SUPERV_isNull(dataflow))) return;
+ if ( SUPERV_isNull(dataflow) )
+ return;
- if (dataflow->IsEditing()) {
- if (!dataflow->IsValid()) {
+ if ( dataflow->IsEditing() ) { // not currently Executing
+
+ // asv 31.01.05 : fix for PAL7854, Editing moved from SUPERVGUI.cxx runDataflow(), stepByStep() to here..
+ Editing(); // remove old executor, update GUI (all nodes to "No Status")
+
+ if ( !dataflow->IsValid() ) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_NOTVALID"));
}
else if (!dataflow->IsExecutable()) {
}
else {
myRunTime = QDateTime::currentDateTime();
- if ( !dataflow->Run() ) {
+ const bool result = andSuspend ? dataflow->Start() : dataflow->Run();
+ if ( !result ) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_BADEXECUTE"));
if ( dataflow->State() == SUPERV::ErrorState ) {
kill();
}
-
-void SUPERVGUI_Main::startExecute() {
- Trace("SUPERVGUI_Main::startExecute");
- if ((SUPERV_isNull(dataflow))) return;
-
- if (dataflow->IsEditing()) {
- if (!dataflow->IsValid()) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_NOTVALID"));
- }
- else if (!dataflow->IsExecutable()) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_NOTEXECUTABLE"));
- }
- else if (myCanvasView->isAnyLinkCreating()) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CRL_NOTCOMPLETE"));
- }
- else {
- myRunTime = QDateTime::currentDateTime();
- if (!dataflow->Start()) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_BADEXECUTE"));
- }
- else {
- myThread->startThread(tr("MSG_GRAPH_STARTED"));
- }
- }
- }
- else {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_RUNNING"));
- }
-}
-
-
void SUPERVGUI_Main::kill() {
Trace("SUPERVGUI_Main::kill");
if ((SUPERV_isNull(dataflow)))