Changeset 318b5bbb in sasview for fittingview/src/sans/perspectives/fitting/basepage.py
- Timestamp:
- Dec 18, 2012 10:55:24 AM (12 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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 6550b64
- Parents:
- 0203ade
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/basepage.py
r657e52c r318b5bbb 147 147 ## smearer object 148 148 self.enable2D = False 149 self._has_magnetic = False 150 self.magnetic_on = False 149 151 self.is_mac = ON_MAC 150 152 self.formfactorbox = None … … 1229 1231 1230 1232 self.enable2D = state.enable2D 1233 try: 1234 self.magnetic_on = state.magnetic_on 1235 except: 1236 # Backward compatibility (for older state files) 1237 self.magnetic_on = False 1231 1238 self.engine_type = state.engine_type 1232 1239 … … 2267 2274 self.model = None 2268 2275 return self.model 2269 2276 # check if model has magnetic parameters 2277 if len(self.model.magnetic_params) > 0: 2278 self._has_magnetic = True 2279 else: 2280 self._has_magnetic = False 2270 2281 ## post state to fit panel 2271 2282 self.state.parameters = [] … … 2951 2962 name = self.formfactorbox.GetValue() 2952 2963 frame = HelpWindow(None, -1, pageToOpen=model_path) 2964 # If model name exists and model is not a custom model 2965 #mod_cat = self.categorybox.GetStringSelection() 2953 2966 if frame.rhelp.HasAnchor(name): 2954 2967 frame.Show(True) … … 2967 2980 frame.Show(True) 2968 2981 2982 def _on_mag_help(self, event): 2983 """ 2984 Magnetic angles help panel 2985 """ 2986 from sans.perspectives.fitting.help_panel import HelpWindow 2987 # Get models help model_function path 2988 #import sans.perspectives.fitting as fitmedia 2989 from sans.models import get_data_path 2990 2991 media = get_data_path(media='media') 2992 path = os.path.join(media, 'img', "M_angles_pic.bmp") 2993 name = "Polar/Magnetic Angles" 2994 frame = HelpWindow(None, -1, 2995 title=' Help: Polarization/Magnetization Angles', 2996 pageToOpen=path, size=(865, 450)) 2997 try: 2998 frame.splitter.DetachWindow(frame.lpanel) 2999 # Display only the right side one 3000 frame.lpanel.Hide() 3001 frame.Show(True) 3002 except: 3003 frame.Destroy() 3004 msg = 'Display Error\n' 3005 info = "Info" 3006 wx.MessageBox(msg, info) 3007 3008 def _on_mag_on(self, event): 3009 """ 3010 Magnetic Parameters ON/OFF 3011 """ 3012 button = event.GetEventObject() 3013 3014 if button.GetLabel().count('ON') > 0: 3015 self.magnetic_on = True 3016 button.SetLabel("Magnetic OFF") 3017 m_value = 1.0e-06 3018 for key in self.model.magnetic_params: 3019 if key.count('M0') > 0: 3020 self.model.setParam(key, m_value) 3021 m_value += 0.5e-06 3022 else: 3023 self.magnetic_on = False 3024 button.SetLabel("Magnetic ON") 3025 for key in self.model.magnetic_params: 3026 if key.count('M0') > 0: 3027 #reset mag value to zero fo safety 3028 self.model.setParam(key, 0.0) 3029 3030 self.Show(False) 3031 self.set_model_param_sizer(self.model) 3032 #self._set_sizer_dispersion() 3033 self.state.magnetic_on = self.magnetic_on 3034 self.SetupScrolling() 3035 self.Show(True) 2969 3036 2970 3037 def on_pd_help_clicked(self, event): … … 3424 3491 str_m = str(model).split(".")[0] 3425 3492 self.model_box.Append(str_m) 3426 print 'but not here'3427 3493 3428 3494 else:
Note: See TracChangeset
for help on using the changeset viewer.