Changeset 2d0756a5 in sasview for fittingview/src/sans/perspectives
- Timestamp:
- Apr 26, 2012 11:23:33 AM (13 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:
- 0318c4f
- Parents:
- e26719b
- Location:
- fittingview/src/sans/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/fitpage.py
r14cd6b92 r2d0756a5 154 154 When fit is complete ,reset the fit button label. 155 155 """ 156 self. btFit.SetLabel("Fit")156 self.set_fitbutton() 157 157 158 158 def _is_2D(self): … … 1084 1084 Allow to fit 1085 1085 """ 1086 if event != None: 1087 event.Skip() 1086 1088 if self.fit_started: 1087 1089 self._StopFit() 1088 1089 if event != None: 1090 event.Skip() 1090 self.fit_started = False 1091 wx.CallAfter(self.set_fitbutton) 1092 return 1093 1091 1094 if len(self.parent._manager.fit_thread_list)>0 and\ 1092 1095 self.parent._manager._fit_engine != "park" and\ … … 1146 1149 1147 1150 #single fit 1148 self._manager.onFit(uid=self.uid) 1149 self.fit_started = True 1150 self.btFit.SetLabel("Stop") 1151 1151 #self._manager.onFit(uid=self.uid) 1152 self.fit_started = self._manager.onFit(uid=self.uid) 1153 wx.CallAfter(self.set_fitbutton) 1154 1155 def set_fitbutton(self): 1156 """ 1157 Set fit button label depending on the fit_started[bool] 1158 """ 1159 if self.fit_started: 1160 label = "Stop" 1161 color = "red" 1162 else: 1163 label = "Fit" 1164 color = "black" 1165 self.btFit.Enable(False) 1166 self.btFit.SetLabel(label) 1167 self.btFit.SetForegroundColour(color) 1168 self.btFit.Enable(True) 1169 1152 1170 def get_weight_flag(self): 1153 1171 """ … … 1172 1190 return flag 1173 1191 1174 def bind_fit_button(self):1175 """1176 bind the fit button to either fit handler or stop fit handler1177 """1178 self.btFit.Unbind(event=wx.EVT_BUTTON, id= self.btFit.GetId())1179 if self.btFit.GetLabel().lower() == "stop":1180 self.fit_started = True1181 self.btFit.SetForegroundColour('red')1182 self.btFit.Bind(event=wx.EVT_BUTTON, handler=self._StopFit,1183 id=self.btFit.GetId())1184 elif self.btFit.GetLabel().lower() == "fit":1185 self.fit_started = False1186 self.btFit.SetDefault()1187 self.btFit.SetForegroundColour('black')1188 #self.btFit.SetBackgroundColour(self.default_bt_colour)1189 self.btFit.Bind(event=wx.EVT_BUTTON, handler=self._onFit,1190 id=self.btFit.GetId())1191 else:1192 msg = "FitPage: fit button has unknown label"1193 raise RuntimeError, msg1194 self._manager._reset_schedule_problem(value=0)1195 1196 def is_fitting(self):1197 if self.fit_started:1198 self._StopFit(event=None)1199 1192 1200 1193 def _StopFit(self, event=None): … … 1202 1195 Stop fit 1203 1196 """ 1204 #time.sleep(0.1)1205 1197 if event != None: 1206 1198 event.Skip() 1207 #if self.engine_type=="scipy":1208 1199 self._manager.stop_fit(self.uid) 1209 1200 self._manager._reset_schedule_problem(value=0) -
fittingview/src/sans/perspectives/fitting/fitting.py
r278b995 r2d0756a5 1609 1609 wx.CallAfter(cpage._on_fit_complete) 1610 1610 except: 1611 msg = "Singular point: Fitting Error occur ed."1611 msg = "Singular point: Fitting Error occurred." 1612 1612 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error", 1613 1613 type="stop"))
Note: See TracChangeset
for help on using the changeset viewer.