def cpacsImport(self, path='.\\cpacs.xml', TIXIHandle=None, TIGLHandle=None): ''' Imports the quarter chord sweep angle of the htp from TIGL. It takes the htp's first and last section and reads y and y coordinates and from these calculates the htp sweep. ''' wingIndex = 2 if not TIXIHandle: TIXIHandle = openTIXI(path) if not TIGLHandle: TIGLHandle = openTIGL(TIXIHandle, self.parent.aircraft.modelUID.getValue()) lastSeg = getWingSegmentCount(TIGLHandle, wingIndex) if checkElement(TIXIHandle, '/cpacs/vehicles/aircraft/model/wings/wing[2]'): x1, y1, z1 = getWingUpperPoint(TIGLHandle, wingIndex, 1, 0., 0.25) x2, y2, z2 = getWingUpperPoint(TIGLHandle, wingIndex, lastSeg, 1., 0.25) #Length of the hypothenuse so we do not need atan h = sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2) self.setValueFix(asin((x2 - x1) / h) / rad) else: self.importError()
def cpacsImport(self, path='.\\cpacs.xml', TIXIHandle=None, TIGLHandle=None): ''' Overwrites the parameters cpacsImport method! Will get the value for the htp span 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/wings/wing[2]'): #get First Point from the WingRoot wingIndex = 2 x1, y1, z1 = getWingUpperPoint(TIGLHandle, wingIndex, 1, 0, 0) lastSegment = getWingSegmentCount(TIGLHandle, wingIndex) x2, y2, z2 = getWingUpperPoint(TIGLHandle, wingIndex, lastSegment, 1, 0) #todo: cpacsImport span: prototype version taking leading Edge Points self.setValueFix((y2 - y1) * 2.) 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 wingSpan 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/wings/wing'): #get First Point from the WingRoot wingIndex = 1 x1, y1, z1 = getWingUpperPoint(TIGLHandle, wingIndex, 1, 0, 0) lastSegment = getWingSegmentCount(TIGLHandle, wingIndex) x2, y2, z2 = getWingUpperPoint(TIGLHandle, wingIndex, lastSegment, 1, 0) #todo: cpacsImport span: prototype version taking leading Edge Points self.setValueFix((y2 - y1) * 2.) self.importSuccess() else: self.importError()
def calcRootLength(tiglHandle, wingIndex): ''' Calculates the length of the root section chord ''' x1, y1, z1 = getWingUpperPoint(tiglHandle, wingIndex, 1, 0, 0) x2, y2, z2 = getWingUpperPoint(tiglHandle, wingIndex, 1, 0, 1) return pointDistance(x1, y1, z1, x2, y2, z2)
def calcRootLength(tiglHandle, wingIndex): """ Calculates the length of the root section chord """ x1, y1, z1 = getWingUpperPoint(tiglHandle, wingIndex, 1, 0, 0) x2, y2, z2 = getWingUpperPoint(tiglHandle, wingIndex, 1, 0, 1) return pointDistance(x1, y1, z1, x2, y2, z2)
def calcTipLength(tiglHandle, wingIndex): ''' Calculates the length of the tip section chord ''' lastSegment = getWingSegmentCount(tiglHandle, wingIndex) x1, y1, z1 = getWingUpperPoint(tiglHandle, wingIndex, lastSegment, 1, 0) x2, y2, z2 = getWingUpperPoint(tiglHandle, wingIndex, lastSegment, 1, 1) return pointDistance(x1, y1, z1, x2, y2, z2)
def calcTipLength(tiglHandle, wingIndex): """ Calculates the length of the tip section chord """ lastSegment = getWingSegmentCount(tiglHandle, wingIndex) x1, y1, z1 = getWingUpperPoint(tiglHandle, wingIndex, lastSegment, 1, 0) x2, y2, z2 = getWingUpperPoint(tiglHandle, wingIndex, lastSegment, 1, 1) return pointDistance(x1, y1, z1, x2, y2, z2)
def cpacsImport(self, path='.\\cpacs.xml', TIXIHandle=None, TIGLHandle=None): ''' Overwrites the parameters cpacsImport method! ''' #@todo: cpacsImport taperRatio: Think about an import logic for the different wings wingIndex = 2 if not TIXIHandle: TIXIHandle = openTIXI(path) if not TIGLHandle: TIGLHandle = openTIGL(TIXIHandle, self.parent.aircraft.modelUID.getValue()) if checkElement(TIXIHandle, '/cpacs/vehicles/aircraft/model/wings/wing[2]'): x1, y1, z1 = getWingUpperPoint(TIGLHandle, wingIndex, 1, 0, 0) self.setValueFix(z1) self.importSuccess() else: self.importError()
def cpacsImport(self, path='.\\cpacs.xml', TIXIHandle=None, TIGLHandle=None): ''' Overwrites the parameters cpacsImport method! ''' #@todo: cpacsImport taperRatio: Think about an import logic for the different wings wingIndex = 2 if not TIXIHandle: TIXIHandle = openTIXI(path) if not TIGLHandle: TIGLHandle = openTIGL(TIXIHandle, self.parent.aircraft.modelUID.getValue()) if checkElement(TIXIHandle, '/cpacs/vehicles/aircraft/model/wings/wing[2]'): x1, y1, z1 = getWingUpperPoint(TIGLHandle, wingIndex, 1, 0, 0) self.setValueFix(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 wing. The first sections x coordinate is read at eta and chord equal 0. ''' wingIndex = 1 if not TIXIHandle: TIXIHandle = openTIXI(path) if not TIGLHandle: TIGLHandle = openTIGL(TIXIHandle, self.parent.aircraft.modelUID.getValue()) if checkElement(TIXIHandle, '/cpacs/vehicles/aircraft/model/wings/wing'): x1, y1, z1 = getWingUpperPoint(TIGLHandle, wingIndex, 1, 0, 0) self.setValueFix(x1) self.importSuccess() else: self.importError()
def cpacsImport(self, path='.\\cpacs.xml', TIXIHandle=None, TIGLHandle=None): ''' Retrieves the xRoot.py coordinate from TIGL. It will go for the vtp. The first sections x coordinate is read at eta and chord equal 0. ''' wingIndex = 3 if not TIXIHandle: TIXIHandle = openTIXI(path) if not TIGLHandle: TIGLHandle = openTIGL(TIXIHandle, self.parent.aircraft.modelUID.getValue()) if checkElement(TIXIHandle, '/cpacs/vehicles/aircraft/model/wings/wing[3]'): x1, y1, z1 = getWingUpperPoint(TIGLHandle, wingIndex, 1, 0, 0) self.setValueFix(x1) self.importSuccess() else: self.importError()