def cpacsImport(self, path='.\\cpacs.xml', TIXIHandle=None, TIGLHandle=None): ''' Overwrites the parameters cpacsImport method! Will get the value for lfus from CPACS via TIGL functions ''' if not TIXIHandle: TIXIHandle = openTIXI(path) if not TIGLHandle: TIGLHandle = openTIGL(TIXIHandle, self.parent.aircraft.modelUID.getValue()) if checkElement(TIXIHandle, '/cpacs/vehicles/aircraft/model/fuselages/fuselage'): # get First Point from the Fuselage x1, y1, z1 = getFuselagePoint(TIGLHandle, 1, 0., 0.) lastSegment = getFuselageSegmentCount(TIGLHandle) x2, y2, z2 = getFuselagePoint(TIGLHandle, lastSegment, 1., 0.) self.setValueFix(x2 - x1) self.importSuccess() else: self.importError()
def cpacsImport(self, path='.\\cpacs.xml', TIXIHandle=None, TIGLHandle=None): ''' Retrieves the xRoot coordinate from TIGL. It will go for the main fuselage. The first sections x coordinate is read at eta and zeta equal 0. ''' if not TIXIHandle: TIXIHandle = openTIXI(path) if not TIGLHandle: TIGLHandle = openTIGL(TIXIHandle, self.parent.aircraft.modelUID.getValue()) if checkElement(TIXIHandle, '/cpacs/vehicles/aircraft/model/fuselages/fuselage'): self.log.debug('Importing fuselage x position...') try: # fuselage index is implicitly set to 1 in TIGL/tigl.py x1, _, _ = getFuselagePoint(TIGLHandle, 1, 0, 0) except Exception as e: self.log.warning(str(e)) self.log.debug('Importing fuselage x position... {}'.format(x1)) self.setValueFix(x1) self.importSuccess() else: self.importError()
def cpacsImport(self, path='.\\cpacs.xml', TIXIHandle=None, TIGLHandle=None): ''' Overwrites the parameters cpacsImport method! Will get the value for lfus from CPACS via TIGL functions ''' if not TIXIHandle: TIXIHandle = openTIXI(path) if not TIGLHandle: TIGLHandle = openTIGL(TIXIHandle, self.parent.aircraft.modelUID.getValue()) if checkElement(TIXIHandle, '/cpacs/vehicles/aircraft/model/fuselages/fuselage'): # get First Point from the Fuselage x1, y1, z1 = getFuselagePoint(TIGLHandle, 1, 0., 0.) lastSegment = getFuselageSegmentCount(TIGLHandle) x2, y2, z2 = getFuselagePoint(TIGLHandle, lastSegment, 1., 0.) self.setValueFix(x2 - x1) self.importSuccess() else: self.importError()
def cpacsImport(self, path='.\\cpacs.xml', TIXIHandle=None, TIGLHandle=None): ''' Retrieves the xRoot coordinate from TIGL. It will go for the main fuselage. The first sections x coordinate is read at eta and zeta equal 0. ''' if not TIXIHandle: TIXIHandle = openTIXI(path) if not TIGLHandle: TIGLHandle = openTIGL(TIXIHandle, self.parent.aircraft.modelUID.getValue()) if checkElement(TIXIHandle, '/cpacs/vehicles/aircraft/model/fuselages/fuselage'): self.log.debug('Importing fuselage x position...') try: # fuselage index is implicitly set to 1 in TIGL/tigl.py x1, _, _ = getFuselagePoint(TIGLHandle, 1, 0, 0) except Exception as e: self.log.warning(str(e)) self.log.debug('Importing fuselage x position... {}'.format(x1)) self.setValueFix(x1) self.importSuccess() else: self.importError()