1 # Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 # File : test_big_table.py
20 # Author : Vadim SANDLER
28 # >>> Getting study builder ==================================================
29 myStudy = salome.myStudy
30 myBuilder = myStudy.NewBuilder()
32 # >>> Creating virtual component =============================================
33 myComponent = myStudy.FindComponent("VirtualComponent")
35 myComponent = myBuilder.NewComponent("VirtualComponent")
36 aName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName")
37 aName.SetValue("VirtualComponent")
39 # >>> Creating object with Table of real[ 200 * 20 ] ========================
40 myTRealObject = myBuilder.NewObject(myComponent)
41 AName = myBuilder.FindOrCreateAttribute(myTRealObject, "AttributeName")
42 AName.SetValue("Table Of Real")
43 ARealTable = myBuilder.FindOrCreateAttribute(myTRealObject, "AttributeTableOfReal")
48 for j in range(0,myHorNb):
50 ARealTable.AddRow(k.values())
51 ARealTable.SetRowTitle(1, "Frequency")
52 ARealTable.SetRowUnit(1, "Hz")
54 for i in range(1,myVerNb+1):
55 for j in range(0,myHorNb):
57 k[j] = math.log10(j*30*math.pi/180) * 20 + i * 15 + j*5
59 k[j] = math.sin(j*30*math.pi/180) * 20 + i * 15 + j*5
60 ARealTable.AddRow(k.values())
61 ARealTable.SetRowTitle(i+1, "Power " + str(i))
62 ARealTable.SetRowUnit(i+1, "Wt")
63 ARealTable.SetTitle("Very useful data")
65 # >>> Updating Object Browser ================================================
66 salome.sg.updateObjBrowser(1)
68 # ============================================================================