示例#1
0
def createFuselageSections(parent, nose,cabin,tail, dfus, strUID, strName, strDescr):
    '''
    Used for generation of fuselage Sections.
    Creates all the sections given through myRQSi.
    @author: Jonas Jepsen
    @param parent: fuselageType object, Sections-object will be added here
    @param confList: cross Sections from PrADO for section configurations
    @param strUID:  UID of Sections [string]
    @param strName: Name of Sections [string]
    @param strDescr: Description of Sections [string]
    '''
    mySections = fuselageSectionsType()
    # countAll counts the total amount of cross sections for this fuselage
    countAll = 0
    for cs in nose:
        countAll += 1
        # create Section
        createFuselageSection(mySections, dfus, cs, 'Circle', strUID+'_Sec'+str(countAll), strName+'_Sec'+str(countAll), strDescr+'_Sec'+str(countAll))
    for cs in cabin:
        countAll += 1
        # create Section
        createFuselageSection(mySections, dfus, cs, 'Circle', strUID+'_Sec'+str(countAll), strName+'_Sec'+str(countAll), strDescr+'_Sec'+str(countAll))
    for cs in tail:
        countAll += 1
        # create Section
        createFuselageSection(mySections, dfus, cs, 'Circle', strUID+'_Sec'+str(countAll), strName+'_Sec'+str(countAll), strDescr+'_Sec'+str(countAll))
        
    parent.set_sections(mySections)
示例#2
0
def createFuselage(CPACSObj, id, dfus, lnose, lcabin, ltail, LoD=0):
    # just for now
    if LoD==FUSE_LOD.NONE:
        return

    cpacsPath = '/cpacs/vehicles/aircraft/model/fuselages/fuselage[' + id + ']'
    # the next line is the one to use later on
    #cpacsPath = '/cpacs/vehicles/aircraft/model[model]/fuselages/fuselage[' + self.id + ']'
    # gets a list of all wing elements
    myFuse = getObjfromXpath(CPACSObj,cpacsPath)
    
    strUID       = myFuse.get_uID()
    myUID        = strUID
    myName       = stringBaseType(valueOf_=id)
    myDescr      = stringBaseType(valueOf_=strUID)
    myFuse.set_uID(myUID)
    myFuse.set_name(myName)
    myFuse.set_description(myDescr)
    
    createTransformation(myFuse, 'absGlobal',0.,0.,0.)
    
    if LoD==FUSE_LOD.A320:
        nose = list(NOSE)
        cabin = list(CABIN)
        tail = list(TAIL)
        # remove double values
        cabin.pop(0)
        tail.pop(0)
        # sections will be created, all existing sections will be deleted
        createFuselageSections(myFuse, nose,cabin,tail, dfus, strUID, strUID, strUID)
        createFuselagePositionings(myFuse, nose,cabin,tail, lnose,lcabin,ltail, strUID, strUID)
        
        createFuselageSegments(myFuse, strUID, len(nose)+len(cabin)+len(tail)-1)
    
    elif LoD==FUSE_LOD.ZYL:
        # sections will be created, all existing sections will be deleted
        mySections = fuselageSectionsType()
        #calc fuselage radius
        #rfus = dfus/2.
        # make fuselage configuration data [x_rel,z-dist,height/2,width/2]]
        fuseConf = [0.,0.,0.5,0.5]
        createFuselageSection(mySections, dfus, fuseConf, 'Circle', strUID+'_Sec1', strUID+'_Sec1', strUID+'_Sec1')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle', strUID+'_Sec2', strUID+'_Sec2', strUID+'_Sec2')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle', strUID+'_Sec3', strUID+'_Sec3', strUID+'_Sec3')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle', strUID+'_Sec4', strUID+'_Sec4', strUID+'_Sec4')
        myFuse.set_sections(mySections)
                
        myPositionings = positioningsType()
        createPositioning(myPositionings,str(id) + '_Pos1',None, str(id) + '_Sec1',0.,90.,0.,id + '_Pos1')
        createPositioning(myPositionings,str(id) + '_Pos2',str(id) + '_Sec1',str(id) + '_Sec2',lnose,90.,0,id + '_Pos2')
        createPositioning(myPositionings,str(id) + '_Pos3',str(id) + '_Sec2',str(id) + '_Sec3',lcabin,90.,0,id + '_Pos3')
        createPositioning(myPositionings,str(id) + '_Pos4',str(id) + '_Sec3',str(id) + '_Sec4',ltail,90.,0,id + '_Pos4')
        myFuse.set_positionings(myPositionings)
        
        createFuselageSegments(myFuse, strUID, 3)
示例#3
0
def createFuselageSections(parent, nose, cabin, tail, dfus, strUID, strName,
                           strDescr):
    '''
    Used for generation of fuselage Sections.
    Creates all the sections given through myRQSi.
    @author: Jonas Jepsen
    @param parent: fuselageType object, Sections-object will be added here
    @param confList: cross Sections from PrADO for section configurations
    @param strUID:  UID of Sections [string]
    @param strName: Name of Sections [string]
    @param strDescr: Description of Sections [string]
    '''
    mySections = fuselageSectionsType()
    # countAll counts the total amount of cross sections for this fuselage
    countAll = 0
    for cs in nose:
        countAll += 1
        # create Section
        createFuselageSection(mySections, dfus, cs, 'Circle',
                              strUID + '_Sec' + str(countAll),
                              strName + '_Sec' + str(countAll),
                              strDescr + '_Sec' + str(countAll))
    for cs in cabin:
        countAll += 1
        # create Section
        createFuselageSection(mySections, dfus, cs, 'Circle',
                              strUID + '_Sec' + str(countAll),
                              strName + '_Sec' + str(countAll),
                              strDescr + '_Sec' + str(countAll))
    for cs in tail:
        countAll += 1
        # create Section
        createFuselageSection(mySections, dfus, cs, 'Circle',
                              strUID + '_Sec' + str(countAll),
                              strName + '_Sec' + str(countAll),
                              strDescr + '_Sec' + str(countAll))

    parent.set_sections(mySections)
示例#4
0
def createFuselage(CPACSObj, id, dfus, lnose, lcabin, ltail, LoD=0):
    # just for now
    if LoD == FUSE_LOD.NONE:
        return

    cpacsPath = '/cpacs/vehicles/aircraft/model/fuselages/fuselage[' + id + ']'
    # the next line is the one to use later on
    #cpacsPath = '/cpacs/vehicles/aircraft/model[model]/fuselages/fuselage[' + self.id + ']'
    # gets a list of all wing elements
    myFuse = getObjfromXpath(CPACSObj, cpacsPath)

    strUID = myFuse.get_uID()
    myUID = strUID
    myName = stringBaseType(None, None, None, id)
    myDescr = stringBaseType(None, None, None, strUID)
    myFuse.set_uID(myUID)
    myFuse.set_name(myName)
    myFuse.set_description(myDescr)

    createTransformation(myFuse, 'absGlobal', 0., 0., 0.)

    if LoD == FUSE_LOD.A320:
        nose = list(NOSE)
        cabin = list(CABIN)
        tail = list(TAIL)
        # remove double values
        cabin.pop(0)
        tail.pop(0)
        # sections will be created, all existing sections will be deleted
        createFuselageSections(myFuse, nose, cabin, tail, dfus, strUID, strUID,
                               strUID)
        createFuselagePositionings(myFuse, nose, cabin, tail, lnose, lcabin,
                                   ltail, strUID, strUID)

        createFuselageSegments(myFuse, strUID,
                               len(nose) + len(cabin) + len(tail) - 1)

    elif LoD == FUSE_LOD.ZYL:
        # sections will be created, all existing sections will be deleted
        mySections = fuselageSectionsType()
        #calc fuselage radius
        #rfus = dfus/2.
        # make fuselage configuration data [x_rel,z-dist,height/2,width/2]]
        fuseConf = [0., 0., 0.5, 0.5]
        createFuselageSection(mySections, dfus, fuseConf, 'Circle',
                              strUID + '_Sec1', strUID + '_Sec1',
                              strUID + '_Sec1')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle',
                              strUID + '_Sec2', strUID + '_Sec2',
                              strUID + '_Sec2')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle',
                              strUID + '_Sec3', strUID + '_Sec3',
                              strUID + '_Sec3')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle',
                              strUID + '_Sec4', strUID + '_Sec4',
                              strUID + '_Sec4')
        myFuse.set_sections(mySections)

        myPositionings = positioningsType()
        createPositioning(myPositionings,
                          str(id) + '_Pos1', None,
                          str(id) + '_Sec1', 0., 90., 0., id + '_Pos1')
        createPositioning(myPositionings,
                          str(id) + '_Pos2',
                          str(id) + '_Sec1',
                          str(id) + '_Sec2', lnose, 90., 0, id + '_Pos2')
        createPositioning(myPositionings,
                          str(id) + '_Pos3',
                          str(id) + '_Sec2',
                          str(id) + '_Sec3', lcabin, 90., 0, id + '_Pos3')
        createPositioning(myPositionings,
                          str(id) + '_Pos4',
                          str(id) + '_Sec3',
                          str(id) + '_Sec4', ltail, 90., 0, id + '_Pos4')
        myFuse.set_positionings(myPositionings)

        createFuselageSegments(myFuse, strUID, 3)