Пример #1
0
 def openData(self):
     try:
         filePathDir = QFileDialog.getOpenFileName(self, "Open Input Data",QCoreApplication.applicationDirPath (),"Xml Files(*.xml)")
         if filePathDir == "":
             return
         DataHelper.loadInputParameters(filePathDir, self)
         return filePathDir
     except UserWarning as e:
         QMessageBox.warning(self, "Error", e.message)
    def openData(self):
        try:




            filePathDir = QFileDialog.getOpenFileName(self, "Open Input Data",QCoreApplication.applicationDirPath (),"Xml Files(*.xml)")
            if filePathDir == "":
                return

            layers = define._canvas.layers()
            if layers != None and len(layers) > 0:
                for layer in layers:
                    if layer.name() == "Symbols":
                        self.currentLayer = layer
                        try:
                            self.initAerodromeAndRwyCmb()
                        except:
                            pass
                        try:
                            self.initBasedOnCmb()
                        except:
                            pass
                        break

            # contents = None
            # with open(filePathDir, 'rb', 0) as tempFile:
            #     contents = tempFile.read()
            #     tempFile.close()
            # bytes = FasDataBlockFile.CRC_Calculation(contents)
            #
            # string_0 = QString(filePathDir)
            # crcFileDir = string_0.left(string_0.length() - 3) + "crc"
            # crcFileContents = None
            # with open(crcFileDir, 'rb', 0) as tempFileCrc:
            #     crcFileContents = tempFileCrc.read()
            #     tempFileCrc.close()
            # if bytes != crcFileContents:
            #     QMessageBox.warning(self, "Error", "Input file has been changed by outside.")
            #     return

            DataHelper.loadInputParameters(filePathDir, self)
            return filePathDir
        except UserWarning as e:
            QMessageBox.warning(self, "Error", e.message)