- Timestamp:
- Nov 30, 2016 4:31:28 PM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 0b1d7d3
- Parents:
- 406644a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
r406644a r7602675 1577 1577 return 1578 1578 1579 ordered_list = [] 1580 for i in range(len(listtorestore)) : 1579 for j in range(len(listtorestore)): 1581 1580 for param in statelist: 1582 if param[1] == listtorestore[i][1]: 1583 ordered_list.append(param) 1581 if param[1] == listtorestore[j][1]: 1582 item_page = listtorestore[j] 1583 item_page_info = statelist[j] 1584 if (item_page_info[1] == "theta" or item_page_info[1] == 1585 "phi") and not self._is_2D(): 1586 break 1587 # change the state of the check box for simple parameters 1588 if item_page[0] is not None: 1589 item_page[0].SetValue(item_page_info[0]) 1590 if item_page[2] is not None: 1591 # TODO: On loading save state, should try to coerce 1592 # TODO: length and scale params to positive values 1593 item_page[2].SetValue(item_page_info[2]) 1594 if item_page[2].__class__.__name__ == "ComboBox": 1595 if item_page_info[2] in self.model.fun_list: 1596 fun_val = self.model.fun_list[item_page_info[2]] 1597 self.model.setParam(item_page_info[1], fun_val) 1598 if item_page[3] is not None: 1599 # show or hide text +/- 1600 if item_page_info[2]: 1601 item_page[3].Show(True) 1602 else: 1603 item_page[3].Hide() 1604 if item_page[4] is not None: 1605 # show of hide the text crtl for fitting error 1606 if item_page_info[4][0]: 1607 item_page[4].Show(True) 1608 item_page[4].SetValue(item_page_info[4][1]) 1609 else: 1610 item_page[3].Hide() 1611 if item_page[5] is not None: 1612 # show of hide the text crtl for fitting error 1613 item_page[5].Show(item_page_info[5][0]) 1614 item_page[5].SetValue(item_page_info[5][1]) 1615 1616 if item_page[6] is not None: 1617 # show of hide the text crtl for fitting error 1618 item_page[6].Show(item_page_info[6][0]) 1619 item_page[6].SetValue(item_page_info[6][1]) 1620 1584 1621 break 1585 if len(ordered_list) != len(statelist) \1586 and len(ordered_list) != len(listtorestore):1587 return1588 statelist = ordered_list1589 1590 #FIXME: Get rid of check above and simple assign params based on name1591 for j in range(len(statelist)) if len(statelist) < len(listtorestore) \1592 else range(len(listtorestore)):1593 item_page = listtorestore[j]1594 item_page_info = statelist[j]1595 if (item_page_info[1] == "theta" or item_page_info[1] == "phi") \1596 and not self._is_2D():1597 break1598 # change the state of the check box for simple parameters1599 if item_page[0] is not None:1600 item_page[0].SetValue(item_page_info[0])1601 if item_page[2] is not None:1602 # TODO: On loading save state, should try to coerce length and1603 # TODO: scale params to positive values1604 item_page[2].SetValue(item_page_info[2])1605 if item_page[2].__class__.__name__ == "ComboBox":1606 if item_page_info[2] in self.model.fun_list:1607 fun_val = self.model.fun_list[item_page_info[2]]1608 self.model.setParam(item_page_info[1], fun_val)1609 if item_page[3] is not None:1610 # show or hide text +/-1611 if item_page_info[2]:1612 item_page[3].Show(True)1613 else:1614 item_page[3].Hide()1615 if item_page[4] is not None:1616 # show of hide the text crtl for fitting error1617 if item_page_info[4][0]:1618 item_page[4].Show(True)1619 item_page[4].SetValue(item_page_info[4][1])1620 else:1621 item_page[3].Hide()1622 if item_page[5] is not None:1623 # show of hide the text crtl for fitting error1624 item_page[5].Show(item_page_info[5][0])1625 item_page[5].SetValue(item_page_info[5][1])1626 1627 if item_page[6] is not None:1628 # show of hide the text crtl for fitting error1629 item_page[6].Show(item_page_info[6][0])1630 item_page[6].SetValue(item_page_info[6][1])1631 1622 1632 1623 def _reset_strparam_state(self, listtorestore, statelist):
Note: See TracChangeset
for help on using the changeset viewer.