Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions src/fourc_webviewer/fourc_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,16 +1012,8 @@ def change_edit_mode(self, edit_mode, **kwargs):
if (
edit_mode == self.state.all_edit_modes["view_mode"]
): # after edit mode we are again in view mode
self.state.general_sections = convert_string2number(
self.state.general_sections
)
self.state.materials_section = convert_string2number(
self.state.materials_section
)
self.state.dc_sections = convert_string2number(self.state.dc_sections)
self.state.result_description_section = convert_string2number(
self.state.result_description_section
)
self.convert_string2num_all_sections()

# for now we don't convert the function section, because it
# works itself with strings, e.g.
# 'SYMBOLIC_FUNCTION_OF_SPACE_TIME' is a string even if it
Expand All @@ -1034,6 +1026,7 @@ def change_export_mode(self, export_mode, **kwargs):
"""Reaction to change of state.export_mode."""
# revert export status to "INFO"
self.state.export_status = self.state.all_export_statuses["info"]
self.convert_string2num_all_sections()

"""------------------- Controller functions -------------------"""

Expand Down Expand Up @@ -1111,6 +1104,18 @@ def click_save_button(self, **kwargs):

""" --- Other helper functions"""

def convert_string2num_all_sections(self):
"""Converts string to num wherever possible for all considered
sections."""
self.state.general_sections = convert_string2number(self.state.general_sections)
self.state.materials_section = convert_string2number(
self.state.materials_section
)
self.state.dc_sections = convert_string2number(self.state.dc_sections)
self.state.result_description_section = convert_string2number(
self.state.result_description_section
)

def determine_master_mat_ind_for_current_selection(self):
"""Determines the real master/source material of the currently selected
material. Accounts for CLONING MATERIAL MAP by going one step further
Expand Down