Skip to content

Commit a95a1c8

Browse files
authored
Merge pull request #258 from PhysiCell-Tools/development
Bug fixes and several improvements (visible in the GUI or just to the code)
2 parents 2c59e2a + ff26270 commit a95a1c8

56 files changed

Lines changed: 2203 additions & 13379 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.39.2
1+
2.40.0

bin/cell_def_tab.py

Lines changed: 953 additions & 1940 deletions
Large diffs are not rendered by default.

bin/config_tab.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from PyQt5.QtWidgets import QFrame,QApplication,QWidget,QTabWidget,QLineEdit,QHBoxLayout,QVBoxLayout,QRadioButton,QPushButton, QLabel,QCheckBox,QComboBox,QScrollArea,QGridLayout, QFileDialog,QSpinBox,QDoubleSpinBox, QButtonGroup # , QMessageBox
1717
# from PyQt5.QtWidgets import QMessageBox
1818

19-
from studio_classes import QLabelSeparator, QLineEdit_custom, QCheckBox_custom, QRadioButton_custom
19+
from studio_classes import QLabelSeparator, QLineEdit_custom, QCheckBox_custom, QRadioButton_custom, HoverWarning
2020
from studio_functions import style_sheet_template
2121

2222
class RandomSeedIntValidator(QtGui.QValidator):
@@ -43,16 +43,17 @@ def validate(self, text, pos):
4343

4444
class Config(QWidget):
4545
# def __init__(self, nanohub_flag):
46-
def __init__(self, studio_flag):
46+
def __init__(self, xml_creator):
4747
super().__init__()
4848
# global self.config_params
4949

50+
self.xml_creator = xml_creator
51+
5052
self.default_time_units = "min"
5153

5254
# self.nanohub_flag = nanohub_flag
5355
self.nanohub_flag = False
5456

55-
self.studio_flag = studio_flag
5657
self.vis_tab = None
5758
self.ics_tab = None
5859

@@ -358,9 +359,8 @@ def __init__(self, studio_flag):
358359
self.random_seed_integer.setValidator(RandomSeedIntValidator())
359360
hbox.addWidget(self.random_seed_integer)
360361

361-
self.random_seed_warning = QLabel()
362-
self.random_seed_warning.setStyleSheet("color: red;")
363-
hbox.addWidget(self.random_seed_warning)
362+
self.random_seed_warning_label = HoverWarning("WARNING: random_seed in user_parameters will take precedence if it remains.")
363+
hbox.addWidget(self.random_seed_warning_label)
364364

365365
hbox.addStretch()
366366

@@ -585,6 +585,17 @@ def random_seed_gp_cb(self, id):
585585
self.random_seed_integer.setEnabled(True)
586586
self.random_seed_integer.check_validity() # set color based on current validity
587587

588+
# see if random_seed remains in user_parameters
589+
if hasattr(self.xml_creator, 'user_params_tab'):
590+
# this is called before user_params_tab is created one time, so make sure it exists
591+
for idx in range(self.xml_creator.user_params_tab.count):
592+
v_name = self.xml_creator.user_params_tab.utable.cellWidget(idx,self.xml_creator.user_params_tab.var_icol_name).text()
593+
if v_name=="random_seed":
594+
self.random_seed_warning_label.show_icon()
595+
return
596+
self.random_seed_warning_label.hide_icon()
597+
598+
588599
def random_seed_integer_cb(self, text):
589600
if text == "":
590601
self.random_seed_integer.setPlaceholderText("system_clock") # warn the user that this will set the seed to system_clock
@@ -717,7 +728,7 @@ def fill_gui(self):
717728
self.random_seed_random_button.setChecked(True)
718729

719730
if self.xml_root.find(".//user_parameters//random_seed") is not None:
720-
self.random_seed_warning.setText("WARNING: random_seed in user_parameters found in xml loading.\nThat parameter will take precedence if it remains.")
731+
self.random_seed_warning_label.show_icon()
721732

722733
# self.disable_auto_springs.setChecked(False)
723734
# if self.xml_root.find(".//disable_automated_spring_adhesions") is not None:
@@ -742,9 +753,6 @@ def fill_gui(self):
742753
self.num_threads.setText(self.xml_root.find(".//omp_num_threads").text)
743754

744755
self.folder.setText(self.xml_root.find(".//save//folder").text)
745-
# print("\n----------------config_tab: fill_gui(): folder= ",self.folder.text())
746-
# if self.studio_flag:
747-
# self.plot_folder.setText(self.xml_root.find(".//folder").text)
748756

749757
self.svg_interval.setText(self.xml_root.find(".//SVG//interval").text)
750758
# NOTE: do this *after* filling the mcds_interval, directly above, due to the callback/constraints on them??
@@ -1054,7 +1062,7 @@ def import_seeding_cb(self):
10541062

10551063
# self.add_new_model(self.current_xml_file, True)
10561064
# self.config_file = self.current_xml_file
1057-
# if self.studio_flag:
1065+
# if self.xml_creator.studio_flag:
10581066
# self.run_tab.config_file = self.current_xml_file
10591067
# self.run_tab.config_xml_name.setText(self.current_xml_file)
10601068
# self.show_sample_model()

bin/ics_tab.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from PyQt5.QtWidgets import QFrame,QApplication,QWidget,QTabWidget,QFormLayout,QLineEdit, QHBoxLayout,QVBoxLayout,QRadioButton,QLabel,QCheckBox,QComboBox,QScrollArea, QMainWindow,QGridLayout, QPushButton, QFileDialog, QMessageBox, QStackedWidget, QSplitter
3131
from PyQt5.QtGui import QPixmap
3232

33-
from studio_classes import QHLine, HoverLabel,DoubleValidatorWidgetBounded
33+
from studio_classes import QHLine,DoubleValidatorWidgetBounded, HoverQuestion
3434
from studio_functions import style_sheet_template
3535
from biwt_tab import BioinformaticsWalkthrough
3636

@@ -641,8 +641,9 @@ def create_base_ics_tab(self):
641641
* click again to stop (or leave the plot area)
642642
* Note: the Gaussian brush will only update a pixel value if it is greater than the current value
643643
"""
644-
self.help_label = HoverLabel("Help", msg)
645-
hbox.addWidget(self.help_label)
644+
self.ic_substrate_question_label = HoverQuestion(msg)
645+
self.ic_substrate_question_label.show_icon()
646+
hbox.addWidget(self.ic_substrate_question_label)
646647

647648
hbox.addStretch(1)
648649
self.vbox.addLayout(hbox)
Lines changed: 24 additions & 0 deletions
Loading

bin/images/info.svg

Lines changed: 25 additions & 0 deletions
Loading

bin/images/warning.svg

Lines changed: 23 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)