• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python uictrl.element函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中uictrl.element函数的典型用法代码示例。如果您正苦于以下问题:Python element函数的具体用法?Python element怎么用?Python element使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了element函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: rotate

    def rotate(self,idgrp):
        lbl_vec=_(u"Vector of rotation (m)")
        lbl_angle=_(u"Angle of rotation (degrees)")
        lbl_rotation_pos=_(u"Rotation center (m)")

        #on recupere le groupe des rp
        rpgroup=ui.element(idgrp)
        #on recupere tout les indices des rp déjà existante
        rplst=rpgroup.getallelementbytype(ui.element_type.ELEMENT_TYPE_SCENE_RECEPTEURSP_RECEPTEUR)
        centregroup=vec3()
        for rp in rplst:
            rpEl=ui.element(rp)
            #On recupere la position du récepteur ponctuel
            centregroup+=vec3(rpEl.getpositionconfig("pos_recepteur"))
        centregroup/=len(rplst)
        res=ui.application.getuserinput(_(u"Rotation of a group of receivers"),
                                    "",
                                    { lbl_vec : "[0.,0.,1.]",
                                      lbl_angle : "90",
                                      lbl_rotation_pos : str(centregroup)
                                        })
        if res[0]:
            try:
                vecrotation=vec3(eval(res[1][lbl_vec]))
                anglerotation=float(res[1][lbl_angle])
                centregroup=vec3(eval(res[1][lbl_rotation_pos]))
            except:
                print(_(u"Wrong parameters"),file=sys.stderr)
                return
            for rp in rplst:
                rpEl=ui.element(rp)
                rotatedpos=vec3(rpEl.getpositionconfig("pos_recepteur"))-centregroup
                rotatedpos=rotatedpos.rotate(vecrotation,math.radians(anglerotation))+centregroup
                rpEl.updatepositionconfig("pos_recepteur",[rotatedpos.x,rotatedpos.y,rotatedpos.z])
开发者ID:Ezio47,项目名称:I-Simpa,代码行数:34,代码来源:__init__.py


示例2: translate

 def translate(self,idgrp):
     lbl_vecx=_(u"Direction x (m)")
     lbl_vecy=_(u"Direction y (m)")
     lbl_vecz=_(u"Direction z (m)")
     res=ui.application.getuserinput(_(u"Translation of a group of receivers"),
                                     _(u"Please enter the coordinates of the translation vector"),
                                 { lbl_vecx : "1.",
                                   lbl_vecy : "0.",
                                   lbl_vecz : "0.",
                                     })
     if res[0]:
         try:
             vectranslation=vec3(float(res[1][lbl_vecx]),float(res[1][lbl_vecy]),float(res[1][lbl_vecz]))
         except:
             print(_(u"Wrong parameters"),file=sys.stderr)
             return
         #on recupere le groupe des rp
         rpgroup=ui.element(idgrp)
         #on recupere tout les indices des rp déjà existante
         rplst=rpgroup.getallelementbytype(ui.element_type.ELEMENT_TYPE_SCENE_RECEPTEURSP_RECEPTEUR)
         for rp in rplst:
             rpEl=ui.element(rp)
             #On recupere la position du rp
             posrecp = rpEl.getpositionconfig("pos_recepteur")
             newpos=vec3(posrecp[0], posrecp[1], posrecp[2])+vectranslation
             rpEl.updatepositionconfig("pos_recepteur",[newpos[0],newpos[1],newpos[2]])
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:26,代码来源:__init__.py


示例3: translate_src

 def translate_src(self,idgrp):
     lbl_vecx=_(u"Direction x (m)")
     lbl_vecy=_(u"Direction y (m)")
     lbl_vecz=_(u"Direction z (m)")
     res=ui.application.getuserinput(_(u"Translation of a group of sound sources"),
                                 "",
                                 { lbl_vecx : "1",
                                 lbl_vecy : "0",
                                 lbl_vecz : "0"
                                     })
     if res[0]:
         try:
             vectranslation=vec3(float(res[1][lbl_vecx]), float(res[1][lbl_vecy]), float(res[1][lbl_vecz]))
         except ValueError:
             print(_(u"Wrong parameters"),file=sys.stderr)
             return
         #on recupere le groupe des sources
         srcgroup=ui.element(idgrp)
         #on recupere tout les indices des sources déjà existante
         srclst=srcgroup.getallelementbytype(ui.element_type.ELEMENT_TYPE_SCENE_SOURCES_SOURCE)
         for src in srclst:
             sourceEl=ui.element(src)
             #On recupere la position de la source
             pos_source = sourceEl.getpositionconfig("pos_source")
             newpos=vec3(pos_source[0], pos_source[1], pos_source[2])+vectranslation
             sourceEl.updatepositionconfig("pos_source",[newpos[0],newpos[1],newpos[2]])
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:26,代码来源:__init__.py


示例4: GetMixedLevel

def GetMixedLevel(folderwxid):
    """
     Retourne un tableau contenant le niveau sonore global et toute bande des récepteurs ponctuels d'un dossier
     folderwxid identifiant wxid de l'élément dossier contenant les récepteurs ponctuels.
    """
    cols = []
    # folder devient l'objet dossier
    folder = ui.element(folderwxid)
    # dans un tableau on place les indices des fichiers de données des récepteurs ponctuels
    recplist = folder.getallelementbytype(ui.element_type.ELEMENT_TYPE_REPORT_GABE_RECP)
    # Pour chaque récepteur on demande à l'application les données traitées du fichier (niveau sonore et cumuls)
    for idrecp in recplist:
        # recp devient l'objet ayant comme indice idrecp (entier)
        recp = ui.element(idrecp)
        if recp.getinfos()["name"] == "soundpressure":
            # on demande le calcul des paramètres sonores
            ui.application.sendevent(
                recp, ui.idevent.IDEVENT_RECP_COMPUTE_ACOUSTIC_PARAMETERS, {"TR": "15;30", "EDT": "", "D": ""}
            )
            # on recupere l'element parent (le dossier de récepteur ponctuel)
            pere = ui.element(recp.getinfos()["parentid"])
            # application.sendevent(pere,idevent.IDEVENT_RELOAD_FOLDER)
            nomrecp = pere.getinfos()["label"]
            # on recupere les données calculées
            params = ui.element(pere.getelementbylibelle("acoustic_param"))
            # on stocke dans gridspl le tableau des niveaux de pression
            gridparam = ui.application.getdataarray(params)
            # on ajoute la colonne
            if len(cols) == 0:  # si le tableau de sortie est vide alors on ajoute les libellés des lignes
                cols.append(list(zip(*gridparam)[0]))  # libellé Freq et Global
            idcol = gridparam[0].index("EDT (s)")  # Changer le paramètre par celui pour lequel on veut la fusion
            cols.append(
                [nomrecp] + list(zip(*gridparam)[idcol][1:])
            )  # 1ere colonne, (0 etant le libellé des lignes) et [1:] pour sauter la premiere ligne
    return cols
开发者ID:JulianYu123456,项目名称:I-Simpa,代码行数:35,代码来源:__init__.py


示例5: dofusion

def dofusion(folderwxid, path):
    arraydata = GetMixedLevel(folderwxid)
    SaveLevel(zip(*arraydata), path)
    # raffraichie l'arbre complet
    ui.application.sendevent(
        ui.element(ui.element(ui.application.getrootreport()).childs()[0][0]), ui.idevent.IDEVENT_RELOAD_FOLDER
    )
开发者ID:JulianYu123456,项目名称:I-Simpa,代码行数:7,代码来源:__init__.py


示例6: GetCurrentProjectPath

def GetCurrentProjectPath():
    projconfel = ui.element(
        ui.element(ui.application.getrootscene()).getelementbytype(
            ui.element_type.ELEMENT_TYPE_SCENE_PROJET_CONFIGURATION
        )
    )
    return projconfel.getstringconfig("urlsave")
开发者ID:JulianYu123456,项目名称:I-Simpa,代码行数:7,代码来源:__init__.py


示例7: modified

 def modified(self,idelmodified):
     #Le mode de calcul stationnaire n'a pas besoin des paramètres de pas de temps ni de durée
     if ui.element(idelmodified).getinfos()["name"]=="solver_mode":
         #le mode de calcul a été modifié par l'utilisateur
         elconf=ui.element(self.getelementbytype(ui.element_type.ELEMENT_TYPE_CORE_CORE_CONFIG))
         is_temporel=(elconf.getlistconfig("solver_mode")==0)
         elconf.setreadonlyconfig("duree_simulation",not is_temporel)
         elconf.setreadonlyconfig("pasdetemps",not is_temporel)
     ui.element.modified(self,idelmodified)
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:9,代码来源:__init_.py


示例8: __init__

    def __init__(self,idel):
		#Initialisation de l'élément
        ui.element.__init__(self,idel)
        
        if not self.hasproperty("exeName"): #La propriété n'existe pas s'il s'agit d'un nouveau projet, elle existe si le projet est chargé
            #Création des paramètres du maillage tetgen, ne pas le faire si le calcul n'a pas besoin de maillage tétraèdrique
            self.appendfilsbytype(ui.element_type.ELEMENT_TYPE_CORE_CORE_CONFMAILLAGE)
			#Ajout de la sélection des bandes de fréquences, ne pas le faire si c'est inutile
            self.appendfilsbytype(ui.element_type.ELEMENT_TYPE_CORE_CORE_BFREQSELECTION)
			#Ajout du noeud de configuration, qui contient par défaut les propriétés de pas de temps et de durée de simulation
            coreconf=ui.element(self.appendfilsbytype(ui.element_type.ELEMENT_TYPE_CORE_CORE_CONFIG))
			####
			#Ces propriétés sont nécessaire pour que I-SIMPA connaisse les fichiers relatifs au code de calcul
			#Nom et format du modèle 3D
            ui.element(self.appendpropertytext("modelName","","mesh.cbin",True,True)).hide()
			#Nom du maillage tétraèdrique
            ui.element(self.appendpropertytext("tetrameshFileName","","tetramesh.mbin",True,True)).hide()
			#Nom et type (exe,py ou pyc) du fichier executable
            ui.element(self.appendpropertytext("exeName","","user_core")).hide()
            ui.element(self.appendpropertytext("corePath","","usercore\\")).hide()
            
            #Création des paramètres de calculs
            coreconf.appendpropertylist("solver_mode",_("Mode de calcul"),[[_("Temporel"),_("Stationnaire")],[0,1]],0,False,1,True)
        else:
            #Chargement d'un projet existant
            pass
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:26,代码来源:__init_.py


示例9: __init__

 def __init__(self,idel):
     ui.element.__init__(self,idel)
     #Ce code de calcul a surement des propriétés
     #Il faut les créer(nouveau projet) ou les mettre à jour (chargement) ici
     
     if not self.hasproperty("exeName"): #Nouveau projet
         #Création des paramètre du maillage tetgen
         self.appendfilsbytype(ui.element_type.ELEMENT_TYPE_CORE_CORE_CONFMAILLAGE)
         self.appendfilsbytype(ui.element_type.ELEMENT_TYPE_CORE_CORE_BFREQSELECTION)
         coreconf=ui.element(self.appendfilsbytype(ui.element_type.ELEMENT_TYPE_CORE_CORE_CONFIG))
         ui.element(self.appendpropertytext("modelName","","mesh.cbin",True,True)).hide()
         ui.element(self.appendpropertytext("tetrameshFileName","","tetramesh.mbin",True,True)).hide()
         ui.element(self.appendpropertytext("exeName","","md.py")).hide()
         ui.element(self.appendpropertytext("corePath","","md\\")).hide()
         
         #Création des paramètres de calculs
         coreconf.appendpropertylist("solver_mode","Mode de calcul",[["Temporel","Stationnaire"],[0,1]],0,False,1,True)
         coreconf.appendpropertybool("with_direct_sound","Fusion avec le champ direct",True,True)
         _("Fusion avec le champ direct")
         _("Mode de calcul")
         _("Temporel")
         _("Stationnaire")
         
         
     else:
         #Chargement d'un projet existant
         if self.getstringconfig("corePath")=="md_trans\\":
             self.updatestringconfig("corePath","md\\")
开发者ID:JimmyFarcy,项目名称:I-Simpa,代码行数:28,代码来源:__init__.py


示例10: getmenu

 def getmenu(self,typeel,idel,menu):
     #Si le pere de l'element se nomme SPPS
     el=ui.element(idel)
     infos=el.getinfos()
     if infos["parentid"]>0:
         parent=ui.element(infos["parentid"])
         if parent.getinfos()["label"]=="SPPS" or parent.getinfos()["label"]==u"Diffusion model":
             menu.insert(0,(_("Make report"),self.MakeReportEventId))
             return True
         else:
             return False
     return False
开发者ID:Ezio47,项目名称:I-Simpa,代码行数:12,代码来源:__init__.py


示例11: onmovetoothergroup

 def onmovetoothergroup(self,elid):
     #On stocke les groupes de surfaces du projet
     rootscene=ui.element(ui.application.getrootscene())
     rootgroups=ui.element(rootscene.getelementbytype(ui.element_type.ELEMENT_TYPE_SCENE_GROUPESURFACES))
     maingroupchildlist=rootgroups.childs()
     listgroups=[(elname,idelement) for idelement,eltype,elname in maingroupchildlist]
     input_lbl=_(u"Label")
     input_values=[ elname for elname,idelement in listgroups]
     dialog_res=ui.application.getuserinput(_(u"Move faces"),_(u"(Please select the group of destination:"),{ input_lbl : input_values})
     if dialog_res[0]==True:
         ideldest=listgroups[input_values.index(dialog_res[1][input_lbl])][1]
         ui.application.dropselectionto(ui.element(ideldest))
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:12,代码来源:__init__.py


示例12: GetMixedLevel

def GetMixedLevel(folderwxid):
    """
     Retourne un tableau contenant le niveau sonore global et toute bande des récepteurs ponctuels d'un dossier
     folderwxid identifiant wxid de l'élément dossier contenant les récepteurs ponctuels.
    """
    i_cols=[]
    myfrequency_labels=[]
    #folder devient l'objet dossier
    recplist=[]
    folder=ui.element(folderwxid)
    # retrieve computation result main folder location
    folderpath = ui.e_file(folder.getinfos()["parentid"]).buildfullpath()
    recpPosition = extractReceiverPositionFromXml(os.path.join(folderpath, 'config.xml'))
    
    for child in folder.childs():
        if child[1]==ui.element_type.ELEMENT_TYPE_REPORT_FOLDER:
            recplist.append(child[0])
    #Pour chaque récepteur on demande a l'application les données traitées du fichier ( niveau sonore et cumuls )
    intensityElements = {}
    for idrecp in recplist:
        #recp devient l'objet ayant comme indice idrecp (entier)
        parent=ui.element(idrecp)
        #application.sendevent(pere,idevent.IDEVENT_RELOAD_FOLDER)
        receiverName=parent.getinfos()["label"]
        #on recupere les données calculées
        elid = parent.getelementbylibelle('Punctual receiver intensity')
        if elid != -1:
            intensity=ui.element(elid)
            intensityElements[receiverName] = intensity
            
            
    for receiverInfo in recpPosition:
        receiverName, rx, ry, rz = receiverInfo
        if receiverName in intensityElements:
            intensity = intensityElements[receiverName]
            #on stocke dans gridspl le tableau des niveaux de pression
            gridparam=ui.application.getdataarray(intensity)
            values=gridparam[-1][1:]
            #retrieve the last row
            if len(myfrequency_labels)==0:
                myfrequency_labels=list(gridparam[0][1:])
                myfrequency_labels.insert(0, "z")
                myfrequency_labels.insert(0, "y")
                myfrequency_labels.insert(0, "x")
                myfrequency_labels.insert(0, "")
            myReceiverRow = [receiverName,rx,ry,rz]
            for idxyz in range(len(values)):
                I=values[idxyz]*1
                myReceiverRow.append(I)
            i_cols.append(myReceiverRow)
    i_cols.insert(0,myfrequency_labels)
    return i_cols
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:52,代码来源:__init__.py


示例13: rotate_src

 def rotate_src(self,idgrp):
     lbl_vecx=_(u"Vector of rotation x (m)")
     lbl_vecy=_(u"Vector of rotation y (m)")
     lbl_vecz=_(u"Vector of rotation z (m)")
     lbl_angle=_(u"Angle (degrees)")
     lbl_rotation_posx=_(u"Rotation center x (m)")
     lbl_rotation_posy=_(u"Rotation center y (m)")
     lbl_rotation_posz=_(u"Rotation center z (m)")
     ##Evaluation du centre de rotation
     #on recupere le groupe des sources
     srcgroup=ui.element(idgrp)
     #on recupere tout les indices des sources déjà existante
     srclst=srcgroup.getallelementbytype(ui.element_type.ELEMENT_TYPE_SCENE_SOURCES_SOURCE)
     centregroup=vec3()
     for src in srclst:
         sourceEl=ui.element(src)
         #On recupere la position de la source
         pos = sourceEl.getpositionconfig("pos_source")
         centregroup+=vec3(pos[0], pos[1], pos[2])
     centregroup/=len(srclst)
     
     res=ui.application.getuserinput(_(u"Rotation of a group of sound sources"),
                                 "",
                                 { lbl_vecx : "0",
                                 lbl_vecy : "0",
                                 lbl_vecz : "1",
                                   lbl_angle : "90",
                                   lbl_rotation_posx : str(centregroup[0]),
                                   lbl_rotation_posy : str(centregroup[1]),
                                   lbl_rotation_posz : str(centregroup[2])
                                     })
     if res[0]:
         vecrotation = vec3()
         try:
             vecrotation=vec3(float(res[1][lbl_vecx]), float(res[1][lbl_vecy]), float(res[1][lbl_vecz]))
             anglerotation=float(res[1][lbl_angle])
             centregroup=vec3(float(res[1][lbl_rotation_posx]), float(res[1][lbl_rotation_posy]), float(res[1][lbl_rotation_posz]))
         except:
             print(_(u"Wrong parameters"),file=sys.stderr)
             return
         #on recupere le groupe des sources
         srcgroup=ui.element(idgrp)
         #on recupere tout les indices des sources déjà existante
         srclst=srcgroup.getallelementbytype(ui.element_type.ELEMENT_TYPE_SCENE_SOURCES_SOURCE)
         for src in srclst:
             sourceEl=ui.element(src)
             pos_source = sourceEl.getpositionconfig("pos_source")
             rotatedpos=vec3(pos_source[0], pos_source[1], pos_source[2])-centregroup
             rotatedpos=rotatedpos.Rotation(vecrotation,math.radians(anglerotation))+centregroup
             sourceEl.updatepositionconfig("pos_source",[rotatedpos[0],rotatedpos[1], rotatedpos[2]])
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:50,代码来源:__init__.py


示例14: align_on_same_point

 def align_on_same_point(self,idel):
     
     lbl_topt=_(u"Orienter vers [x,y,z]")
     res=ui.application.getuserinput(_(u"Orienter un groupe de récepteur vers un point dans l'espace."),
                                 _(u"Veuillez saisir les coordonnées du point d'orientation."),
                                 { lbl_topt : "[0.,0.,0.]"
                                     })
     if res[0]:
         grprecp=ui.element(idel)
         recplst=grprecp.getallelementbytype(ui.element_type.ELEMENT_TYPE_SCENE_RECEPTEURSP_RECEPTEUR)
         topt=eval(res[1][lbl_topt])
         for recpid in recplst:
             recp=ui.element(recpid)
             recp.updatepositionconfig("direction_dot",topt)
开发者ID:JimmyFarcy,项目名称:I-Simpa,代码行数:14,代码来源:__init__.py


示例15: align_on_same_point

 def align_on_same_point(self,idel):
     
     lbl_topt=_(u"Orient to position [x,y,z]")
     res=ui.application.getuserinput(_(u"Orient a group of receivers to a point"),
                                 _(u"Please enter the coordinates of the orientation point"),
                                 { lbl_topt : "[0.,0.,0.]"
                                     })
     if res[0]:
         grprecp=ui.element(idel)
         recplst=grprecp.getallelementbytype(ui.element_type.ELEMENT_TYPE_SCENE_RECEPTEURSP_RECEPTEUR)
         topt=eval(res[1][lbl_topt])
         for recpid in recplst:
             recp=ui.element(recpid)
             recp.updatepositionconfig("direction_dot",topt)
开发者ID:Ezio47,项目名称:I-Simpa,代码行数:14,代码来源:__init__.py


示例16: OnSourceLabelChange

 def OnSourceLabelChange(self,idsource):
     if idsource == self.srcid:
         newlblsrc=ui.element(idsource).getinfos()["name"]
         if newlblsrc!=self.srclbl:
             self.srclbl=newlblsrc
             try:
                 receiver=ui.element(self.receiverid)
                 if not self.isPositionTracker:
                     dir=ui.element(receiver.getelementbylibelle("direction_dot"))
                 else:
                     dir=ui.element(receiver.getelementbylibelle("pos_recepteur"))
                 dir.updatestringconfig("linkedsource",ui.element(idsource).getinfos()["name"])
             except:
                 self.sourceposid=-1 #le recepteur n'existe plus
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:14,代码来源:__init__.py


示例17: LinkSourcePositionWithReceiverOrientation

def LinkSourcePositionWithReceiverOrientation(sourceId,ReceiverId):
    #Il faut ajouter un indice dans l'element de propriete de direction du recepteur ponctuel afin de retrouver la source au prochaine chargement du projet
    receiver=ui.element(ReceiverId)
    source=ui.element(sourceId)
    posel=ui.element(receiver.getelementbylibelle("direction_dot"))
    if(posel.hasproperty("linkedsource")):
        #Mettre a jour la propriete
        posel.updatestringconfig("linkedsource",source.getinfos()["name"])
    else:
        #Ajouter la propriete
        ui.element(posel.appendpropertytext("linkedsource","linkedsource",source.getinfos()["name"])).hide()
    if not SourcePosTrackerLst.has_key(ReceiverId):
        SourcePosTrackerLst[ReceiverId]=PositionUpdater(ReceiverId)
    else:
        SourcePosTrackerLst[ReceiverId].UpdateLinker()
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:15,代码来源:__init__.py


示例18: OnSourcePositionChange

 def OnSourcePositionChange(self,idsourcepos):
     if(self.sourceposid==idsourcepos):
         try:
             source=ui.element(ui.element(idsourcepos).getinfos()["parentid"])
             recp=ui.element(self.receiverid)
             if not self.isPositionTracker:
                 recp.updatepositionconfig("direction_dot",source.getpositionconfig("pos_source"))
             else:
                 recp_pos=recp.getpositionconfig("pos_recepteur")
                 new_source_pos=source.getpositionconfig("pos_source")
                 new_recppos=[recp_pos[i]-self.old_src_pos[i]+new_source_pos[i] for i in range(3)]
                 recp.updatepositionconfig("pos_recepteur",new_recppos)
                 self.old_src_pos=new_source_pos
         except:
             self.sourceposid=-1 #le recepteur n'existe plus
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:15,代码来源:__init__.py


示例19: getmenu

 def getmenu(self,typeel,idel,menu):
     #On ajoute la fonction seulement si il s'agit de la position d'un récepteur ponctuel
     infoEl=ui.element(idel).getinfos()
     infoParent=ui.element(infoEl["parentid"]).getinfos()
     if infoParent["typeElement"]==ui.element_type.ELEMENT_TYPE_SCENE_RECEPTEURSP_RECEPTEUR:
         if infoEl["name"]==u"direction_dot":
             menu.insert(1,(_(u"Link to a source:"),self.linkWithSourcePositionEventId))
             if ui.element(idel).hasproperty("linkedsource"):
                 
                 menu.insert(1,(_(u"Delete the link with the source"),self.unlinkReceiverDirEventId))
             return True
         elif infoEl["name"]==u"pos_recepteur":
             menu.insert(1,(_(u"Please choose the source:"),self.linkPositionWithSourcePositionEventId))
             #todo tester si la position du récepteur est déjà lié a une source
             return True
     return False
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:16,代码来源:__init__.py


示例20: LinkSourcePositionWithReceiverPosition

def LinkSourcePositionWithReceiverPosition(sourceId,ReceiverId):
    #Il faut ajouter les coordonnées X,Y,Z de décalage avec la source
    #Ainsi que le nom de la source dans cette propriété
    receiver=ui.element(ReceiverId)
    source=ui.element(sourceId)
    posel=ui.element(receiver.getelementbylibelle("pos_recepteur"))
    if(posel.hasproperty("linkedsource")):
        #Mettre a jour la propriete
        posel.updatestringconfig("linkedsource",source.getinfos()["name"])  
    else:
        #Ajouter la propriete
        ui.element(posel.appendpropertytext("linkedsource","linkedsource",source.getinfos()["name"])).hide() 
    if not SourcePosToReceiverPosTrackerLst.has_key(ReceiverId):
        SourcePosToReceiverPosTrackerLst[ReceiverId]=PositionUpdater(ReceiverId,True)
    else:
        SourcePosToReceiverPosTrackerLst[ReceiverId].UpdateLinker()    
开发者ID:JimmyFarcy,项目名称:I-Simpa,代码行数:16,代码来源:__init__.py



注:本文中的uictrl.element函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python calc.enter_text_to_cell函数代码示例发布时间:2022-05-27
下一篇:
Python device.swipe函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap