Exemplo n.º 1
0
    def compute(self):
        # Open file dialog
        filename, selectedFilter = Qt.QFileDialog.getSaveFileName(
            self,
            "Save to",
            os.path.join(os.getcwd(), "result.npy"),
            "numpy array (*.npy)")

        if filename == '':
            return  # Cancelled

        # Retrieve parameters
        ncells = int(self._nCellsLineEdit.text())
        h = int(self._hLineEdit.text())
        k = int(self._kLineEdit.text())
        oversampling = int(self._oversamplingLineEdit.text())

        # Run computation
        result = laue.laue_image(ncells, h, k, oversampling)
        
        # Display preview result
        self._plot.setData(result)

        # Save to file
        numpy.save(filename, result)
Exemplo n.º 2
0
    def compute(self):
        statusBar = self.statusBar()
        statusBar.clearMessage()

        # Open file dialog
        filename, selectedFilter = Qt.QFileDialog.getSaveFileName(
            self,
            "Save to",
            os.path.join(os.getcwd(), "result.npy"),
            "numpy array (*.npy)")

        if filename == '':
            statusBar.showMessage("Cancelled", 5000)
            return  # Cancelled

        # Retrieve parameters
        ncells = int(self._nCellsLineEdit.text())
        h = int(self._hLineEdit.text())
        k = int(self._kLineEdit.text())
        oversampling = int(self._oversamplingLineEdit.text())

        # Run computation
        result = laue.laue_image(ncells, h, k, oversampling)

        # Save to file
        numpy.save(filename, result)
        
        statusBar.showMessage("Result saved to %s" % filename, 5000)
Exemplo n.º 3
0
    def compute(self):
        # Retrieve parameters
        ncells = int(self._nCellsLineEdit.text())
        h = int(self._hLineEdit.text())
        k = int(self._kLineEdit.text())
        oversampling = int(self._oversamplingLineEdit.text())

        # Run computation
        self._result = laue.laue_image(ncells, h, k, oversampling)
        self._savePushButton.setEnabled(True)
Exemplo n.º 4
0
    def compute(self):
        # Open file dialog
        filename, selectedFilter = Qt.QFileDialog.getSaveFileName(
            self, "Save to", os.path.join(os.getcwd(), "result.npy"),
            "numpy array (*.npy)")

        if filename == '':
            return  # Cancelled

        # Retrieve parameters
        ncells = int(self._nCellsSpinBox.value())
        h = int(self._hDoubleSpinBox.value())
        k = int(self._kDoubleSpinBox.value())
        oversampling = int(self._oversamplingSpinBox.value())

        # Run computation
        result = laue.laue_image(ncells, h, k, oversampling)

        # Save to file
        numpy.save(filename, result)
Exemplo n.º 5
0
 def run(self):
     result = laue.laue_image(
         self.ncells, self.h, self.k, self.oversampling)
     self.callback(result)