Changeset 518d35d in sasview
- Timestamp:
- Mar 24, 2010 2:40:43 PM (15 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:
- d3fac18
- Parents:
- 00e8df8
- Location:
- invariantview/perspectives/invariant
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
invariantview/perspectives/invariant/invariant.py
r2661d8b r518d35d 104 104 105 105 for item in self.graph.plottables: 106 if issubclass(item.__class__,LoaderData1D): 107 108 if item.name !="$I_{obs}(q)$" and item.name !="$P_{fit}(r)$": 109 if hasattr(item, "group_id"): 110 return [[invariant_option, 111 invariant_hint, self._compute_invariant]] 106 if item.name == graph.selected_plottable : 107 if issubclass(item.__class__,LoaderData1D): 108 109 if item.name !="$I_{obs}(q)$" and item.name !="$P_{fit}(r)$": 110 if hasattr(item, "group_id"): 111 return [[invariant_option, 112 invariant_hint, self._compute_invariant]] 112 113 return [] 113 114 -
invariantview/perspectives/invariant/invariant_details.py
r9ce7641c r518d35d 5 5 import numpy 6 6 from sans.guiframe.utils import format_number, check_float 7 from invariant_widgets import OutputTextCtrl 7 8 # Dimensions related to chart 8 9 RECTANGLE_WIDTH = 400.0 … … 93 94 94 95 invariant_txt = wx.StaticText(self, -1, 'Invariant') 95 self.invariant_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 96 self.invariant_tcl.SetEditable(False) 96 self.invariant_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 97 97 self.invariant_tcl.SetToolTipString("Invariant in the data set's Q range.") 98 self.invariant_err_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 99 self.invariant_err_tcl.SetEditable(False) 98 self.invariant_err_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 100 99 self.invariant_err_tcl.SetToolTipString("Uncertainty on the invariant.") 101 100 invariant_units_txt = wx.StaticText(self, -1, unit_invariant) 102 101 103 102 invariant_low_txt = wx.StaticText(self, -1, 'Invariant in low-Q region') 104 self.invariant_low_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 105 self.invariant_low_tcl.SetEditable(False) 103 self.invariant_low_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 106 104 self.invariant_low_tcl.SetToolTipString("Invariant computed with the extrapolated low-Q data.") 107 self.invariant_low_err_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 108 self.invariant_low_err_tcl.SetEditable(False) 105 self.invariant_low_err_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 109 106 self.invariant_low_err_tcl.SetToolTipString("Uncertainty on the invariant.") 110 107 invariant_low_units_txt = wx.StaticText(self, -1, unit_invariant) 111 108 112 109 invariant_high_txt = wx.StaticText(self, -1, 'Invariant in high-Q region') 113 self.invariant_high_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 114 self.invariant_high_tcl.SetEditable(False) 110 self.invariant_high_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 115 111 self.invariant_high_tcl.SetToolTipString("Invariant computed with the extrapolated high-Q data") 116 self.invariant_high_err_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 117 self.invariant_high_err_tcl.SetEditable(False) 112 self.invariant_high_err_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 118 113 self.invariant_high_err_tcl.SetToolTipString("Uncertainty on the invariant.") 119 114 invariant_high_units_txt = wx.StaticText(self, -1, unit_invariant) -
invariantview/perspectives/invariant/invariant_panel.py
rf43827cc r518d35d 11 11 from sans.guicomm.events import NewPlotEvent, StatusEvent 12 12 from invariant_details import InvariantDetailsWindow 13 from invariant_widgets import OutputTextCtrl, InvTextCtrl 13 14 # The minimum q-value to be used when extrapolating 14 15 Q_MINIMUM = 1e-5 … … 201 202 qstar_total, qstar_total_err = inv.get_qstar_with_error(extrapolation) 202 203 self.invariant_total_tcl.SetValue(format_number(qstar_total)) 203 self.invariant_total_err_tcl.SetValue(format_number(qstar_total ))204 self.invariant_total_err_tcl.SetValue(format_number(qstar_total_err)) 204 205 self.inv_container.qstar_total = qstar_total 205 206 self.inv_container.qstar_total_err = qstar_total_err 206 check_float(self.invariant_total_tcl) 207 check_float(self.invariant_total_err_tcl) 207 208 208 except: 209 209 msg= "Error occurred computing invariant using extrapolation: %s"%sys.exc_value … … 220 220 extrapolated_data = inv.get_extra_data_low(npts_in=npts_low) 221 221 power_low = inv.get_extrapolation_power(range='low') 222 self.power_low_tcl.SetValue(str(power_low)) 222 if self.power_law_low.GetValue(): 223 self.power_low_tcl.SetValue(str(power_low)) 223 224 self._manager.plot_theory(data=extrapolated_data, 224 225 name="Low-Q extrapolation") … … 237 238 self.inv_container.qstar_high = qstar_high 238 239 self.inv_container.qstar_high_err = qstar_high_err 239 power_high = inv.get_extrapolation_power(range='high') 240 power_high = inv.get_extrapolation_power(range='high') 240 241 self.power_high_tcl.SetValue(str(power_high)) 241 242 high_out_data = inv.get_extra_data_high(q_end=Q_MAXIMUM_PLOT) … … 263 264 function_low = "guinier" 264 265 # get the function 265 power_low = None 266 power_low = None #2.0/3.0 266 267 if self.power_law_low.GetValue(): 267 268 function_low = "power_law" 268 if self.fit_ low_cbox.GetValue():269 if self.fit_enable_low.GetValue(): 269 270 #set value of power_low to none to allow fitting 270 271 power_low = None … … 278 279 msg = "Expect float for power at low q , got %s"%(power_low) 279 280 raise ValueError, msg 280 281 281 282 #Get the number of points to extrapolated 282 283 npts_low = self.npts_low_tcl.GetValue().lstrip().rstrip() … … 300 301 if self.power_law_high.GetValue(): 301 302 function_high = "power_law" 302 if self.fit_ high_cbox.GetValue():303 if self.fit_enable_high.GetValue(): 303 304 #set value of power_high to none to allow fitting 304 305 power_high = None … … 359 360 inv, npts_high = self.set_extrapolation_high(inv=inv, high_q=high_q) 360 361 except: 361 msg= "Error occurred computing invariant: %s"%sys.exc_value 362 wx.PostEvent(self.parent, StatusEvent(status= msg, type="stop")) 362 raise 363 #msg= "Error occurred computing invariant: %s"%sys.exc_value 364 #wx.PostEvent(self.parent, StatusEvent(status= msg, type="stop")) 363 365 return 364 366 #check the type of extrapolation … … 469 471 data_name_txt = wx.StaticText(self, -1, 'Data : ') 470 472 471 self.data_name_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH*5, 20), style=0)473 self.data_name_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH*5, 20), style=0) 472 474 self.data_name_tcl.SetToolTipString("Data's name.") 473 475 self.data_name_sizer.AddMany([(data_name_txt, 0, wx.LEFT|wx.RIGHT, 10), … … 476 478 data_range_txt = wx.StaticText(self, -1, 'Total Q Range (1/A): ') 477 479 data_min_txt = wx.StaticText(self, -1, 'Min : ') 478 self.data_min_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0)480 self.data_min_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) 479 481 self.data_min_tcl.SetToolTipString("The minimum value of q range.") 480 self.data_min_tcl.SetEditable(False)481 482 data_max_txt = wx.StaticText(self, -1, 'Max : ') 482 self.data_max_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0)483 self.data_max_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) 483 484 self.data_max_tcl.SetToolTipString("The maximum value of q range.") 484 self.data_max_tcl.SetEditable(False)485 485 self.data_range_sizer.AddMany([(data_range_txt, 0, wx.RIGHT, 10), 486 486 (data_min_txt, 0, wx.RIGHT, 10), … … 497 497 """ 498 498 background_txt = wx.StaticText(self, -1, 'Background : ') 499 self.background_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0)499 self.background_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) 500 500 self.background_tcl.SetValue(str(BACKGROUND)) 501 background_hint_txt = "background" 502 self.background_tcl.SetToolTipString(background_hint_txt) 503 background_unit_txt = wx.StaticText(self, -1, '[1/cm]') 501 504 self.background_sizer.AddMany([(background_txt, 0, wx.LEFT|wx.RIGHT, 10), 502 (self.background_tcl)]) 505 (self.background_tcl, 0, wx.RIGHT, 10), 506 (background_unit_txt)]) 503 507 def _layout_scale(self): 504 508 """ … … 506 510 """ 507 511 scale_txt = wx.StaticText(self, -1, 'Scale : ') 508 self.scale_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) 512 self.scale_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) 513 scale_hint_txt = "Scale" 514 self.scale_tcl.SetToolTipString(scale_hint_txt) 509 515 self.scale_tcl.SetValue(str(SCALE)) 510 516 self.scale_sizer.AddMany([(scale_txt, 0, wx.LEFT|wx.RIGHT, 10), … … 516 522 """ 517 523 contrast_txt = wx.StaticText(self, -1, 'Contrast : ') 518 self.contrast_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0)524 self.contrast_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0) 519 525 self.contrast_tcl.SetValue(str(CONTRAST)) 526 contrast_hint_txt = "Contrast" 527 self.contrast_tcl.SetToolTipString(contrast_hint_txt) 528 contrast_unit_txt = wx.StaticText(self, -1, '[1/A^(2)]') 520 529 self.contrast_sizer.AddMany([(contrast_txt, 0, wx.LEFT|wx.RIGHT, 10), 521 (self.contrast_tcl, 0, wx.LEFT, 15)]) 530 (self.contrast_tcl, 0, wx.LEFT, 15), 531 (contrast_unit_txt, 0, wx.LEFT, 10)]) 522 532 523 533 def _layout_porod_constant(self): … … 526 536 """ 527 537 porod_const_txt = wx.StaticText(self, -1, 'Porod Constant:') 528 self.porod_constant_tcl = wx.TextCtrl(self, -1,538 self.porod_constant_tcl = InvTextCtrl(self, -1, 529 539 size=(_BOX_WIDTH, 20), style=0) 540 porod_const_hint_txt = "Porod Constant" 541 self.porod_constant_tcl.SetToolTipString(porod_const_hint_txt) 530 542 optional_txt = wx.StaticText(self, -1, '(Optional)') 531 543 self.porod_constant_sizer.AddMany([(porod_const_txt, 0, wx.LEFT, 10), … … 533 545 (optional_txt, 0, wx.LEFT, 10)]) 534 546 547 def _enable_fit_power_law_low(self, event=None): 548 """ 549 Enable and disable the power value editing 550 """ 551 if self.fix_enable_low.IsEnabled(): 552 if self.fix_enable_low.GetValue(): 553 self.power_low_tcl.Enable() 554 else: 555 self.power_low_tcl.Disable() 556 557 def _enable_low_q_section(self, event=None): 558 """ 559 Disable or enable some button if the user enable low q extrapolation 560 """ 561 if self.enable_low_cbox.GetValue(): 562 self.npts_low_tcl.Enable() 563 self.fix_enable_low.Enable() 564 self.fit_enable_low.Enable() 565 self.guinier.Enable() 566 self.power_law_low.Enable() 567 568 else: 569 self.npts_low_tcl.Disable() 570 self.fix_enable_low.Disable() 571 self.fit_enable_low.Disable() 572 self.guinier.Disable() 573 self.power_law_low.Disable() 574 self._enable_power_law_low() 575 self._enable_fit_power_law_low() 576 577 def _enable_power_law_low(self, event=None): 578 """ 579 Enable editing power law section at low q range 580 """ 581 if self.guinier.GetValue(): 582 self.fix_enable_low.Disable() 583 self.fit_enable_low.Disable() 584 self.power_low_tcl.Disable() 585 else: 586 self.fix_enable_low.Enable() 587 self.fit_enable_low.Enable() 588 self.power_low_tcl.Enable() 589 self._enable_fit_power_law_low() 590 535 591 def _layout_extrapolation_low(self): 536 592 """ … … 540 596 self.enable_low_cbox.SetForegroundColour('red') 541 597 self.enable_low_cbox.SetValue(False) 542 self.fit_low_cbox = wx.CheckBox(self, -1, "Check to Fit Power") 543 self.fit_low_cbox.SetValue(False) 598 wx.EVT_CHECKBOX(self, self.enable_low_cbox.GetId(), 599 self._enable_low_q_section) 600 self.fix_enable_low = wx.RadioButton(self, -1, 'Fix', 601 (10, 10),style=wx.RB_GROUP) 602 self.fix_enable_low.SetValue(True) 603 self.fit_enable_low = wx.RadioButton(self, -1, 'Fit', (10, 10)) 604 self.Bind(wx.EVT_RADIOBUTTON, self._enable_fit_power_law_low, 605 id=self.fix_enable_low.GetId()) 606 self.Bind(wx.EVT_RADIOBUTTON, self._enable_fit_power_law_low, 607 id=self.fit_enable_low.GetId()) 544 608 self.guinier = wx.RadioButton(self, -1, 'Guinier', 545 609 (10, 10),style=wx.RB_GROUP) 546 610 self.guinier.SetValue(True) 547 611 self.power_law_low = wx.RadioButton(self, -1, 'Power Law', (10, 10)) 612 self.Bind(wx.EVT_RADIOBUTTON, self._enable_power_law_low, 613 id=self.guinier.GetId()) 614 self.Bind(wx.EVT_RADIOBUTTON, self._enable_power_law_low, 615 id=self.power_law_low.GetId()) 616 548 617 npts_low_txt = wx.StaticText(self, -1, 'Npts') 549 self.npts_low_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, -1))618 self.npts_low_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH*2/3, -1)) 550 619 self.npts_low_tcl.SetValue(str(NPTS)) 551 620 msg_hint = "Number of Q points to consider" … … 553 622 self.npts_low_tcl.SetToolTipString(msg_hint) 554 623 power_txt = wx.StaticText(self, -1, 'Power') 555 self.power_low_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, -1))624 self.power_low_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH*2/3, -1)) 556 625 self.power_low_tcl.SetValue(str(self.power_law_exponant)) 626 self.power_low_tcl.Disable() 557 627 power_hint_txt = "Exponent to apply to the Power_law function." 558 628 self.power_low_tcl.SetToolTipString(power_hint_txt) 559 629 iy = 0 630 ix = 0 631 self.low_q_sizer.Add(self.enable_low_cbox,(iy, ix),(1,5), 632 wx.TOP|wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 633 iy += 1 634 ix = 0 635 self.low_q_sizer.Add(npts_low_txt,(iy, ix),(1,1), 636 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 637 ix += 1 638 self.low_q_sizer.Add(self.npts_low_tcl, (iy, ix), (1,1), 639 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 640 iy += 1 560 641 ix = 0 561 642 self.low_q_sizer.Add(self.guinier,(iy, ix),(1,2), … … 565 646 self.low_q_sizer.Add(self.power_law_low,(iy, ix),(1,2), 566 647 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 648 567 649 # Parameter controls for power law 568 650 ix = 1 569 651 iy += 1 570 self.low_q_sizer.Add(self.fit_low_cbox,(iy, ix),(1,3), 571 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 652 self.low_q_sizer.Add(self.fix_enable_low,(iy, ix),(1,1), 653 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 654 ix += 1 655 self.low_q_sizer.Add(self.fit_enable_low,(iy, ix),(1,1), 656 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 572 657 ix = 1 573 658 iy += 1 574 659 self.low_q_sizer.Add(power_txt,(iy, ix),(1,1), 575 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)660 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 576 661 ix += 1 577 662 self.low_q_sizer.Add(self.power_low_tcl, (iy, ix), (1,1), 578 663 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 579 iy += 1 580 ix = 1 581 self.low_q_sizer.Add(npts_low_txt,(iy, ix),(1,1), 582 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 583 ix += 1 584 self.low_q_sizer.Add(self.npts_low_tcl, (iy, ix), (1,1), 585 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 586 iy += 1 587 ix = 0 588 self.low_q_sizer.Add(self.enable_low_cbox,(iy, ix),(1,5), 589 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 664 #Change the state of txtcrtl to enable/disable 665 self._enable_low_q_section() 590 666 self.low_extrapolation_sizer.AddMany([(self.low_q_sizer, 0, 591 667 wx.BOTTOM|wx.RIGHT, 10)]) 592 593 668 def _enable_fit_power_law_high(self, event=None): 669 """ 670 Enable and disable the power value editing 671 """ 672 if self.fix_enable_high.IsEnabled(): 673 if self.fix_enable_high.GetValue(): 674 self.power_high_tcl.Enable() 675 else: 676 self.power_high_tcl.Disable() 677 678 def _enable_high_q_section(self, event=None): 679 """ 680 Disable or enable some button if the user enable high q extrapolation 681 """ 682 if self.enable_high_cbox.GetValue(): 683 self.npts_high_tcl.Enable() 684 self.power_law_high.Enable() 685 self.power_high_tcl.Enable() 686 self.fix_enable_high.Enable() 687 self.fit_enable_high.Enable() 688 else: 689 self.npts_high_tcl.Disable() 690 self.power_law_high.Disable() 691 self.power_high_tcl.Disable() 692 self.fix_enable_high.Disable() 693 self.fit_enable_high.Disable() 694 self._enable_fit_power_law_high() 695 594 696 def _layout_extrapolation_high(self): 595 697 """ … … 599 701 self.enable_high_cbox.SetForegroundColour('red') 600 702 self.enable_high_cbox.SetValue(False) 601 self.fit_high_cbox = wx.CheckBox(self, -1, "Check to Fit Power") 602 self.fit_high_cbox.SetValue(False) 703 wx.EVT_CHECKBOX(self, self.enable_high_cbox.GetId(), 704 self._enable_high_q_section) 705 706 self.fix_enable_high = wx.RadioButton(self, -1, 'Fix', 707 (10, 10),style=wx.RB_GROUP) 708 self.fix_enable_high.SetValue(True) 709 self.fit_enable_high = wx.RadioButton(self, -1, 'Fit', (10, 10)) 710 self.Bind(wx.EVT_RADIOBUTTON, self._enable_fit_power_law_high, 711 id=self.fix_enable_high.GetId()) 712 self.Bind(wx.EVT_RADIOBUTTON, self._enable_fit_power_law_high, 713 id=self.fit_enable_high.GetId()) 714 603 715 self.power_law_high = wx.RadioButton(self, -1, 'Power Law', 604 716 (10, 10), style=wx.RB_GROUP) … … 607 719 self.power_law_high.SetValue(True) 608 720 npts_high_txt = wx.StaticText(self, -1, 'Npts') 609 self.npts_high_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, -1))721 self.npts_high_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH*2/3, -1)) 610 722 msg_hint = "Number of Q points to consider" 611 723 msg_hint += "while extrapolating the high-Q region" … … 613 725 self.npts_high_tcl.SetValue(str(NPTS)) 614 726 power_txt = wx.StaticText(self, -1, 'Power') 615 self.power_high_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, -1))727 self.power_high_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH*2/3, -1)) 616 728 self.power_high_tcl.SetValue(str(self.power_law_exponant)) 617 729 power_hint_txt = "Exponent to apply to the Power_law function." 618 730 self.power_high_tcl.SetToolTipString(power_hint_txt) 619 iy = 1 731 iy = 0 732 ix = 0 733 self.high_q_sizer.Add(self.enable_high_cbox,(iy, ix),(1,5), 734 wx.TOP|wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 735 iy += 1 736 ix = 0 737 self.high_q_sizer.Add(npts_high_txt,(iy, ix),(1,1), 738 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 739 ix += 1 740 self.high_q_sizer.Add(self.npts_high_tcl, (iy, ix), (1,1), 741 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 742 iy += 2 620 743 ix = 0 621 744 self.high_q_sizer.Add(self.power_law_high,(iy, ix),(1,2), 622 745 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 746 747 # Parameter controls for power law 623 748 ix = 1 624 749 iy += 1 625 self.high_q_sizer.Add(self.fit_high_cbox,(iy, ix),(1,3), 626 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 750 self.high_q_sizer.Add(self.fix_enable_high,(iy, ix),(1,1), 751 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 752 ix += 1 753 self.high_q_sizer.Add(self.fit_enable_high,(iy, ix),(1,1), 754 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 627 755 ix = 1 628 756 iy += 1 … … 632 760 self.high_q_sizer.Add(self.power_high_tcl, (iy, ix), (1,1), 633 761 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 634 iy += 1 635 ix = 1 636 self.high_q_sizer.Add(npts_high_txt,(iy, ix),(1,1), 637 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 638 ix += 1 639 self.high_q_sizer.Add(self.npts_high_tcl, (iy, ix), (1,1), 640 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 641 iy += 1 642 ix = 0 643 self.high_q_sizer.Add(self.enable_high_cbox,(iy, ix),(1,5), 644 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 762 #Change the state of txtcrtl to enable/disable 763 self._enable_high_q_section() 645 764 self.high_extrapolation_sizer.AddMany([(self.high_q_sizer, 0, wx.RIGHT, 10)]) 646 765 … … 649 768 Draw widgets related to extrapolation 650 769 """ 651 extra_hint = "Extrapolation Maximum Range: "770 extra_hint = "Extrapolation Maximum Q Range [1/A]: " 652 771 extra_hint_txt = wx.StaticText(self, -1, extra_hint) 653 772 #Extrapolation range [string] 654 773 extrapolation_min_txt = wx.StaticText(self, -1, 'Min : ') 655 self.extrapolation_min_tcl = wx.TextCtrl(self, -1,774 self.extrapolation_min_tcl = OutputTextCtrl(self, -1, 656 775 size=(_BOX_WIDTH, 20), style=0) 657 776 self.extrapolation_min_tcl.SetValue(str(Q_MINIMUM)) 658 777 self.extrapolation_min_tcl.SetToolTipString("The minimum extrapolated q value.") 659 self.extrapolation_min_tcl.SetEditable(False)660 778 extrapolation_max_txt = wx.StaticText(self, -1, 'Max : ') 661 self.extrapolation_max_tcl = wx.TextCtrl(self, -1,779 self.extrapolation_max_tcl = OutputTextCtrl(self, -1, 662 780 size=(_BOX_WIDTH, 20), style=0) 663 781 self.extrapolation_max_tcl.SetValue(str(Q_MAXIMUM)) 664 782 self.extrapolation_max_tcl.SetToolTipString("The maximum extrapolated q value.") 665 self.extrapolation_max_tcl.SetEditable(False)666 783 self.extrapolation_range_sizer.AddMany([(extra_hint_txt, 0, wx.LEFT, 10), 667 784 (extrapolation_min_txt, 0, wx.LEFT, 10), … … 697 814 uncertainty = "+/-" 698 815 volume_txt = wx.StaticText(self, -1, 'Volume Fraction') 699 self.volume_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 700 self.volume_tcl.SetEditable(False) 816 self.volume_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 701 817 self.volume_tcl.SetToolTipString("Volume fraction.") 702 self.volume_err_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 703 self.volume_err_tcl.SetEditable(False) 818 self.volume_err_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 704 819 self.volume_err_tcl.SetToolTipString("Uncertainty on the volume fraction.") 705 820 volume_units_txt = wx.StaticText(self, -1, unit_volume) 706 821 707 822 surface_txt = wx.StaticText(self, -1, 'Specific surface') 708 self.surface_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 709 self.surface_tcl.SetEditable(False) 823 self.surface_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 710 824 self.surface_tcl.SetToolTipString("Specific surface value.") 711 self.surface_err_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 712 self.surface_err_tcl.SetEditable(False) 825 self.surface_err_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 713 826 self.surface_err_tcl.SetToolTipString("Uncertainty on the specific surface.") 714 827 surface_units_txt = wx.StaticText(self, -1, unit_surface) … … 753 866 unit_invariant = '[1/cm][1/A]' 754 867 invariant_total_txt = wx.StaticText(self, -1, 'Invariant Total') 755 self.invariant_total_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 756 self.invariant_total_tcl.SetEditable(False) 868 self.invariant_total_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 757 869 msg_hint = "Total invariant, including extrapolated regions." 758 870 self.invariant_total_tcl.SetToolTipString(msg_hint) 759 self.invariant_total_err_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 760 self.invariant_total_err_tcl.SetEditable(False) 871 self.invariant_total_err_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 761 872 self.invariant_total_err_tcl.SetToolTipString("Uncertainty on invariant.") 762 873 invariant_total_units_txt = wx.StaticText(self, -1, unit_invariant)
Note: See TracChangeset
for help on using the changeset viewer.