def cpacsExport(self, CPACSObj): ''' Export routine for the engine ''' cpacsPath = '/cpacs/vehicles/aircraft/model/engines/engine' myEngine = getObjfromXpath(CPACSObj, cpacsPath) myEngine.set_uID('engine') myEngine.set_symmetry('x-z-plane') myEngine.set_parentUID(stringUIDBaseType(valueOf_="enginePylon")) x = doubleBaseType(valueOf_=str(self.xEngine.getValue())) y = doubleBaseType(valueOf_=str(self.yEngine.getValue())) z = doubleBaseType(valueOf_=str(self.zEngine.getValue())) myTranslation = pointAbsRelType(refType="absGlobal", x=x, y=y, z=z) myTransformation = transformationType(translation=myTranslation) myEngine.set_transformation(myTransformation) # Mass Export Engine Pylon mass = doubleBaseType(valueOf_=str(self.mEngine.getValue())) massIX = doubleBaseType(valueOf_=str(self.massIX.getValue())) massIY = doubleBaseType(valueOf_=str(self.massIY.getValue())) massIZ = doubleBaseType(valueOf_=str(self.massIZ.getValue())) massInertia = massInertiaType(Jxx=massIX, Jyy=massIY, Jzz=massIZ) cpacsPath = '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mPowerUnits' mEngines = getObjfromXpath(CPACSObj, cpacsPath) massDescription = genericMassType(uID='engine_mass', mass=mass, parentUID=stringUIDBaseType(valueOf_="engine"), massInertia=massInertia) mEngines.set_massDescription(massDescription) #call overall export method super(engine, self).cpacsExport(CPACSObj)
def cpacsExport(self, CPACSObj): ''' Export routine for the main and nose landing gear ''' # Main Gear Export cpacsPath = '/cpacs/vehicles/aircraft/model/landingGear/mainGears/mainGear' myMainGear = getObjfromXpath(CPACSObj, cpacsPath) myMainGear.set_parentUID(stringUIDBaseType(valueOf_="fuselage")) myMainGear.set_uID('mainGear') myMainGear.set_symmetry('x-z-plane') # Mass Export Main Landing Gear mass = doubleBaseType(valueOf_=str(self.mLandingGear.getValue())) cpacsPath = '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mLandingGears' myLandingGears = getObjfromXpath(CPACSObj, cpacsPath) massDescription = genericMassType(uID='mainGear_Mass', mass=mass, parentUID=stringUIDBaseType(valueOf_="mainGear")) myRightMainGear = mLandingGearType(massDescription=massDescription) myLandingGears.add_mLandingGear(myRightMainGear) # Nose Gear Export cpacsPath = '/cpacs/vehicles/aircraft/model/landingGear/noseGears/noseGear' myNoseGear = getObjfromXpath(CPACSObj, cpacsPath) myNoseGear.set_parentUID(stringUIDBaseType(valueOf_="fuselage")) myNoseGear.set_uID('noseGear') # Mass Export Nose Landing Gear mass = doubleBaseType(valueOf_=str(self.mNoseGear.getValue())) cpacsPath = '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mLandingGears' myLandingGears = getObjfromXpath(CPACSObj, cpacsPath) massDescription = genericMassType(uID='noseGear_mass', mass=mass, parentUID=stringUIDBaseType(valueOf_="noseGear")) myRightMainGear = mLandingGearType(massDescription=massDescription) myLandingGears.add_mLandingGear(myRightMainGear) #call overall export method super(landingGear, self).cpacsExport(CPACSObj)
def cpacsExport(self, CPACSObj): ''' Export routine for the pylon ''' # pylon cpacsPath = '/cpacs/vehicles/aircraft/model/enginePylons/enginePylon' myPylon = getObjfromXpath(CPACSObj, cpacsPath) myPylon.set_uID('enginePylon') if self.aircraft.engine.location.getValue(): myPylon.set_parentUID(stringUIDBaseType(valueOf_="wing")) else: myPylon.set_parentUID(stringUIDBaseType(valueOf_="fuselage")) # Mass Export Engine Pylon mass = doubleBaseType(valueOf_=str(self.mPylon.getValue())) cpacsPath = '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mPylons' mPylons = getObjfromXpath(CPACSObj, cpacsPath) massDescription = genericMassType(uID='pylon_mass', mass=mass, parentUID=stringUIDBaseType(valueOf_="enginePylon")) mPylons.set_massDescription(massDescription) #call overall export method super(pylon, self).cpacsExport(CPACSObj)