From: nri Date: Fri, 30 Apr 2004 12:21:46 +0000 (+0000) Subject: NRI : Merge from Event_Server. X-Git-Tag: Ecole_Ete_a1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=133526ad92a8cb3d8ebe699acefbf831abef7ce9;p=modules%2Fsuperv.git NRI : Merge from Event_Server. --- diff --git a/examples/GraphStream.py b/examples/GraphStream.py new file mode 100644 index 0000000..4941141 --- /dev/null +++ b/examples/GraphStream.py @@ -0,0 +1,91 @@ + +# Generated python file of Graph GraphStream + +from SuperV import * +# Graph creation +GraphStream = Graph( 'GraphStream' ) +GraphStream.SetName( 'GraphStream' ) +GraphStream.SetAuthor( '' ) +GraphStream.SetComment( '' ) +GraphStream.Coords( 0 , 0 ) + +# Creation of Factory Nodes + +Add = GraphStream.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) +Add.SetName( 'Add' ) +Add.SetAuthor( '' ) +Add.SetContainer( 'FactoryServer' ) +Add.SetComment( 'Add from AddComponent' ) +Add.Coords( 15 , 241 ) +Add.InDataStreamPort( 'istream' , 'long' ) +Add.OutDataStreamPort( 'ostream' , 'long' ) +Add.OutDataStreamPort( 'Ostream' , 'long' ) + +Sub = GraphStream.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub.SetName( 'Sub' ) +Sub.SetAuthor( '' ) +Sub.SetContainer( 'FactoryServer' ) +Sub.SetComment( 'Sub from SubComponent' ) +Sub.Coords( 227 , 99 ) +Sub.InDataStreamPort( 'istream' , 'long' ) +Sub.InDataStreamPort( 'Istream' , 'long' ) + +Mul = GraphStream.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul.SetName( 'Mul' ) +Mul.SetAuthor( '' ) +Mul.SetContainer( 'FactoryServer' ) +Mul.SetComment( 'Mul from MulComponent' ) +Mul.Coords( 444 , 241 ) + +Div = GraphStream.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) +Div.SetName( 'Div' ) +Div.SetAuthor( '' ) +Div.SetContainer( 'FactoryServer' ) +Div.SetComment( 'Div from DivComponent' ) +Div.Coords( 634 , 98 ) +Div.OutDataStreamPort( 'ostream' , 'long' ) + +# Creation of Links +Addz = Add.Port( 'z' ) +Suby = GraphStream.Link( Addz , Sub.Port( 'y' ) ) +Suby.AddCoord( 1 , 189 , 207 ) +Suby.AddCoord( 2 , 189 , 350 ) + +Muly = GraphStream.Link( Addz , Mul.Port( 'y' ) ) + +Addostream = Add.Port( 'ostream' ) +Subistream = GraphStream.Link( Addostream , Sub.Port( 'istream' ) ) +Subistream.AddCoord( 1 , 201 , 237 ) +Subistream.AddCoord( 2 , 200 , 378 ) + +AddOstream = Add.Port( 'Ostream' ) +SubIstream = GraphStream.Link( AddOstream , Sub.Port( 'Istream' ) ) +SubIstream.AddCoord( 1 , 212 , 267 ) +SubIstream.AddCoord( 2 , 211 , 409 ) + +Subz = Sub.Port( 'z' ) +Mulx = GraphStream.Link( Subz , Mul.Port( 'x' ) ) +Mulx.AddCoord( 1 , 420 , 322 ) +Mulx.AddCoord( 2 , 419 , 180 ) + +Divx = GraphStream.Link( Subz , Div.Port( 'x' ) ) + +Mulz = Mul.Port( 'z' ) +Divy = GraphStream.Link( Mulz , Div.Port( 'y' ) ) +Divy.AddCoord( 1 , 622 , 207 ) +Divy.AddCoord( 2 , 623 , 320 ) + +# Creation of Input datas +Addx = Add.Input( 'x' , 3) +Addy = Add.Input( 'y' , 4.5) +Subx = Sub.Input( 'x' , 1.5) +Addistream = Add.Input( 'istream' , 1) + +# Creation of Output variables +AddFuncValue = Add.Port( 'FuncValue' ) +Divz = Div.Port( 'z' ) +Divostream = Div.Port( 'ostream' ) + +GraphStream.Run() +GraphStream.DoneW() +GraphStream.PrintPorts() diff --git a/examples/GraphStream.xml b/examples/GraphStream.xml new file mode 100644 index 0000000..c593d79 --- /dev/null +++ b/examples/GraphStream.xml @@ -0,0 +1,292 @@ + + + + +? + ? + GraphStream + 1 + ? + +GraphStream + + +double + Add\x + +double + Add\y + +double + Sub\x + + +double + Add\FuncValue + +double + Div\z + + +long + Add\istream + +long + Div\ostream + + 12/3/2004 - 17:16:56 + 12/3/2004 - 17:35:43 + 1.05 + ? + ? + ? + 0 + 0 + + +AddComponent + AddComponent + Add + 0 + ? + +Add + + +double + x + +double + y + + +double + FuncValue + +double + z + + +long + istream + +long + ostream + +long + Ostream + + 12/3/2004 - 17:35:43 + 12/3/2004 - 17:35:43 + 1.05 + ? + FactoryServer + Add from AddComponent + 15 + 241 + +SubComponent + SubComponent + Sub + 0 + ? + +Sub + + +double + x + +double + y + + +double + z + + +long + istream + +long + Istream + + 12/3/2004 - 17:35:43 + 12/3/2004 - 17:35:43 + 1.05 + ? + FactoryServer + Sub from SubComponent + 227 + 99 + +MulComponent + MulComponent + Mul + 0 + ? + +Mul + + +double + x + +double + y + + +double + z + + + 12/3/2004 - 17:35:43 + 12/3/2004 - 17:35:43 + 1.05 + ? + FactoryServer + Mul from MulComponent + 444 + 241 + +DivComponent + DivComponent + Div + 0 + ? + +Div + + +double + x + +double + y + + +double + z + + +long + ostream + + 12/3/2004 - 17:35:43 + 12/3/2004 - 17:35:43 + 1.05 + ? + FactoryServer + Div from DivComponent + 634 + 98 + + +Add + z + Sub + y + + +189 + 207 + +189 + 350 + +Add + z + Mul + y + + +Add + ostream + Sub + istream + + +201 + 237 + +200 + 378 + +Add + Ostream + Sub + Istream + + +212 + 267 + +211 + 409 + +Sub + z + Mul + x + + +420 + 322 + +419 + 180 + +Sub + z + Div + x + + +Mul + z + Div + y + + +622 + 207 + +623 + 320 + + +GraphStream + Add\x + Add + x + +7 + 3 + + +GraphStream + Add\y + Add + y + +7 + 4.5 + + +GraphStream + Sub\x + Sub + x + +7 + 1.5 + + +GraphStream + Add\istream + Add + istream + +3 + 1 + diff --git a/examples/GraphStreams.py b/examples/GraphStreams.py new file mode 100644 index 0000000..fc9367b --- /dev/null +++ b/examples/GraphStreams.py @@ -0,0 +1,278 @@ + +# Generated python file of Graph GraphStreams + +from SuperV import * +# Graph creation +GraphStreams = Graph( 'GraphStreams' ) +GraphStreams.SetName( 'GraphStreams' ) +GraphStreams.SetAuthor( '' ) +GraphStreams.SetComment( '' ) +GraphStreams.Coords( 0 , 0 ) + +# Creation of Factory Nodes + +Add = GraphStreams.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) +Add.SetName( 'Add' ) +Add.SetAuthor( '' ) +Add.SetContainer( 'FactoryServer' ) +Add.SetComment( 'Add from AddComponent' ) +Add.Coords( 256 , 156 ) +Add.InDataStreamPort( 'istream' , 'long' ) +Add.OutDataStreamPort( 'ostream' , 'long' ) +Add.OutDataStreamPort( 'Ostream' , 'long' ) + +Sub = GraphStreams.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub.SetName( 'Sub' ) +Sub.SetAuthor( '' ) +Sub.SetContainer( 'FactoryServer' ) +Sub.SetComment( 'Sub from SubComponent' ) +Sub.Coords( 519 , 33 ) +Sub.InDataStreamPort( 'istream' , 'long' ) +Sub.InDataStreamPort( 'Istream' , 'long' ) + +Mul = GraphStreams.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul.SetName( 'Mul' ) +Mul.SetAuthor( '' ) +Mul.SetContainer( 'FactoryServer' ) +Mul.SetComment( 'Mul from MulComponent' ) +Mul.Coords( 723 , 156 ) + +Div = GraphStreams.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) +Div.SetName( 'Div' ) +Div.SetAuthor( '' ) +Div.SetContainer( 'FactoryServer' ) +Div.SetComment( 'Div from DivComponent' ) +Div.Coords( 936 , 34 ) +Div.OutDataStreamPort( 'ostream' , 'long' ) + +Add_1 = GraphStreams.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) +Add_1.SetName( 'Add_1' ) +Add_1.SetAuthor( '' ) +Add_1.SetContainer( 'localhost/FactoryServer' ) +Add_1.SetComment( 'Add from AddComponent' ) +Add_1.Coords( 252 , 499 ) +Add_1.InDataStreamPort( 'istream' , 'long' ) +Add_1.OutDataStreamPort( 'ostream' , 'long' ) +Add_1.OutDataStreamPort( 'Ostream' , 'long' ) + +Sub_1 = GraphStreams.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub_1.SetName( 'Sub_1' ) +Sub_1.SetAuthor( '' ) +Sub_1.SetContainer( 'localhost/FactoryServer' ) +Sub_1.SetComment( 'Sub from SubComponent' ) +Sub_1.Coords( 518 , 369 ) +Sub_1.InDataStreamPort( 'istream' , 'long' ) +Sub_1.InDataStreamPort( 'Istream' , 'long' ) + +Mul_1 = GraphStreams.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul_1.SetName( 'Mul_1' ) +Mul_1.SetAuthor( '' ) +Mul_1.SetContainer( 'localhost/FactoryServer' ) +Mul_1.SetComment( 'Mul from MulComponent' ) +Mul_1.Coords( 731 , 498 ) + +Div_1 = GraphStreams.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) +Div_1.SetName( 'Div_1' ) +Div_1.SetAuthor( '' ) +Div_1.SetContainer( 'localhost/FactoryServer' ) +Div_1.SetComment( 'Div from DivComponent' ) +Div_1.Coords( 931 , 369 ) +Div_1.OutDataStreamPort( 'ostream' , 'long' ) + +# Creation of Loop Nodes +PyLoop = [] +PyLoop.append( 'import time ' ) +PyLoop.append( 'def Init(Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub) : ' ) +PyLoop.append( ' if Min <= Max : ' ) +PyLoop.append( ' Index = Min ' ) +PyLoop.append( ' else : ' ) +PyLoop.append( ' Index = Max ' ) +PyLoop.append( ' time.sleep( 1 ) ' ) +PyLoop.append( ' return Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub ' ) +PyMoreLoop = [] +PyMoreLoop.append( 'import time ' ) +PyMoreLoop.append( 'def More(Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub) : ' ) +PyMoreLoop.append( ' if Index < Max : ' ) +PyMoreLoop.append( ' DoLoop = 1 ' ) +PyMoreLoop.append( ' else : ' ) +PyMoreLoop.append( ' DoLoop = 0 ' ) +PyMoreLoop.append( ' time.sleep( 1 ) ' ) +PyMoreLoop.append( ' return DoLoop,Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub ' ) +PyNextLoop = [] +PyNextLoop.append( 'import time ' ) +PyNextLoop.append( 'def Next(Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub) : ' ) +PyNextLoop.append( ' Index = Index + Incr ' ) +PyNextLoop.append( ' time.sleep( 1 ) ' ) +PyNextLoop.append( ' return Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub ' ) +Loop,EndLoop = GraphStreams.LNode( 'Init' , PyLoop , 'More' , PyMoreLoop , 'Next' , PyNextLoop ) +EndLoop.SetName( 'EndLoop' ) +EndLoop.SetAuthor( '' ) +EndLoop.SetComment( '' ) +EndLoop.Coords( 1157 , 388 ) +PyEndLoop = [] +EndLoop.SetPyFunction( 'EndInit' , PyEndLoop ) +Loop.SetName( 'Loop' ) +Loop.SetAuthor( '' ) +Loop.SetComment( '' ) +Loop.Coords( 5 , 399 ) +Loop.InPort( 'Index' , 'long' ) +Loop.InPort( 'Min' , 'long' ) +Loop.InPort( 'Max' , 'long' ) +Loop.InPort( 'Incr' , 'long' ) +Loop.InPort( 'z_Div' , 'double' ) +Loop.InPort( 'z_Div_1' , 'double' ) +Loop.InPort( 'y_Add' , 'double' ) +Loop.InPort( 'x_Sub' , 'double' ) + +# Creation of Links +Addz = Add.Port( 'z' ) +Suby = GraphStreams.Link( Addz , Sub.Port( 'y' ) ) +Suby.AddCoord( 1 , 448 , 143 ) +Suby.AddCoord( 2 , 447 , 266 ) + +Muly = GraphStreams.Link( Addz , Mul.Port( 'y' ) ) + +Addostream = Add.Port( 'ostream' ) +Subistream = GraphStreams.Link( Addostream , Sub.Port( 'istream' ) ) +Subistream.AddCoord( 1 , 474 , 172 ) +Subistream.AddCoord( 2 , 474 , 294 ) + +AddOstream = Add.Port( 'Ostream' ) +SubIstream = GraphStreams.Link( AddOstream , Sub.Port( 'Istream' ) ) +SubIstream.AddCoord( 1 , 499 , 201 ) +SubIstream.AddCoord( 2 , 500 , 322 ) + +Subz = Sub.Port( 'z' ) +Mulx = GraphStreams.Link( Subz , Mul.Port( 'x' ) ) +Mulx.AddCoord( 1 , 707 , 237 ) +Mulx.AddCoord( 2 , 706 , 114 ) + +Divx = GraphStreams.Link( Subz , Div.Port( 'x' ) ) + +Mulz = Mul.Port( 'z' ) +Divy = GraphStreams.Link( Mulz , Div.Port( 'y' ) ) +Divy.AddCoord( 1 , 912 , 143 ) +Divy.AddCoord( 2 , 912 , 236 ) + +Divz = Div.Port( 'z' ) +EndLoopz_Div = GraphStreams.Link( Divz , EndLoop.Port( 'z_Div' ) ) +EndLoopz_Div.AddCoord( 1 , 1147 , 537 ) +EndLoopz_Div.AddCoord( 2 , 1148 , 113 ) + +Divostream = Div.Port( 'ostream' ) +Add_1istream = GraphStreams.Link( Divostream , Add_1.Port( 'istream' ) ) +Add_1istream.AddCoord( 1 , 232 , 638 ) +Add_1istream.AddCoord( 2 , 232 , 763 ) +Add_1istream.AddCoord( 3 , 1126 , 763 ) +Add_1istream.AddCoord( 4 , 1125 , 144 ) + +Add_1z = Add_1.Port( 'z' ) +Sub_1y = GraphStreams.Link( Add_1z , Sub_1.Port( 'y' ) ) +Sub_1y.AddCoord( 1 , 445 , 478 ) +Sub_1y.AddCoord( 2 , 445 , 608 ) + +Mul_1y = GraphStreams.Link( Add_1z , Mul_1.Port( 'y' ) ) + +Add_1ostream = Add_1.Port( 'ostream' ) +Sub_1istream = GraphStreams.Link( Add_1ostream , Sub_1.Port( 'istream' ) ) +Sub_1istream.AddCoord( 1 , 473 , 508 ) +Sub_1istream.AddCoord( 2 , 474 , 638 ) + +Add_1Ostream = Add_1.Port( 'Ostream' ) +Sub_1Istream = GraphStreams.Link( Add_1Ostream , Sub_1.Port( 'Istream' ) ) +Sub_1Istream.AddCoord( 1 , 498 , 535 ) +Sub_1Istream.AddCoord( 2 , 498 , 667 ) + +Sub_1z = Sub_1.Port( 'z' ) +Mul_1x = GraphStreams.Link( Sub_1z , Mul_1.Port( 'x' ) ) +Mul_1x.AddCoord( 1 , 708 , 579 ) +Mul_1x.AddCoord( 2 , 707 , 450 ) + +Div_1x = GraphStreams.Link( Sub_1z , Div_1.Port( 'x' ) ) + +Mul_1z = Mul_1.Port( 'z' ) +Div_1y = GraphStreams.Link( Mul_1z , Div_1.Port( 'y' ) ) +Div_1y.AddCoord( 1 , 913 , 479 ) +Div_1y.AddCoord( 2 , 913 , 579 ) + +Div_1z = Div_1.Port( 'z' ) +EndLoopz_Div_1 = GraphStreams.Link( Div_1z , EndLoop.Port( 'z_Div_1' ) ) +EndLoopz_Div_1.AddCoord( 1 , 1138 , 567 ) +EndLoopz_Div_1.AddCoord( 2 , 1138 , 449 ) + +Div_1ostream = Div_1.Port( 'ostream' ) +Addistream = GraphStreams.Link( Div_1ostream , Add.Port( 'istream' ) ) +Addistream.AddCoord( 1 , 230 , 293 ) +Addistream.AddCoord( 2 , 229 , 426 ) +Addistream.AddCoord( 3 , 475 , 425 ) +Addistream.AddCoord( 4 , 475 , 352 ) +Addistream.AddCoord( 5 , 1110 , 352 ) +Addistream.AddCoord( 6 , 1111 , 477 ) + +LoopIndex = Loop.Port( 'Index' ) +EndLoopIndex = GraphStreams.Link( LoopIndex , EndLoop.Port( 'Index' ) ) + +Addx = GraphStreams.Link( LoopIndex , Add.Port( 'x' ) ) +Addx.AddCoord( 1 , 201 , 236 ) +Addx.AddCoord( 2 , 202 , 433 ) + +Add_1x = GraphStreams.Link( LoopIndex , Add_1.Port( 'x' ) ) +Add_1x.AddCoord( 1 , 199 , 578 ) +Add_1x.AddCoord( 2 , 200 , 435 ) + +LoopMin = Loop.Port( 'Min' ) +EndLoopMin = GraphStreams.Link( LoopMin , EndLoop.Port( 'Min' ) ) + +LoopMax = Loop.Port( 'Max' ) +EndLoopMax = GraphStreams.Link( LoopMax , EndLoop.Port( 'Max' ) ) + +LoopIncr = Loop.Port( 'Incr' ) +EndLoopIncr = GraphStreams.Link( LoopIncr , EndLoop.Port( 'Incr' ) ) + +Loopy_Add = Loop.Port( 'y_Add' ) +EndLoopy_Add = GraphStreams.Link( Loopy_Add , EndLoop.Port( 'y_Add' ) ) + +Addy = GraphStreams.Link( Loopy_Add , Add.Port( 'y' ) ) +Addy.AddCoord( 1 , 183 , 266 ) +Addy.AddCoord( 2 , 183 , 608 ) + +Add_1y = GraphStreams.Link( Loopy_Add , Add_1.Port( 'y' ) ) + +Loopx_Sub = Loop.Port( 'x_Sub' ) +EndLoopx_Sub = GraphStreams.Link( Loopx_Sub , EndLoop.Port( 'x_Sub' ) ) + +Subx = GraphStreams.Link( Loopx_Sub , Sub.Port( 'x' ) ) +Subx.AddCoord( 1 , 167 , 113 ) +Subx.AddCoord( 2 , 165 , 636 ) + +Sub_1x = GraphStreams.Link( Loopx_Sub , Sub_1.Port( 'x' ) ) +Sub_1x.AddCoord( 1 , 167 , 450 ) +Sub_1x.AddCoord( 2 , 165 , 637 ) + +# Creation of Input datas +LoopIndex = Loop.Input( 'Index' , 0) +LoopMin = Loop.Input( 'Min' , 1) +LoopMax = Loop.Input( 'Max' , 10) +LoopIncr = Loop.Input( 'Incr' , 1) +Loopz_Div = Loop.Input( 'z_Div' , 0) +Loopz_Div_1 = Loop.Input( 'z_Div_1' , 0) +Loopy_Add = Loop.Input( 'y_Add' , 4.5) +Loopx_Sub = Loop.Input( 'x_Sub' , 1.5) + +# Creation of Output variables +AddFuncValue = Add.Port( 'FuncValue' ) +Add_1FuncValue = Add_1.Port( 'FuncValue' ) +Loopz_Div = Loop.Port( 'z_Div' ) +Loopz_Div_1 = Loop.Port( 'z_Div_1' ) +EndLoopIndex = EndLoop.Port( 'Index' ) +EndLoopMin = EndLoop.Port( 'Min' ) +EndLoopMax = EndLoop.Port( 'Max' ) +EndLoopIncr = EndLoop.Port( 'Incr' ) +EndLoopz_Div = EndLoop.Port( 'z_Div' ) +EndLoopz_Div_1 = EndLoop.Port( 'z_Div_1' ) +EndLoopy_Add = EndLoop.Port( 'y_Add' ) +EndLoopx_Sub = EndLoop.Port( 'x_Sub' ) + +GraphStreams.Run() +GraphStreams.DoneW() +GraphStreams.PrintPorts() diff --git a/examples/GraphStreams.xml b/examples/GraphStreams.xml new file mode 100644 index 0000000..8ab2d9b --- /dev/null +++ b/examples/GraphStreams.xml @@ -0,0 +1,922 @@ + + + + +? + ? + GraphStreams + 1 + ? + +GraphStreams + + +long + Loop\Index + +long + Loop\Min + +long + Loop\Max + +long + Loop\Incr + +double + Loop\z_Div + +double + Loop\z_Div_1 + +double + Loop\y_Add + +double + Loop\x_Sub + + +double + Add\FuncValue + +double + Add_1\FuncValue + +double + Loop\z_Div + +double + Loop\z_Div_1 + +long + EndLoop\Index + +long + EndLoop\Min + +long + EndLoop\Max + +long + EndLoop\Incr + +double + EndLoop\z_Div + +double + EndLoop\z_Div_1 + +double + EndLoop\y_Add + +double + EndLoop\x_Sub + + + 15/3/2004 - 14:26:30 + 15/3/2004 - 14:28:51 + 1.05 + ? + ? + ? + 0 + 0 + + +AddComponent + AddComponent + Add + 0 + ? + +Add + + +double + x + +double + y + + +double + FuncValue + +double + z + + +long + istream + +long + ostream + +long + Ostream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + FactoryServer + Add from AddComponent + 256 + 156 + +SubComponent + SubComponent + Sub + 0 + ? + +Sub + + +double + x + +double + y + + +double + z + + +long + istream + +long + Istream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + FactoryServer + Sub from SubComponent + 519 + 33 + +MulComponent + MulComponent + Mul + 0 + ? + +Mul + + +double + x + +double + y + + +double + z + + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + FactoryServer + Mul from MulComponent + 723 + 156 + +DivComponent + DivComponent + Div + 0 + ? + +Div + + +double + x + +double + y + + +double + z + + +long + ostream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + FactoryServer + Div from DivComponent + 936 + 34 + +AddComponent + AddComponent + Add_1 + 0 + ? + +Add + + +double + x + +double + y + + +double + FuncValue + +double + z + + +long + istream + +long + ostream + +long + Ostream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + localhost/FactoryServer + Add from AddComponent + 252 + 499 + +SubComponent + SubComponent + Sub_1 + 0 + ? + +Sub + + +double + x + +double + y + + +double + z + + +long + istream + +long + Istream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + localhost/FactoryServer + Sub from SubComponent + 518 + 369 + +MulComponent + MulComponent + Mul_1 + 0 + ? + +Mul + + +double + x + +double + y + + +double + z + + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + localhost/FactoryServer + Mul from MulComponent + 731 + 498 + +DivComponent + DivComponent + Div_1 + 0 + ? + +Div + + +double + x + +double + y + + +double + z + + +long + ostream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + localhost/FactoryServer + Div from DivComponent + 931 + 369 + +? + ? + Loop + 4 + EndLoop + +Loop + + +long + Index + +long + Min + +long + Max + +long + Incr + +double + z_Div + +double + z_Div_1 + +double + y_Add + +double + x_Sub + + +long + Index + +long + Min + +long + Max + +long + Incr + +double + z_Div + +double + z_Div_1 + +double + y_Add + +double + x_Sub + + + +Init + + + + + + + + + +More + + + + + + + + + +Next + + + + + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + ? + ? + 5 + 399 + +? + ? + EndLoop + 5 + Loop + +EndLoop + + +long + Index + +long + Min + +long + Max + +long + Incr + +double + z_Div + +double + z_Div_1 + +double + y_Add + +double + x_Sub + + +long + Index + +long + Min + +long + Max + +long + Incr + +double + z_Div + +double + z_Div_1 + +double + y_Add + +double + x_Sub + + + +EndInit + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + ? + ? + 1157 + 388 + + +Add + z + Sub + y + + +448 + 143 + +447 + 266 + +Add + z + Mul + y + + +Add + ostream + Sub + istream + + +474 + 172 + +474 + 294 + +Add + Ostream + Sub + Istream + + +499 + 201 + +500 + 322 + +Sub + z + Mul + x + + +707 + 237 + +706 + 114 + +Sub + z + Div + x + + +Mul + z + Div + y + + +912 + 143 + +912 + 236 + +Div + z + EndLoop + z_Div + + +1147 + 537 + +1148 + 113 + +Div + ostream + Add_1 + istream + + +232 + 638 + +232 + 763 + +1126 + 763 + +1125 + 144 + +Add_1 + z + Sub_1 + y + + +445 + 478 + +445 + 608 + +Add_1 + z + Mul_1 + y + + +Add_1 + ostream + Sub_1 + istream + + +473 + 508 + +474 + 638 + +Add_1 + Ostream + Sub_1 + Istream + + +498 + 535 + +498 + 667 + +Sub_1 + z + Mul_1 + x + + +708 + 579 + +707 + 450 + +Sub_1 + z + Div_1 + x + + +Mul_1 + z + Div_1 + y + + +913 + 479 + +913 + 579 + +Div_1 + z + EndLoop + z_Div_1 + + +1138 + 567 + +1138 + 449 + +Div_1 + ostream + Add + istream + + +230 + 293 + +229 + 426 + +475 + 425 + +475 + 352 + +1110 + 352 + +1111 + 477 + +Loop + DoLoop + EndLoop + DoLoop + + +Loop + Index + EndLoop + Index + + +Loop + Index + Add + x + + +201 + 236 + +202 + 433 + +Loop + Index + Add_1 + x + + +199 + 578 + +200 + 435 + +Loop + Min + EndLoop + Min + + +Loop + Max + EndLoop + Max + + +Loop + Incr + EndLoop + Incr + + +Loop + y_Add + EndLoop + y_Add + + +Loop + y_Add + Add + y + + +183 + 266 + +183 + 608 + +Loop + y_Add + Add_1 + y + + +Loop + x_Sub + EndLoop + x_Sub + + +Loop + x_Sub + Sub + x + + +167 + 113 + +165 + 636 + +Loop + x_Sub + Sub_1 + x + + +167 + 450 + +165 + 637 + +EndLoop + DoLoop + Loop + InitLoop + + + +GraphStreams + Loop\Index + Loop + Index + +3 + 0 + + +GraphStreams + Loop\Min + Loop + Min + +3 + 1 + + +GraphStreams + Loop\Max + Loop + Max + +3 + 10 + + +GraphStreams + Loop\Incr + Loop + Incr + +3 + 1 + + +GraphStreams + Loop\z_Div + Loop + z_Div + +7 + 0 + + +GraphStreams + Loop\z_Div_1 + Loop + z_Div_1 + +7 + 0 + + +GraphStreams + Loop\y_Add + Loop + y_Add + +7 + 4.5 + + +GraphStreams + Loop\x_Sub + Loop + x_Sub + +7 + 1.5 + diff --git a/examples/test_events.py b/examples/test_events.py new file mode 100644 index 0000000..fe394f4 --- /dev/null +++ b/examples/test_events.py @@ -0,0 +1,66 @@ + +# Generated python file of Graph aNewDataFlow + +from SuperV import * +# Graph creation +aNewDataFlow = Graph( 'aNewDataFlow' ) +aNewDataFlow.SetName( 'aNewDataFlow' ) +aNewDataFlow.SetAuthor( '' ) +aNewDataFlow.SetComment( '' ) +aNewDataFlow.Coords( 0 , 0 ) + +# Creation of Factory Nodes + +# Creation of InLine Nodes +PyFunc = [] +PyFunc.append( 'def Func( A ): ' ) +PyFunc.append( ' import batchmode_visu ' ) +PyFunc.append( ' batchmode_visu.myVisu.CreateTestView() ' ) +PyFunc.append( ' batchmode_visu.myVisu.ShowTestObject() ' ) +PyFunc.append( ' return A ' ) +Func = aNewDataFlow.INode( 'Func' , PyFunc ) +Func.SetName( 'Func' ) +Func.SetAuthor( '' ) +Func.SetComment( 'Compute Node' ) +Func.Coords( 375 , 162 ) +Func.InPort( 'A' , 'int' ) +Func.OutPort( 'B' , 'int' ) + +# Creation of Loop Nodes +PyInit = [] +PyInit.append( 'def Init( A ): ' ) +PyInit.append( ' return A ' ) +PyMoreInit = [] +PyMoreInit.append( 'def More( A ): ' ) +PyMoreInit.append( ' if A < 10: ' ) +PyMoreInit.append( ' return 1,A ' ) +PyMoreInit.append( ' return 0,A ' ) +PyNextInit = [] +PyNextInit.append( 'def Next( A ): ' ) +PyNextInit.append( ' return (A + 1) ' ) +Init,EndInit = aNewDataFlow.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) +EndInit.SetName( 'EndInit' ) +EndInit.SetAuthor( '' ) +EndInit.SetComment( '' ) +EndInit.Coords( 740 , 168 ) +PyEndInit = [] +EndInit.SetPyFunction( 'EndInit' , PyEndInit ) +Init.SetName( 'Init' ) +Init.SetAuthor( '' ) +Init.SetComment( '' ) +Init.Coords( 118 , 160 ) +Init.InPort( 'A' , 'int' ) +Init.OutPort( 'A' , 'int' ) + +# Creation of Links +InitA = Init.Port( 'A' ) +FuncA = aNewDataFlow.Link( InitA , Func.Port( 'A' ) ) + +FuncB = Func.Port( 'B' ) +EndInitA = aNewDataFlow.Link( FuncB , EndInit.Port( 'A' ) ) + +# Creation of Input datas +InitA = Init.Input( 'A' , 0) + +# Creation of Output variables +EndInitA = EndInit.Port( 'A' ) diff --git a/examples/test_events.xml b/examples/test_events.xml new file mode 100644 index 0000000..97a7ce8 --- /dev/null +++ b/examples/test_events.xml @@ -0,0 +1,167 @@ + + + + +? + ? + aNewDataFlow + 1 + ? + +aNewDataFlow + + +int + Init\A + + +int + EndInit\A + + + 2/4/2004 - 16:38:31 + 2/4/2004 - 18:30:31 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + Init + 4 + EndInit + +Init + + +int + A + + +int + A + + + +Init + + + +More + + + + + +Next + + + 2/4/2004 - 18:30:31 + 2/4/2004 - 18:30:31 + 1.05 + ? + ? + ? + 118 + 160 + +? + ? + EndInit + 5 + Init + +EndInit + + +int + A + + +int + A + + + +EndInit + + 2/4/2004 - 18:30:31 + 2/4/2004 - 18:30:31 + 1.05 + ? + ? + ? + 740 + 168 + +? + ? + Func + 3 + ? + +Func + + +int + A + + +int + B + + + +Func + + + + + + 2/4/2004 - 18:30:31 + 2/4/2004 - 18:30:31 + 1.05 + ? + ? + Compute Node + 375 + 162 + + +Init + DoLoop + EndInit + DoLoop + + +Init + A + Func + A + + +EndInit + DoLoop + Init + InitLoop + + +Func + B + EndInit + A + + + +aNewDataFlow + Init\A + Init + A + +3 + 0 + diff --git a/examples/testvisu20.xml b/examples/testvisu20.xml new file mode 100644 index 0000000..7d8e60e --- /dev/null +++ b/examples/testvisu20.xml @@ -0,0 +1,490 @@ + + + + +? + ? + aNewDataFlow + 1 + ? + +aNewDataFlow + + +long + Init\index + +long + Init\min + +long + Init\max + +double + Init\x1 + + +long + EndOfInit\index + +long + EndOfInit\min + +long + EndOfInit\max + +objref + EndOfInit\aVisu + +objref + EndOfInit\aView + +objref + EndOfInit\aResult + +double + EndOfInit\x1 + + + 13/11/2003 - 11:15:53 + 19/1/2004 - 15:33:34 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + InitDisplay + 3 + ? + +InitDisplay + + + +objref + aVisu + +objref + aView + +objref + myResult + + + +InitDisplay + + + + + + + + + + + + + + + + + + + + + aVisu ", aVisu ]]> + + + aViewManager ", aViewManager ]]> + + + + aView ", aView ]]> + + + + + myResult ", myResult ]]> + + + 19/1/2004 - 15:33:34 + 19/1/2004 - 15:33:34 + 1.05 + ? + ? + Compute Node + 0 + 46 + +? + ? + Init + 4 + EndOfInit + +Init + + +long + index + +long + min + +long + max + +objref + aVisu + +objref + aView + +objref + aResult + +double + x1 + + +long + index + +long + min + +long + max + +objref + aVisu + +objref + aView + +objref + aResult + +double + x1 + + + +Init + + = min : ]]> + + + + + + +More + + = index : ]]> + + + + + + +Next + + + + + + 19/1/2004 - 15:33:34 + 19/1/2004 - 15:33:34 + 1.05 + ? + ? + ? + 190 + 4 + +? + ? + EndOfInit + 5 + Init + +EndOfInit + + +long + index + +long + min + +long + max + +objref + aVisu + +objref + aView + +objref + aResult + +double + x1 + + +long + index + +long + min + +long + max + +objref + aVisu + +objref + aView + +objref + aResult + +double + x1 + + + + 19/1/2004 - 15:33:34 + 19/1/2004 - 15:33:34 + 1.05 + ? + ? + ? + 553 + 5 + +? + ? + DisplayVitesse + 3 + ? + +DisplayVitesse + + +string + index + +objref + aVisu + +objref + aView + +objref + aResult + +double + x1 + + +objref + theResult + + + +DisplayVitesse + + + + + + + + + + + + + + + + + + + + + + + + + + 19/1/2004 - 15:33:34 + 19/1/2004 - 15:33:34 + 1.05 + ? + ? + Compute Node + 374 + 16 + + +InitDisplay + aVisu + Init + aVisu + + +InitDisplay + aView + Init + aView + + +InitDisplay + myResult + Init + aResult + + +Init + DoLoop + EndOfInit + DoLoop + + +Init + index + EndOfInit + index + + +Init + index + DisplayVitesse + index + + +351 + 96 + +350 + 38 + +Init + min + EndOfInit + min + + +Init + max + EndOfInit + max + + +Init + aVisu + EndOfInit + aVisu + + +Init + aVisu + DisplayVitesse + aVisu + + +Init + aView + EndOfInit + aView + + +Init + aView + DisplayVitesse + aView + + +Init + aResult + DisplayVitesse + aResult + + +Init + x1 + EndOfInit + x1 + + +Init + x1 + DisplayVitesse + x1 + + +EndOfInit + DoLoop + Init + InitLoop + + +DisplayVitesse + theResult + EndOfInit + aResult + + +548 + 183 + +548 + 97 + + +aNewDataFlow + Init\index + Init + index + +3 + 1 + + +aNewDataFlow + Init\min + Init + min + +3 + 1 + + +aNewDataFlow + Init\max + Init + max + +3 + 100 + + +aNewDataFlow + Init\x1 + Init + x1 + +7 + 1 + diff --git a/src/SUPERVGUI/SUPERVGUI.cxx b/src/SUPERVGUI/SUPERVGUI.cxx index 394710b..e0893ba 100644 --- a/src/SUPERVGUI/SUPERVGUI.cxx +++ b/src/SUPERVGUI/SUPERVGUI.cxx @@ -49,13 +49,14 @@ using namespace std; int SUPERVGUI::factory = 0; -SUPERVGUI Supervision; +SUPERVGUI Supervision(""); -SUPERVGUI::SUPERVGUI(): QObject(), - desktop(0), - study(0), - browser(0) +SUPERVGUI::SUPERVGUI(const QString& theName, QObject* theParent) + : SALOMEGUI( theName, theParent ), + desktop(0), + study(0), + browser(0) //info(0) { Trace("SUPERVGUI::SUPERVGUI") @@ -445,8 +446,10 @@ void SUPERVGUI::showComponents() { } } -void SUPERVGUI::customPopup(QPopupMenu* popup) { + +bool SUPERVGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext, const QString& theParent, const QString& theObject) { Trace("SUPERVGUI::customPopup"); + Supervision.init(parent); if(popup->count() > 3) { // Temporary code: is to be deleted soon popup->removeItem(QAD_Display_Popup_ID); @@ -457,7 +460,7 @@ void SUPERVGUI::customPopup(QPopupMenu* popup) { // Temporary code end } SALOME_Selection* Sel = SALOME_Selection::Selection(study->getSelection() ); - if ((Sel==NULL) || (Sel->IObjectCount() == 0)) return; + if ((Sel==NULL) || (Sel->IObjectCount() == 0)) return false; if (Sel->IObjectCount() == 1) { Handle(SALOME_InteractiveObject) anIObj = Sel->firstIObject(); @@ -488,6 +491,7 @@ void SUPERVGUI::customPopup(QPopupMenu* popup) { if (aIObjCount == Sel->IObjectCount()) //all selected objects belong to Supervision popup->insertItem(tr("MSG_DELETE"), this, SLOT(deleteObject())); } + return(true); } @@ -577,105 +581,81 @@ void SUPERVGUI::deleteObject() { Sel->ClearIObjects() ; } - - -void SUPERVGUI::activeStudyChanged() { - Trace("SUPERVGUI::activeStudyChanged"); - study = desktop->getActiveStudy(); -} - -extern "C" bool OnGUIEvent(int command, QAD_Desktop* parent) { - Supervision.init(parent); - switch (command) { - case 301: - Supervision.importDataflow(); - return(false); - - case 302: - Supervision.exportDataflow(); - return(false); - - case 303: - Supervision.newDataflow(); - return(false); - - case 304: - Supervision.modifyDataflow(); - return(false); - - case 305: - Supervision.reloadDataflow(); - return(false); - - case 306: - Supervision.runDataflow(); - return(false); - - case 307: - Supervision.killDataflow(); - return(false); - - case 308: - Supervision.suspendResumeDataflow(); - return(false); - - case 309: - Supervision.showComponents(); - return(false); - - case 310: - Supervision.stepByStep(); - return(false); - - default: - QMessageBox::warning(QAD_Application::getDesktop(), "Supervision Error", "Unknown Command From Salome"); - return(false); - - } -} - -extern "C" bool OnKeyPress(QKeyEvent* e, QAD_Desktop* parent, SUPERVGUI_Main* s) { +bool SUPERVGUI::OnGUIEvent(int command, QAD_Desktop* parent) { + Supervision.init(parent); + switch (command) { + case 301: + Supervision.importDataflow(); return(false); -} - -extern "C" bool OnMousePress(QMouseEvent* e, QAD_Desktop* parent, SUPERVGUI_Main* s) { + + case 302: + Supervision.exportDataflow(); return(false); -} - -extern "C" bool OnMouseMove(QMouseEvent* e, QAD_Desktop* parent, SUPERVGUI_Main* s) { + + case 303: + Supervision.newDataflow(); return(false); -} - -extern "C" bool OnPopupGUIEvent(int theCommandID, QAD_Desktop* parent) { + + case 304: + Supervision.modifyDataflow(); return(false); + + case 305: + Supervision.reloadDataflow(); + return(false); + + case 306: + Supervision.runDataflow(); + return(false); + + case 307: + Supervision.killDataflow(); + return(false); + + case 308: + Supervision.suspendResumeDataflow(); + return(false); + + case 309: + Supervision.showComponents(); + return(false); + + case 310: + Supervision.stepByStep(); + return(false); + + default: + QMessageBox::warning(QAD_Application::getDesktop(), "Supervision Error", "Unknown Command From Salome"); + return(false); + } } -extern "C" bool SetSettings(QAD_Desktop* parent) { - Trace("extern SUPERVGUI::SetSettings") - Supervision.init(parent); - return(true); -} - -extern "C" void definePopup(QString& theContext, QString& theParent, QString& theObject) { - theObject = ""; - theContext = ""; +bool SUPERVGUI::SetSettings(QAD_Desktop* parent) { + Trace("SUPERVGUI::SetSettings"); + Supervision.init(parent); + return(true); } -extern "C" bool customPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext, const QString& theParent, const QString& theObject) { - Supervision.init(parent); - Supervision.customPopup(popup); - return(true); +void SUPERVGUI::DefinePopup(QString& theContext, QString& theParent, QString& theObject) { + theObject = ""; + theContext = ""; } -extern "C" void activeStudyChanged(QAD_Desktop* parent) { - Supervision.activeStudyChanged(); +bool SUPERVGUI::ActiveStudyChanged(QAD_Desktop* parent) { + Trace("SUPERVGUI::activeStudyChanged"); + study = desktop->getActiveStudy(); + return true; } -extern "C" int supportedViewType() +void SUPERVGUI::SupportedViewType (int* buffer, int bufferSize) { - return (int)VIEW_GRAPHSUPERV; + if (!buffer || !bufferSize) return; + buffer[0] = (int)VIEW_GRAPHSUPERV; } -extern "C" void buildPresentation ( const Handle(SALOME_InteractiveObject)& theIO ) +extern "C" { + Standard_EXPORT SALOMEGUI* GetComponentGUI() { + return &Supervision; + } } diff --git a/src/SUPERVGUI/SUPERVGUI.h b/src/SUPERVGUI/SUPERVGUI.h index 3bf4606..977e719 100644 --- a/src/SUPERVGUI/SUPERVGUI.h +++ b/src/SUPERVGUI/SUPERVGUI.h @@ -28,7 +28,7 @@ #ifndef SUPERVGUI_H #define SUPERVGUI_H -// Acces a l'ihm de SALOME +// Acces a l`ihm de SALOME // ----------------------- #include "QAD_Desktop.h" @@ -39,15 +39,16 @@ #include "SUPERVGUI_Main.h" //#include "SUPERVGUI_Information.h" +#include "SALOMEGUI.h" // Definition de la classe principale du module de supervision // ----------------------------------------------------------- -class SUPERVGUI: public QObject { +class SUPERVGUI: public SALOMEGUI { Q_OBJECT public: - SUPERVGUI(); + SUPERVGUI( const QString&, QObject* = 0 ); virtual ~SUPERVGUI(); QAD_Desktop* getDesktop(); @@ -73,8 +74,19 @@ class SUPERVGUI: public QObject { void init(QAD_Desktop* parent); SUPERVGUI_Main* getMain(); - void customPopup(QPopupMenu* popup); - void activeStudyChanged(); + + bool OnGUIEvent(int theCommandID, QAD_Desktop* parent); + bool SetSettings(QAD_Desktop* parent); + void DefinePopup(QString & theContext, + QString & theParent, + QString & theObject ) ; + bool CustomPopup(QAD_Desktop* parent, + QPopupMenu* popup, + const QString & theContext, + const QString & theParent, + const QString & theObject); + bool ActiveStudyChanged( QAD_Desktop* parent ); + void SupportedViewType (int* buffer, int bufferSize); bool isContains(QAD_Study* theStudy, const QString theKey);