idl/SUPERV.idl

Go to the documentation of this file.
00001 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00002 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00003 //
00004 //  This library is free software; you can redistribute it and/or
00005 //  modify it under the terms of the GNU Lesser General Public
00006 //  License as published by the Free Software Foundation; either
00007 //  version 2.1 of the License.
00008 //
00009 //  This library is distributed in the hope that it will be useful,
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 //  Lesser General Public License for more details.
00013 //
00014 //  You should have received a copy of the GNU Lesser General Public
00015 //  License along with this library; if not, write to the Free Software
00016 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00017 //
00018 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 //
00020 //
00021 //
00022 //  File   : SUPERV.idl
00023 //  Author : Jean Rahuel
00024 //  $Header:
00025 
00029 #ifndef __SUPERV_IDL__
00030 #define __SUPERV_IDL__
00031 
00032 #include "SALOME_ModuleCatalog.idl"
00033 #include "SALOME_Component.idl"
00034 #include "SALOMEDS.idl"
00038 module SUPERV {
00039 
00045   enum KindOfPort { UndefinedParameter , 
00046               ServiceParameter , 
00047               GateParameter ,
00048                     InLineParameter , 
00049               LoopParameter , 
00050               SwitchParameter ,
00051                     EndSwitchParameter , 
00052               GOTOParameter , 
00053               DataStreamParameter } ;
00054 
00058 //  enum KindOfDependency { UndefinedDependency , TimeDependency , IterationDependency } ;
00059 
00063   enum KindOfSchema { SCHENULL , TI , TF , DELTA } ;
00064 
00068   enum KindOfInterpolation { INTERNULL , L0 , L1 } ;
00069 
00073   enum KindOfExtrapolation { EXTRANULL , E0 , E1 } ;
00074 
00078   enum KindOfDataStreamTrace { WithoutTrace , SummaryTrace , DetailedTrace } ;
00079 
00083   enum KindOfNode { FactoryNode , 
00084               DataFlowGraph , 
00085               ComputingNode ,
00086                     InLineNode , 
00087               LoopNode , 
00088               EndLoopNode ,
00089                     SwitchNode , 
00090               EndSwitchNode , 
00091               GOTONode , 
00092               DataStreamGraph ,
00093                     MacroNode ,
00094               UnknownNode };
00095 
00099   struct SDate {
00100     short Second;
00101     short Minute;
00102     short Hour;
00103     short Day;
00104     short Month;
00105     short Year;
00106   };
00112   enum GraphEvent { UndefinedEvent , 
00113               NoEvent , 
00114               NewThreadEvent ,
00115                     WaitingEvent , 
00116               ReadyEvent ,
00117                     RunningEvent , 
00118               DoneEvent , 
00119               ErroredEvent ,
00120                     SuspendEvent , 
00121               ResumeEvent ,
00122                     KillEvent , 
00123               StopEvent } ;
00124 
00125   // UndefinedState : Non existing Node, Port etc...
00130   enum GraphState { UndefinedState , 
00131               NoState , 
00132               EditingState , 
00133               SuspendState ,
00134                     WaitingState , 
00135               ReadyState , 
00136               SuspendReadyState ,
00137                     RunningState ,
00138                     DoneState , 
00139               ErrorState ,
00140                     SuspendDoneState , 
00141               SuspendErroredState ,
00142                     KillState , 
00143               StopState ,
00144               LoadingState, 
00145               NumberOfGraphStates } ;
00146 
00149   typedef sequence<string> ListOfStrings ;
00150 
00151   interface Value ;
00152 
00153   interface Link ;
00154   interface StreamLink ;
00155 
00156   typedef sequence<Link> ListOfLinks ;
00157   typedef sequence<StreamLink> ListOfStreamLinks ;
00158 
00159   interface Port ;
00160   interface StreamPort ;
00161 
00162   typedef sequence<Port> ListOfPorts ;
00163   typedef sequence<StreamPort> ListOfStreamPorts ;
00164 
00165   interface CNode ;
00166   interface FNode ;
00167   interface INode ;
00168   interface GNode ;
00169   interface LNode ;
00170   interface ELNode ;
00171   interface SNode ;
00172   interface ESNode ;
00173   interface Graph ;
00174   interface StreamGraph ;
00175 
00176   typedef sequence<CNode>  ListOfCNodes ;
00177   typedef sequence<FNode>  ListOfFNodes ;
00178   typedef sequence<INode>  ListOfINodes ;
00179   typedef sequence<GNode>  ListOfGNodes ;
00180   typedef sequence<LNode>  ListOfLNodes ;
00181   typedef sequence<ELNode> ListOfELNodes ;
00182   typedef sequence<SNode>  ListOfSNodes ;
00183   typedef sequence<ESNode> ListOfESNodes ;
00184   typedef sequence<Graph>  ListOfGraphs ;
00185 
00190   struct ListOfNodes {
00191     ListOfCNodes  CNodes ;
00192     ListOfFNodes  FNodes ;
00193     ListOfINodes  INodes ;
00194     ListOfGNodes  GNodes ;
00195     ListOfLNodes  LNodes ;
00196     ListOfELNodes ELNodes ;
00197     ListOfSNodes  SNodes ;
00198     ListOfESNodes ESNodes ;
00199     ListOfGraphs  Graphs ;
00200   } ;
00201 
00202   // ToSuspendState : will be Suspended before running if waiting or
00203   //                  will be Suspended while running or
00204   //                  will be Suspended after run
00205   // ToSuspendStartState : will be Suspended at the beginning of execution
00206   // ToSuspendDoneState : will be Suspended after run
00212   enum ControlState { VoidState , 
00213                 ToSuspendStartState ,
00214                       ToSuspendState , 
00215                 ToSuspendDoneState ,
00216                       ToKillState , 
00217                 ToKillDoneState , 
00218                 ToStopState ,
00219                       NumberOfControlStates } ;
00220 
00221 
00222 
00224 
00228   interface SuperG : Engines::Component, SALOMEDS::Driver {
00230 
00231 //DumpPython is defined in SALOME_Component.idl (SALOMEDS::Driver)
00232 //    SALOMEDS::TMPFile DumpPython( in SALOMEDS::Study theStudy ,
00233 //                                  in boolean isPublished ,
00234 //                                  out boolean isValisScript ) ;
00235 
00240     SUPERV::Graph Graph(in string aGraph ) ; // aGraphName or aGraphXmlFile
00241 
00248     SUPERV::Graph GraphE(in string aGraph ) ; // aGraphName or aGraphXmlFile
00249 
00254     SUPERV::StreamGraph StreamGraph(in string aGraph ) ; // aGraphName or aGraphXmlFile
00255 
00262     SUPERV::StreamGraph StreamGraphE(in string aGraph ) ; // aGraphName or aGraphXmlFile
00263 
00268     SUPERV::Value StringValue( in string aString ) ;
00273     SUPERV::Value AnyValue( in any anAny ) ;
00278     SUPERV::Graph getGraph(in string ior); // get Graph from is IOR
00279 
00284     SUPERV::StreamGraph getStreamGraph(in string ior); // get Graph from is IOR
00285 
00286   };
00287 
00299 
00300   interface CNode : Engines::Component {
00302 
00303 
00307     string Name() ;
00311     SALOME_ModuleCatalog::Service Service() ;
00315     SUPERV::KindOfNode Kind() ;
00319     SUPERV::SDate CreationDate() ;
00323     SUPERV::SDate LastUpdateDate() ;
00327     string Version() ;
00331     string Author() ;
00335     string Comment() ;
00336 
00337 
00343     boolean SetName(in string aNewName ) ;
00349     boolean SetAuthor(in string anAuthor ) ;
00355     boolean SetComment(in string aComment ) ;
00356 
00360     SUPERV::Port Port( in string aParameterName ) ;
00361 
00365     SUPERV::Port GetInPort( in string aParameterName ) ;
00366 
00370     SUPERV::Port GetOutPort( in string aParameterName ) ;
00371 
00375     SUPERV::StreamPort GetInStreamPort( in string aParameterName ) ;
00376 
00380     SUPERV::StreamPort GetOutStreamPort( in string aParameterName ) ;
00381 
00385     boolean HasStreamPort() ;
00386 
00390     SUPERV::Port Input( in string InputParameterName ,
00391                         in Value aValue ) ;
00392 
00396     SUPERV::ListOfPorts Ports() ;
00397 
00401     SUPERV::ListOfStreamPorts StreamPorts() ;
00402 
00405     SUPERV::ListOfLinks Links() ;
00406 
00409     SUPERV::ListOfStreamLinks StreamLinks() ;
00410 
00414     boolean IsStreamGraph() ;
00418     boolean IsGraph() ;
00419 
00423     boolean IsMacro() ;
00427     boolean IsFlowMacro() ;
00431     boolean IsStreamMacro() ;
00432 
00436     boolean IsHeadGraph() ;
00440     long GraphLevel() ;
00441 
00445     boolean IsComputing() ;
00449     boolean IsFactory() ;
00453     boolean IsInLine() ;
00457     boolean IsGOTO() ;
00461     boolean IsLoop() ;
00465     boolean IsEndLoop() ;
00469     boolean IsSwitch() ;
00473     boolean IsEndSwitch() ;
00474 
00478     long SubGraph() ;
00482     long SubStreamGraph() ;
00483 
00487     long Thread() ;
00488 
00492     boolean IsWaiting() ;
00493 
00497      boolean IsReady() ;
00498 
00502     boolean IsRunning() ;
00503 
00508     boolean IsDone() ;
00513     boolean IsSuspended() ;
00517     SUPERV::GraphState State() ;
00518 
00522     boolean ReadyW() ;
00523 
00526     boolean RunningW() ;
00527 
00530     boolean DoneW() ;
00531 
00534     boolean SuspendedW() ;
00535 
00536     //    boolean Ping();
00537 
00543     boolean Kill();
00544 
00549     boolean KillDone();
00550 
00556     boolean Stop();
00562     boolean Suspend();
00565     boolean SuspendDone();
00566 
00572     boolean Resume();
00573 
00574 
00575 // Control state required : Kill, Suspend, Stop
00579     SUPERV::ControlState Control() ;
00583     void ControlClear() ;
00584 
00585     boolean ContainerKill();
00586 
00590     void Coords( in long X , in long Y ) ;
00594     long X() ;
00598     long Y() ;
00602     long CpuUsed() ;
00603 
00604   } ;
00610 
00611   interface FNode : CNode {
00613 
00615     string GetComponentName() ;
00618     string GetInterfaceName() ;
00621     string GetContainer() ;
00625     boolean SetComponentName(in string aComponentName ) ;
00629     boolean SetInterfaceName(in string anInterfaceName ) ;
00633     boolean SetContainer(in string aContainer ) ;
00637     boolean IsCimpl() ;
00638 
00639   } ;
00645   // InLine Nodes
00647   interface INode : CNode {
00649 
00654     void SetPyFunction( in string FuncName ,
00655                         in SUPERV::ListOfStrings aPyInitFunction ) ;
00658     SUPERV::ListOfStrings PyFunction() ;
00661     string PyFuncName() ;
00662 
00667     SUPERV::Port InPort( in string aParameterName , in string aParameterType ) ;
00672     SUPERV::Port OutPort( in string aParameterName , in string aParameterType ) ;
00673 
00678     SUPERV::StreamPort InStreamPort( in string aParameterName , in SALOME_ModuleCatalog::DataStreamType aParameterType , in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
00679 
00684     SUPERV::StreamPort OutStreamPort( in string aParameterName , in SALOME_ModuleCatalog::DataStreamType aParameterType , in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
00685 
00686   } ;
00692   // GOTO/EndLoop/EndSwitch Nodes
00694   interface GNode : INode {
00696 
00698     boolean SetCoupled( in string anInLineNode ) ;
00701     SUPERV::INode Coupled() ;
00702   } ;
00705   // Loop Nodes
00707   interface LNode : GNode {
00709 
00713     void SetPyInit( in string InitName ,
00714                             in SUPERV::ListOfStrings aPyInitFunction ) ;
00717     SUPERV::ListOfStrings PyInit() ;
00720     string PyInitName() ;
00721 
00726     void SetPyMore( in string MoreName ,
00727                             in SUPERV::ListOfStrings aPyMoreFunction ) ;
00730     SUPERV::ListOfStrings PyMore() ;
00733     string PyMoreName() ;
00734 
00739     void SetPyNext( in string NextName ,
00740                             in SUPERV::ListOfStrings aPyNextFunction ) ;
00741 
00744     SUPERV::ListOfStrings PyNext() ;
00747     string PyNextName() ;
00748 
00749   } ;
00750 
00751   // EndOfLoop Nodes
00753   interface ELNode : GNode {
00755   } ;
00756 
00757   // Switch Nodes
00759   interface SNode : GNode {
00761   } ;
00762 
00763   // EndOfSwitch Nodes
00765   interface ESNode : GNode {
00767   } ;
00768 
00774 
00775   interface Graph : GNode {
00777 
00780     SUPERV::CNode CNode( in SALOME_ModuleCatalog::Service aService ) ;
00781 
00784     SUPERV::FNode FNode( in string aComponentName ,
00785                          in string anInterfaceName ,
00786                          in SALOME_ModuleCatalog::Service aService ,
00787                 in boolean isCimpl ) ;
00788 
00791     SUPERV::INode INode( in string FuncName , in ListOfStrings aPythonFunction ) ;
00792 
00795     SUPERV::GNode GNode( in string FuncName , in ListOfStrings aPythonFunction ,
00796                          in string anINode ) ;
00797 
00800     SUPERV::LNode LNode( in string InitName , in ListOfStrings InitFunction ,
00801                          in string MoreName , in ListOfStrings MoreFunction ,
00802                          in string NextName , in ListOfStrings NextFunction ,
00803                          out SUPERV::INode anEndOfLoop ) ;
00804 
00807     SUPERV::SNode SNode( in string FuncName , in ListOfStrings aPythonFunction ,
00808                          out SUPERV::INode anEndOfSwitch ) ;
00809 
00812     SUPERV::Graph MNode( in string aXmlFileName ) ;
00813 
00816     SUPERV::Graph GraphMNode( in Graph aGraph ) ;
00817 
00820     SUPERV::Graph FlowObjRef() ;
00821 
00824     SUPERV::StreamGraph StreamObjRef() ;
00825 
00829     SUPERV::CNode Node( in string aNodeName ) ;
00830 
00833     Engines::Component ComponentRef( in string aComputerContainer ,
00834                                      in string aComponentName ) ;
00835 
00838     SUPERV::Link Link( in SUPERV::Port OutputPort ,
00839                        in SUPERV::Port InputPort ) ;
00840 
00845     string Messages() ;
00846 
00852     boolean Import( in string anXmlFile ) ;
00853 
00859     boolean Export( in string anXmlFile ) ;
00860     
00864     string SavePY( in boolean importSuperV ) ;
00865     
00869     boolean IsReadOnly() ;
00870 
00874     boolean Run() ;
00875 
00884     boolean EventNoW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
00885                       out SUPERV::GraphState aState ) ;
00886 
00895     boolean Event( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
00896                    out SUPERV::GraphState aState ) ;
00897     
00898     // Same as Event but execution of the thread is suspended between the
00899     // return of EventW and the next call to EventW
00910     boolean EventW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
00911                     out SUPERV::GraphState aState ) ;
00915     
00916     long EventQSize() ;
00917     long LevelMax() ;
00918     SUPERV::ListOfNodes LevelNodes( in long aLevel ) ;
00919     long ThreadsMax() ;
00920     
00926     long Threads();
00930     long SuspendedThreads();
00934     boolean IsValid() ;
00938     boolean IsExecutable() ;
00942     boolean IsEditing() ;
00946     boolean IsExecuting() ;
00947     
00948     long LastLevelDone() ;
00949     
00955     boolean Start() ;
00959     SUPERV::Graph Copy() ;
00963     SUPERV::StreamGraph ToStreamGraph() ;
00967     boolean Merge( in Graph aGraph ) ;
00971     SUPERV::ListOfNodes Nodes() ;
00975     SUPERV::ListOfLinks GLinks() ;
00979     string getIOR();
00980     
00984     long SubGraphsNumber() ;
00988     SUPERV::ListOfNodes SubGraphsNodes( in long SubGraphNumber ) ;
00989 
00992     void Editing();
00993     
00994   } ;
00995 
00996 
00997 
00998 
00999 
01005 
01006   interface StreamGraph : Graph {
01008 
01012     SUPERV::StreamGraph StreamCopy() ;
01015     SUPERV::StreamGraph StreamMNode( in string aXmlFileName ) ;
01016 
01019     SUPERV::StreamGraph StreamGraphMNode( in StreamGraph aStreamGraph ) ;
01020 
01024     SUPERV::StreamLink StreamLink( in SUPERV::StreamPort OutputPort ,
01025                                    in SUPERV::StreamPort InputPort ) ;
01026 
01030     SUPERV::ListOfStreamLinks GStreamLinks() ;
01031     boolean SetStreamParams( in long Timeout ,
01032                              in SUPERV::KindOfDataStreamTrace DataStreamTrace ,
01033                              in double DeltaTime ) ;
01034     void StreamParams( out long Timeout ,
01035                        out SUPERV::KindOfDataStreamTrace DataStreamTrace ,
01036                        out double DeltaTime ) ;
01037 
01041     long SubStreamGraphsNumber() ;
01045     SUPERV::ListOfNodes SubStreamGraphsNodes( in long SubStreamGraphNumber ) ;
01046 
01050     SUPERV::Graph ToFlowGraph() ;
01051 
01055     boolean StreamMerge( in StreamGraph aStreamGraph ) ;
01056 
01057   } ;
01058 
01059 
01060 
01061 
01062 
01063 
01070 
01071   interface Link : Engines::Component {
01073 
01076     SUPERV::Port OutPort() ;
01077 
01081     SUPERV::Port InPort() ;
01082 
01083     // For GUI :
01093     long CoordsSize() ;
01100     boolean AddCoord( in long index , in long X , in long Y ) ;
01108     boolean ChangeCoord( in long index , in long X , in long Y ) ;
01114     boolean RemoveCoord( in long index ) ;
01115 
01123     boolean Coords( in long index , out long X , out long Y ) ;
01126     //    void Destroy() ;
01127 
01130     boolean IsValid();
01131 
01134     boolean IsEqual( in SUPERV::Link aLink );
01135 
01136   } ;
01137 
01138 
01139 
01140 
01141 
01142 
01149 
01150   interface StreamLink : Link {
01152 
01155     SUPERV::StreamPort OutStreamPort() ;
01156 
01160     SUPERV::StreamPort InStreamPort() ;
01161 
01162 
01163   } ;
01164 
01165 
01166 
01167 
01168 
01174 
01175   interface Value : Engines::Component {
01177 
01180     string ToString() ;
01184     any ToAny() ;
01188     boolean IsIOR() ;
01192     string ComponentDataType() ;
01193 
01194     //    void Destroy() ;
01195 
01196   } ;
01202 
01203   interface Port : Value {
01205 
01210     boolean Input( in SUPERV::Value aValue ) ;
01211 
01215     SUPERV::CNode Node() ;
01219     string Name() ;
01220 
01221 /* Gets the type of a port.
01222 \return A string defining the type of a port
01223 */
01224 
01225     string Type() ;
01226 
01227     // Link of an Input Port
01231     SUPERV::Link Link() ;
01232 
01236     SUPERV::ListOfLinks Links() ;
01237 
01241     boolean IsInput() ;
01242 
01246     boolean HasInput() ;
01247 
01251 // Port with link (without Value)
01252     boolean IsLinked() ;
01253 
01254     // Kind of a Port
01257     SUPERV::KindOfPort Kind() ;
01258 
01259     // Port from the service of the node
01263     boolean IsParam() ;
01264     // Port is a Gate of the node
01268     boolean IsGate() ;
01269     // Port is a parameter of an InLineNode
01273     boolean IsInLine() ;
01274 
01275     // Port is a LoopParameter (InitLoop or DoLoop) of an LoopNode
01279     boolean IsLoop() ;
01280     // Port is an output parameter of a SwitchNode connected to an InGate
01284     // Port is a parameter of a switch node
01285     boolean IsSwitch() ;
01286     // Port is an Input parameter of a EndSwitchNode connected to several output ports
01290     boolean IsEndSwitch() ;
01291 
01292     boolean IsDataStream() ;
01293 
01296     SUPERV::GraphState State() ;
01299     boolean IsDone() ;
01300 
01303     void Remove() ;
01304 
01305   } ;
01306 
01308   interface StreamPort : Port {
01310 
01311     // Link of a StreamPort
01315     SUPERV::StreamLink StreamLink() ;
01316 
01319     SALOME_ModuleCatalog::DataStreamDependency Dependency() ;
01320     boolean SetDependency( in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
01321 
01324     boolean SetParams( in KindOfSchema aKindOfSchema ,
01325                        in KindOfInterpolation aKindOfInterpolation ,
01326                        in KindOfExtrapolation aKindOfExtrapolation ) ;
01327     boolean Params( out KindOfSchema aKindOfSchema ,
01328                     out KindOfInterpolation aKindOfInterpolation ,
01329                     out KindOfExtrapolation aKindOfExtrapolation ) ;
01330 
01333     boolean SetNumberOfValues( in long aNumberOfValues ) ;
01334     long NumberOfValues() ;
01335 
01336   } ;
01337 
01338 };
01339 #endif