- Timestamp:
- Aug 2, 2017 11:33:30 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:
- a0e6b1b
- Parents:
- 490c617
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/pr/inversion_panel.py
r7432acb r5c3c310 70 70 self.rg_ctl = None 71 71 self.iq0_ctl = None 72 self.bck_chk = None 72 self.bck_value = None 73 self.bck_est_ctl = None 74 self.bck_man_ctl = None 75 self.has_bck = True 76 self.bck_input = None 73 77 self.bck_ctl = None 74 78 … … 326 330 327 331 # Background evaluation checkbox 328 state.estimate_bck = self.bck_ chk.IsChecked()332 state.estimate_bck = self.bck_est_ctl.GetValue() 329 333 330 334 # Estimates … … 372 376 373 377 # Background evaluation checkbox 374 self.bck_ chk.SetValue(state.estimate_bck)378 self.bck_man_ctl.SetValue(state.estimate_bck) 375 379 376 380 # Estimates … … 431 435 wx.EXPAND | wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, 15) 432 436 433 self.bck_chk = wx.CheckBox(self, -1, "Estimate background level") 434 hint_msg = "Check box to let the fit estimate " 435 hint_msg += "the constant background level." 436 self.bck_chk.SetToolTipString(hint_msg) 437 self.bck_chk.Bind(wx.EVT_CHECKBOX, self._on_pars_changed) 438 iy += 1 439 pars_sizer.Add(self.bck_chk, (iy, 0), (1, 2), 437 radio_sizer = wx.GridBagSizer(5, 5) 438 439 self.bck_est_ctl = wx.RadioButton(self, -1, "Estimate background level", 440 name="estimate_bck", style=wx.RB_GROUP) 441 self.bck_man_ctl = wx.RadioButton(self, -1, "Input manual background level", 442 name="manual_bck") 443 444 self.bck_est_ctl.Bind(wx.EVT_RADIOBUTTON, self._on_bck_changed) 445 self.bck_man_ctl.Bind(wx.EVT_RADIOBUTTON, self._on_bck_changed) 446 447 radio_sizer.Add(self.bck_est_ctl, (0,0), (1,1), wx.LEFT | wx.EXPAND) 448 radio_sizer.Add(self.bck_man_ctl, (0,1), (1,1), wx.RIGHT | wx.EXPAND) 449 450 iy += 1 451 pars_sizer.Add(radio_sizer, (iy, 0), (1, 2), 440 452 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 453 454 background_label = wx.StaticText(self, -1, "Background: ") 455 self.bck_input = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, 456 size=(60, 20), value="0.0") 457 self.bck_input.Disable() 458 background_units = wx.StaticText(self, -1, "[A^(-1)]", size=(55, 20)) 459 iy += 1 460 461 background_sizer = wx.GridBagSizer(5, 5) 462 463 background_sizer.Add(background_label, (0, 0), (1,1), 464 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 23) 465 background_sizer.Add(self.bck_input, (0, 1), (1,1), 466 wx.LEFT | wx.ADJUST_MINSIZE, 5) 467 background_sizer.Add(background_units, (0, 2), (1,1), 468 wx.LEFT | wx.ADJUST_MINSIZE, 5) 469 pars_sizer.Add(background_sizer, (iy, 0), (1, 2), 470 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 471 441 472 boxsizer1.Add(pars_sizer, 0, wx.EXPAND) 442 473 vbox.Add(boxsizer1, (iy_vb, 0), (1, 1), … … 764 795 self._on_pars_changed() 765 796 797 def _on_bck_changed(self, evt=None): 798 self.has_bck = self.bck_est_ctl.GetValue() 799 if self.has_bck: 800 self.bck_input.Disable() 801 else: 802 self.bck_input.Enable() 803 766 804 def _on_pars_changed(self, evt=None): 767 805 """ … … 771 809 """ 772 810 flag, alpha, dmax, nfunc, qmin, qmax, height, width = self._read_pars() 773 has_bck = self.bck_chk.IsChecked()774 811 775 812 # If the pars are valid, estimate alpha … … 783 820 d_max=dmax, 784 821 q_min=qmin, q_max=qmax, 785 bck= has_bck,822 bck=self.has_bck, 786 823 height=height, 787 824 width=width) … … 916 953 917 954 flag, alpha, dmax, nfunc, qmin, qmax, height, width = self._read_pars() 918 has_bck = self.bck_chk.IsChecked()919 955 920 956 if flag: … … 928 964 d_max=dmax, 929 965 q_min=qmin, q_max=qmax, 930 bck= has_bck,966 bck=self.has_bck, 931 967 height=height, 932 968 width=width)
Note: See TracChangeset
for help on using the changeset viewer.