Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

setup_calcmethod_choice.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. from PyQt5.QtWidgets import QGroupBox, QComboBox, QVBoxLayout
  2. from PyQt5.QtCore import pyqtSignal, pyqtSlot
  3. from view.python_core.get_internal_files import get_setup_description_dict
  4. class SetupChoice(QGroupBox):
  5. update_LE_loadExp_flag_signal = pyqtSignal(str, str)
  6. return_LE_loadExp = pyqtSignal(int)
  7. def __init__(self, parent):
  8. super().__init__("Choose your setup", parent)
  9. self.setup_description_dict = get_setup_description_dict()
  10. self.dropdown = QComboBox()
  11. self.dropdown.addItems(self.setup_description_dict.keys())
  12. self.dropdown.activated.connect(self.choice_made)
  13. vbox_layout = QVBoxLayout(self)
  14. vbox_layout.addWidget(self.dropdown)
  15. @pyqtSlot(int)
  16. def choice_made(self, index):
  17. chosen_LE_loadExp = list(self.setup_description_dict.values())[index]
  18. self.update_LE_loadExp_flag_signal.emit("LE_loadExp", str(chosen_LE_loadExp))
  19. self.return_LE_loadExp.emit(chosen_LE_loadExp)
  20. def get_current_LE_loadExp(self):
  21. return self.setup_description_dict[self.dropdown.currentText()]
  22. def update_flag_defaults(self, flags):
  23. if "LE_loadExp" in flags:
  24. for k, v in self.setup_description_dict.items():
  25. if v == int(flags["LE_loadExp"]):
  26. self.dropdown.setCurrentText(k)
  27. break