--- /dev/null
+
+# Generated python file of Graph aNewDataFlow
+
+from SuperV import *
+# Graph creation
+aNewDataFlow = Graph( 'aNewDataFlow' )
+aNewDataFlow.SetName( 'aNewDataFlow' )
+aNewDataFlow.SetAuthor( '' )
+aNewDataFlow.SetComment( '' )
+aNewDataFlow.Coords( 0 , 0 )
+
+# Creation of Factory Nodes
+
+# Creation of InLine Nodes
+PyFunc = []
+PyFunc.append( 'def Func( A ): ' )
+PyFunc.append( ' import batchmode_visu ' )
+PyFunc.append( ' batchmode_visu.myVisu.CreateTestView() ' )
+PyFunc.append( ' batchmode_visu.myVisu.ShowTestObject() ' )
+PyFunc.append( ' return A ' )
+Func = aNewDataFlow.INode( 'Func' , PyFunc )
+Func.SetName( 'Func' )
+Func.SetAuthor( '' )
+Func.SetComment( 'Compute Node' )
+Func.Coords( 375 , 162 )
+Func.InPort( 'A' , 'int' )
+Func.OutPort( 'B' , 'int' )
+
+# Creation of Loop Nodes
+PyInit = []
+PyInit.append( 'def Init( A ): ' )
+PyInit.append( ' return A ' )
+PyMoreInit = []
+PyMoreInit.append( 'def More( A ): ' )
+PyMoreInit.append( ' if A < 10: ' )
+PyMoreInit.append( ' return 1,A ' )
+PyMoreInit.append( ' return 0,A ' )
+PyNextInit = []
+PyNextInit.append( 'def Next( A ): ' )
+PyNextInit.append( ' return (A + 1) ' )
+Init,EndInit = aNewDataFlow.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
+EndInit.SetName( 'EndInit' )
+EndInit.SetAuthor( '' )
+EndInit.SetComment( '' )
+EndInit.Coords( 740 , 168 )
+PyEndInit = []
+EndInit.SetPyFunction( 'EndInit' , PyEndInit )
+Init.SetName( 'Init' )
+Init.SetAuthor( '' )
+Init.SetComment( '' )
+Init.Coords( 118 , 160 )
+Init.InPort( 'A' , 'int' )
+Init.OutPort( 'A' , 'int' )
+
+# Creation of Links
+InitA = Init.Port( 'A' )
+FuncA = aNewDataFlow.Link( InitA , Func.Port( 'A' ) )
+
+FuncB = Func.Port( 'B' )
+EndInitA = aNewDataFlow.Link( FuncB , EndInit.Port( 'A' ) )
+
+# Creation of Input datas
+InitA = Init.Input( 'A' , 0)
+
+# Creation of Output variables
+EndInitA = EndInit.Port( 'A' )
--- /dev/null
+<!DOCTYPE Dataflow>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>aNewDataFlow</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>aNewDataFlow</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>int</inParameter-type>
+ <inParameter-name>Init\A</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>EndInit\A</outParameter-name> </outParameter> </outParameter-list> </service>
+ <Parameter-list/>
+ <PyFunction-list/>
+ <creation-date>2/4/2004 - 16:38:31</creation-date>
+ <lastmodification-date>2/4/2004 - 18:30:31</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Init</node-name>
+ <kind>4</kind>
+ <coupled-node>EndInit</coupled-node>
+ <service>
+<service-name>Init</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>int</inParameter-type>
+ <inParameter-name>A</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>A</outParameter-name> </outParameter> </outParameter-list> </service>
+ <Parameter-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Init</FuncName>
+ <PyFunc><![CDATA[def Init( A ): ]]></PyFunc>
+ <PyFunc><![CDATA[ return A ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>More</FuncName>
+ <PyFunc><![CDATA[def More( A ): ]]></PyFunc>
+ <PyFunc><![CDATA[ if A < 10: ]]></PyFunc>
+ <PyFunc><![CDATA[ return 1,A ]]></PyFunc>
+ <PyFunc><![CDATA[ return 0,A ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>Next</FuncName>
+ <PyFunc><![CDATA[def Next( A ): ]]></PyFunc>
+ <PyFunc><![CDATA[ return (A + 1) ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>2/4/2004 - 18:30:31</creation-date>
+ <lastmodification-date>2/4/2004 - 18:30:31</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>118</x-position>
+ <y-position>160</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndInit</node-name>
+ <kind>5</kind>
+ <coupled-node>Init</coupled-node>
+ <service>
+<service-name>EndInit</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>int</inParameter-type>
+ <inParameter-name>A</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>A</outParameter-name> </outParameter> </outParameter-list> </service>
+ <Parameter-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndInit</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>2/4/2004 - 18:30:31</creation-date>
+ <lastmodification-date>2/4/2004 - 18:30:31</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>740</x-position>
+ <y-position>168</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Func</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Func</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>int</inParameter-type>
+ <inParameter-name>A</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>B</outParameter-name> </outParameter> </outParameter-list> </service>
+ <Parameter-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Func</FuncName>
+ <PyFunc><![CDATA[def Func( A ): ]]></PyFunc>
+ <PyFunc><![CDATA[ import batchmode_visu ]]></PyFunc>
+ <PyFunc><![CDATA[ batchmode_visu.myVisu.CreateTestView() ]]></PyFunc>
+ <PyFunc><![CDATA[ batchmode_visu.myVisu.ShowTestObject() ]]></PyFunc>
+ <PyFunc><![CDATA[ return A ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>2/4/2004 - 18:30:31</creation-date>
+ <lastmodification-date>2/4/2004 - 18:30:31</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>375</x-position>
+ <y-position>162</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>A</fromserviceparameter-name>
+ <tonode-name>Func</tonode-name>
+ <toserviceparameter-name>A</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndInit</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Func</fromnode-name>
+ <fromserviceparameter-name>B</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>A</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>aNewDataFlow</fromnode-name>
+ <fromserviceparameter-name>Init\A</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>A</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data> </data-list></dataflow>
int SUPERVGUI::factory = 0;
-SUPERVGUI Supervision;
+SUPERVGUI Supervision("");
-SUPERVGUI::SUPERVGUI(): QObject(),
- desktop(0),
- study(0),
- browser(0)
+SUPERVGUI::SUPERVGUI(const QString& theName, QObject* theParent)
+ : SALOMEGUI( theName, theParent ),
+ desktop(0),
+ study(0),
+ browser(0)
//info(0)
{
Trace("SUPERVGUI::SUPERVGUI")
}
}
-void SUPERVGUI::customPopup(QPopupMenu* popup) {
+
+bool SUPERVGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext, const QString& theParent, const QString& theObject) {
Trace("SUPERVGUI::customPopup");
+ Supervision.init(parent);
if(popup->count() > 3) {
// Temporary code: is to be deleted soon
popup->removeItem(QAD_Display_Popup_ID);
// Temporary code end
}
SALOME_Selection* Sel = SALOME_Selection::Selection(study->getSelection() );
- if ((Sel==NULL) || (Sel->IObjectCount() == 0)) return;
+ if ((Sel==NULL) || (Sel->IObjectCount() == 0)) return false;
if (Sel->IObjectCount() == 1) {
Handle(SALOME_InteractiveObject) anIObj = Sel->firstIObject();
if (aIObjCount == Sel->IObjectCount()) //all selected objects belong to Supervision
popup->insertItem(tr("MSG_DELETE"), this, SLOT(deleteObject()));
}
+ return(true);
}
Sel->ClearIObjects() ;
}
-
-
-void SUPERVGUI::activeStudyChanged() {
- Trace("SUPERVGUI::activeStudyChanged");
- study = desktop->getActiveStudy();
-}
-
-extern "C" bool OnGUIEvent(int command, QAD_Desktop* parent) {
- Supervision.init(parent);
- switch (command) {
- case 301:
- Supervision.importDataflow();
- return(false);
-
- case 302:
- Supervision.exportDataflow();
- return(false);
-
- case 303:
- Supervision.newDataflow();
- return(false);
-
- case 304:
- Supervision.modifyDataflow();
- return(false);
-
- case 305:
- Supervision.reloadDataflow();
- return(false);
-
- case 306:
- Supervision.runDataflow();
- return(false);
-
- case 307:
- Supervision.killDataflow();
- return(false);
-
- case 308:
- Supervision.suspendResumeDataflow();
- return(false);
-
- case 309:
- Supervision.showComponents();
- return(false);
-
- case 310:
- Supervision.stepByStep();
- return(false);
-
- default:
- QMessageBox::warning(QAD_Application::getDesktop(), "Supervision Error", "Unknown Command From Salome");
- return(false);
-
- }
-}
-
-extern "C" bool OnKeyPress(QKeyEvent* e, QAD_Desktop* parent, SUPERVGUI_Main* s) {
+bool SUPERVGUI::OnGUIEvent(int command, QAD_Desktop* parent) {
+ Supervision.init(parent);
+ switch (command) {
+ case 301:
+ Supervision.importDataflow();
return(false);
-}
-
-extern "C" bool OnMousePress(QMouseEvent* e, QAD_Desktop* parent, SUPERVGUI_Main* s) {
+
+ case 302:
+ Supervision.exportDataflow();
return(false);
-}
-
-extern "C" bool OnMouseMove(QMouseEvent* e, QAD_Desktop* parent, SUPERVGUI_Main* s) {
+
+ case 303:
+ Supervision.newDataflow();
return(false);
-}
-
-extern "C" bool OnPopupGUIEvent(int theCommandID, QAD_Desktop* parent) {
+
+ case 304:
+ Supervision.modifyDataflow();
return(false);
+
+ case 305:
+ Supervision.reloadDataflow();
+ return(false);
+
+ case 306:
+ Supervision.runDataflow();
+ return(false);
+
+ case 307:
+ Supervision.killDataflow();
+ return(false);
+
+ case 308:
+ Supervision.suspendResumeDataflow();
+ return(false);
+
+ case 309:
+ Supervision.showComponents();
+ return(false);
+
+ case 310:
+ Supervision.stepByStep();
+ return(false);
+
+ default:
+ QMessageBox::warning(QAD_Application::getDesktop(), "Supervision Error", "Unknown Command From Salome");
+ return(false);
+ }
}
-extern "C" bool SetSettings(QAD_Desktop* parent) {
- Trace("extern SUPERVGUI::SetSettings")
- Supervision.init(parent);
- return(true);
-}
-
-extern "C" void definePopup(QString& theContext, QString& theParent, QString& theObject) {
- theObject = "";
- theContext = "";
+bool SUPERVGUI::SetSettings(QAD_Desktop* parent) {
+ Trace("SUPERVGUI::SetSettings");
+ Supervision.init(parent);
+ return(true);
}
-extern "C" bool customPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext, const QString& theParent, const QString& theObject) {
- Supervision.init(parent);
- Supervision.customPopup(popup);
- return(true);
+void SUPERVGUI::DefinePopup(QString& theContext, QString& theParent, QString& theObject) {
+ theObject = "";
+ theContext = "";
}
-extern "C" void activeStudyChanged(QAD_Desktop* parent) {
- Supervision.activeStudyChanged();
+bool SUPERVGUI::ActiveStudyChanged(QAD_Desktop* parent) {
+ Trace("SUPERVGUI::activeStudyChanged");
+ study = desktop->getActiveStudy();
+ return true;
}
-extern "C" int supportedViewType()
+void SUPERVGUI::SupportedViewType (int* buffer, int bufferSize)
{
- return (int)VIEW_GRAPHSUPERV;
+ if (!buffer || !bufferSize) return;
+ buffer[0] = (int)VIEW_GRAPHSUPERV;
}
-extern "C" void buildPresentation ( const Handle(SALOME_InteractiveObject)& theIO )
+extern "C"
{
+ Standard_EXPORT SALOMEGUI* GetComponentGUI() {
+ return &Supervision;
+ }
}
#ifndef SUPERVGUI_H
#define SUPERVGUI_H
-// Acces a l'ihm de SALOME
+// Acces a l`ihm de SALOME
// -----------------------
#include "QAD_Desktop.h"
#include "SUPERVGUI_Main.h"
//#include "SUPERVGUI_Information.h"
+#include "SALOMEGUI.h"
// Definition de la classe principale du module de supervision
// -----------------------------------------------------------
-class SUPERVGUI: public QObject {
+class SUPERVGUI: public SALOMEGUI {
Q_OBJECT
public:
- SUPERVGUI();
+ SUPERVGUI( const QString&, QObject* = 0 );
virtual ~SUPERVGUI();
QAD_Desktop* getDesktop();
void init(QAD_Desktop* parent);
SUPERVGUI_Main* getMain();
- void customPopup(QPopupMenu* popup);
- void activeStudyChanged();
+
+ bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
+ bool SetSettings(QAD_Desktop* parent);
+ void DefinePopup(QString & theContext,
+ QString & theParent,
+ QString & theObject ) ;
+ bool CustomPopup(QAD_Desktop* parent,
+ QPopupMenu* popup,
+ const QString & theContext,
+ const QString & theParent,
+ const QString & theObject);
+ bool ActiveStudyChanged( QAD_Desktop* parent );
+ void SupportedViewType (int* buffer, int bufferSize);
bool isContains(QAD_Study* theStudy, const QString theKey);