def _add_tray_button_fired(self): dlg = FileDialog(action='open', default_directory=paths.irradiation_tray_maps_dir) if dlg.open() == OK: if dlg.path: # verify this is a valid irradiation map file if parse_irradiation_tray_map(dlg.path) is not None: db = self.db load_irradiation_map(db, dlg.path, os.path.basename(dlg.path), overwrite_geometry=True)
def do_import(self, db): path = self._get_holder_path() if path: self.debug('doing irradiation holder import') overwrite_geometry = True name = os.path.splitext(os.path.basename(path))[0] msg='Added' dbh = db.get_irradiation_holder(name) if dbh: msg = 'Updated' load_irradiation_map(db, path, name, overwrite_geometry) self.information_dialog('{} Irradiation Holder "{}"'.format(msg, name))
def save_tray_to_db(self, p, name): load_irradiation_map(self.dvc.db, p, name, overwrite_geometry=True) self._inform_save()