Compare commits

..

No commits in common. "44a8be6be382efc6b8d28d91d932a9a3e050d966" and "17a18dde186ca35cf628deeaf342d8550a1dfdbb" have entirely different histories.

5 changed files with 15 additions and 30 deletions

View File

@ -105,6 +105,16 @@ class Profile(SQLSubModel):
@classmethod
def _db_update(cls, execute, version, data=None):
major, minor, release = version.strip().split(".")
create = False
if major == "0" and int(minor) < 2:
cls._db_create(execute)
create = True
if major == "0" and int(minor) == 2:
if int(release) < 1 and not create:
cls._db_create(execute)
create = True
return cls._update_submodel(execute, version, data)

View File

@ -446,7 +446,7 @@ class Rubar3(CommandLineSolver):
ind = 1
for mail in edge.reach.inter_profiles_rk():
coef = get_stricklers_from_rk(mail, lst)
if coef is not None:
if coeff is not None:
f.write(f"{ind:>6} {coef:>12.5f}")
ind += 1

View File

@ -276,7 +276,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
"action_menu_new": self.open_new_study,
"action_menu_edit": self.open_edit_study,
"action_menu_open": self.open_model,
"action_menu_save": lambda: self.save_study(),
"action_menu_save": self.save_study,
"action_menu_save_as": self.save_as_study,
"action_menu_numerical_parameter": self.open_solver_parameters,
"action_menu_edit_scenarios": self.open_scenarios,
@ -637,10 +637,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
logger.info(f"Open Study - {self._study.name}")
self.set_title()
def _save(self, source):
self.save_study(progress_parent=source)
def save_study(self, progress_parent=None):
def save_study(self):
"""Save current study
Save current study, if study as no associate file, open a
@ -670,15 +667,11 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
self._backup_timer.blockSignals(True)
self._save_mutex.lock()
parent = self
if progress_parent is not None:
parent = progress_parent
sql_request_count = self._study.sql_save_request_count()
progress = QProgressDialog(
"Saving...", None,
0, sql_request_count,
parent=parent
parent=self
)
progress.setWindowModality(Qt.WindowModal)
progress.setValue(0)
@ -691,7 +684,6 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
progress=lambda: progress.setValue(progress.value() + 1)
)
progress.close()
status += " Done"
logger.info(status)
self.statusbar.showMessage(status, 3000)
@ -766,8 +758,6 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
progress.setValue(progress.value() + 1)
progress.close()
def save_as_study_single_scenario(self, sid=-1):
sql_request_count = self._study.sql_save_request_count()
@ -792,7 +782,6 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
)
status += " Done"
progress.close()
logger.info(status)
self.statusbar.showMessage(status, 3000)

View File

@ -182,7 +182,6 @@ class PamhyrWindow(ASubMainWindow, ListedSubWindow, PamhyrWindowTools):
self._set_title()
self._set_icon()
self._setup_save_sc()
def _set_title(self):
title = self._title
@ -197,25 +196,12 @@ class PamhyrWindow(ASubMainWindow, ListedSubWindow, PamhyrWindowTools):
self.ui.setWindowTitle(title)
def _setup_save_sc(self):
if self._parent is None:
return
self._save_sc = QShortcut(QKeySequence("Ctrl+S"), self)
self._save_sc.activated.connect(lambda: self._save(self))
def closeEvent(self, event):
self._close_sub_window()
self._propagate_update(Modules.WINDOW_LIST)
super(PamhyrWindow, self).closeEvent(event)
def _save(self, source):
if self._parent is None:
return
return self._parent._save(source)
class PamhyrDialog(ASubWindow, ListedSubWindow, PamhyrWindowTools):
_pamhyr_ui = "dummy"

View File

@ -63,7 +63,7 @@ class WaitingDialog(PamhyrDialog):
". ", ". ",
".. ", ".. ",
"...", "..."],
["o ", " o ", " o ", " o", " o ", " o "],
["o ", " o ", " o ", " o", " o ", " o "],
["█▓▒░", "▓█▓▒", "▒▓█▓", "░▒▓█", "▒▓█▓", "▓█▓▒"],
"▖▘▝▗",
"αβγδεζηθικλμνξοπρστυφχψω",