def check_args(self) -> None: """ Checks whether the files have been specified in the command line arguments. """ files = args.args_files() if files and any(files): self.files = [resources.get(f) for f in files] return self.accept() # Close dialog. file = args.args_file() if file: self.files = [resources.get(file), None] return self.accept()
def setup_ui(self) -> None: uic.loadUi(get("layout:window_launcher.ui"), self) self.load_banner_images() self.btn_time_freq.clicked.connect( self.application.start_time_frequency) self.btn_wavelet_phase.clicked.connect( self.application.start_phase_coherence) self.btn_ridge_extraction.clicked.connect( self.application.start_ridge_extraction) self.btn_wavelet_bispectrum.clicked.connect( self.application.start_bispectrum) self.btn_dynamical_bayesian.clicked.connect( self.application.start_bayesian) self.btn_create_shortcut.clicked.connect(self.create_shortcut) self.check_matlab_runtime() self.lbl_update.hide() self.btn_update.hide() self.btn_update.clicked.connect(self.on_update_clicked) if args.post_update(): asyncio.ensure_future(self.post_update()) else: asyncio.ensure_future(self.check_for_updates())
def setup_ui(self) -> None: uic.loadUi(resources.get("layout:dialog_frequency.ui"), self) self.edit_freq.textChanged.connect(self.on_freq_changed) self.btn_use_recent.clicked.connect(self.use_recent_freq) self.setup_combo() asyncio.ensure_future(self.coro_check_args())
def setup_ui(self) -> None: uic.loadUi(resources.get("layout:dialog_pymodalib_cache.ui"), self) self.btn_browse.clicked.connect(self.browse_for_folder) self.checkbox_default.toggled.connect(self.update_ok_status) self.line_location.textChanged.connect(self.update_ok_status) self.set_ok_enabled(False)
def setup_ui(self): uic.loadUi(resources.get("layout:dialog_select_file.ui"), self) self.setup_drops() self.setup_recent_files() self.btn_browse.clicked.connect(self.browse_for_file) self.btn_use_recent.clicked.connect(self.use_recent_file) QTimer.singleShot(500, self.check_args)
def setup_ui(self) -> None: uic.loadUi(resources.get("layout:dialog_settings.ui"), self) self.btn_browse.clicked.connect(self.browse_for_folder) self.btn_open_logs.clicked.connect(self.on_open_logs_clicked) cache_loc = self.settings.get_pymodalib_cache() self.line_cache_loc.setText( cache_loc if cache_loc != "None" else cache_loc)
def check_args(self): """ Check the commandline arguments in case there is a pre-selected file. """ file = args.args_file() if file: self.file = resources.get(file) self.accept() # Close dialog.
def res_check(choice): get_choice = MENU.get(choice) choice_ingredient = get_choice.get("ingredients") choice_price = get_choice.get("cost") choice_milk = 0 choice_water = 0 choice_coffee = 0 if "milk" in choice_ingredient: choice_milk = choice_ingredient.get("milk") if resources.get("milk") < choice_milk: print("Sorry there is not enough milk") return False if "water" in choice_ingredient: choice_water = choice_ingredient.get("water") if resources.get("water") < choice_water: print("Sorry there is not enough water") return False if "coffee" in choice_ingredient: choice_coffee = choice_ingredient.get("coffee") if resources.get("coffee") < choice_coffee: print("Sorry there is not enough coffee") return False if check_money(choice_price): res_cost(choice_milk, choice_water, choice_coffee)
def setup_ui(self) -> None: uic.loadUi(get("layout:window_launcher.ui"), self) self.load_banner_images() self.btn_time_freq.clicked.connect( self.application.start_time_frequency) self.btn_wavelet_phase.clicked.connect( self.application.start_phase_coherence) self.btn_group_coherence.clicked.connect( self.application.start_group_coherence) self.btn_ridge_extraction.clicked.connect( self.application.start_ridge_extraction) self.btn_wavelet_bispectrum.clicked.connect( self.application.start_bispectrum) self.btn_dynamical_bayesian.clicked.connect( self.application.start_bayesian) self.btn_harmonics.clicked.connect(self.application.start_harmonics) self.btn_create_shortcut.clicked.connect(self.create_shortcut) # TODO: check for Matlab runtime, but show less intrusive message. # self.check_matlab_runtime() self.lbl_updating.setVisible(False) self.progress_updating.setVisible(False) self.lbl_update_complete.setVisible(False) self.btn_settings.clicked.connect(self.on_settings_clicked) self.lbl_update_status = QLabel("") self.statusBar().addPermanentWidget(self.lbl_update_status) if args.create_shortcut(): logging.info("Creating desktop shortcut silently.") self.create_shortcut(silent=True) if args.post_update(): asyncio.ensure_future(self.post_update()) else: asyncio.ensure_future(self.check_for_updates())
def get_layout_file(self) -> str: return resources.get("layout:window_time_freq.ui")
def get_layout_file(self) -> str: return resources.get("layout:window_harmonics.ui")
def setup_ui(self) -> None: uic.loadUi(resources.get("layout:dialog_matlab_runtime.ui"), self) checkbox: QCheckBox = self.checkbox_dont_show_again checkbox.stateChanged.connect(self.on_check)
def colormap(): file = resources.get("colours:colormap.csv") colours = np.loadtxt(file, dtype=float, delimiter=',') cmap = LinearSegmentedColormap.from_list("colours", colours, N=len(colours), gamma=1.0) return cmap
def get_layout_file(self) -> str: return resources.get("layout:window_dynamical_bayesian.ui")
def set_icon(self, img=resources.get("image:icon.svg")): icon = QIcon(img) self.setWindowIcon(icon)
def load_banner_images(self) -> None: """ Loads the banner images and displays them at the top of the window. """ image = QPixmap(resources.get("image:physicslogo.png")) self.lbl_physics.setPixmap(image.scaled(600, 300, Qt.KeepAspectRatio))
def setup_ui(self) -> None: uic.loadUi(resources.get("layout:dialog_select_group.ui"), self) self.setup_drops() QTimer.singleShot(500, self.check_args)
def get_layout_file(self) -> str: return resources.get("layout:window_bispectrum_analysis.ui")
def get_layout_file(self) -> str: return resources.get("layout:window_phase_coherence.ui")
def get_layout_file(self) -> str: return resources.get("layout:window_ridge_extraction.ui")