Changeset 8b21fa7 in sasview for src/sas/perspectives/pr/inversion_panel.py
- Timestamp:
- Mar 6, 2015 2:05:50 PM (10 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:
- b1e609c
- Parents:
- c1c14ba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/perspectives/pr/inversion_panel.py
r79492222 r8b21fa7 10 10 import logging 11 11 from wx.lib.scrolledpanel import ScrolledPanel 12 from sas.guiframe.events import StatusEvent 13 from sas.guiframe.panel_base import PanelBase 12 from sas.guiframe.events import StatusEvent 13 from sas.guiframe.panel_base import PanelBase 14 14 from inversion_state import InversionState 15 15 from pr_widgets import PrTextCtrl … … 28 28 window_caption = "P(r) control panel" 29 29 CENTER_PANE = True 30 30 31 31 # Figure of merit parameters [default] 32 32 33 33 ## Oscillation parameters (sin function = 1.1) 34 34 oscillation_max = 1.5 35 36 def __init__(self, parent, id=-1, plots=None, 37 standalone=False, **kwargs): 35 36 def __init__(self, parent, id=-1, plots=None, standalone=False, **kwargs): 38 37 """ 39 38 """ … … 41 40 PanelBase.__init__(self, parent) 42 41 self.SetupScrolling() 43 #Set window's font size 42 #Set window's font size 44 43 self.SetWindowVariant(variant=FONT_VARIANT) 45 44 46 45 self.plots = plots 47 46 self.radio_buttons = {} 48 47 self.parent = parent.parent 49 48 50 49 ## Data file TextCtrl 51 self.data_file 52 self.plot_data 53 self.nfunc_ctl 54 self.alpha_ctl 55 self.dmax_ctl 56 self.time_ctl 57 self.chi2_ctl 58 self.osc_ctl 50 self.data_file = None 51 self.plot_data = None 52 self.nfunc_ctl = None 53 self.alpha_ctl = None 54 self.dmax_ctl = None 55 self.time_ctl = None 56 self.chi2_ctl = None 57 self.osc_ctl = None 59 58 self.file_radio = None 60 59 self.plot_radio = None 61 60 self.label_sugg = None 62 self.qmin_ctl 63 self.qmax_ctl 61 self.qmin_ctl = None 62 self.qmax_ctl = None 64 63 self.swidth_ctl = None 65 64 self.sheight_ctl = None 66 67 self.rg_ctl 68 self.iq0_ctl 69 self.bck_chk 70 self.bck_ctl 71 65 66 self.rg_ctl = None 67 self.iq0_ctl = None 68 self.bck_chk = None 69 self.bck_ctl = None 70 72 71 # TextCtrl for fraction of positive P(r) 73 72 self.pos_ctl = None 74 73 75 74 # TextCtrl for fraction of 1 sigma positive P(r) 76 self.pos_err_ctl = None 77 75 self.pos_err_ctl = None 76 78 77 ## Estimates 79 78 self.alpha_estimate_ctl = None … … 82 81 self.distance_explorator_ctl = None 83 82 ## Data manager 84 self._manager 83 self._manager = None 85 84 ## Standalone flage 86 85 self.standalone = standalone … … 88 87 self._default_save_location = os.getcwd() 89 88 if self.parent is not None: 90 self._default_save_location = \89 self._default_save_location = \ 91 90 self.parent._default_save_location 92 91 93 92 # Default width 94 93 self._default_width = 350 95 94 self._do_layout() 96 95 97 96 def __setattr__(self, name, value): 98 97 """ … … 115 114 elif name == 'elapsed': 116 115 self.time_ctl.SetValue("%-5.2g" % value) 117 elif name == 'rg':116 elif name == 'rg': 118 117 self.rg_ctl.SetValue("%-5.2g" % value) 119 118 elif name == 'iq0': … … 147 146 else: 148 147 wx.Panel.__setattr__(self, name, value) 149 148 150 149 def __getattr__(self, name): 151 150 """ … … 182 181 except: 183 182 return 0.0 184 elif name =='q_max':183 elif name == 'q_max': 185 184 try: 186 185 return float(self.qmax_ctl.GetValue()) … … 197 196 except: 198 197 return None 199 elif name =='iq0':198 elif name == 'iq0': 200 199 try: 201 200 return float(self.iq0_ctl.GetValue()) … … 212 211 except: 213 212 return None 214 elif name =='slit_height':213 elif name == 'slit_height': 215 214 try: 216 215 return float(self.sheight_ctl.GetValue()) … … 243 242 else: 244 243 return wx.Panel.__getattribute__(self, name) 245 244 246 245 def save_project(self, doc=None): 247 246 """ … … 260 259 else: 261 260 doc = new_doc 262 return doc 263 261 return doc 262 264 263 def on_save(self, evt=None): 265 264 """ 266 265 Method used to create a memento of the current state 267 268 :return: state object 266 267 :return: state object 269 268 """ 270 269 # Ask the user the location of the file to write to. 271 270 path = None 272 271 if self.parent != None: 273 self._default_save_location =\ 274 self.parent._default_save_location 272 self._default_save_location = self.parent._default_save_location 275 273 dlg = wx.FileDialog(self, "Choose a file", 276 self._default_save_location, \274 self._default_save_location, 277 275 self.window_caption, "*.prv", wx.SAVE) 278 276 if dlg.ShowModal() == wx.ID_OK: … … 280 278 self._default_save_location = os.path.dirname(path) 281 279 if self.parent != None: 282 self.parent._default_save_location =\ 283 self._default_save_location 280 self.parent._default_save_location = self._default_save_location 284 281 else: 285 282 return None 286 283 287 284 dlg.Destroy() 288 285 289 286 state = self.get_state() 290 287 291 288 # MAC always needs the extension for saving 292 289 extens = ".prv" … … 294 291 fName = os.path.splitext(path)[0] + extens 295 292 self._manager.save_data(filepath=fName, prstate=state) 296 293 297 294 return state 298 295 299 296 def get_data(self): 300 297 """ 301 298 """ 302 299 return self._manager.get_data() 303 300 304 301 def get_state(self): 305 302 """ 306 303 Get the current state 307 304 308 305 : return: state object 309 306 """ 310 # Construct the state object 307 # Construct the state object 311 308 state = InversionState() 312 309 313 310 # Read the panel's parameters 314 311 flag, alpha, dmax, nfunc, qmin, \ 315 312 qmax, height, width = self._read_pars() 316 313 317 314 state.nfunc = nfunc 318 315 state.d_max = dmax 319 316 state.alpha = alpha 320 state.qmin 321 state.qmax 317 state.qmin = qmin 318 state.qmax = qmax 322 319 state.width = width 323 320 state.height = height 324 321 325 322 # Data file 326 323 state.file = self.plot_data.GetValue() 327 324 328 325 # Background evaluation checkbox 329 326 state.estimate_bck = self.bck_chk.IsChecked() 330 327 331 328 # Estimates 332 329 state.nterms_estimate = self.nterms_estimate 333 330 state.alpha_estimate = self.alpha_estimate 334 331 335 332 # Read the output values 336 state.chi2 333 state.chi2 = self.chi2 337 334 state.elapsed = self.elapsed 338 state.osc 339 state.pos 335 state.osc = self.oscillation 336 state.pos = self.pos 340 337 state.pos_err = self.pos_err 341 state.rg 342 state.iq0 343 state.bck 344 338 state.rg = self.rg 339 state.iq0 = self.iq0 340 state.bck = self.bck 341 345 342 return state 346 343 347 344 def set_state(self, state): 348 345 """ 349 346 Set the state of the panel and inversion problem to 350 347 the state passed as a parameter. 351 Execute the inversion immediately after filling the 348 Execute the inversion immediately after filling the 352 349 controls. 353 350 354 351 :param state: InversionState object 355 352 """ … … 361 358 self.alpha = state.alpha 362 359 if state.qmin is not None: 363 self.q_min 360 self.q_min = state.qmin 364 361 if state.qmax is not None: 365 self.q_max 362 self.q_max = state.qmax 366 363 if state.width is not None: 367 364 self.slit_width = state.width 368 365 if state.height is not None: 369 366 self.slit_height = state.height 370 367 371 368 # Data file 372 369 self.plot_data.SetValue(str(state.file)) 373 370 374 371 # Background evaluation checkbox 375 372 self.bck_chk.SetValue(state.estimate_bck) 376 373 377 374 # Estimates 378 375 if state.nterms_estimate is not None: 379 376 self.nterms_estimate = state.nterms_estimate 380 if state.alpha_estimate is not None: 381 self.alpha_estimate = state.alpha_estimate 382 383 377 if state.alpha_estimate is not None: 378 self.alpha_estimate = state.alpha_estimate 379 380 384 381 # Read the output values 385 382 if state.chi2 is not None: 386 self.chi2 383 self.chi2 = state.chi2 387 384 if state.elapsed is not None: 388 385 self.elapsed = state.elapsed … … 394 391 self.pos_err = state.pos_err 395 392 if state.rg is not None: 396 self.rg 393 self.rg = state.rg 397 394 if state.iq0 is not None: 398 self.iq0 395 self.iq0 = state.iq0 399 396 if state.bck is not None: 400 self.bck 397 self.bck = state.bck 401 398 402 399 # Perform inversion 403 self._on_invert(None) 404 400 self._on_invert(None) 401 405 402 def set_manager(self, manager): 406 403 self._manager = manager 407 404 408 405 def _do_layout(self): 409 vbox = wx.GridBagSizer(0, 0)406 vbox = wx.GridBagSizer(0, 0) 410 407 iy_vb = 0 411 408 412 409 # ----- I(q) data ----- 413 410 databox = wx.StaticBox(self, -1, "I(q) data source") 414 411 415 412 boxsizer1 = wx.StaticBoxSizer(databox, wx.VERTICAL) 416 413 boxsizer1.SetMinSize((self._default_width, 50)) … … 420 417 self.file_radio = wx.StaticText(self, -1, "Name:") 421 418 pars_sizer.Add(self.file_radio, (iy, 0), (1, 1), 422 wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 15)423 424 self.plot_data = DataFileTextCtrl(self, -1, size=(260, 20))425 419 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 420 421 self.plot_data = DataFileTextCtrl(self, -1, size=(260, 20)) 422 426 423 pars_sizer.Add(self.plot_data, (iy, 1), (1, 1), 427 wx.EXPAND |wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 15)428 424 wx.EXPAND | wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, 15) 425 429 426 self.bck_chk = wx.CheckBox(self, -1, "Estimate background level") 430 427 hint_msg = "Check box to let the fit estimate " … … 434 431 iy += 1 435 432 pars_sizer.Add(self.bck_chk, (iy, 0), (1, 2), 436 wx.LEFT |wx.EXPAND|wx.ADJUST_MINSIZE, 15)437 boxsizer1.Add(pars_sizer, 0, wx.EXPAND) 433 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 434 boxsizer1.Add(pars_sizer, 0, wx.EXPAND) 438 435 vbox.Add(boxsizer1, (iy_vb, 0), (1, 1), 439 wx.LEFT |wx.RIGHT|wx.EXPAND|wx.ADJUST_MINSIZE|wx.TOP, 5)440 436 wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ADJUST_MINSIZE | wx.TOP, 5) 437 441 438 # ----- Add slit parameters ----- 442 439 if True: … … 444 441 sboxsizer = wx.StaticBoxSizer(sbox, wx.VERTICAL) 445 442 sboxsizer.SetMinSize((self._default_width, 20)) 446 443 447 444 sizer_slit = wx.GridBagSizer(5, 5) 448 445 449 446 label_sheight = wx.StaticText(self, -1, "Height", size=(40, 20)) 450 447 label_swidth = wx.StaticText(self, -1, "Width", size=(40, 20)) 451 #label_sunits1 = wx.StaticText(self, -1, "[A^(-1)]") 452 label_sunits2 = wx.StaticText(self, -1, "[A^(-1)]", size=(55,20)) 453 self.sheight_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, 454 size=(60,20)) 455 self.swidth_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, 456 size=(60,20)) 448 label_sunits2 = wx.StaticText(self, -1, "[A^(-1)]", size=(55, 20)) 449 self.sheight_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, size=(60, 20)) 450 self.swidth_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, size=(60, 20)) 457 451 hint_msg = "Enter slit height in units of Q or leave blank." 458 452 self.sheight_ctl.SetToolTipString(hint_msg) 459 453 hint_msg = "Enter slit width in units of Q or leave blank." 460 454 self.swidth_ctl.SetToolTipString(hint_msg) 461 #self.sheight_ctl.Bind(wx.EVT_TEXT, self._on_pars_changed) 462 #self.swidth_ctl.Bind(wx.EVT_TEXT, self._on_pars_changed) 463 455 464 456 iy = 0 465 sizer_slit.Add(label_sheight, (iy, 0), (1, 1), 466 wx.LEFT|wx.EXPAND, 5) 467 sizer_slit.Add(self.sheight_ctl, (iy, 1), (1, 1), 468 wx.LEFT|wx.EXPAND, 5) 469 470 sizer_slit.Add(label_swidth, (iy, 2), (1, 1), 471 wx.LEFT|wx.EXPAND, 5) 472 sizer_slit.Add(self.swidth_ctl, (iy, 3), (1, 1), 473 wx.LEFT|wx.EXPAND, 5) 474 sizer_slit.Add(label_sunits2, (iy, 4), (1, 1), 475 wx.LEFT|wx.EXPAND, 5) 476 457 sizer_slit.Add(label_sheight, (iy, 0), (1, 1), wx.LEFT | wx.EXPAND, 5) 458 sizer_slit.Add(self.sheight_ctl, (iy, 1), (1, 1), wx.LEFT | wx.EXPAND, 5) 459 sizer_slit.Add(label_swidth, (iy, 2), (1, 1), wx.LEFT | wx.EXPAND, 5) 460 sizer_slit.Add(self.swidth_ctl, (iy, 3), (1, 1), wx.LEFT | wx.EXPAND, 5) 461 sizer_slit.Add(label_sunits2, (iy, 4), (1, 1), wx.LEFT | wx.EXPAND, 5) 462 477 463 sboxsizer.Add(sizer_slit, wx.TOP, 15) 478 464 iy_vb += 1 479 465 vbox.Add(sboxsizer, (iy_vb, 0), (1, 1), 480 wx.LEFT|wx.RIGHT|wx.EXPAND|wx.ADJUST_MINSIZE, 5) 481 482 466 wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 467 483 468 # ----- Q range ----- 484 469 qbox = wx.StaticBox(self, -1, "Q range") 485 470 qboxsizer = wx.StaticBoxSizer(qbox, wx.VERTICAL) 486 471 qboxsizer.SetMinSize((self._default_width, 20)) 487 472 488 473 sizer_q = wx.GridBagSizer(5, 5) 489 474 490 475 label_qmin = wx.StaticText(self, -1, "Q min", size=(40, 20)) 491 476 label_qmax = wx.StaticText(self, -1, "Q max", size=(40, 20)) 492 #label_qunits1 = wx.StaticText(self, -1, "[A^(-1)]")493 477 label_qunits2 = wx.StaticText(self, -1, "[A^(-1)]", size=(55, 20)) 494 self.qmin_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, 495 size=(60,20)) 496 self.qmax_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, 497 size=(60,20)) 478 self.qmin_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, size=(60, 20)) 479 self.qmax_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, size=(60, 20)) 498 480 hint_msg = "Select a lower bound for Q or leave blank." 499 481 self.qmin_ctl.SetToolTipString(hint_msg) … … 502 484 self.qmin_ctl.Bind(wx.EVT_TEXT, self._on_pars_changed) 503 485 self.qmax_ctl.Bind(wx.EVT_TEXT, self._on_pars_changed) 504 486 505 487 iy = 0 506 sizer_q.Add(label_qmin, (iy, 0), (1, 1), wx.LEFT|wx.EXPAND, 5) 507 sizer_q.Add(self.qmin_ctl, (iy, 1), (1, 1), wx.LEFT|wx.EXPAND, 5) 508 #sizer_q.Add(label_qunits1, (iy,2), (1,1), wx.LEFT|wx.EXPAND, 15) 509 sizer_q.Add(label_qmax, (iy, 2), (1, 1), wx.LEFT|wx.EXPAND, 5) 510 sizer_q.Add(self.qmax_ctl, (iy, 3), (1, 1), wx.LEFT|wx.EXPAND, 5) 511 sizer_q.Add(label_qunits2, (iy, 4), (1, 1), wx.LEFT|wx.EXPAND, 5) 488 sizer_q.Add(label_qmin, (iy, 0), (1, 1), wx.LEFT | wx.EXPAND, 5) 489 sizer_q.Add(self.qmin_ctl, (iy, 1), (1, 1), wx.LEFT | wx.EXPAND, 5) 490 sizer_q.Add(label_qmax, (iy, 2), (1, 1), wx.LEFT | wx.EXPAND, 5) 491 sizer_q.Add(self.qmax_ctl, (iy, 3), (1, 1), wx.LEFT | wx.EXPAND, 5) 492 sizer_q.Add(label_qunits2, (iy, 4), (1, 1), wx.LEFT | wx.EXPAND, 5) 512 493 qboxsizer.Add(sizer_q, wx.TOP, 15) 513 494 514 495 iy_vb += 1 515 vbox.Add(qboxsizer, (iy_vb, 0), (1,1),516 wx.LEFT |wx.RIGHT|wx.EXPAND|wx.ADJUST_MINSIZE, 5)517 496 vbox.Add(qboxsizer, (iy_vb, 0), (1, 1), 497 wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 498 518 499 # ----- Parameters ----- 519 500 parsbox = wx.StaticBox(self, -1, "Parameters") 520 501 boxsizer2 = wx.StaticBoxSizer(parsbox, wx.VERTICAL) 521 boxsizer2.SetMinSize((self._default_width, 50))522 523 explanation 502 boxsizer2.SetMinSize((self._default_width, 50)) 503 504 explanation = "P(r) is found by fitting a set of base functions" 524 505 explanation += " to I(Q). The minimization involves" 525 506 explanation += " a regularization term to ensure a smooth P(r)." 526 explanation += " The regularization constant gives the size of that " 507 explanation += " The regularization constant gives the size of that " 527 508 explanation += "term. The suggested value is the value above which the" 528 509 explanation += " output P(r) will have only one peak." 529 label_explain = wx.StaticText(self, -1, explanation, size=(280,90)) 530 boxsizer2.Add(label_explain, wx.LEFT|wx.BOTTOM, 5) 531 532 533 510 label_explain = wx.StaticText(self, -1, explanation, size=(280, 90)) 511 boxsizer2.Add(label_explain, wx.LEFT | wx.BOTTOM, 5) 512 534 513 label_nfunc = wx.StaticText(self, -1, "Number of terms") 535 514 label_nfunc.SetMinSize((120, 20)) 536 515 label_alpha = wx.StaticText(self, -1, "Regularization constant") 537 label_dmax = wx.StaticText(self, -1, "Max distance [A]") 538 self.label_sugg = wx.StaticText(self, -1, "Suggested value") 539 #self.label_sugg.Hide() 540 541 self.nfunc_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, 542 size=(60,20)) 516 label_dmax = wx.StaticText(self, -1, "Max distance [A]") 517 self.label_sugg = wx.StaticText(self, -1, "Suggested value") 518 519 self.nfunc_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, size=(60, 20)) 543 520 self.nfunc_ctl.SetToolTipString("Number of terms in the expansion.") 544 self.alpha_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, 545 size=(60,20)) 521 self.alpha_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, size=(60, 20)) 546 522 hint_msg = "Control parameter for the size of the regularization term." 547 523 self.alpha_ctl.SetToolTipString(hint_msg) 548 self.dmax_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, 549 size=(60,20)) 524 self.dmax_ctl = PrTextCtrl(self, -1, style=wx.TE_PROCESS_ENTER, size=(60, 20)) 550 525 hint_msg = "Maximum distance between any two points in the system." 551 526 self.dmax_ctl.SetToolTipString(hint_msg) 552 id = wx.NewId() 553 self.alpha_estimate_ctl = wx.Button(self, id, "") 554 #self.alpha_estimate_ctl.Hide() 555 self.Bind(wx.EVT_BUTTON, self._on_accept_alpha, id = id) 527 wx_id = wx.NewId() 528 self.alpha_estimate_ctl = wx.Button(self, wx_id, "") 529 self.Bind(wx.EVT_BUTTON, self._on_accept_alpha, id=wx_id) 556 530 self.alpha_estimate_ctl.Enable(False) 557 #self.alpha_estimate_ctl.SetBackgroundColour('#ffdf85')558 #self.alpha_estimate_ctl.SetBackgroundColour(self.GetBackgroundColour())559 531 self.alpha_estimate_ctl.SetToolTipString("Waiting for estimate...") 560 561 id = wx.NewId()562 self.nterms_estimate_ctl = wx.Button(self,id, "")532 533 wx_id = wx.NewId() 534 self.nterms_estimate_ctl = wx.Button(self, wx_id, "") 563 535 #self.nterms_estimate_ctl.Hide() 564 self.Bind(wx.EVT_BUTTON, self._on_accept_nterms, id = id)536 self.Bind(wx.EVT_BUTTON, self._on_accept_nterms, id=wx_id) 565 537 self.nterms_estimate_ctl.Enable(False) 566 538 567 539 self.nterms_estimate_ctl.SetToolTipString("Waiting for estimate...") 568 540 569 541 self.nfunc_ctl.Bind(wx.EVT_TEXT, self._read_pars) 570 542 self.alpha_ctl.Bind(wx.EVT_TEXT, self._read_pars) 571 543 self.dmax_ctl.Bind(wx.EVT_TEXT, self._on_pars_changed) 572 544 573 545 # Distance explorator 574 id = wx.NewId()575 self.distance_explorator_ctl = wx.Button(self, id, "Explore")576 self.Bind(wx.EVT_BUTTON, self._on_explore, id = id)577 578 579 sizer_params = wx.GridBagSizer(5, 5)546 wx_id = wx.NewId() 547 self.distance_explorator_ctl = wx.Button(self, wx_id, "Explore") 548 self.Bind(wx.EVT_BUTTON, self._on_explore, id=wx_id) 549 550 551 sizer_params = wx.GridBagSizer(5, 5) 580 552 581 553 iy = 0 582 554 sizer_params.Add(self.label_sugg, (iy, 2), (1, 1), wx.LEFT, 15) 583 555 iy += 1 584 sizer_params.Add(label_nfunc, 585 sizer_params.Add(self.nfunc_ctl, 556 sizer_params.Add(label_nfunc, (iy, 0), (1, 1), wx.LEFT, 15) 557 sizer_params.Add(self.nfunc_ctl, (iy, 1), (1, 1), wx.RIGHT, 0) 586 558 sizer_params.Add(self.nterms_estimate_ctl, (iy, 2), (1, 1), wx.LEFT, 15) 587 559 iy += 1 588 sizer_params.Add(label_alpha, 589 sizer_params.Add(self.alpha_ctl, 560 sizer_params.Add(label_alpha, (iy, 0), (1, 1), wx.LEFT, 15) 561 sizer_params.Add(self.alpha_ctl, (iy, 1), (1, 1), wx.RIGHT, 0) 590 562 sizer_params.Add(self.alpha_estimate_ctl, (iy, 2), (1, 1), wx.LEFT, 15) 591 563 iy += 1 592 564 sizer_params.Add(label_dmax, (iy, 0), (1, 1), wx.LEFT, 15) 593 sizer_params.Add(self.dmax_ctl, 565 sizer_params.Add(self.dmax_ctl, (iy, 1), (1, 1), wx.RIGHT, 0) 594 566 sizer_params.Add(self.distance_explorator_ctl, (iy, 2), 595 567 (1, 1), wx.LEFT, 15) 596 568 597 569 boxsizer2.Add(sizer_params, 0) 598 570 599 571 iy_vb += 1 600 572 vbox.Add(boxsizer2, (iy_vb, 0), (1, 1), 601 wx.LEFT |wx.RIGHT|wx.EXPAND|wx.ADJUST_MINSIZE, 5)573 wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 602 574 603 575 … … 606 578 ressizer = wx.StaticBoxSizer(resbox, wx.VERTICAL) 607 579 ressizer.SetMinSize((self._default_width, 50)) 608 609 label_rg 610 label_rg_unit 611 label_iq0 580 581 label_rg = wx.StaticText(self, -1, "Rg") 582 label_rg_unit = wx.StaticText(self, -1, "[A]") 583 label_iq0 = wx.StaticText(self, -1, "I(Q=0)") 612 584 label_iq0_unit = wx.StaticText(self, -1, "[A^(-1)]") 613 label_bck 585 label_bck = wx.StaticText(self, -1, "Background") 614 586 label_bck_unit = wx.StaticText(self, -1, "[A^(-1)]") 615 self.rg_ctl = OutputTextCtrl(self, -1, size=(60,20))587 self.rg_ctl = OutputTextCtrl(self, -1, size=(60, 20)) 616 588 hint_msg = "Radius of gyration for the computed P(r)." 617 589 self.rg_ctl.SetToolTipString(hint_msg) 618 self.iq0_ctl 590 self.iq0_ctl = OutputTextCtrl(self, -1, size=(60, 20)) 619 591 hint_msg = "Scattering intensity at Q=0 for the computed P(r)." 620 592 self.iq0_ctl.SetToolTipString(hint_msg) 621 self.bck_ctl 593 self.bck_ctl = OutputTextCtrl(self, -1, size=(60, 20)) 622 594 self.bck_ctl.SetToolTipString("Value of estimated constant background.") 623 595 624 596 label_time = wx.StaticText(self, -1, "Computation time") 625 597 label_time_unit = wx.StaticText(self, -1, "secs") 626 label_time.SetMinSize((120, 20))598 label_time.SetMinSize((120, 20)) 627 599 label_chi2 = wx.StaticText(self, -1, "Chi2/dof") 628 600 label_osc = wx.StaticText(self, -1, "Oscillations") 629 601 label_pos = wx.StaticText(self, -1, "Positive fraction") 630 602 label_pos_err = wx.StaticText(self, -1, "1-sigma positive fraction") 631 603 632 604 self.time_ctl = OutputTextCtrl(self, -1, size=(60, 20)) 633 605 hint_msg = "Computation time for the last inversion, in seconds." 634 606 self.time_ctl.SetToolTipString(hint_msg) 635 607 636 608 self.chi2_ctl = OutputTextCtrl(self, -1, size=(60, 20)) 637 609 self.chi2_ctl.SetToolTipString("Chi^2 over degrees of freedom.") 638 610 639 611 # Oscillation parameter 640 612 self.osc_ctl = OutputTextCtrl(self, -1, size=(60, 20)) … … 642 614 hint_msg += " oscillation parameter of 1.1." 643 615 self.osc_ctl.SetToolTipString(hint_msg) 644 616 645 617 # Positive fraction figure of merit 646 618 self.pos_ctl = OutputTextCtrl(self, -1, size=(60, 20)) … … 648 620 hint_msg += "Theoretically, P(r) is defined positive." 649 621 self.pos_ctl.SetToolTipString(hint_msg) 650 622 651 623 # 1-simga positive fraction figure of merit 652 624 self.pos_err_ctl = OutputTextCtrl(self, -1, size=(60, 20)) 653 message 625 message = "Fraction of P(r) that is at least 1 standard deviation" 654 626 message += " greater than zero.\n" 655 627 message += "This figure of merit tells you about the size of the " … … 658 630 message += " consider changing the maximum distance." 659 631 self.pos_err_ctl.SetToolTipString(message) 660 632 661 633 sizer_res = wx.GridBagSizer(5, 5) 662 634 663 635 iy = 0 664 sizer_res.Add(label_rg, (iy, 0), (1, 1), wx.LEFT |wx.EXPAND, 15)665 sizer_res.Add(self.rg_ctl, (iy, 1), (1, 1), wx.RIGHT|wx.EXPAND, 15)666 sizer_res.Add(label_rg_unit, (iy, 2), (1, 1), wx.RIGHT|wx.EXPAND, 15)636 sizer_res.Add(label_rg, (iy, 0), (1, 1), wx.LEFT | wx.EXPAND, 15) 637 sizer_res.Add(self.rg_ctl, (iy, 1), (1, 1), wx.RIGHT | wx.EXPAND, 15) 638 sizer_res.Add(label_rg_unit, (iy, 2), (1, 1), wx.RIGHT | wx.EXPAND, 15) 667 639 iy += 1 668 sizer_res.Add(label_iq0, (iy, 0), (1, 1), wx.LEFT |wx.EXPAND, 15)669 sizer_res.Add(self.iq0_ctl, (iy, 1), (1, 1), wx.RIGHT|wx.EXPAND, 15)670 sizer_res.Add(label_iq0_unit, (iy, 2), (1, 1), wx.RIGHT |wx.EXPAND, 15)640 sizer_res.Add(label_iq0, (iy, 0), (1, 1), wx.LEFT | wx.EXPAND, 15) 641 sizer_res.Add(self.iq0_ctl, (iy, 1), (1, 1), wx.RIGHT | wx.EXPAND, 15) 642 sizer_res.Add(label_iq0_unit, (iy, 2), (1, 1), wx.RIGHT | wx.EXPAND, 15) 671 643 iy += 1 672 sizer_res.Add(label_bck, (iy, 0), (1, 1), wx.LEFT |wx.EXPAND, 15)673 sizer_res.Add(self.bck_ctl, (iy, 1), (1, 1), wx.RIGHT |wx.EXPAND, 15)674 sizer_res.Add(label_bck_unit, (iy, 2), (1, 1), wx.RIGHT |wx.EXPAND, 15)644 sizer_res.Add(label_bck, (iy, 0), (1, 1), wx.LEFT | wx.EXPAND, 15) 645 sizer_res.Add(self.bck_ctl, (iy, 1), (1, 1), wx.RIGHT | wx.EXPAND, 15) 646 sizer_res.Add(label_bck_unit, (iy, 2), (1, 1), wx.RIGHT | wx.EXPAND, 15) 675 647 iy += 1 676 sizer_res.Add(label_time, (iy, 0), (1, 1), wx.LEFT |wx.EXPAND, 15)677 sizer_res.Add(self.time_ctl, (iy, 1), (1, 1), wx.RIGHT|wx.EXPAND, 15)678 sizer_res.Add(label_time_unit, (iy, 2), (1, 1), wx.RIGHT |wx.EXPAND, 15)648 sizer_res.Add(label_time, (iy, 0), (1, 1), wx.LEFT | wx.EXPAND, 15) 649 sizer_res.Add(self.time_ctl, (iy, 1), (1, 1), wx.RIGHT | wx.EXPAND, 15) 650 sizer_res.Add(label_time_unit, (iy, 2), (1, 1), wx.RIGHT | wx.EXPAND, 15) 679 651 iy += 1 680 sizer_res.Add(label_chi2, (iy, 0), (1, 1), wx.LEFT |wx.EXPAND, 15)681 sizer_res.Add(self.chi2_ctl, (iy, 1), (1, 1), wx.RIGHT|wx.EXPAND, 15)652 sizer_res.Add(label_chi2, (iy, 0), (1, 1), wx.LEFT | wx.EXPAND, 15) 653 sizer_res.Add(self.chi2_ctl, (iy, 1), (1, 1), wx.RIGHT | wx.EXPAND, 15) 682 654 iy += 1 683 sizer_res.Add(label_osc, (iy, 0), (1, 1), wx.LEFT |wx.EXPAND, 15)684 sizer_res.Add(self.osc_ctl, (iy, 1), (1, 1), wx.RIGHT|wx.EXPAND, 15)655 sizer_res.Add(label_osc, (iy, 0), (1, 1), wx.LEFT | wx.EXPAND, 15) 656 sizer_res.Add(self.osc_ctl, (iy, 1), (1, 1), wx.RIGHT | wx.EXPAND, 15) 685 657 686 658 iy += 1 687 sizer_res.Add(label_pos, (iy, 0), (1, 1), wx.LEFT |wx.EXPAND, 15)688 sizer_res.Add(self.pos_ctl, (iy, 1), (1, 1), wx.RIGHT |wx.EXPAND, 15)659 sizer_res.Add(label_pos, (iy, 0), (1, 1), wx.LEFT | wx.EXPAND, 15) 660 sizer_res.Add(self.pos_ctl, (iy, 1), (1, 1), wx.RIGHT | wx.EXPAND, 15) 689 661 690 662 iy += 1 691 sizer_res.Add(label_pos_err, (iy, 0), (1, 1), wx.LEFT |wx.EXPAND, 15)692 sizer_res.Add(self.pos_err_ctl, (iy,1), (1, 1), wx.RIGHT|wx.EXPAND, 15)663 sizer_res.Add(label_pos_err, (iy, 0), (1, 1), wx.LEFT | wx.EXPAND, 15) 664 sizer_res.Add(self.pos_err_ctl, (iy, 1), (1, 1), wx.RIGHT | wx.EXPAND, 15) 693 665 694 666 ressizer.Add(sizer_res, 0) 695 667 iy_vb += 1 696 668 vbox.Add(ressizer, (iy_vb, 0), (1, 1), 697 wx.LEFT |wx.RIGHT|wx.EXPAND|wx.ADJUST_MINSIZE, 5)669 wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 698 670 699 671 # ----- Buttons ----- 700 id = wx.NewId()701 button_ OK = wx.Button(self,id, "Compute")702 button_ OK.SetToolTipString("Perform P(r) inversion.")703 self.Bind(wx.EVT_BUTTON, self._on_invert, id = id)704 672 wx_id = wx.NewId() 673 button_ok = wx.Button(self, wx_id, "Compute") 674 button_ok.SetToolTipString("Perform P(r) inversion.") 675 self.Bind(wx.EVT_BUTTON, self._on_invert, id=wx_id) 676 705 677 self._set_reset_flag(True) 706 678 self._set_save_flag(True) 707 679 sizer_button = wx.BoxSizer(wx.HORIZONTAL) 708 sizer_button.Add((20, 20), 1, wx.EXPAND |wx.ADJUST_MINSIZE, 0)709 sizer_button.Add(button_ OK, 0, wx.LEFT|wx.ADJUST_MINSIZE, 10)710 680 sizer_button.Add((20, 20), 1, wx.EXPAND | wx.ADJUST_MINSIZE, 0) 681 sizer_button.Add(button_ok, 0, wx.LEFT | wx.ADJUST_MINSIZE, 10) 682 711 683 iy_vb += 1 712 684 vbox.Add(sizer_button, (iy_vb, 0), (1, 1), 713 wx.EXPAND |wx.BOTTOM|wx.TOP|wx.RIGHT, 10)685 wx.EXPAND | wx.BOTTOM | wx.TOP | wx.RIGHT, 10) 714 686 715 687 self.Bind(wx.EVT_TEXT_ENTER, self._on_invert) 716 688 717 689 self.SetSizer(vbox) 718 690 719 691 def _on_accept_alpha(self, evt): 720 692 """ 721 User has accepted the estimated alpha, 693 User has accepted the estimated alpha, 722 694 set it as part of the input parameters 723 695 """ 724 696 try: 725 697 alpha = self.alpha_estimate_ctl.GetLabel() 726 tmp = float(alpha) 727 self.alpha_ctl.SetValue(alpha) 698 self.alpha_ctl.SetValue(float(alpha)) 728 699 except: 729 700 # No estimate or bad estimate, either do nothing 730 #import sys 731 print "InversionControl._on_accept_alpha: %s" % sys.exc_value 732 pass 733 701 logging.error("InversionControl._on_accept_alpha: %s" % sys.exc_value) 702 734 703 def _on_accept_nterms(self, evt): 735 704 """ 736 User has accepted the estimated number of terms, 705 User has accepted the estimated number of terms, 737 706 set it as part of the input parameters 738 707 """ 739 708 try: 740 709 nterms = self.nterms_estimate_ctl.GetLabel() 741 tmp = float(nterms) 742 self.nfunc_ctl.SetValue(nterms) 710 self.nfunc_ctl.SetValue(float(nterms)) 743 711 except: 744 712 # No estimate or bad estimate, either do nothing 745 import sys 746 print "InversionControl._on_accept_nterms: %s" % sys.exc_value 747 pass 748 713 logging.error("InversionControl._on_accept_nterms: %s" % sys.exc_value) 714 749 715 def clear_panel(self): 750 716 """ … … 752 718 self.plot_data.SetValue("") 753 719 self.on_reset(event=None) 754 720 755 721 def on_reset(self, event=None): 756 722 """ … … 775 741 self.nterms_estimate_ctl.SetLabel("") 776 742 self._on_pars_changed() 777 743 778 744 def _on_pars_changed(self, evt=None): 779 745 """ 780 746 Called when an input parameter has changed 781 747 We will estimate the alpha parameter behind the 782 scenes. 748 scenes. 783 749 """ 784 750 flag, alpha, dmax, nfunc, qmin, qmax, height, width = self._read_pars() 785 751 has_bck = self.bck_chk.IsChecked() 786 752 787 753 # If the pars are valid, estimate alpha 788 754 if flag: 789 755 self.nterms_estimate_ctl.Enable(False) 790 756 self.alpha_estimate_ctl.Enable(False) 791 757 792 758 dataset = self.plot_data.GetValue() 793 759 if dataset is not None and dataset.strip() != "": 794 self._manager.estimate_plot_inversion(alpha=alpha, nfunc=nfunc, 795 d_max=dmax,796 q_min=qmin, q_max=qmax,797 bck=has_bck,798 height=height,799 width=width)800 760 self._manager.estimate_plot_inversion(alpha=alpha, nfunc=nfunc, 761 d_max=dmax, 762 q_min=qmin, q_max=qmax, 763 bck=has_bck, 764 height=height, 765 width=width) 766 801 767 def _read_pars(self, evt=None): 802 768 """ 803 """ 769 """ 804 770 alpha = 0 805 771 nfunc = 5 806 dmax 807 qmin 808 qmax 772 dmax = 120 773 qmin = 0 774 qmax = 0 809 775 height = 0 810 width 776 width = 0 811 777 flag = True 812 778 # Read slit height … … 823 789 self.sheight_ctl.SetBackgroundColour("pink") 824 790 self.sheight_ctl.Refresh() 825 791 826 792 # Read slit width 827 793 try: 828 794 width_str = self.swidth_ctl.GetValue() 829 if len(width_str.lstrip().rstrip()) ==0:795 if len(width_str.lstrip().rstrip()) == 0: 830 796 width = 0 831 797 else: … … 837 803 self.swidth_ctl.SetBackgroundColour("pink") 838 804 self.swidth_ctl.Refresh() 839 805 840 806 # Read alpha 841 807 try: … … 847 813 self.alpha_ctl.SetBackgroundColour("pink") 848 814 self.alpha_ctl.Refresh() 849 850 # Read d_max 815 816 # Read d_max 851 817 try: 852 818 dmax = float(self.dmax_ctl.GetValue()) … … 857 823 self.dmax_ctl.SetBackgroundColour("pink") 858 824 self.dmax_ctl.Refresh() 859 825 860 826 # Read nfunc 861 827 try: … … 873 839 self.nfunc_ctl.SetBackgroundColour("pink") 874 840 self.nfunc_ctl.Refresh() 875 841 876 842 # Read qmin 877 843 try: … … 887 853 self.qmin_ctl.SetBackgroundColour("pink") 888 854 self.qmin_ctl.Refresh() 889 855 890 856 # Read qmax 891 857 try: … … 901 867 self.qmax_ctl.SetBackgroundColour("pink") 902 868 self.qmax_ctl.Refresh() 903 869 904 870 return flag, alpha, dmax, nfunc, qmin, qmax, height, width 905 871 906 872 def _on_explore(self, evt): 907 873 """ … … 916 882 message = "No data to analyze. Please load a data set to proceed." 917 883 wx.PostEvent(self._manager.parent, StatusEvent(status=message)) 918 884 919 885 def _on_invert(self, evt): 920 886 """ 921 887 Perform inversion 922 923 :param silent: when True, there will be no output for the user 924 888 889 :param silent: when True, there will be no output for the user 890 925 891 """ 926 892 # Get the data from the form 927 893 # Push it to the manager 928 894 929 895 flag, alpha, dmax, nfunc, qmin, qmax, height, width = self._read_pars() 930 896 has_bck = self.bck_chk.IsChecked() 931 897 932 898 if flag: 933 899 dataset = self.plot_data.GetValue() 934 if dataset ==None or len(dataset.strip())==0:900 if dataset == None or len(dataset.strip()) == 0: 935 901 message = "No data to invert. Select a data set before" 936 902 message += " proceeding with P(r) inversion." 937 903 wx.PostEvent(self._manager.parent, StatusEvent(status=message)) 938 904 else: 939 self._manager.setup_plot_inversion(alpha=alpha, nfunc=nfunc, 940 d_max=dmax,941 q_min=qmin, q_max=qmax,942 bck=has_bck,943 height=height,944 width=width)905 self._manager.setup_plot_inversion(alpha=alpha, nfunc=nfunc, 906 d_max=dmax, 907 q_min=qmin, q_max=qmax, 908 bck=has_bck, 909 height=height, 910 width=width) 945 911 else: 946 912 message = "The P(r) form contains invalid values: " 947 913 message += "please submit it again." 948 914 wx.PostEvent(self.parent, StatusEvent(status=message)) 949 915 950 916 def _change_file(self, evt=None, filepath=None, data=None): 951 917 """ … … 960 926 except: 961 927 msg = "InversionControl._change_file: %s" % sys.exc_value 962 logging.error(msg) 928 logging.error(msg) 963 929 964 930 class HelpDialog(wx.Dialog): … … 970 936 from sas.pr.invertor import help 971 937 wx.Dialog.__init__(self, parent, id, size=(400, 450)) 972 self.SetTitle("P(r) help") 938 self.SetTitle("P(r) help") 973 939 self.SetWindowVariant(variant=FONT_VARIANT) 974 940 … … 976 942 977 943 explanation = help() 978 944 979 945 label_explain = wx.StaticText(self, -1, explanation, size=(360, 350)) 980 981 vbox.Add(label_explain, 0, wx.ALL |wx.EXPAND, 15)946 947 vbox.Add(label_explain, 0, wx.ALL | wx.EXPAND, 15) 982 948 983 949 984 950 static_line = wx.StaticLine(self, -1) 985 951 vbox.Add(static_line, 0, wx.EXPAND, 0) 986 987 button_OK = wx.Button(self, wx.ID_OK, "OK") 988 #button_Cancel = wx.Button(self, wx.ID_CANCEL, "Cancel") 989 952 953 button_ok = wx.Button(self, wx.ID_OK, "OK") 954 990 955 sizer_button = wx.BoxSizer(wx.HORIZONTAL) 991 sizer_button.Add((20, 20), 1, wx.EXPAND |wx.ADJUST_MINSIZE, 0)992 sizer_button.Add(button_ OK, 0, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10)993 994 vbox.Add(sizer_button, 0, wx.EXPAND |wx.BOTTOM|wx.TOP, 10)956 sizer_button.Add((20, 20), 1, wx.EXPAND | wx.ADJUST_MINSIZE, 0) 957 sizer_button.Add(button_ok, 0, wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, 10) 958 959 vbox.Add(sizer_button, 0, wx.EXPAND | wx.BOTTOM | wx.TOP, 10) 995 960 996 961 self.SetSizer(vbox) 997 962 self.SetAutoLayout(True) 998 963 999 964 self.Layout() 1000 965 self.Centre() … … 1008 973 from sas.pr.invertor import help 1009 974 wx.Dialog.__init__(self, parent, id, size=(250, 120)) 1010 self.SetTitle("P(r) distribution") 1011 975 self.SetTitle("P(r) distribution") 976 1012 977 1013 978 vbox = wx.BoxSizer(wx.VERTICAL) 1014 979 1015 980 label_npts = wx.StaticText(self, -1, "Number of points") 1016 981 self.npts_ctl = PrTextCtrl(self, -1, size=(100, 20)) 1017 982 1018 983 pars_sizer = wx.GridBagSizer(5, 5) 1019 984 iy = 0 1020 985 pars_sizer.Add(label_npts, (iy, 0), (1, 1), wx.LEFT, 15) 1021 986 pars_sizer.Add(self.npts_ctl, (iy, 1), (1, 1), wx.RIGHT, 0) 1022 1023 vbox.Add(pars_sizer, 0, wx.ALL |wx.EXPAND, 15)987 988 vbox.Add(pars_sizer, 0, wx.ALL | wx.EXPAND, 15) 1024 989 1025 990 static_line = wx.StaticLine(self, -1) 1026 991 vbox.Add(static_line, 0, wx.EXPAND, 0) 1027 1028 button_ OK= wx.Button(self, wx.ID_OK, "OK")1029 self.Bind(wx.EVT_BUTTON, self._checkValues, button_ OK)1030 button_ Cancel = wx.Button(self, wx.ID_CANCEL, "Cancel")1031 992 993 button_ok = wx.Button(self, wx.ID_OK, "OK") 994 self.Bind(wx.EVT_BUTTON, self._checkValues, button_ok) 995 button_cancel = wx.Button(self, wx.ID_CANCEL, "Cancel") 996 1032 997 sizer_button = wx.BoxSizer(wx.HORIZONTAL) 1033 sizer_button.Add((20, 20), 1, wx.EXPAND |wx.ADJUST_MINSIZE, 0)1034 sizer_button.Add(button_ OK, 0, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10)1035 sizer_button.Add(button_ Cancel, 0,1036 wx.LEFT |wx.RIGHT|wx.ADJUST_MINSIZE, 10)1037 vbox.Add(sizer_button, 0, wx.EXPAND |wx.BOTTOM|wx.TOP, 10)998 sizer_button.Add((20, 20), 1, wx.EXPAND | wx.ADJUST_MINSIZE, 0) 999 sizer_button.Add(button_ok, 0, wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, 10) 1000 sizer_button.Add(button_cancel, 0, 1001 wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, 10) 1002 vbox.Add(sizer_button, 0, wx.EXPAND | wx.BOTTOM | wx.TOP, 10) 1038 1003 1039 1004 self.SetSizer(vbox) 1040 1005 self.SetAutoLayout(True) 1041 1006 1042 1007 self.Layout() 1043 1008 self.Centre() … … 1067 1032 value = int(self.npts_ctl.GetValue()) 1068 1033 return value 1069 1034 1070 1035 def set_content(self, npts): 1071 1036 """ … … 1073 1038 """ 1074 1039 self.npts_ctl.SetValue("%i" % npts) 1075 1076 ##### testing code ############################################################1077 """1078 Example: ::1079 1080 class TestPlot:1081 def __init__(self, text):1082 self.name = text1083 1084 class MyApp(wx.App):1085 def OnInit(self):1086 wx.InitAllImageHandlers()1087 dialog = PrDistDialog(None, -1)1088 if dialog.ShowModal() == wx.ID_OK:1089 pass1090 dialog.Destroy()1091 1092 return 11093 1094 # end of class MyApp1095 1096 if __name__ == "__main__":1097 app = MyApp(0)1098 app.MainLoop()1099 1100 """1101 ##### end of testing code #####################################################
Note: See TracChangeset
for help on using the changeset viewer.