Example #1
0
 def import_file_dialog(self):
     filename = QtGui.QFileDialog.getOpenFileName(parent=None,
                                                  caption='import airfoil',
                                                  directory='~',
                                                  filter='*.dat',
                                                  selectedFilter='*.dat')
     if filename[0] != '':
         self.QList_View.addItem(
             QAirfoil_item(BezierProfile2D.import_from_dat(filename[0])))
Example #2
0
 def spline_edit(self):
     if self.is_edit:
         self.current_airfoil.apply_splines()
         self.unset_edit_mode()
         self.update_airfoil()
     else:
         if not isinstance(self.current_airfoil, BezierProfile2D):
             self.current_airfoil = BezierProfile2D.from_profile_2d(self.current_airfoil)
             self.update_selection()
         self.set_edit_mode()
Example #3
0
 def spline_edit(self):
     if self.is_edit:
         self.current_airfoil.apply_splines()
         self.unset_edit_mode()
         self.update_airfoil()
     else:
         if not isinstance(self.current_airfoil, BezierProfile2D):
             self.current_airfoil = BezierProfile2D.from_profile_2d(
                 self.current_airfoil)
             self.update_selection()
         self.set_edit_mode()
Example #4
0
 def create_airfoil(self):
     j = 0
     for index in range(self.QList_View.count()):
         name = self.QList_View.item(index).text()
         if 'airfoil' in name:
             j += 1
     airfoil = BezierProfile2D.compute_naca(4412)
     airfoil.name = 'airfoil' + str(j)
     new_item = QAirfoil_item(airfoil)
     self.QList_View.addItem(new_item)
     self.QList_View.setCurrentItem(new_item)
Example #5
0
 def import_file_dialog(self):
     filename = QtGui.QFileDialog.getOpenFileName(
         parent=None,
         caption="import airfoil",
         directory='~',
         filter='*.dat',
         selectedFilter='*.dat')
     if filename[0] != "":
         self.QList_View.addItem(
             QAirfoil_item(
                 BezierProfile2D.import_from_dat(filename[0])))
Example #6
0
 def create_airfoil(self):
     j = 0
     for index in range(self.QList_View.count()):
         name = self.QList_View.item(index).text()
         if "airfoil" in name:
             j += 1
     airfoil = BezierProfile2D.compute_naca(4412)
     airfoil.name = "airfoil" + str(j)
     new_item = QAirfoil_item(airfoil)
     self.QList_View.addItem(new_item)
     self.QList_View.setCurrentItem(new_item)
Example #7
0
 def import_file_dialog(self):
     filename = QtGui.QFileDialog.getOpenFileName(
         parent=None,
         caption='import airfoil',
         directory='~',
         filter='*.dat *.json',
         selectedFilter='*.dat *.json')
     if filename[0] != '':
         name, format = os.path.splitext(filename[0])
         if format == ".dat":
             self.QList_View.addItem(
                 QAirfoil_item(BezierProfile2D.import_from_dat(
                     filename[0])))
         elif format == ".json":
             with open(filename[0], "r") as fp:
                 airfoil = jsonify.load(fp)["data"]
                 self.QList_View.addItem(QAirfoil_item(airfoil))