コード例 #1
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkCamera', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Display mesh informations.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=0)
    Frame.columnconfigure(1, weight=3)
    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkCamera')
    WIDGETS['frameMenu'] = FrameMenu

    #- VARS -
    # -0- posCam -
    V = TK.StringVar(win); V.set('(0., 0., 0.)'); VARS.append(V)
    # -1- posEye -
    V = TK.StringVar(win); V.set('(0., 0.; 0.)'); VARS.append(V)
    # -2- dirCam -
    V = TK.StringVar(win); V.set('(0., 0., 0.)'); VARS.append(V)
    
    # - posCam -
    B = TTK.Label(Frame, text="posCam: ")
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=15)
    B.grid(row=0, column=1, columnspan=1, sticky=TK.EW)
    B.bind('<Return>', setInfo)
    BB = CTK.infoBulle(parent=B, text='Camera position.')

    # - posEye -
    B = TTK.Label(Frame, text="posEye: ")
    B.grid(row=1, column=0, columnspan=1, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=15)
    B.grid(row=1, column=1, columnspan=1, sticky=TK.EW)
    B.bind('<Return>', setInfo)
    BB = CTK.infoBulle(parent=B, text='Eye position.')

    # - dirCam -
    B = TTK.Label(Frame, text="dirCam: ")
    B.grid(row=2, column=0, columnspan=1, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[2], background='White', width=15)
    B.grid(row=2, column=1, columnspan=1, sticky=TK.EW)
    B.bind('<Return>', setInfo)
    BB = CTK.infoBulle(parent=B, text='Camera direction.')
    
    # - get -
    B = TTK.Button(Frame, text="Get", command=getInfo)
    B.grid(row=3, column=1, columnspan=1, sticky=TK.EW)
    
    # - set -
    B = TTK.Button(Frame, text="Set", command=setInfo)
    B.grid(row=3, column=0, columnspan=1, sticky=TK.EW)
コード例 #2
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkBasicSurfs',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Create basic surfaces.\nCtrl+c to close applet.', btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(0, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkBasicSurfs')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- NPts -
    V = TK.StringVar(win)
    V.set('10')
    VARS.append(V)
    if 'tkBasicSurfsNpts' in CTK.PREFS:
        V.set(CTK.PREFS['tkBasicSurfsNpts'])
    # -1- Type d'elements
    V = TK.StringVar(win)
    V.set('TRI')
    VARS.append(V)
    if 'tkBasicSurfsElts' in CTK.PREFS:
        V.set(CTK.PREFS['tkBasicSurfsElts'])
    # -2- Type de surface
    V = TK.StringVar(win)
    V.set('Sphere')
    VARS.append(V)
    if 'tkBasicSurfsType' in CTK.PREFS:
        V.set(CTK.PREFS['tkBasicSurfsType'])

    # - Npts -
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White')
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of generated points.')
    B.bind('<Return>', generate)

    # - Type d'elements: TRI ou STRUCT -
    B = TTK.OptionMenu(Frame, VARS[1], 'TRI', 'QUAD', 'STRUCT')
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Surface element type.')

    # - Type de surface -
    SURFTYPES = [
        'Sphere', 'Cube', 'Tetra', 'Pyramid', 'Cylinder', 'Plane', 'Cone'
    ]
    SURFTYPES += base.keys()
    if ttk is None:
        B = TK.OptionMenu(Frame, VARS[2], *SURFTYPES)
    else:
        B = ttk.Combobox(Frame,
                         textvariable=VARS[2],
                         values=SURFTYPES,
                         state='readonly',
                         width=10)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Type of generated surface.')
    B = TTK.Button(Frame, text="Generate", command=generate)
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Generate surface.')
コード例 #3
0
def createApp(win):

    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkFamily', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Create famlies of\nblocks or BCs.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=4)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkFamily')
    WIDGETS['frameMenu'] = FrameMenu
    
    # - VARS -
    # -0- Nom de la FamilyZone (new) -
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -1- Nom de la FamilyBC (new) -
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -2- Nom de la famille zone pour le tag
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    
    # - Create zone family name -
    B = TTK.Button(Frame, text="NewZoneFamily", command=createZoneFamily)
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Create a new zone family tag.')
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=15)
    BB = CTK.infoBulle(parent=B, text='Zone family name.')
    B.grid(row=0, column=1, sticky=TK.EW)
    B.bind('<Return>', createZoneFamily)

    # - Tag with zone family -
    B = TTK.Button(Frame, text="Tag zone", command=tagWithZoneFamily)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Tag a zone with a zone family.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[2], '')
        B.grid(sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Family zone name.')
        F.bind('<Enter>', updateFamilyZoneNameList)
        F.grid(row=1, column=1, sticky=TK.EW)
        WIDGETS['zones'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[2], 
                         values=[], state='readonly')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateFamilyZoneNameList2)
        F.grid(row=1, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Family zone name.')
        WIDGETS['zones'] = B

    # - Create BC family -
    B = TTK.Button(Frame, text="NewBCFamily", command=createBCFamily)
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Create a new BC family tag.')
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=15)
    BB = CTK.infoBulle(parent=B, text='BC family name.')
    B.grid(row=2, column=1, sticky=TK.EW)
    B.bind('<Return>', createBCFamily)
コード例 #4
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkMeshInfo', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Display mesh informations.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=2)
    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkMeshInfo')
    WIDGETS['frameMenu'] = FrameMenu

    #- VARS -
    # -0- Npts -
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -1- Var min -
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -2- Var max -
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -3- Selected block name
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -4- Selected block type
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -5- Selected variable
    V = TK.StringVar(win); V.set('CoordinateX'); VARS.append(V)
    # -6- NCells -
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -7- NFaces -
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    

    # - selected block name -
    B = TTK.Entry(Frame, textvariable=VARS[3], background='White', width=15)
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Currently selected zone name.')

    # - selected block type -
    B = TTK.Entry(Frame, textvariable=VARS[4], background='White')
    B.grid(row=0, column=1, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Currently selected zone type.')
    
    # - Npts -
    B = TTK.Label(Frame, text="Npts")
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of points in selection.')
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White',
                  width=10)
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of points in selection.')

    # - Ncells -
    B = TTK.Label(Frame, text="NCells")
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of cells in selection.')
    B = TTK.Entry(Frame, textvariable=VARS[6], background='White',
                  width=10)
    B.grid(row=2, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of cells in selection.')

    # - NFaces -
    B = TTK.Label(Frame, text="NFaces")
    B.grid(row=3, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of faces in selection.')
    B = TTK.Entry(Frame, textvariable=VARS[7], background='White',
                  width=10)
    B.grid(row=3, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of faces in selection.')

    # - Variable -
    B = TTK.Label(Frame, text="Variable: ")
    B.grid(row=4, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Selected var name.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[5], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList)
        F.grid(row=4, column=1, columnspan=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Selected var name.')
        WIDGETS['variable'] = B
    else: 
        B = ttk.Combobox(F, textvariable=VARS[5], 
                         values=[], state='readonly')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2)
        F.grid(row=4, column=1, columnspan=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Selected var name.')
        WIDGETS['variable'] = B
    
    # - Min de la variable - 
    B = TTK.Label(Frame, text="Min:")
    B.grid(row=5, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Min of variable.')
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White',
                  width=10)
    B.grid(row=5, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Min of variable.')
    
    # - Max de la variable -    
    B = TTK.Label(Frame, text="Max:")
    B.grid(row=6, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Max of variable.')
    B = TTK.Entry(Frame, textvariable=VARS[2], background='White',
                  width=10)
    B.grid(row=6, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Max of variable.')
    
    # - update -
    B = TTK.Button(Frame, text="Update info", command=updateInfo)
    B.grid(row=7, column=0, columnspan=2, sticky=TK.EW)
コード例 #5
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkBC',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Manage boundary conditions.\nCtrl+c to close applet.', btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=4)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkBC')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # - 0 - Type de BC -
    V = TK.StringVar(win)
    V.set('Mesh')
    VARS.append(V)
    # - 1 - Type de cas (2D/3D) -
    V = TK.StringVar(win)
    V.set('3D')
    VARS.append(V)
    # - 2 - tol pour ConnectMatch -
    V = TK.StringVar(win)
    V.set('1.e-6')
    VARS.append(V)
    if 'tkBCMatchTol' in CTK.PREFS: V.set(CTK.PREFS['tkBCMatchTol'])
    # - 3 - ratio pour ConnectNearMatch -
    V = TK.StringVar(win)
    V.set('2')
    VARS.append(V)
    # - 4 - Type de BC pour fillEmptyBCWith -
    V = TK.StringVar(win)
    V.set('BCWall')
    VARS.append(V)
    # - 5 - Type de BC pour rmBCOfType -
    V = TK.StringVar(win)
    V.set('-All BC-')
    VARS.append(V)
    # - 6 - Type de BC pour setBCWith -
    V = TK.StringVar(win)
    V.set('BCWall')
    VARS.append(V)
    # - 7 - Edges des zones du calcul
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    if 'tkBCEdges' in CTK.PREFS: V.set(CTK.PREFS['tkBCEdges'])
    # -8- SplitFactor info bulle
    V = TK.StringVar(win)
    V.set(
        'Split more or less undefined BCs. \nUsefull only for unstructured grids.'
    )
    VARS.append(V)
    # -9- Periodicity? in connectMatch
    V = TK.StringVar(win)
    V.set('Not periodic')
    VARS.append(V)
    # -10- Periodicity field (0;0;0...)
    V = TK.StringVar(win)
    V.set('0;0;0;0;0;0')
    VARS.append(V)
    if 'tkBCMatchPer' in CTK.PREFS: V.set(CTK.PREFS['tkBCMatchPer'])

    # - View mesh -
    B = TTK.Button(Frame, text="View Mesh", command=viewMesh)
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='View mesh.\nTree is NOT modified.')

    # - Edges -
    B = TTK.Checkbutton(Frame, text='Edges', variable=VARS[7])
    BB = CTK.infoBulle(parent=B, text='Show edges of zones of the tree.')
    B.grid(row=0, column=1, sticky=TK.EW)

    # - View type de BC -
    B = TTK.Button(Frame, text="View BC", command=view)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='View specified BC.\nTree is NOT modified.')

    # - Type of BC - ListBox Frame -
    LBFrame = TTK.Frame(Frame)
    LBFrame.grid(row=1, column=1, rowspan=4, sticky=TK.EW)
    LBFrame.rowconfigure(0, weight=1)
    LBFrame.columnconfigure(0, weight=1)
    LBFrame.columnconfigure(1, weight=0)
    SB = TTK.Scrollbar(LBFrame)
    LB = TTK.Listbox(LBFrame, selectmode=TK.EXTENDED, height=6)
    LB.bind('<Double-1>', view)
    LB.bind('<Enter>', updateBCNameList)
    # LB.bind('<ButtonRelease-1>', view)
    for i, value in enumerate(['-All BC-'] + getAllDefinedBC(CTK.t)):
        LB.insert(i, value)
    SB.config(command=LB.yview)
    LB.config(yscrollcommand=SB.set)
    LB.grid(row=0, column=0, sticky=TK.NSEW)
    SB.grid(row=0, column=1, sticky=TK.NSEW)
    LBFrame.bind('<Enter>', updateFamilyBCNameList1_2)
    WIDGETS['BCLB'] = LB

    # - View undefined BCs -
    B = TTK.Button(Frame,
                   text="View undefined BC",
                   command=displayUndefinedBoundaries)
    B.grid(row=2, column=0, columnspan=1, sticky=TK.EW)
    WIDGETS['undefinedBC'] = B
    BB = CTK.infoBulle(
        parent=B,
        text='View undefined BC in ALL tree.\nUse this to setBC or fillEmptyBC.'
    )

    # - Slider for splitFactor -
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  command=setSplitFactor,
                  showvalue=0,
                  borderwidth=1,
                  value=0)
    WIDGETS['splitFactor'] = B
    B.grid(row=3, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, textVariable=VARS[8])

    # - rmBCOfType -
    B = TTK.Button(Frame, text="rm BC", command=rmBCOfType)
    B.grid(row=4, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Remove the BCs of given type from tree.')

    # - setBCWith -
    B = TTK.Button(Frame, text="setBCWith", command=setBCWith)
    B.grid(row=5, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B, text='Set the BC with specified type.\nAdded to pyTree.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.OptionMenu(F, VARS[6], *(Internal.KNOWNBCS))
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateFamilyBCNameList3)
        F.grid(row=6, column=1, sticky=TK.EW)
        WIDGETS['BCs2'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[6],
                         values=Internal.KNOWNBCS,
                         state='readonly',
                         width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateFamilyBCNameList3_2)
        F.grid(row=5, column=1, sticky=TK.EW)
        WIDGETS['BCs2'] = B

    # - FillEmptyBCWith -
    B = TTK.Button(Frame, text="FillEmptyBCWith", command=fillEmptyBCWith)
    B.grid(row=6, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B, text='Fill empty BCs with given type.\nAdded to pyTree.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.OptionMenu(F, VARS[4], *(Internal.KNOWNBCS))
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateFamilyBCNameList4)
        F.grid(row=6, column=1, sticky=TK.EW)
        WIDGETS['BCs4'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[4],
                         values=Internal.KNOWNBCS,
                         state='readonly',
                         width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateFamilyBCNameList4_2)
        F.grid(row=6, column=1, sticky=TK.EW)
        WIDGETS['BCs4'] = B

    # - setDegeneratedBC -
    B = TTK.Button(Frame, text="SetDegeneratedBC", command=setDegeneratedBC)
    B.grid(row=7, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Find the degenerated BCs\nAdded to pyTree.')

    # - ConnectMatch -
    B = TTK.Button(Frame, text="ConnectMatch", command=connectMatch)
    B.grid(row=8, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Find the matching BCs\nAdded to pyTree.')
    B = TTK.Entry(Frame, textvariable=VARS[2], background='White')
    B.grid(row=8, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Tolerance for matching.')

    # - Periodicity management -
    B = TTK.OptionMenu(Frame, VARS[9], 'Not periodic', 'Translation',
                       'Rotation (Degree)')
    B.grid(row=9, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[10], background='White')
    B.grid(row=9, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text=
        'Periodic translation: tx;ty;tz\nPeriodic rotation: cx;cy;cz;ax;ay;az\nangles in degrees.'
    )

    # - ConnectNearMatch -
    B = TTK.Button(Frame, text="ConnectNearMatch", command=connectNearMatch)
    B.grid(row=10, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Find the matching BCs\nAdded to pyTree.')
    B = TTK.Entry(Frame, textvariable=VARS[3], background='White')
    B.grid(row=10, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Nearmatch ratio (2 or 2;1;2).')
コード例 #6
0
def createApp(win):

    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkPerfo', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Improve performance of Cassiopee.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=4)
    Frame.columnconfigure(2, weight=1)

    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkPerfo')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Displayed field -
    V = TK.StringVar(win); V.set('All fields'); VARS.append(V)
    # -1- Oneovern -
    V = TK.StringVar(win); V.set('All points'); VARS.append(V)
    if 'tkPerfoPoints' in CTK.PREFS: V.set(CTK.PREFS['tkPerfoPoints'])
    # -2- Threads
    V = TK.StringVar(win); V.set('1'); VARS.append(V)
    
    # - Field transmission -
    B = TTK.Label(Frame, text="Display")
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Describe what part of the tree is displayed.\nCan fasten the display. In memory tree is not modified.')

    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    
    if ttk is None:
        B = TK.OptionMenu(F, VARS[0], 'All fields', 'No field')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList)
        F.grid(row=0, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Display only certain fields.')
        WIDGETS['fields'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[0], 
                         values=['All fields', 'No field'], 
                         state='readonly', width=10)
        B.grid(sticky=TK.EW)
        B.bind('<<ComboboxSelected>>', setViewMode2)
        F.bind('<Enter>', updateVarNameList2)
        F.grid(row=0, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Display only certain fields.')
        WIDGETS['fields'] = B

    # - Point transmission -
    B = TTK.OptionMenu(Frame, VARS[1], 'All points', 'One over 2', 'One over 3',
                       'One over 4', 'Exclusive', command=oneovern)
    B.grid(row=0, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Display less points.')

    # - OMP threads -
    B = TTK.Label(Frame, text="Threads")
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='The number of CPU cores used by Cassiopee.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.grid(row=1, column=1, columnspan=1, sticky=TK.EW)
    B = TTK.Entry(F, textvariable=VARS[2], background='White', width=3)
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of threads\n(init value is OMP_NUM_THREADS).')
    B.bind('<Return>', setThreads)
    WIDGETS['threads'] = B
    mxProcs = getMaxProcs()
    B = TK.Label(F, text='/'+mxProcs)
    B.grid(row=0, column=1, columnspan=1, sticky=TK.EW)

    B = TTK.Button(Frame, text="Set", command=setThreads)
    B.grid(row=1, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set the number of threads.')
コード例 #7
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkInteg',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Integrate fields.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkInteg')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Integration type -
    V = TK.StringVar(win)
    V.set('INT(v1dS)')
    VARS.append(V)
    # -1- Moment center  -
    V = TK.StringVar(win)
    V.set('0;0;0')
    VARS.append(V)
    # -2- Var0 for integration -
    V = TK.StringVar(win)
    V.set('CoordinateX')
    VARS.append(V)
    # -3- Var1 for integration -
    V = TK.StringVar(win)
    V.set('CoordinateY')
    VARS.append(V)
    # -4- Var2 for integration -
    V = TK.StringVar(win)
    V.set('CoordinateZ')
    VARS.append(V)

    # - Menu des integrations -
    B = TTK.OptionMenu(Frame, VARS[0], \
                       'INT(v1dS)', 'INT(v1.ndS)', \
                       'INT((v1,v2,v3).ndS)', \
                       'INT((v1,v2,v3)^OMdS)', 'INT(v1n^OMdS)')
    B.grid(row=0, column=0, sticky=TK.EW)

    # - Centre des moments -
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=5)
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Moment center.')

    # - Bouton compute -
    B = TTK.Button(Frame, text="Compute", command=compute)
    B.grid(row=0, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Compute integration on contour/surface.')

    # - Menu des variables -
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.OptionMenu(F, VARS[2], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList1)
        F.grid(row=1, column=0, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 1.')
        WIDGETS['variable1'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[2],
                         values=[],
                         state='readonly',
                         width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList1_2)
        F.grid(row=1, column=0, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 1.')
        WIDGETS['variable1'] = B

    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.OptionMenu(F, VARS[3], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2)
        F.grid(row=1, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 2.')
        WIDGETS['variable2'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[3],
                         values=[],
                         state='readonly',
                         width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2_2)
        F.grid(row=1, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 2.')
        WIDGETS['variable2'] = B

    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.OptionMenu(F, VARS[4], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList3)
        F.grid(row=1, column=2, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 3.')
        WIDGETS['variable3'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[4],
                         values=[],
                         state='readonly',
                         width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList3_2)
        F.grid(row=1, column=2, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 3.')
        WIDGETS['variable3'] = B
コード例 #8
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkIsoLine',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Compute isolines.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkIsoLine')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Field name -
    V = TK.StringVar(win)
    V.set('CoordinateX')
    VARS.append(V)
    # -1- nlevels -
    V = TK.StringVar(win)
    V.set('25')
    VARS.append(V)
    if 'tkIsoLineLevels' in CTK.PREFS:
        V.set(CTK.PREFS['tkIsoLineLevels'])
    # -2- value -
    V = TK.StringVar(win)
    V.set('1.')
    VARS.append(V)
    if 'tkIsoLineValue' in CTK.PREFS:
        V.set(CTK.PREFS['tkIsoLineValue'])
    # -3- min iso
    V = TK.StringVar(win)
    V.set('MIN')
    VARS.append(V)
    if 'tkIsoLineMin' in CTK.PREFS:
        V.set(CTK.PREFS['tkIsoLineMin'])
    # -4- max iso
    V = TK.StringVar(win)
    V.set('MAX')
    VARS.append(V)
    V = TK.StringVar(win)
    V.set('MIN')
    VARS.append(V)
    if 'tkIsoLineMax' in CTK.PREFS:
        V.set(CTK.PREFS['tkIsoLineMax'])

    # - field name -
    B = TTK.Label(Frame, text="Field:")
    B.grid(row=0, column=0, sticky=TK.EW)
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[0], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList)
        F.grid(row=0, column=1, columnspan=2, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Extracted field.')
        WIDGETS['field'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[0], values=[], state='readonly')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2)
        F.grid(row=0, column=1, columnspan=2, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Extracted field.')
        WIDGETS['field'] = B

    if CTK.t != []:
        vars = C.getVarNames(CTK.t)
        if (len(vars) > 0):
            if (len(vars[0]) > 0): VARS[0].set(vars[0][0])

    # - nlevels -
    #B = TK.Label(Frame, text="Nlevels:")
    #B.grid(row=1, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=7)
    BB = CTK.infoBulle(parent=B, text='Number of levels.')
    B.grid(row=1, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[3], background='White', width=7)
    BB = CTK.infoBulle(parent=B, text='Min value.')
    B.grid(row=1, column=1, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[4], background='White', width=7)
    BB = CTK.infoBulle(parent=B, text='Max value.')
    B.grid(row=1, column=2, sticky=TK.EW)

    # - Draw all isolines -
    B = TTK.Button(Frame, text="Extract isolines", command=drawIsoLines)
    BB = CTK.infoBulle(parent=B, text='Extract isolines.')
    B.grid(row=2, column=0, columnspan=3, sticky=TK.EW)

    # - Value -
    B = TTK.Label(Frame, text="Value:")
    B.grid(row=3, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[2], background='White')
    B.grid(row=3, column=1, columnspan=2, sticky=TK.EW)

    # - Extract one isoline -
    B = TTK.Button(Frame, text="Extract isoline", command=extractIsoLine)
    B.grid(row=4, column=0, columnspan=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Extract one isoline to CONTOURS.')
コード例 #9
0
def createApp(win):

    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkExtractBC', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Extract boundary conditions.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=2)
    Frame.columnconfigure(1, weight=2)
    Frame.columnconfigure(2, weight=0)
    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkExtractBC')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # - 0 - Type de BC -
    V = TK.StringVar(win); V.set('-All BC-'); VARS.append(V)
    if 'tkExtractBCType' in CTK.PREFS: 
        V.set(CTK.PREFS['tkExtractBCType'])
    # - 1 - List of zoneBCs to recover
    V = TK.StringVar(win); V.set(''); VARS.append(V)

    # - Extract type de BC -
    B = TTK.Button(Frame, text="Extract", command=extract)
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Extract specified BC.\nTree is modified.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.OptionMenu(F, VARS[0], *(Internal.KNOWNBCS))
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateFamilyBCNameList)
        F.grid(row=0, column=1, columnspan=2, sticky=TK.EW)
        WIDGETS['BC'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[0], 
                         values=Internal.KNOWNBCS, 
                         state='readonly', width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateFamilyBCNameList2)
        F.grid(row=0, column=1, columnspan=2, sticky=TK.EW)
        WIDGETS['BC'] = B

    # - Recover BCs -
    B = TTK.Button(Frame, text="Recover", command=recover)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Recover BCs.\nTree is modified.')
    B = TTK.Button(Frame, command=setBC2Recover,
                   image=iconics.PHOTO[8], padx=0, pady=0)
    B.grid(row=1, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set the BC (zones) to recover.')
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=8)
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='BCs to recover.')
コード例 #10
0
def createApp(win):

    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkContainers', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Manage container names.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=4)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkContainers')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- GridCoordinates container -
    V = TK.StringVar(win); V.set('GridCoordinates'); VARS.append(V)
    if 'GridCoordinatesContainer' in CTK.PREFS:
        V.set(CTK.PREFS['GridCoordinatesContainer'])

    # -1- FlowSolutionNodes container -
    V = TK.StringVar(win); V.set('FlowSolution'); VARS.append(V)
    if 'FlowSolutionNodesContainer' in CTK.PREFS:
        V.set(CTK.PREFS['FlowSolutionNodesContainer'])
    # -2- FlowSolutionCenters container -
    V = TK.StringVar(win); V.set('FlowSolution#Centers'); VARS.append(V)
    if 'FlowSolutionCentersContainer' in CTK.PREFS:
        V.set(CTK.PREFS['FlowSolutionCentersContainer'])

    # - GridCoordinates -
    B = TTK.Label(Frame, text="GridCoordinates")
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='This name will be used to find coordinates node in zones.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.Entry(F, textvariable=VARS[0], background='White')
        B.grid(sticky=TK.EW)
        F.bind('<Return>', setNames)
        F.grid(row=0, column=1, sticky=TK.EW)
        WIDGETS['GridCoordinates'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[0],
                         values=[], state='normal')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateGridCoordinates)
        B.bind('<Return>', setNames)
        F.grid(row=0, column=1, sticky=TK.EW)
        WIDGETS['GridCoordinates'] = B

    # - FlowSolutionNodes -
    B = TTK.Label(Frame, text="FlowSolutionNodes")
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='This name will be used to find solution node in zones.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.Entry(F, textvariable=VARS[1], background='White')
        B.grid(sticky=TK.EW)
        F.bind('<Return>', setNames)
        F.grid(row=1, column=1, sticky=TK.EW)
        WIDGETS['FlowSolution'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[1],
                         values=[], state='normal')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateFlowSolution)
        B.bind('<Return>', setNames)
        F.grid(row=1, column=1, sticky=TK.EW)
        WIDGETS['FlowSolution'] = B

    # - FlowSolutionCenters -
    B = TTK.Label(Frame, text="FlowSolutionCenters")
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='This name will be used to find centers solution node in zones.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.Entry(F, textvariable=VARS[2], background='White')
        B.grid(sticky=TK.EW)
        F.bind('<Return>', setNames)
        F.grid(row=2, column=1, sticky=TK.EW)
        WIDGETS['FlowSolutionCenters'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[2],
                         values=[], state='normal')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateFlowSolutionCenters)
        B.bind('<Return>', setNames)
        F.grid(row=2, column=1, sticky=TK.EW)
        WIDGETS['FlowSolutionCenters'] = B

    # - set -
    B = TTK.Button(Frame, text="Set", command=setNames)
    BB = CTK.infoBulle(parent=B, text='Change the container names used by Cassiopee functions.')
    B.grid(row=3, column=0, columnspan=2, sticky=TK.EW)
コード例 #11
0
import Tkinter as TK
import tkMessageBox
import os, sys, re, time
import subprocess
import CPlot.Tk as CTK
import KCore.Dist as Dist
import KCore.kcore
from threading import Thread
try:
    from Queue import Queue, Empty
except ImportError:
    from queue import Queue, Empty

ON_POSIX = 'posix' in sys.builtin_module_names

ttk = CTK.importTtk()

# CASSIOPEE var
CASSIOPEE = os.getenv('CASSIOPEE')
if (CASSIOPEE == ''):
    print 'Error: CASSIOPEE must be present in your environement.'
    sys.exit()

# Systeme
mySystem = Dist.getSystem()[0]

# Success
regSuccess = re.compile('Writing restart.cgns')
regReal = re.compile('real')

# Separator
コード例 #12
0
def createApp(win):

    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkTreeOps',
                           font=CTK.FRAMEFONT,
                           takefocus=1)

    #BB = CTK.infoBulle(parent=Frame, text='Operations on pyTree.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkTreeOps')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Base to move to -
    V = TK.StringVar(win)
    V.set('New Base')
    VARS.append(V)
    # -1- Displayed index
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -2- Displayed node value
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -3- Displayed node type
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -4- Displayed node name
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -5- Name/Type to be deleted
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -6- Type of deletion
    V = TK.StringVar(win)
    V.set('Name')
    VARS.append(V)

    # - Move selection to base -
    B = TTK.Button(Frame, text="Move sel. to", command=moveSelection)
    BB = CTK.infoBulle(parent=B, text='Move selected zones to another base.')
    B.grid(row=0, column=0, sticky=TK.EW)

    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.OptionMenu(F, VARS[0], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateBaseNameList)
    else:
        VARS[0].set('newBase')
        B = ttk.Combobox(F, textvariable=VARS[0], values=[], state='normal')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateBaseNameList2)
    F.grid(row=0, column=1, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Destination Base name.')
    WIDGETS['base'] = B

    # - Move nodes up/down/import selection in tkTree
    B = TTK.Button(Frame, text="Node Up", command=moveNodeUp)
    BB = CTK.infoBulle(parent=B, text='Move selected node in tkTree up.')
    B.grid(row=1, column=0, sticky=TK.EW)
    B = TTK.Button(Frame, text="Node Down", command=moveNodeDown)
    BB = CTK.infoBulle(parent=B, text='Move selected node in tkTree down.')
    B.grid(row=1, column=1, columnspan=2, sticky=TK.EW)

    # - Rm Nodes -
    #B = TK.Button(Frame, text="Rm node(s)", command=rmNodes)
    #BB = CTK.infoBulle(parent=B, text='Remove nodes from tree.\nYou can also use the Suppr key.')
    #B.grid(row=2, column=0, sticky=TK.EW)
    #B = TK.OptionMenu(Frame, VARS[6], 'Name', 'Type', 'Value')
    #B.grid(row=2, column=1, sticky=TK.EW)
    #B = TK.Entry(Frame, textvariable=VARS[5], background='White', width=5)
    #BB = CTK.infoBulle(parent=B, text='Enter node name or types. Wildcards are accepted.')
    #B.grid(row=2, column=2, sticky=TK.EW)

    # - Small node editor -
    F = TTK.LabelFrame(Frame,
                       borderwidth=2,
                       relief=CTK.FRAMESTYLE,
                       text='Edit node',
                       takefocus=1)
    F.columnconfigure(0, weight=1)
    F.columnconfigure(1, weight=4)
    F.grid(row=3, column=0, columnspan=3, sticky=TK.EW)
    B = TTK.Entry(F, textvariable=VARS[4], background='White', width=5)
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text='Selected node name.\nYou can change this by pressing <Enter>.')
    B.bind('<Return>', setNodeName)

    B = TTK.Entry(F, textvariable=VARS[3], background='White', width=5)
    B.grid(row=0, column=1, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text='Selected node type.\nYou can change this by pressing <Enter>.')
    B.bind('<Return>', setNodeType)

    FrameA = TK.Frame(F)
    FrameA.columnconfigure(0, weight=0)
    FrameA.columnconfigure(1, weight=1)
    FrameA.columnconfigure(2, weight=0)
    FrameA.grid(row=1, column=0, sticky=TK.EW)
    B = TTK.Entry(FrameA, textvariable=VARS[1], background='White', width=5)
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Displayed index (start: 0).')
    B.bind('<Return>', showNodeValue)
    B = TTK.Button(FrameA, text="<", command=decreaseIndex, width=2)
    B.grid(row=0, column=0, sticky=TK.EW)
    B = TTK.Button(FrameA, text=">", command=increaseIndex, width=2)
    B.grid(row=0, column=2, sticky=TK.EW)

    B = TTK.Entry(F, textvariable=VARS[2], background='White', width=5)
    B.grid(row=1, column=1, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text=
        'Selected node value at given index.\nYou can change this by pressing <Enter>.'
    )
    B.bind('<Return>', setNodeValue)
コード例 #13
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkPlot',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='My personal applet.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkPlot')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Direction -
    V = TK.StringVar(win)
    V.set('None')
    VARS.append(V)
    if 'tkPlotDirection' in CTK.PREFS: V.set(CTK.PREFS['tkPlotDirection'])
    # -1- grid size -
    V = TK.StringVar(win)
    V.set('3;3')
    VARS.append(V)
    if 'tkPlotGridSize' in CTK.PREFS: V.set(CTK.PREFS['tkPlotGridSize'])
    # -2- grid pos -
    V = TK.StringVar(win)
    V.set('0;0')
    VARS.append(V)
    if 'tkPlotGridPos' in CTK.PREFS: V.set(CTK.PREFS['tkPlotGridPos'])
    # -3- Var1
    V = TK.StringVar(win)
    V.set('CoordinateX')
    VARS.append(V)
    # -4- Var2
    V = TK.StringVar(win)
    V.set('CoordinateX')
    VARS.append(V)
    # -5- Slot
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)

    # - Slot -
    B = TTK.Entry(Frame, textvariable=VARS[5], width=2)
    BB = CTK.infoBulle(parent=B, text='Slot.')
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)

    # - grid size -
    B = TTK.Entry(Frame, textvariable=VARS[1], width=2)
    BB = CTK.infoBulle(parent=B, text='Grid size (1;1).')
    B.grid(row=0, column=1, columnspan=1, sticky=TK.EW)

    # - grid pos -
    B = TTK.Entry(Frame, textvariable=VARS[2], width=2)
    BB = CTK.infoBulle(parent=B, text='Position of slot in grid (0;0).')
    B.grid(row=0, column=2, columnspan=1, sticky=TK.EW)

    # - Element 1D -
    B = TTK.OptionMenu(Frame, VARS[0], 'None', 'X (Y)', 'Y (X)', 'Z (X)',
                       'X (Z)', 'Y (Z)', 'Z (Y)', 'I', 'J', 'K', 'Elements')
    B.grid(row=1, column=0, columnspan=3, sticky=TK.EW)

    # Var1
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[3], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVar1NameList)
        F.grid(row=2, column=1, columnspan=2, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 1 (abcsiss).')
        WIDGETS['var1'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[3],
                         values=[],
                         state='readonly',
                         width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVar1NameList2)
        F.grid(row=2, column=1, columnspan=2, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 1 (absciss).')
        WIDGETS['var1'] = B

    # Var2
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[4], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVar2NameList)
        F.grid(row=2, column=0, columnspan=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 2 (ordinates).')
        WIDGETS['var2'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[4],
                         values=[],
                         state='readonly',
                         width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVar2NameList2)
        F.grid(row=2, column=0, columnspan=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 2 (ordinates).')
        WIDGETS['var2'] = B

    # - Ranges -
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  showvalue=0,
                  borderwidth=1,
                  command=display1D,
                  value=50)
    WIDGETS['rangePos'] = B
    B.grid(row=3, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Move range.')
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  showvalue=0,
                  borderwidth=1,
                  command=display1D,
                  value=0)
    WIDGETS['rangeZoom'] = B
    B.grid(row=3, column=1, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Zoom range.')

    # - Set in slot -
    B = TTK.Button(Frame, text="Set", command=display1D)
    B.grid(row=4, column=0, columnspan=3, sticky=TK.EW)
コード例 #14
0
def createApp(win):

    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkVariable',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Manage field variables.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=4)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkVariables')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- computeVariable name
    V = TK.StringVar(win)
    V.set('Pressure')
    VARS.append(V)
    if 'tkVariablesName' in CTK.PREFS:
        V.set(CTK.PREFS['tkVariablesName'])
    # -1- addVar
    V = TK.StringVar(win)
    V.set('Density')
    VARS.append(V)
    if 'tkVariablesAddVar' in CTK.PREFS:
        V.set(CTK.PREFS['tkVariablesAddVar'])
    # -2- computeGrad -
    V = TK.StringVar(win)
    V.set('CoordinateX')
    VARS.append(V)
    # -3- computeCurl -
    V = TK.StringVar(win)
    V.set('MomentumX;MomentumY;MomentumZ')
    VARS.append(V)
    # -4- importFile -
    V = TK.StringVar(win)
    V.set('output.plt')
    VARS.append(V)
    if 'tkVariablesImportFile' in CTK.PREFS:
        V.set(CTK.PREFS['tkVariablesImportFile'])
    # -5- Rm variable
    V = TK.StringVar(win)
    V.set('All')
    VARS.append(V)
    # -6- Var location
    V = TK.StringVar(win)
    V.set('nodes')
    VARS.append(V)
    if 'tkVariablesLoc' in CTK.PREFS:
        V.set(CTK.PREFS['tkVariablesLoc'])
    # -7- adim type
    V = TK.StringVar(win)
    V.set('Adim1 (ro,a,T)')
    VARS.append(V)
    if 'tkVariablesAdim' in CTK.PREFS:
        V.set(CTK.PREFS['tkVariablesAdim'])
    # -8- center2Node variable
    V = TK.StringVar(win)
    V.set('FlowSolutionCenters')
    VARS.append(V)
    # -9- node2Center variable
    V = TK.StringVar(win)
    V.set('FlowSolutionNodes')
    VARS.append(V)
    # -10- renameVar variable - new
    V = TK.StringVar(win)
    V.set('CoordinateX')
    VARS.append(V)
    # -11- renameVar variable - prev
    V = TK.StringVar(win)
    V.set('x')
    VARS.append(V)

    # - importFile -
    norow = 0
    B = TTK.Button(Frame, text="Import file", command=importFile)
    B.grid(row=norow, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Import solution file into existing pyTree.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    F.columnconfigure(1, weight=0)
    B = TTK.Entry(F, textvariable=VARS[4], background='White')
    B.bind('<Return>', importFile)
    B.grid(row=norow, column=0, sticky=TK.EW)
    B = TTK.Button(F, text="...", padx=0, command=chooseImportFile)
    BB = CTK.infoBulle(parent=B, text='Select solution file.')
    B.grid(row=norow, column=1, sticky=TK.EW)
    F.grid(row=norow, column=1, sticky=TK.EW)

    # - addVar -
    norow += 1
    B = TTK.Button(Frame, text="Add/modify variable", command=addVar)
    B.grid(row=norow, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text=
        'Add a new variable into pyTree. A formula of type: Density=3*{CoordinateX} can be specified.'
    )
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White')
    B.bind('<Return>', addVar)
    B.grid(row=norow, column=1, sticky=TK.EW)

    # - rmVar -
    norow += 1
    B = TTK.Button(Frame, text="Rm variable", command=rmVar)
    B.grid(row=norow, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Rm variable from pyTree.')

    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[5], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList1)
        F.grid(row=norow, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Removed variable.')
        WIDGETS['var1'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[5], values=[], state='readonly')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList1_2)
        F.grid(row=norow, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Removed variable.')
        WIDGETS['var1'] = B

    # - renameVar -
    #norow+= 1
    #F = TTK.Frame(Frame, borderwidth=0)
    #F.columnconfigure(0, weight=1)
    #if ttk is None:
    #    B = TK.OptionMenu(F, VARS[11], '')
    #    B.grid(sticky=TK.EW)
    #    F.bind('<Enter>', updateVarNameList5)
    #    F.grid(row=norow, column=0, sticky=TK.EW)
    #    BB = CTK.infoBulle(parent=B, text='Renamed variable.')
    #    WIDGETS['var5'] = B
    #else:
    #    B = ttk.Combobox(F, textvariable=VARS[11],
    #                     values=[], state='readonly')
    #    B.grid(sticky=TK.EW)
    #    F.bind('<Enter>', updateVarNameList5_2)
    #    F.grid(row=norow, column=0, sticky=TK.EW)
    #    BB = CTK.infoBulle(parent=B, text='Renamed variable.')
    #    WIDGETS['var5'] = B
    #B = TK.Entry(Frame, textvariable=VARS[10], background='White')
    #B.bind('<Return>', renameVar)
    #B.grid(row=norow, column=1, sticky=TK.EW)
    #norow+=1
    #B = TK.Button(Frame, text="Rename variable", command=renameVar)
    #B.grid(row=norow, column=0, columnspan=2, sticky=TK.EW)
    #BB = CTK.infoBulle(parent=B, text='Rename variable from pyTree.')

    # - center2Node var -
    norow += 1
    B = TTK.Button(Frame, text="Center2Node", command=center2NodeVar)
    B.grid(row=norow, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Put a center variable to nodes in pyTree.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[8], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList3)
        F.grid(row=norow, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B,
                           text='Center variable to be set in nodes.')
        WIDGETS['var3'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[8], values=[], state='readonly')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList3_2)
        F.grid(row=norow, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B,
                           text='Center variable to be set in nodes.')
        WIDGETS['var3'] = B

    # - node2Center var -
    norow += 1
    B = TTK.Button(Frame, text="Node2Center", command=node2CenterVar)
    B.grid(row=norow, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Put a node variable to centers in pyTree.')

    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[9], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList4)
        F.grid(row=norow, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B,
                           text='Node variable to be set in centers.')
        WIDGETS['var4'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[9], values=[], state='readonly')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList4_2)
        F.grid(row=norow, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B,
                           text='Node variable to be set in centers.')
        WIDGETS['var4'] = B

    # - computeGrad -
    norow += 1
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    F.columnconfigure(1, weight=1)
    B = TTK.Button(F, text="Grad", command=computeGrad)
    BB = CTK.infoBulle(parent=B, text='Compute gradient of variables.')
    B.grid(row=0, column=0, sticky=TK.EW)
    B = TTK.Button(F, text="Norm", command=computeNormGrad)
    BB = CTK.infoBulle(parent=B, text='Compute gradient\' norm of variables.')
    B.grid(row=0, column=1, sticky=TK.EW)
    F.grid(row=norow, column=0, sticky=TK.EW)
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.OptionMenu(F, VARS[2], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2)
        F.grid(row=norow, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable for gradient.')
        WIDGETS['var2'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[2], values=[], state='readonly')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2_2)
        F.grid(row=norow, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable for gradient.')
        WIDGETS['var2'] = B

    # - computeCurl -
    norow += 1
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    F.columnconfigure(1, weight=1)
    B = TTK.Button(F, text="Curl ", command=computeCurl)
    BB = CTK.infoBulle(parent=B, text='Compute curl of variables.')
    B.grid(row=0, column=0, sticky=TK.EW)
    B = TTK.Button(F, text="Norm", command=computeNormCurl)
    BB = CTK.infoBulle(parent=B, text='Compute gradient\' norm of variables.')
    B.grid(row=0, column=1, sticky=TK.EW)
    F.grid(row=norow, column=0, sticky=TK.EW)

    B = TTK.Entry(Frame, textvariable=VARS[3], background='White')
    BB = CTK.infoBulle(parent=B, text='Variables for curl.')
    B.grid(row=norow, column=1, sticky=TK.EW)

    # - computeVariables -
    norow += 1
    B = TTK.OptionMenu(Frame, VARS[7], 'Adim1 (ro,a,T)', 'Adim2 (ro,u,T)')
    B.grid(row=norow, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Use this adimensioning for variable computation.')
    B = TTK.OptionMenu(Frame, VARS[6], 'nodes', 'centers')
    B.grid(row=norow, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Computed variable will be localized here.')

    norow += 1
    B = TTK.Button(Frame, text="Compute variable", command=computeVariables)
    B.grid(row=norow, column=0, sticky=TK.EW)
    B = TTK.OptionMenu(Frame, VARS[0],'Pressure','Temperature',
                       'VelocityMagnitude','VelocityX',\
                       'VelocityY','VelocityZ','Enthalpy','Entropy','Mach',\
                       'ViscosityMolecular','PressureStagnation',\
                       'TemperatureStagnation', 'PressureDynamic',
                       'Vorticity', 'VorticityMagnitude', 'QCriterion',
                       'ShearStress', 'SkinFriction', 'SkinFrictionTangential')
    B.grid(row=norow, column=1, sticky=TK.EW)

    # fill missing variables
    norow += 1
    B = TTK.Button(Frame,
                   text="Fill missing variables",
                   command=fillMissingVariables)
    B.grid(row=norow, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='All zones will have the same variables.')
コード例 #15
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkRenderSet',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Customize block rendering\n(render mode).\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkRenderSet')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Material -
    V = TK.StringVar(win)
    V.set('Solid')
    VARS.append(V)
    # -1- Color -
    V = TK.StringVar(win)
    V.set('White')
    VARS.append(V)
    # -2- Blending
    V = TK.StringVar(win)
    V.set('1.')
    VARS.append(V)
    # -3- Mesh overlay
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -4- Shader parameter1 info bulle
    V = TK.StringVar(win)
    V.set('Shader parameter 1.')
    VARS.append(V)
    # -5- Shader parameter2 info bulle
    V = TK.StringVar(win)
    V.set('Shader parameter 2.')
    VARS.append(V)
    # -6- Blending info bulle
    V = TK.StringVar(win)
    V.set('Blending.')
    VARS.append(V)

    # - set Blending -
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  command=setBlending,
                  showvalue=0,
                  borderwidth=1,
                  value=100)
    WIDGETS['blending'] = B
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, textVariable=VARS[6])

    # - set mesh overlay -
    B = TTK.Checkbutton(Frame,
                        text='Mesh',
                        variable=VARS[3],
                        command=setMeshOverlay)
    BB = CTK.infoBulle(parent=B, text='Add underlaying mesh.')
    B.grid(row=0, column=1, sticky=TK.EW)

    # - set shader parameter 1 & 2-
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  command=setShaderParameter,
                  showvalue=0,
                  borderwidth=1,
                  value=50)
    WIDGETS['param1'] = B
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, textVariable=VARS[4])

    # - set shader parameter 2 -
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  command=setShaderParameter,
                  showvalue=0,
                  borderwidth=1,
                  value=50)
    WIDGETS['param2'] = B
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, textVariable=VARS[5])

    # - set Material -
    B = TTK.Button(Frame, text="Set Material", command=setMaterial)
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set the material render property.')
    B = TTK.OptionMenu(Frame, VARS[0], *MATERIALS)
    B.grid(row=2, column=1, sticky=TK.EW)

    # - set Color -
    B = TTK.Button(Frame, text="Set Color", command=setColor)
    B.grid(row=3, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set the color render property.')

    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[1], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList)
        F.grid(row=3, column=1, sticky=TK.EW)
        WIDGETS['colors'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[1],
                         values=[],
                         state='readonly',
                         height=11)
        B.bind('<<ComboboxSelected>>', setColorVar2)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2)
        F.grid(row=3, column=1, sticky=TK.EW)
        WIDGETS['colors'] = B

    # - set all properties -
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    F.columnconfigure(1, weight=0)

    B = TTK.Button(F, text="Set all properties", command=setAll)
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set all render properties.')
    B = TTK.Button(F, command=getData, image=iconics.PHOTO[8], padx=0, pady=0)
    BB = CTK.infoBulle(parent=B, text='Get data from selected zone.')
    B.grid(row=0, column=1, sticky=TK.EW)
    F.grid(row=4, column=0, columnspan=2, sticky=TK.EW)
コード例 #16
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkPrefs',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Set Cassiopee preferences.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=2)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    #FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkPrefs')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Default mesh display style -
    V = TK.StringVar(win)
    V.set('Monocolor wires+solid')
    VARS.append(V)
    # -1- Undo
    V = TK.StringVar(win)
    V.set('Active')
    VARS.append(V)
    # -2- DisplayInfo
    V = TK.StringVar(win)
    V.set('Active')
    VARS.append(V)
    # -3- bgColor
    V = TK.StringVar(win)
    V.set('Black')
    VARS.append(V)
    # -4- auto open apps
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -5- Default solid display style -
    V = TK.StringVar(win)
    V.set('Monocolor/1-side')
    VARS.append(V)
    # -6- Default envmap
    V = TK.StringVar(win)
    V.set('windtunnel.png')
    VARS.append(V)
    # -7- Selection style
    V = TK.StringVar(win)
    V.set('Blue')
    VARS.append(V)
    # -8- Export resolution
    V = TK.StringVar(win)
    V.set('1120x820')
    VARS.append(V)
    # -9- GUI Theme
    V = TK.StringVar(win)
    V.set('default')
    VARS.append(V)

    # Init VARS par le fichier de preferences
    CTK.loadPrefFile()
    for i in CTK.PREFS:
        k1 = CTK.PREFS[i]
        if i == 'undo':
            if k1 == '1': VARS[1].set('Active')
            elif k1 == '0': VARS[1].set('Inactive')
        elif i == 'displayInfo':
            if k1 == '1': VARS[2].set('Active')
            elif k1 == '0': VARS[2].set('Inactive')
        elif i == 'bgColor':
            if k1 == '0': VARS[3].set('Black')
            elif k1 == '1': VARS[3].set('White')
            elif k1 == '2': VARS[3].set('Grey')
            elif k1 == '3': VARS[3].set('Yellow')
            elif k1 == '4': VARS[3].set('Blue')
            elif k1 == '5': VARS[3].set('Red')
            elif k1 == '6': VARS[3].set('Paper1')
            elif k1 == '7': VARS[3].set('Paper2')
            elif k1 == '8': VARS[3].set('Arch')
            elif k1 == '9': VARS[3].set('Jarvis')
            elif k1 == '10': VARS[3].set('Onera')
        elif i == 'auto': VARS[4].set(k1)
        elif i == 'envmap': VARS[6].set(k1)
        elif i == 'selectionStyle': VARS[7].set(k1)
        elif i == 'exportResolution': VARS[8].set(k1)
        elif i == 'guitheme': VARS[9].set(k1)

    r = 0
    # - gui theme -
    B = TTK.Label(Frame, text="GUI Theme")
    B.grid(row=r, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Style for GUI (buttons,...).')

    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TTK.OptionMenu(F, VARS[9], 'default')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateThemeList)
        F.grid(row=r, column=1, sticky=TK.EW)
        WIDGETS['guitheme'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[9],
                         values=[],
                         state='readonly',
                         width=10)
        B.bind('<<ComboboxSelected>>', setTheme)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateThemeList2)
        F.grid(row=r, column=1, sticky=TK.EW)
        WIDGETS['guitheme'] = B
    r += 1

    # - Default display info style -
    B = TTK.Label(Frame, text="Display Info")
    B.grid(row=r, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Default display info style.')
    B = TTK.OptionMenu(Frame,
                       VARS[2],
                       'Active',
                       'Inactive',
                       command=setDisplayInfo)
    B.grid(row=r, column=1, sticky=TK.EW)
    r += 1

    # - Default background color -
    B = TTK.Label(Frame, text="Background")
    B.grid(row=r, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Default background color or image.')
    B = TTK.OptionMenu(Frame,
                       VARS[3],
                       'Black',
                       'White',
                       'Grey',
                       'Yellow',
                       'Blue',
                       'Red',
                       'Paper1',
                       'Paper2',
                       'Arch',
                       'Jarvis',
                       'Onera',
                       command=setBgColor)
    B.grid(row=r, column=1, sticky=TK.EW)
    r += 1

    # - Undo -
    B = TTK.Label(Frame, text="Undo")
    B.grid(row=r, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Undo is active.')
    B = TTK.OptionMenu(Frame, VARS[1], 'Active', 'Inactive', command=setUndo)
    B.grid(row=r, column=1, sticky=TK.EW)
    r += 1

    # - selection style -
    B = TTK.Label(Frame, text="Selection")
    B.grid(row=r, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Selection style.')
    B = TTK.OptionMenu(Frame,
                       VARS[7],
                       'Blue',
                       'Alpha',
                       command=setSelectionStyle)
    B.grid(row=r, column=1, sticky=TK.EW)
    r += 1

    # - Envmap -
    B = TTK.Label(Frame, text="Envmap")
    B.grid(row=r, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Environment map (chrome/glass render).')
    B = TTK.OptionMenu(Frame,
                       VARS[6],
                       'windtunnel.png',
                       'sky.png',
                       'city.png',
                       'forest.png',
                       'house.png',
                       command=setEnvmap)
    B.grid(row=r, column=1, sticky=TK.EW)
    r += 1

    # - export resolution -
    B = TTK.Label(Frame, text="Export")
    B.grid(row=r, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Resolution for image export.')
    B = TTK.Entry(Frame, textvariable=VARS[8], background='White', width=5)
    B.bind('<Return>', setExportRes)
    BB = CTK.infoBulle(parent=B, text='Resolution for image export.')
    B.grid(row=r, column=1, sticky=TK.EW)
    r += 1

    # - Auto open apps -
    #B = TK.Button(Frame, text='Opened apps', command=getOpenedApps)
    #BB = CTK.infoBulle(parent=B, text='Keep currently opened apps for next restart.')
    #B.grid(row=r, column=0, sticky=TK.EW)
    #B = TK.Button(Frame, text='Classic apps', command=getClassicApps)
    #BB = CTK.infoBulle(parent=B, text='Keep a classic set of apps for next restart.')
    #B.grid(row=r, column=1, sticky=TK.EW)
    #r += 1
    #B = TK.Label(Frame, text="Auto open")
    #B.grid(row=r, column=0, sticky=TK.EW)
    #BB = CTK.infoBulle(parent=B, text='Open automatically these apps for next restart (tkTree;tkBC;...)')
    #B = TK.Entry(Frame, textvariable=VARS[4], background='White')
    #BB = CTK.infoBulle(parent=B, text='Apps opened for next restart (tkTree;tkBC;...)')
    #B.grid(row=r, column=1, sticky=TK.EW)
    #r += 1

    # - Set prefs -
    #B = TK.Button(Frame, text="Set prefs", command=setPrefs)
    #B.grid(row=r, column=0, columnspan=2, sticky=TK.EW)
    #BB = CTK.infoBulle(parent=B, text='Set prefs in Cassiopee.')
    #WIDGETS.append(B); r += 1

    # - Save prefs -
    B = TTK.Button(Frame, text="Save prefs", command=savePrefs)
    B.grid(row=r, column=0, columnspan=2, sticky=TK.EW)
    B = CTK.infoBulle(parent=B, text='Save pref file (.cassiopee).')
    r += 1
コード例 #17
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkIsoSurf', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Compute iso-surfaces.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=0)
    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkIsoSurf')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Field name -
    V = TK.StringVar(win); V.set('CoordinateX'); VARS.append(V)
    # -1- value -
    V = TK.StringVar(win); V.set('1.'); VARS.append(V)
    if 'tkIsoSurfValue' in CTK.PREFS: 
        V.set(CTK.PREFS['tkIsoSurfValue'])

    # - field name -
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[0], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList)
        F.grid(row=0, column=0, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Extracted field.')
        WIDGETS['field'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[0], 
                         values=[], state='readonly', width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2)
        F.grid(row=0, column=0, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Extracted field.')
        WIDGETS['field'] = B

    # - Value -
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=7)
    BB = CTK.infoBulle(parent=B, text='Extracted field value.')
    B.bind('<Return>', extractIsoSurf)
    B.grid(row=0, column=1, sticky=TK.EW)
    
    # - Get value from mouse -
    B = TTK.Button(Frame, image=iconics.PHOTO[8],
                   command=getValueFromMouse, padx=0)
    B.grid(row=0, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Get value from mouse.')

    # - Extract -
    B = TTK.Button(Frame, text="Extract isosurf", command=extractIsoSurf)
    B.grid(row=1, column=0, columnspan=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Extract isosurf to SURFACES.')
コード例 #18
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkStream',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Compute stream lines/surfaces.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkStream')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- nptsmax -
    V = TK.StringVar(win)
    V.set('2000')
    VARS.append(V)
    if 'tkStreamNpts' in CTK.PREFS:
        V.set(CTK.PREFS['tkStreamNpts'])
    # -1- Var0 for vector -
    V = TK.StringVar(win)
    V.set('CoordinateX')
    VARS.append(V)
    # -2- Var1 for vector -
    V = TK.StringVar(win)
    V.set('CoordinateY')
    VARS.append(V)
    # -3- Var2 for vector -
    V = TK.StringVar(win)
    V.set('CoordinateZ')
    VARS.append(V)

    # - Menu des variables -
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.OptionMenu(F, VARS[1], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList1)
        F.grid(row=0, column=0, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 1.')
        WIDGETS['variable1'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[1],
                         values=[],
                         state='readonly',
                         width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList1_2)
        F.grid(row=0, column=0, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 1.')
        WIDGETS['variable1'] = B

    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.OptionMenu(F, VARS[2], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2)
        F.grid(row=0, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 2.')
        WIDGETS['variable2'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[2],
                         values=[],
                         state='readonly',
                         width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2_2)
        F.grid(row=0, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 2.')
        WIDGETS['variable2'] = B

    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    if ttk is None:
        B = TK.OptionMenu(F, VARS[3], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList3)
        F.grid(row=0, column=2, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 3.')
        WIDGETS['variable3'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[3],
                         values=[],
                         state='readonly',
                         width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList3_2)
        F.grid(row=0, column=2, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Variable 3.')
        WIDGETS['variable3'] = B

    # - nptsmax -
    B = TTK.Label(Frame, text="nptsmax")
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Max number of points of streams.')
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=5)
    BB = CTK.infoBulle(parent=B, text='Max number of points of streams.')
    B.grid(row=1, column=1, columnspan=2, sticky=TK.EW)

    # - Stream line -
    B = TTK.Button(Frame, text="Line", command=streamLine)
    B.grid(row=2, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Draw a stream line.')

    # - Stream ribbon -
    B = TTK.Button(Frame, text="Ribbon", command=streamRibbon)
    B.grid(row=2, column=1, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Draw a stream ribbon.')

    # - Stream surface -
    B = TTK.Button(Frame, text="Surface", command=streamSurface)
    B.grid(row=2, column=2, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Draw a stream surface from a BAR.')