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