Changeset 7432acb in sasview for src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py
- Timestamp:
- Apr 9, 2017 6:11:31 AM (7 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 45dffa69
- Parents:
- ac07a3a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py
rac07a3a r7432acb 61 61 Add icon in the frame 62 62 """ 63 if parent !=None:63 if parent is not None: 64 64 if hasattr(frame, "IsIconized"): 65 65 if not frame.IsIconized(): … … 74 74 Set_error dialog 75 75 """ 76 if item !=None:76 if item is not None: 77 77 item.SetBackgroundColour("pink") 78 78 item.Refresh() 79 79 if show_msg: 80 80 msg = "Error: wrong (or out of range) value entered." 81 if panel.parent.parent !=None:81 if panel.parent.parent is not None: 82 82 wx.PostEvent(panel.parent.parent, 83 83 StatusEvent(status=msg, info='Error')) … … 425 425 """ 426 426 unit = 'sec' 427 if self.time_text !=None:427 if self.time_text is not None: 428 428 self.time_text.SetForegroundColour('black') 429 429 etime = self.estimate_ctime() … … 633 633 self.model.set_sld_data(self.sld_data) 634 634 635 self.draw_button.Enable(self.sld_data !=None)635 self.draw_button.Enable(self.sld_data is not None) 636 636 wx.CallAfter(self.parent.set_sld_data, self.sld_data) 637 637 self._update_model_params() … … 855 855 """ 856 856 flag = self.parent.check_omfpanel_inputs() 857 if not flag and self.parent.parent !=None:857 if not flag and self.parent.parent is not None: 858 858 infor = 'Error' 859 859 msg = 'Error: Wrong inputs in the SLD info panel.' … … 865 865 self.sld_data = self.parent.get_sld_from_omf() 866 866 if self.sld_data is None: 867 if self.parent.parent !=None:867 if self.parent.parent is not None: 868 868 infor = 'Error' 869 869 msg = 'Error: No data has been selected.' … … 971 971 self.bt_compute.SetLabel(label) 972 972 self.bt_compute.SetToolTipString(label) 973 if self.parent.parent !=None:973 if self.parent.parent is not None: 974 974 wx.PostEvent(self.parent.parent, 975 975 StatusEvent(status=msg, type=type)) … … 995 995 for ind in range(len(input[0])): 996 996 if self.is_avg: 997 if ind % 1 == 0 and update !=None:997 if ind % 1 == 0 and update is not None: 998 998 update() 999 999 time.sleep(0.1) … … 1002 1002 out = np.append(out, outi) 1003 1003 else: 1004 if ind % 50 == 0 and update !=None:1004 if ind % 50 == 0 and update is not None: 1005 1005 update() 1006 1006 time.sleep(0.001) … … 1151 1151 new_plot.label = new_plot.id 1152 1152 #theory_data = deepcopy(new_plot) 1153 if self.parent.parent !=None:1153 if self.parent.parent is not None: 1154 1154 self.parent.parent.update_theory(data_id=new_plot.id, 1155 1155 theory=new_plot, … … 1210 1210 new_plot.label = new_plot.id 1211 1211 #theory_data = deepcopy(new_plot) 1212 if self.parent.parent !=None:1212 if self.parent.parent is not None: 1213 1213 self.parent.parent.update_theory(data_id=data.id, 1214 1214 theory=new_plot, … … 1299 1299 mz = sld_sets[key] 1300 1300 else: 1301 if sld_sets[key] !=None:1301 if sld_sets[key] is not None: 1302 1302 self.sld_data.set_sldn(sld_sets[key]) 1303 1303 self.sld_data.set_sldms(mx, my, mz) … … 1347 1347 infor = 'Error' 1348 1348 #logger.error(msg) 1349 if self.parent.parent !=None:1349 if self.parent.parent is not None: 1350 1350 # inform msg to wx 1351 1351 wx.PostEvent(self.parent.parent, … … 1690 1690 data = self.parent.get_sld_data() 1691 1691 fName = os.path.splitext(path)[0] + '.' + extension.split('.')[-1] 1692 if data !=None:1692 if data is not None: 1693 1693 try: 1694 1694 reader.write(fName, data) … … 1699 1699 infor = 'Error' 1700 1700 #logger.error(msg) 1701 if self.parent.parent !=None:1701 if self.parent.parent is not None: 1702 1702 # inform msg to wx 1703 1703 wx.PostEvent(self.parent.parent, … … 1708 1708 msg = "Error occurred while saving. " 1709 1709 infor = 'Error' 1710 if self.parent.parent !=None:1710 if self.parent.parent is not None: 1711 1711 # inform msg to wx 1712 1712 wx.PostEvent(self.parent.parent, … … 1718 1718 """ 1719 1719 flag = True 1720 if event !=None:1720 if event is not None: 1721 1721 event.Skip() 1722 1722 ctl = event.GetEventObject() … … 1758 1758 """ 1759 1759 flag = True 1760 if event !=None:1760 if event is not None: 1761 1761 event.Skip() 1762 1762 ctl = event.GetEventObject() … … 1974 1974 Send full draw to gui frame 1975 1975 """ 1976 if self.parent !=None:1976 if self.parent is not None: 1977 1977 self.parent.set_schedule_full_draw(panel, func) 1978 1978 … … 2050 2050 Close 2051 2051 """ 2052 if self.base !=None:2052 if self.base is not None: 2053 2053 self.base.gen_frame = None 2054 2054 self.Destroy()
Note: See TracChangeset
for help on using the changeset viewer.