Skip to content

Commit

Permalink
Merge pull request #91 from PhysiCell-Tools/development
Browse files Browse the repository at this point in the history
updates
  • Loading branch information
rheiland authored May 30, 2023
2 parents f079209 + b75a7cb commit a73af46
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 52 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.25.0
2.25.6
29 changes: 28 additions & 1 deletion bin/rules_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,11 @@ def __init__(self, nanohub_flag, microenv_tab, celldef_tab):
hlayout = QHBoxLayout()
# hlayout.addStretch(0)

wwidth = 300
# self.signal_combobox = QComboBox()
self.signal_model = QStandardItemModel()
self.signal_combobox = ExtendedCombo()
self.signal_combobox.setFixedWidth(wwidth)
self.signal_combobox.setModel(self.signal_model)
self.signal_combobox.setModelColumn(0)

Expand All @@ -348,6 +350,7 @@ def __init__(self, nanohub_flag, microenv_tab, celldef_tab):
# Behavior combobox
self.response_model = QStandardItemModel()
self.response_combobox = ExtendedCombo()
self.response_combobox.setFixedWidth(wwidth)
self.response_combobox.setModel(self.response_model)
self.response_combobox.setModelColumn(0)
self.response_combobox.currentIndexChanged.connect(self.response_combobox_changed_cb)
Expand Down Expand Up @@ -585,6 +588,8 @@ def __init__(self, nanohub_flag, microenv_tab, celldef_tab):
# person_groupbox.setLayout(form_layout)

self.import_rules_button = QPushButton("Import")
if self.nanohub_flag:
self.import_rules_button.setEnabled(False)
self.import_rules_button.setFixedWidth(100)
self.import_rules_button.setStyleSheet("background-color: lightgreen")
self.import_rules_button.clicked.connect(self.import_rules_cb)
Expand All @@ -598,6 +603,8 @@ def __init__(self, nanohub_flag, microenv_tab, celldef_tab):
# hlayout.addWidget(self.load_button)

self.save_button = QPushButton("Save")
if self.nanohub_flag:
self.save_button.setEnabled(False)
self.save_button.setFixedWidth(100)
# self.save_button.setStyleSheet("background-color: lightgreen")
self.save_button.setStyleSheet("background-color: yellow")
Expand All @@ -612,6 +619,8 @@ def __init__(self, nanohub_flag, microenv_tab, celldef_tab):
label.setAlignment(QtCore.Qt.AlignCenter)
hbox1.addWidget(label)
self.rules_folder = QLineEdit()
# if self.nanohub_flag:
# self.rules_folder.setEnabled(False)
self.rules_folder.setFixedWidth(200)
# self.rules_folder.setAlignment(QtCore.Qt.AlignLeft)
hbox1.addWidget(self.rules_folder)
Expand All @@ -624,6 +633,8 @@ def __init__(self, nanohub_flag, microenv_tab, celldef_tab):
label.setAlignment(QtCore.Qt.AlignCenter)
hbox2.addWidget(label)
self.rules_file = QLineEdit()
if self.nanohub_flag:
self.rules_file.setEnabled(False)
self.rules_file.setFixedWidth(200)
hbox2.addWidget(self.rules_file)
hlayout.addLayout(hbox2)
Expand Down Expand Up @@ -1640,10 +1651,23 @@ def save_rules_cb(self):
# self.rules_file.setText("")
return

#-----------------------------------------------------------
def clear_comboboxes(self):
# self.substrates.clear()
self.signal_l.clear()
self.response_l.clear()

self.celltype_combobox.clear()
self.signal_combobox.clear()
self.response_combobox.clear()

#-----------------------------------------------------------
def fill_signals_widget(self):
# print("\n rules_tab:-------------------fill_signals_widget()")
self.signal_l.clear()
self.signal_combobox.clear()

# print("\n fill_signals_widget(): self.substrates= ",self.substrates)

for s in self.substrates:
self.signal_l.append(s)
Expand Down Expand Up @@ -1681,6 +1705,7 @@ def fill_signals_widget(self):
#-----------------------------------------------------------
def fill_responses_widget(self):
self.response_l.clear()
self.response_combobox.clear()

# TODO: figure out how best to organize these responses
for s in self.substrates:
Expand Down Expand Up @@ -1736,6 +1761,8 @@ def fill_gui(self):
# logging.debug(f'\n\n------------\nrules_tab.py: fill_gui():')
print(f'\n\n------------\nrules_tab.py: fill_gui():')

self.clear_comboboxes()

# print("rules_tab.py: fill_gui(): self.celldef_tab.param_d.keys()= ",self.celldef_tab.param_d.keys())
for key in self.celldef_tab.param_d.keys():
# logging.debug(f'cell type ---> {key}')
Expand Down Expand Up @@ -1785,7 +1812,7 @@ def fill_gui(self):
if folder_name == None:
msg += " rules file "
msg += " missing from .xml"
self.show_warning(msg)
# self.show_warning(msg)

self.rules_folder.setText("")
self.rules_file.setText("")
Expand Down
Loading

0 comments on commit a73af46

Please sign in to comment.