Skip to content

Commit

Permalink
more code protection
Browse files Browse the repository at this point in the history
  • Loading branch information
SanPen committed Sep 20, 2024
1 parent f341a2f commit 10fc769
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
21 changes: 10 additions & 11 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions src/GridCal/Gui/Main/SubClasses/simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,14 @@ def changed_study(self):
drv_dict = {driver.tpe.value: driver for driver in self.get_available_drivers()}
drv = drv_dict.get(current_study_name, None)
if drv is not None and hasattr(drv, 'time_indices'):
if len(drv.time_indices):
a = drv.time_indices[0]
b = drv.time_indices[-1]
self.ui.diagram_step_slider.setRange(a, b)
self.ui.diagram_step_slider.setValue(a)
if drv.time_indices is not None:
if len(drv.time_indices):
a = drv.time_indices[0]
b = drv.time_indices[-1]
self.ui.diagram_step_slider.setRange(a, b)
self.ui.diagram_step_slider.setValue(a)
else:
self.setup_time_sliders()
else:
self.setup_time_sliders()
else:
Expand Down

0 comments on commit 10fc769

Please sign in to comment.