Salome HOME
Update copyright information
[modules/superv.git] / idl / SUPERV.idl
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File   : SUPERV.idl
23 //  Author : Jean Rahuel
24 //  $Header:
25 //
26 /*! \file SUPERV.idl This file contains a set of interfaces of the %SUPERVISION module
27 */
28
29 #ifndef __SUPERV_IDL__
30 #define __SUPERV_IDL__
31
32 #include "SALOME_ModuleCatalog.idl"
33 #include "SALOME_Component.idl"
34 #include "SALOMEDS.idl"
35 /*!
36  The main package of interfaces of %SUPERVISION module
37 */
38 module SUPERV {
39
40 /*!
41 This enumeration contains a set of elements defining the type of the port.
42 \note  <BR>In general, ports represent <STRONG>input or output parameters</STRONG> of the functions,
43 implemented in different kinds of nodes of the graph.
44 */
45   enum KindOfPort { UndefinedParameter , 
46                     ServiceParameter , 
47                     GateParameter ,
48                     InLineParameter , 
49                     LoopParameter , 
50                     SwitchParameter ,
51                     EndSwitchParameter , 
52                     GOTOParameter , 
53                     DataStreamParameter } ;
54
55 /*!
56 This enumeration contains a set of dependencies of InPorts and OutPorts.
57 */
58 //  enum KindOfDependency { UndefinedDependency , TimeDependency , IterationDependency } ;
59
60 /*!
61 This enumeration contains a set of schemas of InPorts.
62 */
63   enum KindOfSchema { SCHENULL , TI , TF , DELTA } ;
64
65 /*!
66 This enumeration contains a set of interpolations of InPorts.
67 */
68   enum KindOfInterpolation { INTERNULL , L0 , L1 } ;
69
70 /*!
71 This enumeration contains a set of extrapolations of InPorts.
72 */
73   enum KindOfExtrapolation { EXTRANULL , E0 , E1 } ;
74
75 /*!
76 This enumeration contains a set of dependencies of Ports.
77 */
78   enum KindOfDataStreamTrace { WithoutTrace , SummaryTrace , DetailedTrace } ;
79
80 /*!
81 This enumeration contains a set of elements defining the type of the node.
82 */
83   enum KindOfNode { FactoryNode , 
84                     DataFlowGraph , 
85                     ComputingNode ,
86                     InLineNode , 
87                     LoopNode , 
88                     EndLoopNode ,
89                     SwitchNode , 
90                     EndSwitchNode , 
91                     GOTONode , 
92                     DataStreamGraph ,
93                     MacroNode ,
94                     UnknownNode };
95
96 /*!
97 This struct contains fields defining the date.
98 */
99   struct SDate {
100     short Second;
101     short Minute;
102     short Hour;
103     short Day;
104     short Month;
105     short Year;
106   };
107 /*!
108 This enumeration contains a set of elements defining the type of operation, which has been performed
109 on this node(graph).
110 */
111
112   enum GraphEvent { UndefinedEvent , 
113                     NoEvent , 
114                     NewThreadEvent ,
115                     WaitingEvent , 
116                     ReadyEvent ,
117                     RunningEvent , 
118                     DoneEvent , 
119                     ErroredEvent ,
120                     SuspendEvent , 
121                     ResumeEvent ,
122                     KillEvent , 
123                     StopEvent } ;
124
125   // UndefinedState : Non existing Node, Port etc...
126 /*!
127 This enumeration contains a set of elements defining the current state of the node(graph).
128 */
129
130   enum GraphState { UndefinedState , 
131                     NoState , 
132                     EditingState , 
133                     SuspendState ,
134                     WaitingState , 
135                     ReadyState , 
136                     SuspendReadyState ,
137                     RunningState ,
138                     DoneState , 
139                     ErrorState ,
140                     SuspendDoneState , 
141                     SuspendErroredState ,
142                     KillState , 
143                     StopState ,
144                     LoadingState, 
145                     NumberOfGraphStates } ;
146
147 /*! A sequence of string values.
148 */
149   typedef sequence<string> ListOfStrings ;
150
151   interface Value ;
152
153   interface Link ;
154   interface StreamLink ;
155
156   typedef sequence<Link> ListOfLinks ;
157   typedef sequence<StreamLink> ListOfStreamLinks ;
158
159   interface Port ;
160   interface StreamPort ;
161
162   typedef sequence<Port> ListOfPorts ;
163   typedef sequence<StreamPort> ListOfStreamPorts ;
164
165   interface CNode ;
166   interface FNode ;
167   interface INode ;
168   interface GNode ;
169   interface LNode ;
170   interface ELNode ;
171   interface SNode ;
172   interface ESNode ;
173   interface Graph ;
174   interface StreamGraph ;
175
176   typedef sequence<CNode>  ListOfCNodes ;
177   typedef sequence<FNode>  ListOfFNodes ;
178   typedef sequence<INode>  ListOfINodes ;
179   typedef sequence<GNode>  ListOfGNodes ;
180   typedef sequence<LNode>  ListOfLNodes ;
181   typedef sequence<ELNode> ListOfELNodes ;
182   typedef sequence<SNode>  ListOfSNodes ;
183   typedef sequence<ESNode> ListOfESNodes ;
184   typedef sequence<Graph>  ListOfGraphs ;
185
186 /*!
187 This struct contains fields defining different types of nodes.
188 */
189
190   struct ListOfNodes {
191     ListOfCNodes  CNodes ;
192     ListOfFNodes  FNodes ;
193     ListOfINodes  INodes ;
194     ListOfGNodes  GNodes ;
195     ListOfLNodes  LNodes ;
196     ListOfELNodes ELNodes ;
197     ListOfSNodes  SNodes ;
198     ListOfESNodes ESNodes ;
199     ListOfGraphs  Graphs ;
200   } ;
201
202   // ToSuspendState : will be Suspended before running if waiting or
203   //                  will be Suspended while running or
204   //                  will be Suspended after run
205   // ToSuspendStartState : will be Suspended at the beginning of execution
206   // ToSuspendDoneState : will be Suspended after run
207 /*!
208 This enumeration contains a set of elements defining the %ControlState of the node.
209 The %ControlState gives a possibility to determine the "control actions" which have been done by
210 the user (Suspend, SuspendDone, Kill, etc...).
211 */
212   enum ControlState { VoidState , 
213                       ToSuspendStartState ,
214                       ToSuspendState , 
215                       ToSuspendDoneState ,
216                       ToKillState , 
217                       ToKillDoneState , 
218                       ToStopState ,
219                       NumberOfControlStates } ;
220
221
222
223   ////////////////
224 /*! \brief interface %SuperG
225
226 This interface contains a set of methods necessary for management of a %graph.
227 */
228   interface SuperG : Engines::Component, SALOMEDS::Driver {
229   ////////////////
230
231 //DumpPython is defined in SALOME_Component.idl (SALOMEDS::Driver)
232 //    SALOMEDS::TMPFile DumpPython( in SALOMEDS::Study theStudy ,
233 //                                  in boolean isPublished ,
234 //                                  out boolean isValisScript ) ;
235
236 /*!
237   Constructs a graph with possibility to read/edit it
238   \param aGraph  %aGraphName or %aGraphXmlFile
239 */
240     SUPERV::Graph Graph(in string aGraph ) ; // aGraphName or aGraphXmlFile
241
242 /*!
243   Constructs a read Only graph ( for execution ).
244  \note <BR>In this graph there is also a possibility to update nodes, coordinates of the links,
245   of container names and input data.
246   \param aGraph  %aGraphName or %aGraphXmlFile
247 */
248     SUPERV::Graph GraphE(in string aGraph ) ; // aGraphName or aGraphXmlFile
249
250 /*!
251   Constructs a StreamGraph with possibility to read/edit it
252   \param aGraph  %aGraphName or %aGraphXmlFile
253 */
254     SUPERV::StreamGraph StreamGraph(in string aGraph ) ; // aGraphName or aGraphXmlFile
255
256 /*!
257   Constructs a read Only StreamGraph ( for execution ).
258  \note <BR>In this graph there is also a possibility to update nodes, coordinates of the links,
259   of container names and input data.
260   \param aGraph  %aGraphName or %aGraphXmlFile
261 */
262     SUPERV::StreamGraph StreamGraphE(in string aGraph ) ; // aGraphName or aGraphXmlFile
263
264 /*!
265 Creates a value of <b>string</b> type which will be used for <VAR>Input</VAR> method in the interface %Node.
266 \param aString Input value of string type.
267 */
268     SUPERV::Value StringValue( in string aString ) ;
269 /*!
270 Creates a value of <b>any</b> type which will be used for <VAR>Input</VAR> method in the interface %Node.
271 \param anAny Input value of any type.
272 */
273     SUPERV::Value AnyValue( in any anAny ) ;
274 /*!
275  Gets a graph with a definite %IOR
276 \param ior String parameter defining %IOR of the graph.
277 */
278     SUPERV::Graph getGraph(in string ior); // get Graph from is IOR
279
280 /*!
281  Gets a graph with a definite %IOR
282 \param ior String parameter defining %IOR of the graph.
283 */
284     SUPERV::StreamGraph getStreamGraph(in string ior); // get Graph from is IOR
285
286   };
287
288 /*! \brief %CNode interface
289
290 This is a base class of the SUPERVISION module. It contains a set of methods allowing:
291 <ul>
292     <li>creating a <b>Computation</b> node and setting its parameters (Name, Author, Comments etc.)
293     <li>checking the current state of the node in the data flow
294     <li>node execution follow-up
295     <li>management of the components, which can be initialized for execution of calculations in the data flow. (For that purpose %CNode class inherits the methods of the %Engines:Component class)
296 </ul>
297 */
298
299   //////////////
300   interface CNode : Engines::Component {
301   //////////////
302
303
304 /*!
305 Returns the name of the node(graph).
306 */
307     string Name() ;
308 /*!
309 Returns the service of this node .
310 */
311     SALOME_ModuleCatalog::Service Service() ;
312 /*!
313 Returns the type of the node.
314 */
315     SUPERV::KindOfNode Kind() ;
316 /*!
317 Returns the date of creation of the node(graph).
318 */
319     SUPERV::SDate CreationDate() ;
320 /*!
321 Returns the date of last update of the node(graph).
322 */
323     SUPERV::SDate LastUpdateDate() ;
324 /*!
325 Returns the name of the version of the node(graph).
326 */
327     string Version() ;
328 /*!
329 Returns the name of the author of the node(graph).
330 */
331     string Author() ;
332 /*!
333 Returns the string containing comments about this node(graph).
334 */
335     string Comment() ;
336
337
338 /*!
339 Sets the name of the node(graph).
340 \param aNewName String value defining the name of the node(graph).
341 \return True if the name has been updated.
342 */
343     boolean SetName(in string aNewName ) ;
344 /*!
345 Sets the name of the author. Returns True if it is updated.
346 \param anAuthor String value defining the name of the author.
347 \return True if the name has been updated.
348 */
349     boolean SetAuthor(in string anAuthor ) ;
350 /*!
351 Allows to update the comments about this node(graph).
352 \param aComment String value containing a comment to this node(graph).
353 \return True if the old comment has been updated.
354 */
355     boolean SetComment(in string aComment ) ;
356
357 /*!
358  Gets a port of the node (for compatibility : see GetInPort - GetOutPort).
359 */
360     SUPERV::Port Port( in string aParameterName ) ;
361
362 /*! Gets an Input port in a node.
363 \param aParameterName This value sets the name of the parameter which will be defined in this port.
364 */
365     SUPERV::Port GetInPort( in string aParameterName ) ;
366
367 /*! Gets an Output port in a node.
368 \param aParameterName This value sets the name of the parameter which will be defined in this port.
369 */
370     SUPERV::Port GetOutPort( in string aParameterName ) ;
371
372 /*! Gets an Input StreamPort in a node.
373 \param aParameterName This value sets the name of the parameter which will be defined in this port.
374 */
375     SUPERV::StreamPort GetInStreamPort( in string aParameterName ) ;
376
377 /*! Gets an Output StreamPort in a node.
378 \param aParameterName This value sets the name of the parameter which will be defined in this port.
379 */
380     SUPERV::StreamPort GetOutStreamPort( in string aParameterName ) ;
381
382 /*!
383  Returns true if a Node (or Graph) has StreamPorts
384 */
385     boolean HasStreamPort() ;
386
387 /*!
388  Enters a value into an Input %Port
389 */
390     SUPERV::Port Input( in string InputParameterName ,
391                         in Value aValue ) ;
392
393 /*!
394   Gets a list of ports of the node(graph)
395 */
396     SUPERV::ListOfPorts Ports() ;
397
398 /*!
399   Gets a list of ports of the node(graph)
400 */
401     SUPERV::ListOfStreamPorts StreamPorts() ;
402
403 /*! Gets a list of links of a node(graph)
404 */
405     SUPERV::ListOfLinks Links() ;
406
407 /*! Gets a list of StreamLinks of a node(graph)
408 */
409     SUPERV::ListOfStreamLinks StreamLinks() ;
410
411 /*!
412 Returns True if this node is a graph.
413 */
414     boolean IsStreamGraph() ;
415 /*!
416 Returns True if this node is a graph.
417 */
418     boolean IsGraph() ;
419
420 /*!
421 Returns True if this node is a MacroNode of a DataFlowGraph or a DataStreamGraph.
422 */
423     boolean IsMacro() ;
424 /*!
425 Returns True if this node is a MacroNode of a DataFlowGraph.
426 */
427     boolean IsFlowMacro() ;
428 /*!
429 Returns True if this node is a MacroNode of a DataStreamGraph.
430 */
431     boolean IsStreamMacro() ;
432
433 /*!
434 Returns True if this node is a Head Graph .
435 */
436     boolean IsHeadGraph() ;
437 /*!
438 Returns the MacroNode Level of this node.
439 */
440     long GraphLevel() ;
441
442 /*!
443 Returns True if the node appears to be a %computing node.
444 */
445     boolean IsComputing() ;
446 /*!
447 Returns True if the node appears to be a %factory node.
448 */
449     boolean IsFactory() ;
450 /*!
451 Returns True if the node appears to be an %inline node.
452 */
453     boolean IsInLine() ;
454 /*!
455 Returns True if the node appears to be a %GOTO node.
456 */
457     boolean IsGOTO() ;
458 /*!
459 Returns True if the node appears to be a %loop node.
460 */
461     boolean IsLoop() ;
462 /*!
463 Returns True if the node appears to be an %endloop node.
464 */
465     boolean IsEndLoop() ;
466 /*!
467 Returns True if the node appears to be a %switch node.
468 */
469     boolean IsSwitch() ;
470 /*!
471 Returns True if the node appears to be a %endswitch node.
472 */
473     boolean IsEndSwitch() ;
474
475 /*!
476  Returns the numero of subgraph of a node.
477 */
478     long SubGraph() ;
479 /*!
480  Returns the numero of substreamgraph of a node.
481 */
482     long SubStreamGraph() ;
483
484 /*!
485 Returns the number of threads of the graph.
486 */
487     long Thread() ;
488
489 /*!
490  Returns True if the node(graph) is waiting for Data input
491 */
492     boolean IsWaiting() ;
493
494 /*!
495  Returns True if the node(graph) is ready for execution
496 */
497      boolean IsReady() ;
498
499 /*!
500  Returns True if the node(graph) is currently running
501 */
502     boolean IsRunning() ;
503
504 /*!
505  Returns True if execution is finished
506 */
507
508     boolean IsDone() ;
509 /*!
510  Returns True if execution is suspended
511 */
512
513     boolean IsSuspended() ;
514 /*!
515 Returns the current state of the graph.
516 */
517     SUPERV::GraphState State() ;
518
519 /*!
520  Waits for ready_to_run state, Suspend and return.
521 */
522     boolean ReadyW() ;
523
524 /*! Waits for running state, Suspend and return.
525 */
526     boolean RunningW() ;
527
528 /*! Waits for done state, Suspend and return.
529 */
530     boolean DoneW() ;
531
532 /*! Waits for Suspend state and return.
533 */
534     boolean SuspendedW() ;
535
536     //    boolean Ping();
537
538 /*! Kills execution.
539 <br>
540 If not running : will be killed when ready to run.
541 If running : kills immediatly.
542 */
543     boolean Kill();
544
545 /*! Kills execution.
546 <br>
547 Execution will be killed only just after running (only for nodes).
548 */
549     boolean KillDone();
550
551 /*! Stops execution.
552 <br>
553 If not running : will be stopped when ready to run.
554 If running : stops immediatly
555 */
556     boolean Stop();
557 /*! Suspends execution.
558 <br>
559 If not running : will be Suspended when ready to run. It is used in step-by-step execution.
560 If running : suspends immediatly
561 */
562     boolean Suspend();
563 /*! Suspends execution only just after running.
564 */
565     boolean SuspendDone();
566
567 /*! Resumes execution.
568 <br>
569 If Suspended : running will be continued.
570 If not Suspended : cancels the current ControlState ( Suspend, Kill, ...)
571 */
572     boolean Resume();
573
574
575 // Control state required : Kill, Suspend, Stop
576 /*!
577  Returns control state of the node(graph).
578 */
579     SUPERV::ControlState Control() ;
580 /*!
581 Clears the control state of the node(graph).
582 */
583     void ControlClear() ;
584
585     boolean ContainerKill();
586
587 /*!
588 Sets the position of the node in the window.
589 */
590     void Coords( in long X , in long Y ) ;
591 /*!
592 Returns the position of the node along X-axis.
593 */
594     long X() ;
595 /*!
596 Returns the position of the node along Y-axis.
597 */
598     long Y() ;
599 /*!
600 Returns the Cpu used by a node for execution of calculations in seconds.
601 */
602     long CpuUsed() ;
603
604   } ;
605 /*! \brief %FNode class
606
607 This class is necessary for management of factory nodes in a data flow. Besides the inherited methods it contains some methods allowing to define
608 the component from the container, which will be called for execution of the calculation.
609 */
610   //////////////
611   interface FNode : CNode {
612   //////////////
613 /*! Gets the name of the component, which will be called for execution of the calculation.
614 */
615     string GetComponentName() ;
616 /*! Gets the name of the interface of the component.
617 */
618     string GetInterfaceName() ;
619 /*! Gets the container containing the component, which will be called for execution of the calculation.
620 */
621     string GetContainer() ;
622 /*! Sets the name of the component, which will be called for execution of the calculation.
623 \param aComponentName Name of the component.
624 */
625     boolean SetComponentName(in string aComponentName ) ;
626 /*! Sets the name of the interface of the component.
627 \param anInterfaceName Name of the interface.
628 */
629     boolean SetInterfaceName(in string anInterfaceName ) ;
630 /*! Gets the container containing the component, which will be called for execution of the calculation.
631 \param aContainer Container containing the component.
632 */
633     boolean SetContainer(in string aContainer ) ;
634 /*! Method to define if %FNode gets from a component, which is implemented in C++ or Python.
635   Returns True if it's a C++ component node
636 */
637     boolean IsCimpl() ;
638
639   } ;
640 /*! \brief %INode class
641
642 This class is necessary for management of inline nodes in a data flow. Besides the inherited methods it contains some methods allowing to set a Python function, which will be
643 executed for performing calculations, as well as input and output parameters for the node.
644 */
645   // InLine Nodes
646   //////////////
647   interface INode : CNode {
648   //////////////
649
650 /*! Sets Python function for the InLine Node.
651 \param FuncName Name of the function
652 \param aPyInitFunction Python initialization function of the InLine Node
653 */
654     void SetPyFunction( in string FuncName ,
655                         in SUPERV::ListOfStrings aPyInitFunction ) ;
656 /*! Returns Python function of the InLine Node.
657 */
658     SUPERV::ListOfStrings PyFunction() ;
659 /*! Returns the name of the Python function of the InLine Node.
660 */
661     string PyFuncName() ;
662
663 /*! Creates an Input port in a node.
664 \param aParameterName This value sets the name of the parameter which will be defined in this port.
665 \param aParameterType This value sets the type of the parameter which will be defined in this port.
666 */
667     SUPERV::Port InPort( in string aParameterName , in string aParameterType ) ;
668 /*! Creates an Output port in an Inline node.
669 \param aParameterName This value sets the name of the parameter which will be defined in this port.
670 \param aParameterType This value sets the type of the parameter which will be defined in this port.
671 */
672     SUPERV::Port OutPort( in string aParameterName , in string aParameterType ) ;
673
674     /*! Creates an Input DataStreamPort in an Inline node.
675       \param aParameterName This value sets the name of the parameter which will be defined in this port.
676       \param aParameterType This value sets the type of the parameter which will be defined in this port.
677     */
678     SUPERV::StreamPort InStreamPort (in string aParameterName, in string aParameterType,
679                                      in SALOME_ModuleCatalog::DataStreamDependency aDependency);
680
681     /*! Creates an Output DataStreamPort in an Inline node.
682       \param aParameterName This value sets the name of the parameter which will be defined in this port.
683       \param aParameterType This value sets the type of the parameter which will be defined in this port.
684     */
685     SUPERV::StreamPort OutStreamPort (in string aParameterName, in string aParameterType,
686                                       in SALOME_ModuleCatalog::DataStreamDependency aDependency);
687   };
688
689 /*! \brief %GNode class
690
691 This class is necessary for management of GOTO/EndLoop/EndSwitch nodes in the dataflow.
692 Besides the inherited methods it contains some methods allowing to define the couple node, which will be linked to this one.
693 */
694   // GOTO/EndLoop/EndSwitch Nodes
695   ///////////////
696   interface GNode : INode {
697   ///////////////
698 /*! Sets the coupled InLine Node to this GOTO/EndLoop/EndSwitch Node.
699 */
700     boolean SetCoupled( in string anInLineNode ) ;
701 /*! Returns the coupled InLine Node to this GOTO/EndLoop/EndSwitch Node.
702 */
703     SUPERV::INode Coupled() ;
704   } ;
705 /*! %Loop Nodes class
706 */
707   // Loop Nodes
708   ///////////////
709   interface LNode : GNode {
710   ///////////////
711 /*! Sets Python Init function of the Loop Node.
712 \param InitName Name of the Init function
713 \param aPyInitFunction Python Init function
714 */
715     void SetPyInit( in string InitName ,
716                             in SUPERV::ListOfStrings aPyInitFunction ) ;
717 /*! Returns Python Init function of the Loop Node.
718 */
719     SUPERV::ListOfStrings PyInit() ;
720 /*! Returns the name of the Python Init function of the Loop  Node.
721 */
722     string PyInitName() ;
723
724 /*! Sets Python More function of the Loop Node.
725 \param MoreName Name of the More function
726 \param aPyMoreFunction Python More function
727 */
728     void SetPyMore( in string MoreName ,
729                             in SUPERV::ListOfStrings aPyMoreFunction ) ;
730 /*! Returns Python More function of the Loop Node.
731 */
732     SUPERV::ListOfStrings PyMore() ;
733 /*! Returns the name of the Python More function of the Loop Node.
734 */
735     string PyMoreName() ;
736
737 /*! Sets Python Next function of the Loop Node.
738 \param  NextName Name of the  Next function
739 \param aPy NextFunction Python  Next function
740 */
741     void SetPyNext( in string NextName ,
742                             in SUPERV::ListOfStrings aPyNextFunction ) ;
743
744 /*! Returns Python Next function of the Loop Node.
745 */
746     SUPERV::ListOfStrings PyNext() ;
747 /*! Returns the name of the Python Next function of the Loop Node.
748 */
749     string PyNextName() ;
750
751   } ;
752
753   // EndOfLoop Nodes
754   ////////////////
755   interface ELNode : GNode {
756   ////////////////
757   } ;
758
759   // Switch Nodes
760   ///////////////
761   interface SNode : GNode {
762   ///////////////
763   } ;
764
765   // EndOfSwitch Nodes
766   ////////////////
767   interface ESNode : GNode {
768   ////////////////
769   } ;
770
771 /*! \brief Interface of a graph
772
773 This interface includes a set of methods used for management of the graphs in %SUPERVISION module.
774 */
775
776   ///////////////
777   interface Graph : GNode {
778   ///////////////
779
780     /*! Creates a Computing Node in a Graph.
781     */
782     SUPERV::CNode CNode( in SALOME_ModuleCatalog::Service aService ) ;
783
784     /*! Creates a Factory Node in a Graph.
785     */
786     SUPERV::FNode FNode( in string aComponentName ,
787                          in string anInterfaceName ,
788                          in SALOME_ModuleCatalog::Service aService ,
789                          in SALOME_ModuleCatalog::ImplType implType ) ;
790
791     /*! Creates an InLine Node in a Graph.
792     */
793     SUPERV::INode INode( in string FuncName , in ListOfStrings aPythonFunction ) ;
794
795     /*! Creates a GOTO Node and links it to the corresponding InLine node.
796     */
797     SUPERV::GNode GNode( in string FuncName , in ListOfStrings aPythonFunction ,
798                          in string anINode ) ;
799
800     /*! Creates a Loop Node ("for" or "while" loop) and links it to the corresponding end of loop node.
801     */
802     SUPERV::LNode LNode( in string InitName , in ListOfStrings InitFunction ,
803                          in string MoreName , in ListOfStrings MoreFunction ,
804                          in string NextName , in ListOfStrings NextFunction ,
805                          out SUPERV::INode anEndOfLoop ) ;
806
807     /*! Creates a conditional "if/elseif/else" or "switch" node and the corresponding end node
808     */
809     SUPERV::SNode SNode( in string FuncName , in ListOfStrings aPythonFunction ,
810                          out SUPERV::INode anEndOfSwitch ) ;
811
812     /*! Creates a "MacroNode" node which corresponds to a Graph with a xml file
813     */
814     SUPERV::Graph MNode( in string aXmlFileName ) ;
815
816     /*! Creates a "MacroNode" node which corresponds to a Graph with a Graph
817     */
818     SUPERV::Graph GraphMNode( in Graph aGraph ) ;
819
820     /*! Returns a Graph of a "MacroNode" or a "MacroNode" of a Graph
821     */
822     SUPERV::Graph FlowObjRef() ;
823
824     /*! Returns a StreamGraph of a "MacroNode"  or a "MacroNode" of a StreamGraph
825     */
826     SUPERV::StreamGraph StreamObjRef() ;
827
828     /*! Returns an existing node with a definite name.
829     \param aNodeName Name of the Node.
830     */
831     SUPERV::CNode Node( in string aNodeName ) ;
832
833     /*! Creates a CORBA Component Object Reference
834     */
835     Engines::Component ComponentRef( in string aComputerContainer ,
836                                      in string aComponentName ) ;
837
838     /*! Creates a link  connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
839      */
840     SUPERV::Link Link( in SUPERV::Port OutputPort ,
841                        in SUPERV::Port InputPort ) ;
842
843     /*!
844       Give the last error[s] message[s]
845       \return string[s] corresponding to last error[s].
846     */
847     string Messages() ;
848
849     /*!
850       Imports a graph into a file with XML format
851       \param anXmlFile String parameter defining the name of the XML file.
852       \return True, if the graph has been successfully imported.
853     */
854     boolean Import( in string anXmlFile ) ;
855
856     /*!
857       Exports a graph to a file with XML format
858       \param anXmlFile String parameter defining the name of the XML file.
859       \return True, if the graph has been successfully exported.
860     */
861     boolean Export( in string anXmlFile ) ;
862     
863     /*!
864       Exports a graph to a string in python format
865     */
866     string SavePY( in boolean importSuperV ) ;
867     
868     /*!
869       Returns True if the graph is read Only.
870     */
871     boolean IsReadOnly() ;
872
873     /*!
874       Starts asynchronous execution of the graph.
875     */
876     boolean Run() ;
877
878     /*!
879       Assigns to the %Node an %Event and a %State of the %Node, if the Event is
880       available. And returns immediately Nil, NoEvent and NoState if not.
881       Returns false if the graph is finished, suspended, killed or stopped.
882       \param aNode  %Node for which this method is called
883       \param anEvent  An operation, which has been performed on this node(graph).
884       \param aState   Current state of the graph
885     */
886     boolean EventNoW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
887                       out SUPERV::GraphState aState ) ;
888
889     /*!
890       Assigns to the %Node an %Event and a %State of the %Node, if the Event is
891       available. Waits if it is not available at the current moment.
892       Returns false if the graph is finished, suspended, killed or stopped.
893       \param aNode  %Node for which this method is called
894       \param anEvent  An operation, which has been performed on this node(graph).
895       \param aState   Current state of the graph
896     */
897     boolean Event( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
898                    out SUPERV::GraphState aState ) ;
899     
900     // Same as Event but execution of the thread is suspended between the
901     // return of EventW and the next call to EventW
902     /*!
903       Assigns to the %Node an %Event and a %State of the %Node, if the Event is
904       available. And returns immediately Nil, NoEvent and NoState if not.
905       Returns false if the graph is finished, suspended, killed or stopped.
906       \note <BR>Execution of the thread is suspended between the return of this
907       method and its next usage.
908       \param aNode  %Node for which this method is called
909       \param anEvent  An operation, which has been performed on this node(graph).
910       \param aState   Current state of the graph
911     */
912     boolean EventW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
913                     out SUPERV::GraphState aState ) ;
914     /*! \name Methods used for inner debugging purposes of threads management :
915      */
916     /*@{*/
917     
918     long EventQSize() ;
919     long LevelMax() ;
920     SUPERV::ListOfNodes LevelNodes( in long aLevel ) ;
921     long ThreadsMax() ;
922     
923     /*@}*/
924
925     /*!
926       Returns the number of currently running threads.
927     */
928     long Threads();
929     /*!
930       Returns the number of suspended threads.
931     */
932     long SuspendedThreads();
933     /*!
934       Returns True if the graph is valid.
935     */
936     boolean IsValid() ;
937     /*!
938       Returns True if the graph can be executed.
939     */
940     boolean IsExecutable() ;
941     /*!
942       Returns True if the graph is being currently edited.
943     */
944     boolean IsEditing() ;
945     /*!
946       Returns True if the graph is being currently executed.
947     */
948     boolean IsExecuting() ;
949     
950     long LastLevelDone() ;
951     
952     /*!
953       Launches step-by-step execution of the graph.
954       \note  The execution is suspended immediatly after performance of operations of the first node and
955       user can specify the nodes, where execution will be again suspended after its resuming.
956     */
957     boolean Start() ;
958     /*!
959       Allows to copy one graph into another.
960     */
961     SUPERV::Graph Copy() ;
962     /*!
963       Convert a FlowGraph to a StreamGraph.
964     */
965     SUPERV::StreamGraph ToStreamGraph() ;
966     /*!
967       Merges two graphs
968     */
969     boolean Merge( in Graph aGraph ) ;
970     /*!
971       Returns a list of nodes of the graph.
972     */
973     SUPERV::ListOfNodes Nodes() ;
974     /*!
975       Returns a list of links of the graph.
976     */
977     SUPERV::ListOfLinks GLinks() ;
978     /*!
979       Gets IOR of the garph.
980     */
981     string getIOR();
982     
983     /*!
984       Returns the number of independent subgraphs
985     */
986     long SubGraphsNumber() ;
987     /*!
988       Returns a list of Nodes of a SubGraph.
989     */
990     SUPERV::ListOfNodes SubGraphsNodes( in long SubGraphNumber ) ;
991
992     /*! Forces use of Editor's data model and destroy of Executor
993      */
994     void Editing();
995
996     /*! Returns the default name of container for C component
997      */
998     string DefaultCContainerName();
999
1000     /*! Returns the default name of container for Python component
1001      */
1002     string DefaultPythonContainerName();
1003
1004     /*! Returns the last container name associated with the ComponentName component
1005      */
1006     string ContainerNameForComponent( in string ComponentName );
1007
1008   } ;
1009
1010
1011
1012
1013
1014 /*! \brief Interface of a StreamGraph
1015
1016 This interface includes a set of methods used for management of the graphs in %SUPERVISION module.
1017 */
1018
1019   /////////////////////
1020   interface StreamGraph : Graph {
1021   /////////////////////
1022
1023 /*!
1024 Allows to copy one graph into another.
1025 */
1026     SUPERV::StreamGraph StreamCopy() ;
1027     /*! Creates a "MacroNode" node which corresponds to a StreamGraph with a xml file
1028     */
1029     SUPERV::StreamGraph StreamMNode( in string aXmlFileName ) ;
1030
1031     /*! Creates a "MacroNode" node which corresponds to a StreamGraph with a Graph
1032     */
1033     SUPERV::StreamGraph StreamGraphMNode( in StreamGraph aStreamGraph ) ;
1034
1035 /*!
1036  Creates a link  connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
1037 */
1038     SUPERV::StreamLink StreamLink( in SUPERV::StreamPort OutputPort ,
1039                                    in SUPERV::StreamPort InputPort ) ;
1040
1041 /*!
1042 Returns a list of links of the graph.
1043 */
1044     SUPERV::ListOfStreamLinks GStreamLinks() ;
1045     boolean SetStreamParams( in long Timeout ,
1046                              in SUPERV::KindOfDataStreamTrace DataStreamTrace ,
1047                              in double DeltaTime ) ;
1048     void StreamParams( out long Timeout ,
1049                        out SUPERV::KindOfDataStreamTrace DataStreamTrace ,
1050                        out double DeltaTime ) ;
1051
1052 /*!
1053 Returns the number of independent subStreamgraphs
1054 */
1055     long SubStreamGraphsNumber() ;
1056 /*!
1057 Returns a list of Nodes of a SubStreamGraph.
1058 */
1059     SUPERV::ListOfNodes SubStreamGraphsNodes( in long SubStreamGraphNumber ) ;
1060
1061 /*!
1062 Convert a StreamGraph to a FlowGraph.
1063 */
1064     SUPERV::Graph ToFlowGraph() ;
1065
1066 /*!
1067 Merge a StreamGraph.
1068 */
1069     boolean StreamMerge( in StreamGraph aStreamGraph ) ;
1070
1071   } ;
1072
1073
1074
1075
1076
1077
1078 /*! \brief Interface of the %link
1079
1080 This interface contains a set of methods used for representation and management of the links
1081 connecting nodes in a %graph.
1082 */
1083
1084   //////////////
1085   interface Link : Engines::Component {
1086   //////////////
1087 /*!
1088 Returns the %Output %Port of the Link
1089 */
1090     SUPERV::Port OutPort() ;
1091
1092 /*!
1093 Returns the %Input %Port of the Link
1094 */
1095     SUPERV::Port InPort() ;
1096
1097     // For GUI :
1098 /*! \name Methods used for representation of links in GUI of %SALOME application :
1099 */
1100 /*@{*/
1101 /*!
1102 Returns the number of coordinate points which are included in the link.
1103 \note  <BR>Every link can contain a set of coordinate points which constitute it. These points have
1104 index numbers (beginning from 1) and coordinates defining their position in the window. Indexing of
1105 the points starts from input port to output port of the corresponding link.
1106 */
1107     long CoordsSize() ;
1108 /*!
1109 Adds a coordinate point to the link.
1110 \param index  Index of the point.
1111 \param X  Coordinates of the point.
1112 \param Y  Coordinates of the point.
1113 */
1114     boolean AddCoord( in long index , in long X , in long Y ) ;
1115 /*!
1116 Changes the location of a definite coordinate point of the link.
1117 \param index  Index of the point.
1118 \param X  Coordinates of the point.
1119 \param Y  Coordinates of the point.
1120 */
1121
1122     boolean ChangeCoord( in long index , in long X , in long Y ) ;
1123 /*!
1124 Removes a coordinate point of the link.
1125 \param index  Index of the point.
1126 */
1127
1128     boolean RemoveCoord( in long index ) ;
1129
1130 /*!
1131 Sets the location of a coordinate point of the link.
1132 \param index  Index of the point.
1133 \param X  Coordinates of the point.
1134 \param Y  Coordinates of the point.
1135 */
1136
1137     boolean Coords( in long index , out long X , out long Y ) ;
1138 /*@}*/
1139
1140     //    void Destroy() ;
1141
1142     /*! Checks if the types of Ports that it connects are compatible
1143      */
1144     boolean IsValid();
1145
1146     /*! Check if the Link equals to the another given Link
1147      */
1148     boolean IsEqual( in SUPERV::Link aLink );
1149
1150   } ;
1151
1152
1153
1154
1155
1156
1157 /*! \brief Interface of the %link
1158
1159 This interface contains a set of methods used for representation and management of the links
1160 connecting nodes in a %graph.
1161 */
1162
1163   ////////////////////
1164   interface StreamLink : Link {
1165   ////////////////////
1166 /*!
1167 Returns the %Output %StreamPort of the StreamLink
1168 */
1169     SUPERV::StreamPort OutStreamPort() ;
1170
1171 /*!
1172 Returns the %Input %StreamPort of the StreamLink
1173 */
1174     SUPERV::StreamPort InStreamPort() ;
1175
1176
1177   } ;
1178
1179
1180
1181
1182
1183 /*! \brief  %Value interface
1184
1185 This interface contains a set of methods used for setting initial parameters of the ports
1186 */
1187
1188   ///////////////
1189   interface Value : Engines::Component {
1190   ///////////////
1191 /*!
1192 Converts the given value into a value of string type.
1193 */
1194     string ToString() ;
1195 /*!
1196 Converts the given value into a value of independant data type.
1197 */
1198     any ToAny() ;
1199 /*!
1200 Returns True if the value represents an IOR.
1201 */
1202     boolean IsIOR() ;
1203 /*!
1204 Gets data type of the component.
1205 */
1206     string ComponentDataType() ;
1207
1208     //    void Destroy() ;
1209
1210   } ;
1211 /*! \brief  %Port interface
1212
1213 This interface contains a set of methods used for management of the ports.
1214 */
1215
1216   //////////////
1217   interface Port : Value {
1218   //////////////
1219
1220 /*!
1221   Gives a value to an Input %Port
1222 \param aValue This parameter defines the input value
1223 */
1224     boolean Input( in SUPERV::Value aValue ) ;
1225
1226 /*!
1227 Returns the node of the port
1228 */
1229     SUPERV::CNode Node() ;
1230 /*!
1231 Sets the name of the port.
1232 */
1233     string Name() ;
1234
1235 /* Gets the type of a port.
1236 \return A string defining the type of a port
1237 */
1238
1239     string Type() ;
1240
1241     // Link of an Input Port
1242 /*!
1243 Returns the link of an %Input %Port
1244 */
1245     SUPERV::Link Link() ;
1246
1247 /*!
1248 Returns a list of links of an Input %Port of an EndSwitchNode
1249 */
1250     SUPERV::ListOfLinks Links() ;
1251
1252 /*!
1253 Returns True if this port appears to be an %Input %Port of a Node
1254 */
1255     boolean IsInput() ;
1256
1257 /*!
1258 Returns True if an %Input %Value exists for that %Input %Port (without link)
1259 */
1260     boolean HasInput() ;
1261
1262 /*!
1263 Returns True if the %Port is linked (without value)
1264 */
1265 // Port with link (without Value)
1266     boolean IsLinked() ;
1267
1268     // Kind of a Port
1269 /*! Returns the type of this port.
1270 */
1271     SUPERV::KindOfPort Kind() ;
1272
1273     // Port from the service of the node
1274 /*!
1275 Returns True if the %Port is a parameter of a service
1276 */
1277     boolean IsParam() ;
1278     // Port is a Gate of the node
1279 /*!
1280 Returns True if the %Port appears to be a Gate Port of the Node
1281 */
1282     boolean IsGate() ;
1283     // Port is a parameter of an InLineNode
1284 /*!
1285 Returns True if the %Port appears to be a parameter of an InLine Node.
1286 */
1287     boolean IsInLine() ;
1288
1289     // Port is a LoopParameter (InitLoop or DoLoop) of an LoopNode
1290 /*!
1291 Returns True if the %Port appears to be a Loop Parameter (InitLoop or DoLoop) of a Loop Node
1292 */
1293     boolean IsLoop() ;
1294     // Port is an output parameter of a SwitchNode connected to an InGate
1295 /*!
1296 Returns True if the %Port appears to be a parameter of a switch node
1297 */
1298     // Port is a parameter of a switch node
1299     boolean IsSwitch() ;
1300     // Port is an Input parameter of a EndSwitchNode connected to several output ports
1301 /*!
1302 Returns True if the %Port appears to be an EndSwitch Node connected to several output ports.
1303 */
1304     boolean IsEndSwitch() ;
1305
1306     boolean IsDataStream() ;
1307
1308 /*! Returns the current state of the port.
1309 */
1310     SUPERV::GraphState State() ;
1311 /*! Returns True if computation is finished.
1312 */
1313     boolean IsDone() ;
1314
1315 /*! deactivate the objref of a Port when its node is destroyed
1316 */
1317     void Remove() ;
1318
1319   } ;
1320
1321   ////////////////////
1322   interface StreamPort : Port {
1323   ////////////////////
1324
1325     // Link of a StreamPort
1326 /*!
1327 Returns the link of a %StreamPort
1328 */
1329     SUPERV::StreamLink StreamLink() ;
1330
1331 /*! Returns the current Dependency of the DataStreamPort : TimeDependency or IterationDependency
1332 */
1333     SALOME_ModuleCatalog::DataStreamDependency Dependency() ;
1334     boolean SetDependency( in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
1335
1336 /*! Sets or Returns the current kinds of Schema, Interpolation and Extrapolation of the InDataStreamPort
1337 */
1338     boolean SetParams( in KindOfSchema aKindOfSchema ,
1339                        in KindOfInterpolation aKindOfInterpolation ,
1340                        in KindOfExtrapolation aKindOfExtrapolation ) ;
1341     boolean Params( out KindOfSchema aKindOfSchema ,
1342                     out KindOfInterpolation aKindOfInterpolation ,
1343                     out KindOfExtrapolation aKindOfExtrapolation ) ;
1344
1345 /*! Sets or Returns the current number of values ("NIVEAU") of the OutDataStreamPort
1346 */
1347     boolean SetNumberOfValues( in long aNumberOfValues ) ;
1348     long NumberOfValues() ;
1349
1350   } ;
1351
1352 };
1353 #endif