mirror of https://gitlab.com/pamhyr/pamhyr2
Compare commits
7 Commits
17a18dde18
...
44a8be6be3
| Author | SHA1 | Date |
|---|---|---|
|
|
44a8be6be3 | |
|
|
a5a64f2080 | |
|
|
16ee5a90e4 | |
|
|
7ca6e69526 | |
|
|
abe24611b3 | |
|
|
8bd791b2c4 | |
|
|
c8d0d0c212 |
|
|
@ -105,16 +105,6 @@ class Profile(SQLSubModel):
|
||||||
@classmethod
|
@classmethod
|
||||||
def _db_update(cls, execute, version, data=None):
|
def _db_update(cls, execute, version, data=None):
|
||||||
major, minor, release = version.strip().split(".")
|
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)
|
return cls._update_submodel(execute, version, data)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -446,7 +446,7 @@ class Rubar3(CommandLineSolver):
|
||||||
ind = 1
|
ind = 1
|
||||||
for mail in edge.reach.inter_profiles_rk():
|
for mail in edge.reach.inter_profiles_rk():
|
||||||
coef = get_stricklers_from_rk(mail, lst)
|
coef = get_stricklers_from_rk(mail, lst)
|
||||||
if coeff is not None:
|
if coef is not None:
|
||||||
f.write(f"{ind:>6} {coef:>12.5f}")
|
f.write(f"{ind:>6} {coef:>12.5f}")
|
||||||
|
|
||||||
ind += 1
|
ind += 1
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
"action_menu_new": self.open_new_study,
|
"action_menu_new": self.open_new_study,
|
||||||
"action_menu_edit": self.open_edit_study,
|
"action_menu_edit": self.open_edit_study,
|
||||||
"action_menu_open": self.open_model,
|
"action_menu_open": self.open_model,
|
||||||
"action_menu_save": self.save_study,
|
"action_menu_save": lambda: self.save_study(),
|
||||||
"action_menu_save_as": self.save_as_study,
|
"action_menu_save_as": self.save_as_study,
|
||||||
"action_menu_numerical_parameter": self.open_solver_parameters,
|
"action_menu_numerical_parameter": self.open_solver_parameters,
|
||||||
"action_menu_edit_scenarios": self.open_scenarios,
|
"action_menu_edit_scenarios": self.open_scenarios,
|
||||||
|
|
@ -637,7 +637,10 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
logger.info(f"Open Study - {self._study.name}")
|
logger.info(f"Open Study - {self._study.name}")
|
||||||
self.set_title()
|
self.set_title()
|
||||||
|
|
||||||
def save_study(self):
|
def _save(self, source):
|
||||||
|
self.save_study(progress_parent=source)
|
||||||
|
|
||||||
|
def save_study(self, progress_parent=None):
|
||||||
"""Save current study
|
"""Save current study
|
||||||
|
|
||||||
Save current study, if study as no associate file, open a
|
Save current study, if study as no associate file, open a
|
||||||
|
|
@ -667,11 +670,15 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
self._backup_timer.blockSignals(True)
|
self._backup_timer.blockSignals(True)
|
||||||
self._save_mutex.lock()
|
self._save_mutex.lock()
|
||||||
|
|
||||||
|
parent = self
|
||||||
|
if progress_parent is not None:
|
||||||
|
parent = progress_parent
|
||||||
|
|
||||||
sql_request_count = self._study.sql_save_request_count()
|
sql_request_count = self._study.sql_save_request_count()
|
||||||
progress = QProgressDialog(
|
progress = QProgressDialog(
|
||||||
"Saving...", None,
|
"Saving...", None,
|
||||||
0, sql_request_count,
|
0, sql_request_count,
|
||||||
parent=self
|
parent=parent
|
||||||
)
|
)
|
||||||
progress.setWindowModality(Qt.WindowModal)
|
progress.setWindowModality(Qt.WindowModal)
|
||||||
progress.setValue(0)
|
progress.setValue(0)
|
||||||
|
|
@ -684,6 +691,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
progress=lambda: progress.setValue(progress.value() + 1)
|
progress=lambda: progress.setValue(progress.value() + 1)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
progress.close()
|
||||||
status += " Done"
|
status += " Done"
|
||||||
logger.info(status)
|
logger.info(status)
|
||||||
self.statusbar.showMessage(status, 3000)
|
self.statusbar.showMessage(status, 3000)
|
||||||
|
|
@ -758,6 +766,8 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
|
|
||||||
progress.setValue(progress.value() + 1)
|
progress.setValue(progress.value() + 1)
|
||||||
|
|
||||||
|
progress.close()
|
||||||
|
|
||||||
def save_as_study_single_scenario(self, sid=-1):
|
def save_as_study_single_scenario(self, sid=-1):
|
||||||
sql_request_count = self._study.sql_save_request_count()
|
sql_request_count = self._study.sql_save_request_count()
|
||||||
|
|
||||||
|
|
@ -782,6 +792,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
)
|
)
|
||||||
|
|
||||||
status += " Done"
|
status += " Done"
|
||||||
|
progress.close()
|
||||||
logger.info(status)
|
logger.info(status)
|
||||||
self.statusbar.showMessage(status, 3000)
|
self.statusbar.showMessage(status, 3000)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -182,6 +182,7 @@ class PamhyrWindow(ASubMainWindow, ListedSubWindow, PamhyrWindowTools):
|
||||||
|
|
||||||
self._set_title()
|
self._set_title()
|
||||||
self._set_icon()
|
self._set_icon()
|
||||||
|
self._setup_save_sc()
|
||||||
|
|
||||||
def _set_title(self):
|
def _set_title(self):
|
||||||
title = self._title
|
title = self._title
|
||||||
|
|
@ -196,12 +197,25 @@ class PamhyrWindow(ASubMainWindow, ListedSubWindow, PamhyrWindowTools):
|
||||||
|
|
||||||
self.ui.setWindowTitle(title)
|
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):
|
def closeEvent(self, event):
|
||||||
self._close_sub_window()
|
self._close_sub_window()
|
||||||
self._propagate_update(Modules.WINDOW_LIST)
|
self._propagate_update(Modules.WINDOW_LIST)
|
||||||
|
|
||||||
super(PamhyrWindow, self).closeEvent(event)
|
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):
|
class PamhyrDialog(ASubWindow, ListedSubWindow, PamhyrWindowTools):
|
||||||
_pamhyr_ui = "dummy"
|
_pamhyr_ui = "dummy"
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ class WaitingDialog(PamhyrDialog):
|
||||||
". ", ". ",
|
". ", ". ",
|
||||||
".. ", ".. ",
|
".. ", ".. ",
|
||||||
"...", "..."],
|
"...", "..."],
|
||||||
["o ", " o ", " o ", " o", " o ", " o "],
|
["o ", " o ", " o ", " o", " o ", " o "],
|
||||||
["█▓▒░", "▓█▓▒", "▒▓█▓", "░▒▓█", "▒▓█▓", "▓█▓▒"],
|
["█▓▒░", "▓█▓▒", "▒▓█▓", "░▒▓█", "▒▓█▓", "▓█▓▒"],
|
||||||
"▖▘▝▗",
|
"▖▘▝▗",
|
||||||
"αβγδεζηθικλμνξοπρστυφχψω",
|
"αβγδεζηθικλμνξοπρστυφχψω",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue