Exemplo n.º 1
0
    def apply(self):

        cl = acalculate()
        cl = cl.liftcoefficient(float(cl_minv_edit.text()), float(cl_maxv_edit.text()), self.weight, self.wingarea, self.rho)

        if cl_exportdata_checkbox.isChecked():
            cl_export_xlsx = aeroexport()
            cl_export_xlsx.clvsVelocity(cl, np.arange(float(cl_minv_edit.text()), float(cl_maxv_edit.text()), 0.1))

            cl_info_msg = QtWidgets.QMessageBox()
            cl_info_msg.setIcon(QtWidgets.QMessageBox.Information)
            cl_info_msg.setText("All data have been exported inside 'XLSX Workbooks' folder.")
            cl_info_msg.setWindowTitle("DATA HAVE BEEN EXPORTED SUCCESSFULLY")
            cl_info_msg.setStyleSheet("QMessageBox {font: 12pt Ubuntu}")
            cl_button = cl_info_msg.addButton(QtWidgets.QMessageBox.Ok)
            cl_button.setIcon(QtGui.QIcon("icons/check.png"))
            cl_button.setFixedSize(75, 35)
            cl_button.setStyleSheet("QPushButton {font: 10pt Ubuntu}")
            cl_info_msg.setDefaultButton(cl_button)
            cl_info_msg.exec_()
        else:
            pass

        plotcl_velocity = agplot()
        plotcl_velocity.clvsvelocity(cl, float(cl_minv_edit.text()), float(cl_maxv_edit.text()), 0.1, colors.get(cl_linecolor_combo.currentText()), int(cl_lineweight_spin.value()), True)

        cl_minv_edit.clear()
        cl_maxv_edit.clear()
        self.close()
Exemplo n.º 2
0
    def apply(self):

        lift2drag_k = acalculate()
        lift2drag_oef = acalculate()
        lift2drag_cd = acalculate()
        lift2drag_cl = acalculate()
        lift2drag_cd = lift2drag_cd.dragcoefficient(self.cd0, lift2drag_k.kFactor(self.wingspan, self.wingarea, lift2drag_oef.oef_estimate(self.wingspan, self.wingarea)), lift2drag_cl.liftcoefficient(float(lift2drag_minv_edit.text()), float(lift2drag_maxv_edit.text()), self.weight, self.wingarea, self.rho))

        lift2drag_cl = acalculate()
        lift2drag_cl = lift2drag_cl.liftcoefficient(float(lift2drag_minv_edit.text()), float(lift2drag_maxv_edit.text()), self.weight, self.wingarea, self.rho)

        ltod = lift2drag_cd/lift2drag_cl

        if lift2drag_exportdata_checkbox.isChecked():

            lift2drag_export_xlsx = aeroexport()
            lift2drag_export_xlsx.lift2dragvsVelocity(ltod, np.arange(float(lift2drag_minv_edit.text()), float(lift2drag_maxv_edit.text())))

            lift2drag_info_msg = QtWidgets.QMessageBox()
            lift2drag_info_msg.setIcon(QtWidgets.QMessageBox.Information)
            lift2drag_info_msg.setText("All data have been exported inside 'XLSX Workbooks' folder.")
            lift2drag_info_msg.setWindowTitle("DATA HAVE BEEN EXPORTED SUCCESSFULLY")
            lift2drag_info_msg.setStyleSheet("QMessageBox {font: 12pt Ubuntu}")
            lift2drag_button = lift2drag_info_msg.addButton(QtWidgets.QMessageBox.Ok)
            lift2drag_button.setIcon(QtGui.QIcon("icons/check.png"))
            lift2drag_button.setFixedSize(75, 35)
            lift2drag_button.setStyleSheet("QPushButton {font: 10pt Ubuntu}")
            lift2drag_info_msg.setDefaultButton(lift2drag_button)
            lift2drag_info_msg.exec_()
        else:
            pass

        plotlift2drag_vel = agplot()
        plotlift2drag_vel.lift2dragvsvelocity(ltod, float(lift2drag_minv_edit.text()), float(lift2drag_maxv_edit.text()), 0.1, colors.get(lift2drag_linecolor_combo.currentText()), int(lift2drag_lineweight_spin.value()), True)

        lift2drag_minv_edit.clear()
        lift2drag_maxv_edit.clear()
        self.close()