Пример #1
0
 def _create_folder(self):
     DEBUG("Creating a folder...")
     current_item = self.currentItem()
     qinput = QInputDialog(self)
     qinput.setInputMode(QInputDialog.TextInput)
     qinput.setWindowTitle(self.tr("Nueva Carpeta"))
     qinput.setLabelText(self.tr("Nombre:"))
     qinput.resize(400, 100)
     ok = qinput.exec_()
     folder_name = qinput.textValue()
     if ok:
         path = os.path.join(current_item.path, folder_name)
         if os.path.exists(path):
             QMessageBox.information(self, self.tr("Información"),
                                     self.tr("La carpeta ya existe"),
                                     QMessageBox.Yes)
             DEBUG("The folder already exists...")
             return
         # Creo la carpeta
         os.mkdir(path)
         # Agrego el ítem al árbol
         folder_item = TreeItem(current_item, [folder_name])
         folder_item.path = path
         folder_item.isFile = False
         folder_item.setExpanded(True)
Пример #2
0
    def __call__(self, val):
        dialog = QInputDialog(parent=self.parent)
#         dialog.setLabelText("")
        dialog.setLabelText("set label for minimum: " + str(self.minimum.energy))
        dialog.setInputMode(0)
        dialog.exec_()
        if dialog.result():
            label = dialog.textValue()
            self.parent._minima_labels[self.minimum] = label
Пример #3
0
    def __call__(self, val):
        dialog = QInputDialog(parent=self.parent)
#         dialog.setLabelText("")
        dialog.setLabelText("set label for minimum: " + str(self.minimum.energy))
        dialog.setInputMode(0)
        dialog.exec_()
        if dialog.result():
            label = dialog.textValue()
            self.parent._minima_labels[self.minimum] = label
Пример #4
0
 def motor_current_button_clicked(self):
     qid = QInputDialog(self)
     qid.setInputMode(QInputDialog.IntInput)
     qid.setIntMinimum(360)
     qid.setIntMaximum(1640)
     qid.setIntStep(100)
     async_call(self.silent_stepper.get_motor_current, None, qid.setIntValue, self.increase_error_count)
     qid.intValueSelected.connect(self.motor_current_selected)
     qid.setLabelText("Choose motor current in mA.")
     qid.open()
Пример #5
0
 def __call__(self, val):
     dialog = QInputDialog(parent=self.parent)
     #         dialog.setLabelText("")
     dialog.setLabelText("Temperature for committor calculation")
     dialog.setInputMode(2)
     dialog.setDoubleValue(1.)
     dialog.exec_()
     if dialog.result():
         T = dialog.doubleValue()
         self.parent._layout_by_committor(self.minimum1, self.minimum2, T=T)
Пример #6
0
 def minimum_motor_voltage_button_pressed(self):
     qid = QInputDialog(self)
     qid.setInputMode(QInputDialog.IntInput)
     qid.setIntMinimum(0)
     qid.setIntMaximum(40000)
     qid.setIntStep(100)
     async_call(self.stepper.get_minimum_voltage, None, qid.setIntValue, self.increase_error_count)
     qid.intValueSelected.connect(self.minimum_motor_voltage_selected)
     qid.setLabelText("Choose minimum motor voltage in mV.")
     qid.open()
Пример #7
0
    def __call__(self, val):
        dialog = QInputDialog(parent=self.parent)
#         dialog.setLabelText("")
        dialog.setLabelText("Temperature for MFPT calculation")
        dialog.setInputMode(2)
        dialog.setDoubleValue(1.)
        dialog.exec_()
        if dialog.result():
            T = dialog.doubleValue()
            self.parent._color_by_mfpt(self.minimum1, T=T)
Пример #8
0
    def __call__(self, val):
        dialog = QInputDialog(parent=self.parent)
#         dialog.setLabelText("")
        dialog.setLabelText("Temperature for committor calculation")
        dialog.setInputMode(2)
        dialog.setDoubleValue(1.)
        dialog.exec_()
        if dialog.result():
            T = dialog.doubleValue()
            self.parent._layout_by_committor(self.minimum1, self.minimum2, T=T)
Пример #9
0
 def __call__(self, val):
     dialog = QInputDialog(parent=self.parent)
     #         dialog.setLabelText("")
     dialog.setLabelText("Temperature for MFPT calculation")
     dialog.setInputMode(2)
     dialog.setDoubleValue(1.)
     dialog.exec_()
     if dialog.result():
         T = dialog.doubleValue()
         self.parent._color_by_mfpt(self.minimum1, T=T)
Пример #10
0
 def motor_current_button_clicked(self):
     qid = QInputDialog(self)
     qid.setInputMode(QInputDialog.IntInput)
     qid.setIntMinimum(0)
     qid.setIntMaximum(2500)
     qid.setIntStep(100)
     async_call(self.silent_stepper.get_motor_current, None, qid.setIntValue, self.increase_error_count)
     qid.intValueSelected.connect(self.motor_current_selected)
     qid.setLabelText("Choose motor current in mA.")
     qid.open()
Пример #11
0
 def minimum_motor_voltage_button_clicked(self):
     qid = QInputDialog(self)
     qid.setInputMode(QInputDialog.IntInput)
     qid.setIntMinimum(0)
     qid.setIntMaximum(40000)
     qid.setIntStep(100)
     async_call(self.stepper.get_minimum_voltage, None, qid.setIntValue, self.increase_error_count)
     qid.intValueSelected.connect(self.minimum_motor_voltage_selected)
     qid.setLabelText("Choose minimum motor voltage in mV.")
     qid.open()
Пример #12
0
    def output_voltage_button_clicked(self):
        qid = QInputDialog(self)
        qid.setInputMode(QInputDialog.IntInput)
        qid.setIntMinimum(2000)
        qid.setIntMaximum(9000)
        qid.setIntStep(100)
        async_call(self.servo.get_output_voltage, None, qid.setIntValue, self.increase_error_count)
        qid.intValueSelected.connect(self.output_voltage_selected)
        qid.setLabelText("Choose Output Voltage in mV.")
#                         "<font color=red>Setting this too high can destroy your servo.</font>")
        qid.open()
Пример #13
0
    def motor_current_button_pressed(self):
        qid = QInputDialog(self)
        qid.setInputMode(QInputDialog.IntInput)
        qid.setIntMinimum(0)
        qid.setIntMaximum(2500)
        qid.setIntStep(100)
        async_call(self.stepper.get_motor_current, None, qid.setIntValue, self.increase_error_count)
        qid.intValueSelected.connect(self.motor_current_selected)
        qid.setLabelText("Choose motor current in mA.")
#                         "<font color=red>Setting this too high can destroy your Motor.</font>")
        qid.open()
Пример #14
0
    def motor_current_button_clicked(self):
        qid = QInputDialog(self)
        qid.setInputMode(QInputDialog.IntInput)
        qid.setIntMinimum(0)
        qid.setIntMaximum(2500)
        qid.setIntStep(100)
        async_call(self.stepper.get_motor_current, None, qid.setIntValue, self.increase_error_count)
        qid.intValueSelected.connect(self.motor_current_selected)
        qid.setLabelText("Choose motor current in mA.")
#                         "<font color=red>Setting this too high can destroy your Motor.</font>")
        qid.open()
Пример #15
0
 def output_voltage_button_clicked(self):
     qid = QInputDialog(self)
     qid.setInputMode(QInputDialog.IntInput)
     qid.setIntMinimum(2000)
     qid.setIntMaximum(9000)
     qid.setIntStep(100)
     async_call(self.servo.get_output_voltage, None, qid.setIntValue,
                self.increase_error_count)
     qid.intValueSelected.connect(self.output_voltage_selected)
     qid.setLabelText("Choose Output Voltage in mV.")
     #                         "<font color=red>Setting this too high can destroy your servo.</font>")
     qid.open()
Пример #16
0
 def minimum_voltage_button_pressed(self):
     qid = QInputDialog(self)
     qid.setInputMode(QInputDialog.IntInput)
     qid.setIntMinimum(5000)
     qid.setIntMaximum(0xFFFF)
     qid.setIntStep(100)
     try:
         qid.setIntValue(self.servo.get_minimum_voltage())
     except ip_connection.Error:
         return
     qid.intValueSelected.connect(self.minimum_voltage_selected)
     qid.setLabelText("Choose minimum servo voltage in mV.")
     qid.open()
Пример #17
0
 def minimum_voltage_button_pressed(self):
     qid = QInputDialog(self)
     qid.setInputMode(QInputDialog.IntInput)
     qid.setIntMinimum(5000)
     qid.setIntMaximum(0xFFFF)
     qid.setIntStep(100)
     try:
         qid.setIntValue(self.servo.get_minimum_voltage())
     except ip_connection.Error:
         return
     qid.intValueSelected.connect(self.minimum_voltage_selected)
     qid.setLabelText("Choose minimum servo voltage in mV.")
     qid.open()
Пример #18
0
    def output_voltage_button_clicked(self):
        qid = QInputDialog(self)
        qid.setInputMode(QInputDialog.IntInput)
        qid.setIntMinimum(5000)
        qid.setIntMaximum(27000)
        qid.setIntStep(100)
        try:
            qid.setIntValue(self.servo.get_output_voltage())
        except ip_connection.Error:
            return
        qid.intValueSelected.connect(self.output_voltage_selected)
        qid.setLabelText("Choose Output Voltage in mV.")
#                         "<font color=red>Setting this too high can destroy your servo.</font>")
        qid.open()
Пример #19
0
 def output_voltage_button_clicked(self):
     qid = QInputDialog(self)
     qid.setInputMode(QInputDialog.IntInput)
     qid.setIntMinimum(5000)
     qid.setIntMaximum(27000)
     qid.setIntStep(100)
     try:
         qid.setIntValue(self.servo.get_output_voltage())
     except ip_connection.Error:
         return
     qid.intValueSelected.connect(self.output_voltage_selected)
     qid.setLabelText("Choose Output Voltage in mV.")
     #                         "<font color=red>Setting this too high can destroy your servo.</font>")
     qid.open()
Пример #20
0
 def motor_current_button_pressed(self):
     qid = QInputDialog(self)
     qid.setInputMode(QInputDialog.IntInput)
     qid.setIntMinimum(0)
     qid.setIntMaximum(2500)
     qid.setIntStep(100)
     try:
         qid.setIntValue(self.stepper.get_motor_current())
     except ip_connection.Error:
         return
     qid.intValueSelected.connect(self.motor_current_selected)
     qid.setLabelText("Choose motor current in mA.")
     #                         "<font color=red>Setting this too high can destroy your Motor.</font>")
     qid.open()
Пример #21
0
    def motor_current_button_pressed(self):
        qid = QInputDialog(self)
        qid.setInputMode(QInputDialog.IntInput)
        qid.setIntMinimum(0)
        qid.setIntMaximum(2500)
        qid.setIntStep(100)
        try:
            qid.setIntValue(self.stepper.get_motor_current())
        except ip_connection.Error:
            return
        qid.intValueSelected.connect(self.motor_current_selected)
        qid.setLabelText("Choose motor current in mA.")
#                         "<font color=red>Setting this too high can destroy your Motor.</font>")
        qid.open()
Пример #22
0
def getFindMsg( parentWidget, prepText = None ):
    qd = QInputDialog(parentWidget)
    qd.setInputMode(QInputDialog.TextInput)
    qd.setOkButtonText(QString('Find'))
    qd.setLabelText(QString('Text to find'))
    if (prepText is not None):
        if prepText.size() > 40 :
            prepText.truncate(40)
        qd.setTextValue(prepText)
    b = (QDialog.Accepted == qd.exec_() )
    if b :
        return (True, qd.textValue())
    else:
        return (False, QString() )
Пример #23
0
 def _create_folder(self):
     DEBUG("Creating a folder...")
     current_item = self.currentItem()
     qinput = QInputDialog(self)
     qinput.setInputMode(QInputDialog.TextInput)
     qinput.setWindowTitle(self.tr("Nueva Carpeta"))
     qinput.setLabelText(self.tr("Nombre:"))
     qinput.resize(400, 100)
     ok = qinput.exec_()
     folder_name = qinput.textValue()
     if ok:
         path = os.path.join(current_item.path, folder_name)
         if os.path.exists(path):
             QMessageBox.information(self, self.tr("Información"), self.tr("La carpeta ya existe"), QMessageBox.Yes)
             DEBUG("The folder already exists...")
             return
         # Creo la carpeta
         os.mkdir(path)
         # Agrego el ítem al árbol
         folder_item = TreeItem(current_item, [folder_name])
         folder_item.path = path
         folder_item.isFile = False
         folder_item.setExpanded(True)