Exemplo n.º 1
0
 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
                 with db.session_ctx():
                     load_irradiation_map(db, dlg.path,
                                          os.path.basename(dlg.path), overwrite_geometry=True)
Exemplo n.º 2
0
 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
                 with db.session_ctx():
                     load_irradiation_map(db, dlg.path,
                                          os.path.basename(dlg.path))
    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'
            with db.session_ctx():
                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))
Exemplo n.º 4
0
    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'
            with db.session_ctx():
                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))
Exemplo n.º 5
0
 def save_tray_to_db(self, p, name):
     with self.dvc.db.session_ctx():
         load_irradiation_map(self.dvc.db, p, name, overwrite_geometry=True)
     self._inform_save()
Exemplo n.º 6
0
 def save_tray_to_db(self, p, name):
     with self.db.session_ctx():
         load_irradiation_map(self.db, p, name, overwrite_geometry=True)
     self._inform_save()