Ejemplo n.º 1
0
 def datasetExprChanged(self):
     """Validate expression."""
     text = self.indataset.text()
     document.simpleEvalExpression(self.document, unicode(text))
Ejemplo n.º 2
0
 def datasetExprChanged(self):
     """Validate expression."""
     text = self.indataset.text()
     document.simpleEvalExpression(self.document, unicode(text))
Ejemplo n.º 3
0
        }[gen.cumulative].click()

        # if error bars
        self.errorBars.setChecked(bool(gen.errors))

    def applyClicked(self):
        """Create histogram."""

        qt4.QTimer.singleShot(4000, self.statuslabel.clear)
        try:
            p = HistoDataDialog.Params(self)
        except RuntimeError, ex:
            self.statuslabel.setText(_("Invalid parameters: %s") % unicode(ex))
            return

        exprresult = N.array(document.simpleEvalExpression(
            self.document, p.expr),
                             dtype=N.float64)
        if len(exprresult) == 0:
            self.statuslabel.setText(_("Invalid expression"))
            return

        op = p.getOperation()
        self.document.applyOperation(op)

        self.statuslabel.setText(
            _('Created datasets "%s" and "%s"') % (p.outbins, p.outdataset))


def recreateDataset(mainwindow, document, dataset, datasetname):
    """Open dialog to recreate histogram."""
    dialog = HistoDataDialog(mainwindow, document)
Ejemplo n.º 4
0
        # if error bars
        self.errorBars.setChecked( bool(gen.errors) )

    def applyClicked(self):
        """Create histogram."""

        qt4.QTimer.singleShot(4000, self.statuslabel.clear)
        try:
            p = HistoDataDialog.Params(self)
        except RuntimeError, ex:
            self.statuslabel.setText(_("Invalid parameters: %s") % unicode(ex))
            return

        exprresult = N.array(
            document.simpleEvalExpression(self.document, p.expr),
            dtype=N.float64)
        if len(exprresult) == 0:
            self.statuslabel.setText(_("Invalid expression"))
            return

        op = p.getOperation()
        self.document.applyOperation(op)

        self.statuslabel.setText(
            _('Created datasets "%s" and "%s"') % (p.outbins, p.outdataset))

def recreateDataset(mainwindow, document, dataset, datasetname):
    """Open dialog to recreate histogram."""
    dialog = HistoDataDialog(mainwindow, document)
    mainwindow.showDialog(dialog)