Salome HOME
80ef176f698746e9c7dd6a42de19499ad57348df
[modules/superv.git] / idl / SUPERV.idl
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 //  This library is free software; you can redistribute it and/or
5 //  modify it under the terms of the GNU Lesser General Public
6 //  License as published by the Free Software Foundation; either
7 //  version 2.1 of the License.
8 //
9 //  This library is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 //  Lesser General Public License for more details.
13 //
14 //  You should have received a copy of the GNU Lesser General Public
15 //  License along with this library; if not, write to the Free Software
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
19 //
20 //
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 Returns a duplicate of the object (omniORB4 problem).
287 */
288     Object ToObject( in Object anObject ) ;
289
290   };
291
292 /*! \brief %CNode interface
293
294 This is a base class of the SUPERVISION module. It contains a set of methods allowing:
295 <ul>
296     <li>creating a <b>Computation</b> node and setting its parameters (Name, Author, Comments etc.)
297     <li>checking the current state of the node in the data flow
298     <li>node execution follow-up
299     <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)
300 </ul>
301 */
302
303   //////////////
304   interface CNode : Engines::Component {
305   //////////////
306
307
308 /*!
309 Returns the name of the node(graph).
310 */
311     string Name() ;
312 /*!
313 Returns the service of this node .
314 */
315     SALOME_ModuleCatalog::Service Service() ;
316 /*!
317 Returns the type of the node.
318 */
319     SUPERV::KindOfNode Kind() ;
320 /*!
321 Returns the date of creation of the node(graph).
322 */
323     SUPERV::SDate CreationDate() ;
324 /*!
325 Returns the date of last update of the node(graph).
326 */
327     SUPERV::SDate LastUpdateDate() ;
328 /*!
329 Returns the name of the version of the node(graph).
330 */
331     string Version() ;
332 /*!
333 Returns the name of the author of the node(graph).
334 */
335     string Author() ;
336 /*!
337 Returns the string containing comments about this node(graph).
338 */
339     string Comment() ;
340
341
342 /*!
343 Sets the name of the node(graph).
344 \param aNewName String value defining the name of the node(graph).
345 \return True if the name has been updated.
346 */
347     boolean SetName(in string aNewName ) ;
348 /*!
349 Sets the name of the author. Returns True if it is updated.
350 \param anAuthor String value defining the name of the author.
351 \return True if the name has been updated.
352 */
353     boolean SetAuthor(in string anAuthor ) ;
354 /*!
355 Allows to update the comments about this node(graph).
356 \param aComment String value containing a comment to this node(graph).
357 \return True if the old comment has been updated.
358 */
359     boolean SetComment(in string aComment ) ;
360
361 /*!
362  Gets a port of the node (for compatibility : see GetInPort - GetOutPort).
363 */
364     SUPERV::Port Port( in string aParameterName ) ;
365
366 /*! Gets an Input port in a node.
367 \param aParameterName This value sets the name of the parameter which will be defined in this port.
368 */
369     SUPERV::Port GetInPort( in string aParameterName ) ;
370
371 /*! Gets an Output port in a node.
372 \param aParameterName This value sets the name of the parameter which will be defined in this port.
373 */
374     SUPERV::Port GetOutPort( in string aParameterName ) ;
375
376 /*! Gets an Input StreamPort in a node.
377 \param aParameterName This value sets the name of the parameter which will be defined in this port.
378 */
379     SUPERV::StreamPort GetInStreamPort( in string aParameterName ) ;
380
381 /*! Gets an Output StreamPort in a node.
382 \param aParameterName This value sets the name of the parameter which will be defined in this port.
383 */
384     SUPERV::StreamPort GetOutStreamPort( in string aParameterName ) ;
385
386 /*!
387  Returns true if a Node (or Graph) has StreamPorts
388 */
389     boolean HasStreamPort() ;
390
391 /*!
392  Enters a value into an Input %Port
393 */
394     SUPERV::Port Input( in string InputParameterName ,
395                         in Value aValue ) ;
396
397 /*!
398   Gets a list of ports of the node(graph)
399 */
400     SUPERV::ListOfPorts Ports() ;
401
402 /*!
403   Gets a list of ports of the node(graph)
404 */
405     SUPERV::ListOfStreamPorts StreamPorts() ;
406
407 /*! Gets a list of links of a node(graph)
408 */
409     SUPERV::ListOfLinks Links() ;
410
411 /*! Gets a list of StreamLinks of a node(graph)
412 */
413     SUPERV::ListOfStreamLinks StreamLinks() ;
414
415 /*!
416 Returns True if this node is a graph.
417 */
418     boolean IsStreamGraph() ;
419 /*!
420 Returns True if this node is a graph.
421 */
422     boolean IsGraph() ;
423
424 /*!
425 Returns True if this node is a MacroNode of a DataFlowGraph or a DataStreamGraph.
426 */
427     boolean IsMacro() ;
428 /*!
429 Returns True if this node is a MacroNode of a DataFlowGraph.
430 */
431     boolean IsFlowMacro() ;
432 /*!
433 Returns True if this node is a MacroNode of a DataStreamGraph.
434 */
435     boolean IsStreamMacro() ;
436
437 /*!
438 Returns True if this node is a Head Graph .
439 */
440     boolean IsHeadGraph() ;
441 /*!
442 Returns the MacroNode Level of this node.
443 */
444     long GraphLevel() ;
445
446 /*!
447 Returns True if the node appears to be a %computing node.
448 */
449     boolean IsComputing() ;
450 /*!
451 Returns True if the node appears to be a %factory node.
452 */
453     boolean IsFactory() ;
454 /*!
455 Returns True if the node appears to be an %inline node.
456 */
457     boolean IsInLine() ;
458 /*!
459 Returns True if the node appears to be a %GOTO node.
460 */
461     boolean IsGOTO() ;
462 /*!
463 Returns True if the node appears to be a %loop node.
464 */
465     boolean IsLoop() ;
466 /*!
467 Returns True if the node appears to be an %endloop node.
468 */
469     boolean IsEndLoop() ;
470 /*!
471 Returns True if the node appears to be a %switch node.
472 */
473     boolean IsSwitch() ;
474 /*!
475 Returns True if the node appears to be a %endswitch node.
476 */
477     boolean IsEndSwitch() ;
478
479 /*!
480  Returns the numero of subgraph of a node.
481 */
482     long SubGraph() ;
483 /*!
484  Returns the numero of substreamgraph of a node.
485 */
486     long SubStreamGraph() ;
487
488 /*!
489 Returns the number of threads of the graph.
490 */
491     long Thread() ;
492
493 /*!
494  Returns True if the node(graph) is waiting for Data input
495 */
496     boolean IsWaiting() ;
497
498 /*!
499  Returns True if the node(graph) is ready for execution
500 */
501      boolean IsReady() ;
502
503 /*!
504  Returns True if the node(graph) is currently running
505 */
506     boolean IsRunning() ;
507
508 /*!
509  Returns True if execution is finished
510 */
511
512     boolean IsDone() ;
513 /*!
514  Returns True if execution is suspended
515 */
516
517     boolean IsSuspended() ;
518 /*!
519 Returns the current state of the graph.
520 */
521     SUPERV::GraphState State() ;
522
523 /*!
524  Waits for ready_to_run state, Suspend and return.
525 */
526     boolean ReadyW() ;
527
528 /*! Waits for running state, Suspend and return.
529 */
530     boolean RunningW() ;
531
532 /*! Waits for done state, Suspend and return.
533 */
534     boolean DoneW() ;
535
536 /*! Waits for Suspend state and return.
537 */
538     boolean SuspendedW() ;
539
540     //    boolean Ping();
541
542 /*! Kills execution.
543 <br>
544 If not running : will be killed when ready to run.
545 If running : kills immediatly.
546 */
547     boolean Kill();
548
549 /*! Kills execution.
550 <br>
551 Execution will be killed only just after running (only for nodes).
552 */
553     boolean KillDone();
554
555 /*! Stops execution.
556 <br>
557 If not running : will be stopped when ready to run.
558 If running : stops immediatly
559 */
560     boolean Stop();
561 /*! Suspends execution.
562 <br>
563 If not running : will be Suspended when ready to run. It is used in step-by-step execution.
564 If running : suspends immediatly
565 */
566     boolean Suspend();
567 /*! Suspends execution only just after running.
568 */
569     boolean SuspendDone();
570
571 /*! Resumes execution.
572 <br>
573 If Suspended : running will be continued.
574 If not Suspended : cancels the current ControlState ( Suspend, Kill, ...)
575 */
576     boolean Resume();
577
578
579 // Control state required : Kill, Suspend, Stop
580 /*!
581  Returns control state of the node(graph).
582 */
583     SUPERV::ControlState Control() ;
584 /*!
585 Clears the control state of the node(graph).
586 */
587     void ControlClear() ;
588
589     boolean ContainerKill();
590
591 /*!
592 Sets the position of the node in the window.
593 */
594     void Coords( in long X , in long Y ) ;
595 /*!
596 Returns the position of the node along X-axis.
597 */
598     long X() ;
599 /*!
600 Returns the position of the node along Y-axis.
601 */
602     long Y() ;
603 /*!
604 Returns the Cpu used by a node for execution of calculations in seconds.
605 */
606     long CpuUsed() ;
607
608   } ;
609 /*! \brief %FNode class
610
611 This class is necessary for management of factory nodes in a data flow. Besides the inherited methods it contains some methods allowing to define
612 the component from the container, which will be called for execution of the calculation.
613 */
614   //////////////
615   interface FNode : CNode {
616   //////////////
617 /*! Gets the name of the component, which will be called for execution of the calculation.
618 */
619     string GetComponentName() ;
620 /*! Gets the name of the interface of the component.
621 */
622     string GetInterfaceName() ;
623 /*! Gets the container containing the component, which will be called for execution of the calculation.
624 */
625     string GetContainer() ;
626 /*! Sets the name of the component, which will be called for execution of the calculation.
627 \param aComponentName Name of the component.
628 */
629     boolean SetComponentName(in string aComponentName ) ;
630 /*! Sets the name of the interface of the component.
631 \param anInterfaceName Name of the interface.
632 */
633     boolean SetInterfaceName(in string anInterfaceName ) ;
634 /*! Gets the container containing the component, which will be called for execution of the calculation.
635 \param aContainer Container containing the component.
636 */
637     boolean SetContainer(in string aContainer ) ;
638   } ;
639 /*! \brief %INode class
640
641 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
642 executed for performing calculations, as well as input and output parameters for the node.
643 */
644   // InLine Nodes
645   //////////////
646   interface INode : CNode {
647   //////////////
648
649 /*! Sets Python function for the InLine Node.
650 \param FuncName Name of the function
651 \param aPyInitFunction Python initialization function of the InLine Node
652 */
653     void SetPyFunction( in string FuncName ,
654                         in SUPERV::ListOfStrings aPyInitFunction ) ;
655 /*! Returns Python function of the InLine Node.
656 */
657     SUPERV::ListOfStrings PyFunction() ;
658 /*! Returns the name of the Python function of the InLine Node.
659 */
660     string PyFuncName() ;
661
662 /*! Creates an Input port in a node.
663 \param aParameterName This value sets the name of the parameter which will be defined in this port.
664 \param aParameterType This value sets the type of the parameter which will be defined in this port.
665 */
666     SUPERV::Port InPort( in string aParameterName , in string aParameterType ) ;
667 /*! Creates an Output port in an Inline node.
668 \param aParameterName This value sets the name of the parameter which will be defined in this port.
669 \param aParameterType This value sets the type of the parameter which will be defined in this port.
670 */
671     SUPERV::Port OutPort( in string aParameterName , in string aParameterType ) ;
672
673 /*! Creates an Input DataStreamPort in an Inline node.
674 \param aParameterName This value sets the name of the parameter which will be defined in this port.
675 \param aParameterType This value sets the type of the parameter which will be defined in this port.
676 */
677     SUPERV::StreamPort InStreamPort( in string aParameterName , in SALOME_ModuleCatalog::DataStreamType aParameterType , in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
678
679 /*! Creates an Output DataStreamPort in an Inline node.
680 \param aParameterName This value sets the name of the parameter which will be defined in this port.
681 \param aParameterType This value sets the type of the parameter which will be defined in this port.
682 */
683     SUPERV::StreamPort OutStreamPort( in string aParameterName , in SALOME_ModuleCatalog::DataStreamType aParameterType , in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
684
685   } ;
686 /*! \brief %GNode class
687
688 This class is necessary for management of GOTO/EndLoop/EndSwitch nodes in the dataflow.
689 Besides the inherited methods it contains some methods allowing to define the couple node, which will be linked to this one.
690 */
691   // GOTO/EndLoop/EndSwitch Nodes
692   ///////////////
693   interface GNode : INode {
694   ///////////////
695 /*! Sets the coupled InLine Node to this GOTO/EndLoop/EndSwitch Node.
696 */
697     boolean SetCoupled( in string anInLineNode ) ;
698 /*! Returns the coupled InLine Node to this GOTO/EndLoop/EndSwitch Node.
699 */
700     SUPERV::INode Coupled() ;
701   } ;
702 /*! %Loop Nodes class
703 */
704   // Loop Nodes
705   ///////////////
706   interface LNode : GNode {
707   ///////////////
708 /*! Sets Python Init function of the Loop Node.
709 \param InitName Name of the Init function
710 \param aPyInitFunction Python Init function
711 */
712     void SetPyInit( in string InitName ,
713                             in SUPERV::ListOfStrings aPyInitFunction ) ;
714 /*! Returns Python Init function of the Loop Node.
715 */
716     SUPERV::ListOfStrings PyInit() ;
717 /*! Returns the name of the Python Init function of the Loop  Node.
718 */
719     string PyInitName() ;
720
721 /*! Sets Python More function of the Loop Node.
722 \param MoreName Name of the More function
723 \param aPyMoreFunction Python More function
724 */
725     void SetPyMore( in string MoreName ,
726                             in SUPERV::ListOfStrings aPyMoreFunction ) ;
727 /*! Returns Python More function of the Loop Node.
728 */
729     SUPERV::ListOfStrings PyMore() ;
730 /*! Returns the name of the Python More function of the Loop Node.
731 */
732     string PyMoreName() ;
733
734 /*! Sets Python Next function of the Loop Node.
735 \param  NextName Name of the  Next function
736 \param aPy NextFunction Python  Next function
737 */
738     void SetPyNext( in string NextName ,
739                             in SUPERV::ListOfStrings aPyNextFunction ) ;
740
741 /*! Returns Python Next function of the Loop Node.
742 */
743     SUPERV::ListOfStrings PyNext() ;
744 /*! Returns the name of the Python Next function of the Loop Node.
745 */
746     string PyNextName() ;
747
748   } ;
749
750   // EndOfLoop Nodes
751   ////////////////
752   interface ELNode : GNode {
753   ////////////////
754   } ;
755
756   // Switch Nodes
757   ///////////////
758   interface SNode : GNode {
759   ///////////////
760   } ;
761
762   // EndOfSwitch Nodes
763   ////////////////
764   interface ESNode : GNode {
765   ////////////////
766   } ;
767
768 /*! \brief Interface of a graph
769
770 This interface includes a set of methods used for management of the graphs in %SUPERVISION module.
771 */
772
773   ///////////////
774   interface Graph : GNode {
775   ///////////////
776
777     /*! Creates a Computing Node in a Graph.
778     */
779     SUPERV::CNode CNode( in SALOME_ModuleCatalog::Service aService ) ;
780
781     /*! Creates a Factory Node in a Graph.
782     */
783     SUPERV::FNode FNode( in string aComponentName ,
784                          in string anInterfaceName ,
785                          in SALOME_ModuleCatalog::Service aService ) ;
786
787     /*! Creates an InLine Node in a Graph.
788     */
789     SUPERV::INode INode( in string FuncName , in ListOfStrings aPythonFunction ) ;
790
791     /*! Creates a GOTO Node and links it to the corresponding InLine node.
792     */
793     SUPERV::GNode GNode( in string FuncName , in ListOfStrings aPythonFunction ,
794                          in string anINode ) ;
795
796     /*! Creates a Loop Node ("for" or "while" loop) and links it to the corresponding end of loop node.
797     */
798     SUPERV::LNode LNode( in string InitName , in ListOfStrings InitFunction ,
799                          in string MoreName , in ListOfStrings MoreFunction ,
800                          in string NextName , in ListOfStrings NextFunction ,
801                          out SUPERV::INode anEndOfLoop ) ;
802
803     /*! Creates a conditional "if/elseif/else" or "switch" node and the corresponding end node
804     */
805     SUPERV::SNode SNode( in string FuncName , in ListOfStrings aPythonFunction ,
806                          out SUPERV::INode anEndOfSwitch ) ;
807
808     /*! Creates a "MacroNode" node which corresponds to a Graph with a xml file
809     */
810     SUPERV::Graph MNode( in string aXmlFileName ) ;
811
812     /*! Creates a "MacroNode" node which corresponds to a Graph with a Graph
813     */
814     SUPERV::Graph GraphMNode( in Graph aGraph ) ;
815
816     /*! Returns a Graph of a "MacroNode" or a "MacroNode" of a Graph
817     */
818     SUPERV::Graph FlowObjRef() ;
819
820     /*! Returns a StreamGraph of a "MacroNode"  or a "MacroNode" of a StreamGraph
821     */
822     SUPERV::StreamGraph StreamObjRef() ;
823
824     /*! Returns an existing node with a definite name.
825     \param aNodeName Name of the Node.
826     */
827     SUPERV::CNode Node( in string aNodeName ) ;
828
829     /*! Creates a CORBA Component Object Reference
830     */
831     Engines::Component ComponentRef( in string aComputerContainer ,
832                                      in string aComponentName ) ;
833
834     /*! Creates a link  connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
835      */
836     SUPERV::Link Link( in SUPERV::Port OutputPort ,
837                        in SUPERV::Port InputPort ) ;
838
839     /*!
840       Give the last error[s] message[s]
841       \return string[s] corresponding to last error[s].
842     */
843     string Messages() ;
844
845     /*!
846       Imports a graph into a file with XML format
847       \param anXmlFile String parameter defining the name of the XML file.
848       \return True, if the graph has been successfully imported.
849     */
850     boolean Import( in string anXmlFile ) ;
851
852     /*!
853       Exports a graph to a file with XML format
854       \param anXmlFile String parameter defining the name of the XML file.
855       \return True, if the graph has been successfully exported.
856     */
857     boolean Export( in string anXmlFile ) ;
858     
859     /*!
860       Exports a graph to a string in python format
861     */
862     string SavePY( in boolean importSuperV ) ;
863     
864     /*!
865       Returns True if the graph is read Only.
866     */
867     boolean IsReadOnly() ;
868
869     /*!
870       Starts asynchronous execution of the graph.
871     */
872     boolean Run() ;
873
874     /*!
875       Assigns to the %Node an %Event and a %State of the %Node, if the Event is
876       available. And returns immediately Nil, NoEvent and NoState if not.
877       Returns false if the graph is finished, suspended, killed or stopped.
878       \param aNode  %Node for which this method is called
879       \param anEvent  An operation, which has been performed on this node(graph).
880       \param aState   Current state of the graph
881     */
882     boolean EventNoW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
883                       out SUPERV::GraphState aState ) ;
884
885     /*!
886       Assigns to the %Node an %Event and a %State of the %Node, if the Event is
887       available. Waits if it is not available at the current moment.
888       Returns false if the graph is finished, suspended, killed or stopped.
889       \param aNode  %Node for which this method is called
890       \param anEvent  An operation, which has been performed on this node(graph).
891       \param aState   Current state of the graph
892     */
893     boolean Event( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
894                    out SUPERV::GraphState aState ) ;
895     
896     // Same as Event but execution of the thread is suspended between the
897     // return of EventW and the next call to EventW
898     /*!
899       Assigns to the %Node an %Event and a %State of the %Node, if the Event is
900       available. And returns immediately Nil, NoEvent and NoState if not.
901       Returns false if the graph is finished, suspended, killed or stopped.
902       \note <BR>Execution of the thread is suspended between the return of this
903       method and its next usage.
904       \param aNode  %Node for which this method is called
905       \param anEvent  An operation, which has been performed on this node(graph).
906       \param aState   Current state of the graph
907     */
908     boolean EventW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
909                     out SUPERV::GraphState aState ) ;
910     /*! \name Methods used for inner debugging purposes of threads management :
911      */
912     /*@{*/
913     
914     long EventQSize() ;
915     long LevelMax() ;
916     SUPERV::ListOfNodes LevelNodes( in long aLevel ) ;
917     long ThreadsMax() ;
918     
919     /*@}*/
920
921     /*!
922       Returns the number of currently running threads.
923     */
924     long Threads();
925     /*!
926       Returns the number of suspended threads.
927     */
928     long SuspendedThreads();
929     /*!
930       Returns True if the graph is valid.
931     */
932     boolean IsValid() ;
933     /*!
934       Returns True if the graph can be executed.
935     */
936     boolean IsExecutable() ;
937     /*!
938       Returns True if the graph is being currently edited.
939     */
940     boolean IsEditing() ;
941     /*!
942       Returns True if the graph is being currently executed.
943     */
944     boolean IsExecuting() ;
945     
946     long LastLevelDone() ;
947     
948     /*!
949       Launches step-by-step execution of the graph.
950       \note  The execution is suspended immediatly after performance of operations of the first node and
951       user can specify the nodes, where execution will be again suspended after its resuming.
952     */
953     boolean Start() ;
954     /*!
955       Allows to copy one graph into another.
956     */
957     SUPERV::Graph Copy() ;
958     /*!
959       Convert a FlowGraph to a StreamGraph.
960     */
961     SUPERV::StreamGraph ToStreamGraph() ;
962     /*!
963       Merges two graphs
964     */
965     boolean Merge( in Graph aGraph ) ;
966     /*!
967       Returns a list of nodes of the graph.
968     */
969     SUPERV::ListOfNodes Nodes() ;
970     /*!
971       Returns a list of links of the graph.
972     */
973     SUPERV::ListOfLinks GLinks() ;
974     /*!
975       Gets IOR of the garph.
976     */
977     string getIOR();
978     
979     /*!
980       Returns the number of independent subgraphs
981     */
982     long SubGraphsNumber() ;
983     /*!
984       Returns a list of Nodes of a SubGraph.
985     */
986     SUPERV::ListOfNodes SubGraphsNodes( in long SubGraphNumber ) ;
987
988     /*! Forces use of Editor's data model and destroy of Executor
989      */
990     void Editing();
991     
992   } ;
993
994
995
996
997
998 /*! \brief Interface of a StreamGraph
999
1000 This interface includes a set of methods used for management of the graphs in %SUPERVISION module.
1001 */
1002
1003   /////////////////////
1004   interface StreamGraph : Graph {
1005   /////////////////////
1006
1007 /*!
1008 Allows to copy one graph into another.
1009 */
1010     SUPERV::StreamGraph StreamCopy() ;
1011     /*! Creates a "MacroNode" node which corresponds to a StreamGraph with a xml file
1012     */
1013     SUPERV::StreamGraph StreamMNode( in string aXmlFileName ) ;
1014
1015     /*! Creates a "MacroNode" node which corresponds to a StreamGraph with a Graph
1016     */
1017     SUPERV::StreamGraph StreamGraphMNode( in StreamGraph aStreamGraph ) ;
1018
1019 /*!
1020  Creates a link  connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
1021 */
1022     SUPERV::StreamLink StreamLink( in SUPERV::StreamPort OutputPort ,
1023                                    in SUPERV::StreamPort InputPort ) ;
1024
1025 /*!
1026 Returns a list of links of the graph.
1027 */
1028     SUPERV::ListOfStreamLinks GStreamLinks() ;
1029     boolean SetStreamParams( in long Timeout ,
1030                              in SUPERV::KindOfDataStreamTrace DataStreamTrace ,
1031                              in double DeltaTime ) ;
1032     void StreamParams( out long Timeout ,
1033                        out SUPERV::KindOfDataStreamTrace DataStreamTrace ,
1034                        out double DeltaTime ) ;
1035
1036 /*!
1037 Returns the number of independent subStreamgraphs
1038 */
1039     long SubStreamGraphsNumber() ;
1040 /*!
1041 Returns a list of Nodes of a SubStreamGraph.
1042 */
1043     SUPERV::ListOfNodes SubStreamGraphsNodes( in long SubStreamGraphNumber ) ;
1044
1045 /*!
1046 Convert a StreamGraph to a FlowGraph.
1047 */
1048     SUPERV::Graph ToFlowGraph() ;
1049
1050 /*!
1051 Merge a StreamGraph.
1052 */
1053     boolean StreamMerge( in StreamGraph aStreamGraph ) ;
1054
1055   } ;
1056
1057
1058
1059
1060
1061
1062 /*! \brief Interface of the %link
1063
1064 This interface contains a set of methods used for representation and management of the links
1065 connecting nodes in a %graph.
1066 */
1067
1068   //////////////
1069   interface Link : Engines::Component {
1070   //////////////
1071 /*!
1072 Returns the %Output %Port of the Link
1073 */
1074     SUPERV::Port OutPort() ;
1075
1076 /*!
1077 Returns the %Input %Port of the Link
1078 */
1079     SUPERV::Port InPort() ;
1080
1081     // For GUI :
1082 /*! \name Methods used for representation of links in GUI of %SALOME application :
1083 */
1084 /*@{*/
1085 /*!
1086 Returns the number of coordinate points which are included in the link.
1087 \note  <BR>Every link can contain a set of coordinate points which constitute it. These points have
1088 index numbers (beginning from 1) and coordinates defining their position in the window. Indexing of
1089 the points starts from input port to output port of the corresponding link.
1090 */
1091     long CoordsSize() ;
1092 /*!
1093 Adds a coordinate point to the link.
1094 \param index  Index of the point.
1095 \param X  Coordinates of the point.
1096 \param Y  Coordinates of the point.
1097 */
1098     boolean AddCoord( in long index , in long X , in long Y ) ;
1099 /*!
1100 Changes the location of a definite coordinate point of the link.
1101 \param index  Index of the point.
1102 \param X  Coordinates of the point.
1103 \param Y  Coordinates of the point.
1104 */
1105
1106     boolean ChangeCoord( in long index , in long X , in long Y ) ;
1107 /*!
1108 Removes a coordinate point of the link.
1109 \param index  Index of the point.
1110 */
1111
1112     boolean RemoveCoord( in long index ) ;
1113
1114 /*!
1115 Sets the location of a coordinate point of the link.
1116 \param index  Index of the point.
1117 \param X  Coordinates of the point.
1118 \param Y  Coordinates of the point.
1119 */
1120
1121     boolean Coords( in long index , out long X , out long Y ) ;
1122 /*@}*/
1123
1124     //    void Destroy() ;
1125
1126     /*! Checks if the types of Ports that it connects are compatible
1127      */
1128     boolean IsValid();
1129
1130     /*! Check if the Link equals to the another given Link
1131      */
1132     boolean IsEqual( in SUPERV::Link aLink );
1133
1134   } ;
1135
1136
1137
1138
1139
1140
1141 /*! \brief Interface of the %link
1142
1143 This interface contains a set of methods used for representation and management of the links
1144 connecting nodes in a %graph.
1145 */
1146
1147   ////////////////////
1148   interface StreamLink : Link {
1149   ////////////////////
1150 /*!
1151 Returns the %Output %StreamPort of the StreamLink
1152 */
1153     SUPERV::StreamPort OutStreamPort() ;
1154
1155 /*!
1156 Returns the %Input %StreamPort of the StreamLink
1157 */
1158     SUPERV::StreamPort InStreamPort() ;
1159
1160
1161   } ;
1162
1163
1164
1165
1166
1167 /*! \brief  %Value interface
1168
1169 This interface contains a set of methods used for setting initial parameters of the ports
1170 */
1171
1172   ///////////////
1173   interface Value : Engines::Component {
1174   ///////////////
1175 /*!
1176 Converts the given value into a value of string type.
1177 */
1178     string ToString() ;
1179 /*!
1180 Converts the given value into a value of independant data type.
1181 */
1182     any ToAny() ;
1183 /*!
1184 Returns True if the value represents an IOR.
1185 */
1186     boolean IsIOR() ;
1187 /*!
1188 Gets data type of the component.
1189 */
1190     string ComponentDataType() ;
1191
1192     //    void Destroy() ;
1193
1194   } ;
1195 /*! \brief  %Port interface
1196
1197 This interface contains a set of methods used for management of the ports.
1198 */
1199
1200   //////////////
1201   interface Port : Value {
1202   //////////////
1203
1204 /*!
1205   Gives a value to an Input %Port
1206 \param aValue This parameter defines the input value
1207 */
1208     boolean Input( in SUPERV::Value aValue ) ;
1209
1210 /*!
1211 Returns the node of the port
1212 */
1213     SUPERV::CNode Node() ;
1214 /*!
1215 Sets the name of the port.
1216 */
1217     string Name() ;
1218
1219 /* Gets the type of a port.
1220 \return A string defining the type of a port
1221 */
1222
1223     string Type() ;
1224
1225     // Link of an Input Port
1226 /*!
1227 Returns the link of an %Input %Port
1228 */
1229     SUPERV::Link Link() ;
1230
1231 /*!
1232 Returns a list of links of an Input %Port of an EndSwitchNode
1233 */
1234     SUPERV::ListOfLinks Links() ;
1235
1236 /*!
1237 Returns True if this port appears to be an %Input %Port of a Node
1238 */
1239     boolean IsInput() ;
1240
1241 /*!
1242 Returns True if an %Input %Value exists for that %Input %Port (without link)
1243 */
1244     boolean HasInput() ;
1245
1246 /*!
1247 Returns True if the %Port is linked (without value)
1248 */
1249 // Port with link (without Value)
1250     boolean IsLinked() ;
1251
1252     // Kind of a Port
1253 /*! Returns the type of this port.
1254 */
1255     SUPERV::KindOfPort Kind() ;
1256
1257     // Port from the service of the node
1258 /*!
1259 Returns True if the %Port is a parameter of a service
1260 */
1261     boolean IsParam() ;
1262     // Port is a Gate of the node
1263 /*!
1264 Returns True if the %Port appears to be a Gate Port of the Node
1265 */
1266     boolean IsGate() ;
1267     // Port is a parameter of an InLineNode
1268 /*!
1269 Returns True if the %Port appears to be a parameter of an InLine Node.
1270 */
1271     boolean IsInLine() ;
1272
1273     // Port is a LoopParameter (InitLoop or DoLoop) of an LoopNode
1274 /*!
1275 Returns True if the %Port appears to be a Loop Parameter (InitLoop or DoLoop) of a Loop Node
1276 */
1277     boolean IsLoop() ;
1278     // Port is an output parameter of a SwitchNode connected to an InGate
1279 /*!
1280 Returns True if the %Port appears to be a parameter of a switch node
1281 */
1282     // Port is a parameter of a switch node
1283     boolean IsSwitch() ;
1284     // Port is an Input parameter of a EndSwitchNode connected to several output ports
1285 /*!
1286 Returns True if the %Port appears to be an EndSwitch Node connected to several output ports.
1287 */
1288     boolean IsEndSwitch() ;
1289
1290     boolean IsDataStream() ;
1291
1292 /*! Returns the current state of the port.
1293 */
1294     SUPERV::GraphState State() ;
1295 /*! Returns True if computation is finished.
1296 */
1297     boolean IsDone() ;
1298
1299 /*! deactivate the objref of a Port when its node is destroyed
1300 */
1301     void Remove() ;
1302
1303   } ;
1304
1305   ////////////////////
1306   interface StreamPort : Port {
1307   ////////////////////
1308
1309     // Link of a StreamPort
1310 /*!
1311 Returns the link of a %StreamPort
1312 */
1313     SUPERV::StreamLink StreamLink() ;
1314
1315 /*! Returns the current Dependency of the DataStreamPort : TimeDependency or IterationDependency
1316 */
1317     SALOME_ModuleCatalog::DataStreamDependency Dependency() ;
1318     boolean SetDependency( in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
1319
1320 /*! Sets or Returns the current kinds of Schema, Interpolation and Extrapolation of the InDataStreamPort
1321 */
1322     boolean SetParams( in KindOfSchema aKindOfSchema ,
1323                        in KindOfInterpolation aKindOfInterpolation ,
1324                        in KindOfExtrapolation aKindOfExtrapolation ) ;
1325     boolean Params( out KindOfSchema aKindOfSchema ,
1326                     out KindOfInterpolation aKindOfInterpolation ,
1327                     out KindOfExtrapolation aKindOfExtrapolation ) ;
1328
1329 /*! Sets or Returns the current number of values ("NIVEAU") of the OutDataStreamPort
1330 */
1331     boolean SetNumberOfValues( in long aNumberOfValues ) ;
1332     long NumberOfValues() ;
1333
1334   } ;
1335
1336 };
1337 #endif