Changeset 2387abc in sasview for src/sas/sasgui/guiframe
- Timestamp:
- Aug 19, 2016 11:02:55 AM (8 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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 6f343e3
- Parents:
- 32c5983 (diff), 45d7662 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas/sasgui/guiframe
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/data_panel.py
rb5c44f0 re767897 2 2 #This software was developed by the University of Tennessee as part of the 3 3 #Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 4 #project funded by the US National Science Foundation. 4 #project funded by the US National Science Foundation. 5 5 # 6 6 #See the license text in license.txt … … 41 41 as QucikPlotDialog 42 42 import sas.sasgui.guiframe.config as config 43 43 44 44 extension_list = [] 45 45 if config.APPLICATION_STATE_EXTENSION is not None: 46 46 extension_list.append(config.APPLICATION_STATE_EXTENSION) 47 EXTENSIONS = config.PLUGIN_STATE_EXTENSIONS + extension_list 47 EXTENSIONS = config.PLUGIN_STATE_EXTENSIONS + extension_list 48 48 PLUGINS_WLIST = config.PLUGINS_WLIST 49 49 APPLICATION_WLIST = config.APPLICATION_WLIST 50 50 51 #Control panel width 51 #Control panel width 52 52 if sys.platform.count("win32") > 0: 53 53 PANEL_WIDTH = 235 … … 67 67 STYLE_FLAG = wx.RAISED_BORDER|CT.TR_HAS_BUTTONS| CT.TR_HIDE_ROOT|\ 68 68 wx.WANTS_CHARS|CT.TR_HAS_VARIABLE_ROW_HEIGHT 69 70 69 70 71 71 class DataTreeCtrl(CT.CustomTreeCtrl): 72 72 """ … … 97 97 CT.CustomTreeCtrl.__init__(self, parent, *args, **kwds) 98 98 self.root = self.AddRoot("Available Data") 99 99 100 100 def OnCompareItems(self, item1, item2): 101 """ 102 Overrides OnCompareItems in wx.TreeCtrl. 103 Used by the SortChildren method. 101 """ 102 Overrides OnCompareItems in wx.TreeCtrl. 103 Used by the SortChildren method. 104 104 """ 105 105 # Get the item data … … 113 113 else: 114 114 return 0 115 115 116 116 class DataPanel(ScrolledPanel, PanelBase): 117 117 """ 118 This panel displays data available in the application and widgets to 118 This panel displays data available in the application and widgets to 119 119 interact with data. 120 120 """ … … 123 123 ## Title to appear on top of the window 124 124 window_caption = "Data Explorer" 125 #type of window 125 #type of window 126 126 window_type = "Data Panel" 127 127 ## Flag to tell the GUI manager that this panel is not 128 128 # tied to any perspective 129 129 #ALWAYS_ON = True 130 def __init__(self, parent, 130 def __init__(self, parent, 131 131 list=None, 132 132 size=(PANEL_WIDTH, PANEL_HEIGHT), … … 138 138 PanelBase.__init__(self, parent) 139 139 self.SetupScrolling() 140 #Set window's font size 140 #Set window's font size 141 141 self.SetWindowVariant(variant=FONT_VARIANT) 142 self.loader = Loader() 142 self.loader = Loader() 143 143 #Default location 144 self._default_save_location = None 144 self._default_save_location = None 145 145 self.all_data1d = True 146 146 self.parent = parent.parent … … 188 188 if self.parent is not None: 189 189 self.parent.Bind(EVT_DELETE_PLOTPANEL, self._on_delete_plot_panel) 190 190 191 191 def do_layout(self): 192 192 """ … … 198 198 self.layout_batch() 199 199 self.layout_button() 200 200 201 201 def disable_app_combo(self, enable): 202 202 """ … … 204 204 """ 205 205 self.perspective_cbox.Enable(enable) 206 206 207 207 def define_panel_structure(self): 208 208 """ … … 213 213 self.sizer1 = wx.BoxSizer(wx.VERTICAL) 214 214 self.sizer1.SetMinSize(wx.Size(w/13, h*2/5)) 215 215 216 216 self.sizer2 = wx.BoxSizer(wx.VERTICAL) 217 217 self.sizer3 = wx.FlexGridSizer(9, 2, 4, 1) 218 218 self.sizer4 = wx.BoxSizer(wx.VERTICAL) 219 219 self.sizer5 = wx.BoxSizer(wx.VERTICAL) 220 220 221 221 self.vbox.Add(self.sizer5, 0, wx.EXPAND|wx.ALL, 1) 222 222 self.vbox.Add(self.sizer1, 1, wx.EXPAND|wx.ALL, 0) … … 224 224 self.vbox.Add(self.sizer3, 0, wx.EXPAND|wx.ALL, 10) 225 225 #self.vbox.Add(self.sizer4, 0, wx.EXPAND|wx.ALL,5) 226 226 227 227 self.SetSizer(self.vbox) 228 228 229 229 def layout_selection(self): 230 230 """ … … 244 244 self.selection_cbox.SetValue('Select all Data') 245 245 wx.EVT_COMBOBOX(self.selection_cbox, -1, self._on_selection_type) 246 self.sizer5.AddMany([(select_txt, 0, wx.ALL, 5), 246 self.sizer5.AddMany([(select_txt, 0, wx.ALL, 5), 247 247 (self.selection_cbox, 0, wx.ALL,5)]) 248 248 self.enable_selection() 249 250 249 250 251 251 def _on_selection_type(self, event): 252 252 """ … … 254 254 :param event: UI event 255 255 """ 256 def check_item_and_children(control, check_value=True): 257 self.tree_ctrl.CheckItem(data_ctrl, check_value) 258 if data_ctrl.HasChildren(): 259 if check_value == True and not control.IsExpanded(): 260 # Only select children if control is expanded 261 # Always deselect children, regardless (see ticket #259) 262 return 263 for child_ctrl in data_ctrl.GetChildren(): 264 self.tree_ctrl.CheckItem(child_ctrl, check_value) 265 256 266 option = self.selection_cbox.GetValue() 257 267 258 268 pos = self.selection_cbox.GetSelection() 259 269 if pos == wx.NOT_FOUND: 260 return 270 return 261 271 option = self.selection_cbox.GetString(pos) 262 272 for item in self.list_cb_data.values(): 263 273 data_ctrl, _, _, _, _, _, _, _ = item 264 _, data_class, _ = self.tree_ctrl.GetItemPyData(data_ctrl) 274 _, data_class, _ = self.tree_ctrl.GetItemPyData(data_ctrl) 265 275 if option == 'Select all Data': 266 self.tree_ctrl.CheckItem(data_ctrl, True)276 check_item_and_children(data_ctrl, check_value=True) 267 277 elif option == 'Unselect all Data': 268 self.tree_ctrl.CheckItem(data_ctrl,False)278 check_item_and_children(data_ctrl, check_value=False) 269 279 elif option == 'Select all Data 1D': 270 280 if data_class == 'Data1D': 271 self.tree_ctrl.CheckItem(data_ctrl, True)281 check_item_and_children(data_ctrl, check_value=True) 272 282 elif option == 'Unselect all Data 1D': 273 283 if data_class == 'Data1D': 274 self.tree_ctrl.CheckItem(data_ctrl, False) 275 elif option == 'Select all Data 1D': 276 if data_class == 'Data1D': 277 self.tree_ctrl.CheckItem(data_ctrl, True) 284 check_item_and_children(data_ctrl, check_value=False) 278 285 elif option == 'Select all Data 2D': 279 286 if data_class == 'Data2D': 280 self.tree_ctrl.CheckItem(data_ctrl, True)287 check_item_and_children(data_ctrl, check_value=True) 281 288 elif option == 'Unselect all Data 2D': 282 289 if data_class == 'Data2D': 283 self.tree_ctrl.CheckItem(data_ctrl, False)290 check_item_and_children(data_ctrl, check_value=False) 284 291 self.enable_append() 285 292 self.enable_freeze() … … 287 294 self.enable_import() 288 295 self.enable_remove() 289 296 290 297 def layout_button(self): 291 298 """ … … 293 300 """ 294 301 #Load Data Button 295 self.bt_add = wx.Button(self, wx.NewId(), "Load Data", 302 self.bt_add = wx.Button(self, wx.NewId(), "Load Data", 296 303 size=(BUTTON_WIDTH, -1)) 297 304 self.bt_add.SetToolTipString("Load data files") 298 305 wx.EVT_BUTTON(self, self.bt_add.GetId(), self._load_data) 299 306 300 307 #Delete Data Button 301 308 self.bt_remove = wx.Button(self, wx.NewId(), "Delete Data", … … 303 310 self.bt_remove.SetToolTipString("Delete data from the application") 304 311 wx.EVT_BUTTON(self, self.bt_remove.GetId(), self.on_remove) 305 312 306 313 #Send data to perspective button 307 314 self.bt_import = wx.Button(self, wx.NewId(), "Send To", … … 309 316 self.bt_import.SetToolTipString("Send Data set to active perspective") 310 317 wx.EVT_BUTTON(self, self.bt_import.GetId(), self.on_import) 311 318 312 319 #Choose perspective to be send data to combo box 313 320 self.perspective_cbox = wx.ComboBox(self, -1, … … 315 322 if not IS_MAC: 316 323 self.perspective_cbox.SetMinSize((BUTTON_WIDTH*1.6, -1)) 317 wx.EVT_COMBOBOX(self.perspective_cbox, -1, 324 wx.EVT_COMBOBOX(self.perspective_cbox, -1, 318 325 self._on_perspective_selection) 319 326 320 327 #Append data to current Graph Button 321 328 self.bt_append_plot = wx.Button(self, wx.NewId(), "Append Plot To", … … 324 331 "Plot the selected data in the active panel") 325 332 wx.EVT_BUTTON(self, self.bt_append_plot.GetId(), self.on_append_plot) 326 333 327 334 #Create a new graph and send data to that new graph button 328 self.bt_plot = wx.Button(self, wx.NewId(), "New Plot", 335 self.bt_plot = wx.Button(self, wx.NewId(), "New Plot", 329 336 size=(BUTTON_WIDTH, -1)) 330 337 self.bt_plot.SetToolTipString("To trigger plotting") 331 338 wx.EVT_BUTTON(self, self.bt_plot.GetId(), self.on_plot) 332 339 333 340 #Freeze current theory button - becomes a data set and stays on graph 334 self.bt_freeze = wx.Button(self, wx.NewId(), "Freeze Theory", 341 self.bt_freeze = wx.Button(self, wx.NewId(), "Freeze Theory", 335 342 size=(BUTTON_WIDTH, -1)) 336 343 freeze_tip = "To trigger freeze a theory: making a copy\n" … … 339 346 self.bt_freeze.SetToolTipString(freeze_tip) 340 347 wx.EVT_BUTTON(self, self.bt_freeze.GetId(), self.on_freeze) 341 348 342 349 #select plot to send to combo box (blank if no data) 343 350 if sys.platform == 'darwin': 344 self.cb_plotpanel = wx.ComboBox(self, -1, 351 self.cb_plotpanel = wx.ComboBox(self, -1, 345 352 style=wx.CB_READONLY) 346 353 else: 347 self.cb_plotpanel = wx.ComboBox(self, -1, 354 self.cb_plotpanel = wx.ComboBox(self, -1, 348 355 style=wx.CB_READONLY|wx.CB_SORT) 349 356 wx.EVT_COMBOBOX(self.cb_plotpanel, -1, self._on_plot_selection) 350 357 self.cb_plotpanel.Disable() 351 358 352 359 #Help button 353 360 self.bt_help = wx.Button(self, wx.NewId(), "HELP", … … 365 372 ((10, 10)), 366 373 (self.bt_append_plot), 367 (self.cb_plotpanel, 374 (self.cb_plotpanel, 368 375 wx.EXPAND|wx.ADJUST_MINSIZE, 5), 369 376 ((5, 5)), 370 377 ((5, 5)), 371 378 (self.bt_import, 0, wx.EXPAND|wx.RIGHT, 5), 372 (self.perspective_cbox, 379 (self.perspective_cbox, 373 380 wx.EXPAND|wx.ADJUST_MINSIZE, 5), 374 381 ((10, 10)), … … 385 392 self.enable_freeze() 386 393 self.enable_remove_plot() 387 394 388 395 def layout_batch(self): 389 396 """ … … 397 404 self.Bind(wx.EVT_RADIOBUTTON, self.on_batch_mode, 398 405 id=self.rb_batch_mode.GetId()) 399 406 400 407 self.rb_single_mode.SetValue(not self.parent.batch_on) 401 408 self.rb_batch_mode.SetValue(self.parent.batch_on) 402 409 self.sizer4.AddMany([(self.rb_single_mode, 0, wx.ALL, 4), 403 410 (self.rb_batch_mode, 0, wx.ALL, 4)]) 404 411 405 412 def on_single_mode(self, event): 406 413 """ … … 410 417 if self.parent is not None: 411 418 wx.PostEvent(self.parent, NewBatchEvent(enable=False)) 412 419 413 420 def on_batch_mode(self, event): 414 421 """ … … 417 424 """ 418 425 if self.parent is not None: 419 wx.PostEvent(self.parent, 426 wx.PostEvent(self.parent, 420 427 NewBatchEvent(enable=True)) 421 422 def _get_data_selection(self, event): 428 429 def _get_data_selection(self, event): 423 430 """ 424 431 Get data selection from the right click … … 435 442 data = theory_list.values()[0][0] 436 443 return data 437 444 438 445 def on_edit_data(self, event): 439 446 """ … … 443 450 from sas.sasgui.guiframe.local_perspectives.plotting.masking \ 444 451 import MaskPanel as MaskDialog 445 446 panel = MaskDialog(parent=self.parent, base=self, 452 453 panel = MaskDialog(parent=self.parent, base=self, 447 454 data=data, id=wx.NewId()) 448 455 panel.ShowModal() 449 456 450 457 def on_plot_3d(self, event): 451 458 """ … … 455 462 from sas.sasgui.guiframe.local_perspectives.plotting.masking \ 456 463 import FloatPanel as Float3dDialog 457 458 panel = Float3dDialog(base=self, data=data, 464 465 panel = Float3dDialog(base=self, data=data, 459 466 dimension=3, id=wx.NewId()) 460 panel.ShowModal() 461 467 panel.ShowModal() 468 462 469 def on_quick_plot(self, event): 463 470 """ … … 468 475 dimension = 2 469 476 else: 470 dimension = 1 471 #panel = QucikPlotDialog(base=self, data=data, 477 dimension = 1 478 #panel = QucikPlotDialog(base=self, data=data, 472 479 # dimension=dimension, id=wx.NewId()) 473 480 frame = QucikPlotDialog(self, -1, "Plot " + data.name, 'log_{10}') … … 477 484 frame.Show(True) 478 485 frame.SetFocus() 479 #panel.ShowModal() 480 486 #panel.ShowModal() 487 481 488 def on_data_info(self, event): 482 489 """ … … 488 495 else: 489 496 self.parent.show_data1d(data, data.name) 490 497 491 498 def on_save_as(self, event): 492 499 """ … … 506 513 else: 507 514 print "unable to save this type of data" 508 515 509 516 def layout_data_list(self): 510 517 """ … … 523 530 self.data_menu.Append(id, name, msg) 524 531 wx.EVT_MENU(self, id, self.on_data_info) 525 532 526 533 id = wx.NewId() 527 534 name = "Save As" … … 529 536 self.data_menu.Append(id, name, msg) 530 537 wx.EVT_MENU(self, id, self.on_save_as) 531 538 532 539 quickplot_id = wx.NewId() 533 540 name = "Quick Plot" … … 535 542 self.data_menu.Append(quickplot_id, name, msg) 536 543 wx.EVT_MENU(self, quickplot_id, self.on_quick_plot) 537 544 538 545 self.plot3d_id = wx.NewId() 539 546 name = "Quick 3DPlot (Slow)" … … 541 548 self.data_menu.Append(self.plot3d_id, name, msg) 542 549 wx.EVT_MENU(self, self.plot3d_id, self.on_plot_3d) 543 550 544 551 self.editmask_id = wx.NewId() 545 552 name = "Edit Mask" … … 547 554 self.data_menu.Append(self.editmask_id, name, msg) 548 555 wx.EVT_MENU(self, self.editmask_id, self.on_edit_data) 549 556 550 557 tree_ctrl_theory_label = wx.StaticText(self, -1, "Theory") 551 558 tree_ctrl_theory_label.SetForegroundColour('blue') 552 self.tree_ctrl_theory = DataTreeCtrl(parent=self, 559 self.tree_ctrl_theory = DataTreeCtrl(parent=self, 553 560 style=wx.SUNKEN_BORDER) 554 self.tree_ctrl_theory.Bind(CT.EVT_TREE_ITEM_CHECKING, 561 self.tree_ctrl_theory.Bind(CT.EVT_TREE_ITEM_CHECKING, 555 562 self.on_check_item) 556 self.tree_ctrl_theory.Bind(CT.EVT_TREE_ITEM_MENU, 563 self.tree_ctrl_theory.Bind(CT.EVT_TREE_ITEM_MENU, 557 564 self.on_right_click_theory) 558 565 self.sizer1.Add(tree_ctrl_label, 0, wx.LEFT, 10) … … 560 567 self.sizer1.Add(tree_ctrl_theory_label, 0, wx.LEFT, 10) 561 568 self.sizer1.Add(self.tree_ctrl_theory, 1, wx.EXPAND|wx.ALL, 10) 562 569 563 570 def on_right_click_theory(self, event): 564 571 """ … … 575 582 self.data_menu.Enable(self.editmask_id, False) 576 583 self.data_menu.Enable(self.plot3d_id, menu_enable) 577 self.PopupMenu(self.data_menu) 578 584 self.PopupMenu(self.data_menu) 585 579 586 def on_right_click_data(self, event): 580 587 """ … … 596 603 self.data_menu.Enable(self.editmask_id, maskmenu_enable) 597 604 self.data_menu.Enable(self.plot3d_id, menu_enable) 598 self.PopupMenu(self.data_menu) 599 600 def onContextMenu(self, event): 605 self.PopupMenu(self.data_menu) 606 607 def onContextMenu(self, event): 601 608 """ 602 609 Retrieve the state selected state … … 606 613 pos = event.GetPosition() 607 614 pos = self.ScreenToClient(pos) 608 self.PopupMenu(self.popUpMenu, pos) 609 610 615 self.PopupMenu(self.popUpMenu, pos) 616 617 611 618 def on_check_item(self, event): 612 619 """ … … 614 621 """ 615 622 item = event.GetItem() 616 item.Check(not item.IsChecked()) 623 item.Check(not item.IsChecked()) 617 624 self.enable_append() 618 625 self.enable_freeze() … … 621 628 self.enable_remove() 622 629 event.Skip() 623 630 624 631 def fill_cbox_analysis(self, plugin): 625 632 """ … … 635 642 if plug.get_perspective(): 636 643 self.perspective_cbox.Append(plug.sub_menu, plug) 637 644 638 645 curr_pers = self.parent.get_current_perspective() 639 646 if curr_pers: 640 647 self.perspective_cbox.SetStringSelection(curr_pers.sub_menu) 641 648 self.enable_import() 642 649 643 650 def load_data_list(self, list): 644 651 """ … … 654 661 data_run = str(data.run) 655 662 data_class = data.__class__.__name__ 656 path = dstate.get_path() 663 path = dstate.get_path() 657 664 process_list = data.process 658 665 data_id = data.id … … 661 668 #new state 662 669 data_c = self.tree_ctrl.InsertItem(self.tree_ctrl.root, 663 0, data_name, ct_type=1, 670 0, data_name, ct_type=1, 664 671 data=(data_id, data_class, state_id)) 665 672 data_c.Check(True) 666 673 d_i_c = self.tree_ctrl.AppendItem(data_c, 'Info') 667 d_t_c = self.tree_ctrl.AppendItem(d_i_c, 674 d_t_c = self.tree_ctrl.AppendItem(d_i_c, 668 675 'Title: %s' % data_title) 669 r_n_c = self.tree_ctrl.AppendItem(d_i_c, 676 r_n_c = self.tree_ctrl.AppendItem(d_i_c, 670 677 'Run: %s' % data_run) 671 i_c_c = self.tree_ctrl.AppendItem(d_i_c, 678 i_c_c = self.tree_ctrl.AppendItem(d_i_c, 672 679 'Type: %s' % data_class) 673 680 p_c_c = self.tree_ctrl.AppendItem(d_i_c, 674 681 "Path: '%s'" % s_path) 675 682 d_p_c = self.tree_ctrl.AppendItem(d_i_c, 'Process') 676 683 677 684 for process in process_list: 678 685 process_str = str(process).replace('\n',' ') … … 680 687 process_str = process_str[:20]+' [...]' 681 688 self.tree_ctrl.AppendItem(d_p_c, process_str) 682 theory_child = self.tree_ctrl.AppendItem(data_c, 689 theory_child = self.tree_ctrl.AppendItem(data_c, 683 690 "THEORIES") 684 self.list_cb_data[state_id] = [data_c, 691 self.list_cb_data[state_id] = [data_c, 685 692 d_i_c, 686 693 d_t_c, … … 695 702 data_c, d_i_c, d_t_c, r_n_c, i_c_c, p_c_c, d_p_c, _ \ 696 703 = data_ctrl_list 697 self.tree_ctrl.SetItemText(data_c, data_name) 704 self.tree_ctrl.SetItemText(data_c, data_name) 698 705 temp = (data_id, data_class, state_id) 699 self.tree_ctrl.SetItemPyData(data_c, temp) 700 self.tree_ctrl.SetItemText(i_c_c, 706 self.tree_ctrl.SetItemPyData(data_c, temp) 707 self.tree_ctrl.SetItemText(i_c_c, 701 708 'Type: %s' % data_class) 702 self.tree_ctrl.SetItemText(p_c_c, 703 'Path: %s' % s_path) 704 self.tree_ctrl.DeleteChildren(d_p_c) 709 self.tree_ctrl.SetItemText(p_c_c, 710 'Path: %s' % s_path) 711 self.tree_ctrl.DeleteChildren(d_p_c) 705 712 for process in process_list: 706 713 if not process.is_empty(): … … 710 717 # Sort by data name 711 718 if self.tree_ctrl.root: 712 self.tree_ctrl.SortChildren(self.tree_ctrl.root) 719 self.tree_ctrl.SortChildren(self.tree_ctrl.root) 713 720 self.enable_remove() 714 721 self.enable_import() … … 716 723 self.enable_freeze() 717 724 self.enable_selection() 718 725 719 726 def _uncheck_all(self): 720 727 """ … … 723 730 for item in self.list_cb_data.values(): 724 731 data_ctrl, _, _, _, _, _, _, _ = item 725 self.tree_ctrl.CheckItem(data_ctrl, False) 732 self.tree_ctrl.CheckItem(data_ctrl, False) 726 733 self.enable_append() 727 734 self.enable_freeze() … … 729 736 self.enable_import() 730 737 self.enable_remove() 731 738 732 739 def append_theory(self, state_id, theory_list): 733 740 """ … … 736 743 """ 737 744 if not theory_list: 738 return 745 return 739 746 if state_id not in self.list_cb_data.keys(): 740 747 root = self.tree_ctrl_theory.root … … 746 753 tree = self.tree_ctrl 747 754 if root is not None: 748 wx.CallAfter(self.append_theory_helper, tree=tree, root=root, 749 state_id=state_id, 755 wx.CallAfter(self.append_theory_helper, tree=tree, root=root, 756 state_id=state_id, 750 757 theory_list=theory_list) 751 752 758 759 753 760 def append_theory_helper(self, tree, root, state_id, theory_list): 754 761 """ … … 778 785 name, ct_type=1, data=temp) 779 786 t_i_c = tree.AppendItem(t_child, 'Info') 780 i_c_c = tree.AppendItem(t_i_c, 787 i_c_c = tree.AppendItem(t_i_c, 781 788 'Type: %s' % theory_class) 782 789 t_p_c = tree.AppendItem(t_i_c, 'Process') 783 790 784 791 for process in theory_data.process: 785 792 tree.AppendItem(t_p_c, process.__str__()) 786 theory_list_ctrl[theory_id] = [t_child, 787 i_c_c, 793 theory_list_ctrl[theory_id] = [t_child, 794 i_c_c, 788 795 t_p_c] 789 796 else: 790 797 #replace theory 791 798 t_child, i_c_c, t_p_c = theory_list_ctrl[theory_id] 792 tree.SetItemText(t_child, name) 793 tree.SetItemPyData(t_child, temp) 794 tree.SetItemText(i_c_c, 'Type: %s' % theory_class) 795 tree.DeleteChildren(t_p_c) 799 tree.SetItemText(t_child, name) 800 tree.SetItemPyData(t_child, temp) 801 tree.SetItemText(i_c_c, 'Type: %s' % theory_class) 802 tree.DeleteChildren(t_p_c) 796 803 for process in theory_data.process: 797 804 tree.AppendItem(t_p_c, process.__str__()) 798 805 799 806 else: 800 807 #data didn't have a theory associated it before … … 807 814 theory_id = theory_data.id 808 815 #if theory_state is not None: 809 # name = theory_state.model.name 816 # name = theory_state.model.name 810 817 temp = (theory_id, theory_class, state_id) 811 818 t_child = tree.AppendItem(root, 812 name, ct_type=1, 819 name, ct_type=1, 813 820 data=(theory_data.id, theory_class, state_id)) 814 821 t_i_c = tree.AppendItem(t_child, 'Info') 815 i_c_c = tree.AppendItem(t_i_c, 822 i_c_c = tree.AppendItem(t_i_c, 816 823 'Type: %s' % theory_class) 817 824 t_p_c = tree.AppendItem(t_i_c, 'Process') 818 825 819 826 for process in theory_data.process: 820 827 tree.AppendItem(t_p_c, process.__str__()) 821 828 822 829 theory_list_ctrl[theory_id] = [t_child, i_c_c, t_p_c] 823 830 #self.list_cb_theory[data_id] = theory_list_ctrl 824 831 self.list_cb_theory[state_id] = theory_list_ctrl 825 826 827 832 833 834 828 835 def set_data_helper(self): 829 836 """ … … 840 847 if state_id not in state_to_plot: 841 848 state_to_plot.append(state_id) 842 849 843 850 for theory_dict in self.list_cb_theory.values(): 844 851 for _, value in theory_dict.iteritems(): … … 850 857 state_to_plot.append(state_id) 851 858 return data_to_plot, theory_to_plot, state_to_plot 852 859 853 860 def remove_by_id(self, id): 854 861 """ … … 857 864 for item in self.list_cb_data.values(): 858 865 data_c, _, _, _, _, _, _, _ = item 859 data_id, _, state_id = self.tree_ctrl.GetItemPyData(data_c) 866 data_id, _, state_id = self.tree_ctrl.GetItemPyData(data_c) 860 867 if id == data_id: 861 868 self.tree_ctrl.Delete(data_c) 862 869 del self.list_cb_data[state_id] 863 870 del self.list_cb_theory[data_id] 864 871 865 872 def load_error(self, error=None): 866 873 """ 867 874 Pop up an error message. 868 875 869 876 :param error: details error message to be displayed 870 877 """ 871 878 if error is not None or str(error).strip() != "": 872 dial = wx.MessageDialog(self.parent, str(error), 879 dial = wx.MessageDialog(self.parent, str(error), 873 880 'Error Loading File', 874 881 wx.OK | wx.ICON_EXCLAMATION) 875 dial.ShowModal() 876 882 dial.ShowModal() 883 877 884 def _load_data(self, event): 878 885 """ … … 881 888 if self.parent is not None: 882 889 wx.PostEvent(self.parent, NewLoadDataEvent()) 883 890 884 891 885 892 def on_remove(self, event): 886 893 """ 887 894 Get a list of item checked and remove them from the treectrl 888 Ask the parent to remove reference to this item 895 Ask the parent to remove reference to this item 889 896 """ 890 897 msg = "This operation will delete the data sets checked " … … 893 900 if msg_box.ShowModal() != wx.ID_OK: 894 901 return 895 902 896 903 data_to_remove, theory_to_remove, _ = self.set_data_helper() 897 904 data_key = [] … … 906 913 theory_list_ctrl = self.list_cb_theory[d_key] 907 914 theory_to_remove += theory_list_ctrl.keys() 908 # Remove theory from treectrl 915 # Remove theory from treectrl 909 916 for _, theory_dict in self.list_cb_theory.iteritems(): 910 917 for key, value in theory_dict.iteritems(): … … 916 923 pass 917 924 theory_key.append(key) 918 925 919 926 #Remove data and related theory references 920 927 for key in data_key: … … 934 941 pass 935 942 del theory_dict[key] 936 937 943 944 938 945 self.parent.remove_data(data_id=data_to_remove, 939 946 theory_id=theory_to_remove) … … 941 948 self.enable_freeze() 942 949 self.enable_remove_plot() 943 950 944 951 def on_import(self, event=None): 945 952 """ … … 951 958 temp = data_id + state_id 952 959 self.parent.set_data(data_id=temp, theory_id=theory_id) 953 960 954 961 def on_append_plot(self, event=None): 955 962 """ … … 958 965 self._on_plot_selection() 959 966 data_id, theory_id, state_id = self.set_data_helper() 960 self.parent.plot_data(data_id=data_id, 967 self.parent.plot_data(data_id=data_id, 961 968 state_id=state_id, 962 969 theory_id=theory_id, 963 970 append=True) 964 971 965 972 def on_plot(self, event=None): 966 973 """ … … 968 975 """ 969 976 data_id, theory_id, state_id = self.set_data_helper() 970 self.parent.plot_data(data_id=data_id, 977 self.parent.plot_data(data_id=data_id, 971 978 state_id=state_id, 972 979 theory_id=theory_id, 973 980 append=False) 974 981 self.enable_remove_plot() 975 982 976 983 def on_close_page(self, event=None): 977 984 """ … … 982 989 # send parent to update menu with no show nor hide action 983 990 self.parent.show_data_panel(action=False) 984 991 985 992 def on_freeze(self, event): 986 993 """ … … 995 1002 msg = "Freeze Theory: Requires at least one theory checked." 996 1003 wx.PostEvent(self.parent, StatusEvent(status=msg)) 997 1004 998 1005 def set_active_perspective(self, name): 999 1006 """ … … 1002 1009 self.perspective_cbox.SetStringSelection(name) 1003 1010 self.enable_import() 1004 1011 1005 1012 def _on_delete_plot_panel(self, event): 1006 1013 """ 1007 get an event with attribute name and caption to delete existing name 1014 get an event with attribute name and caption to delete existing name 1008 1015 from the combobox of the current panel 1009 1016 """ … … 1011 1018 caption = event.caption 1012 1019 if self.cb_plotpanel is not None: 1013 pos = self.cb_plotpanel.FindString(str(caption)) 1020 pos = self.cb_plotpanel.FindString(str(caption)) 1014 1021 if pos != wx.NOT_FOUND: 1015 1022 self.cb_plotpanel.Delete(pos) 1016 1023 self.enable_append() 1017 1024 1018 1025 def set_panel_on_focus(self, name=None): 1019 1026 """ … … 1031 1038 self.enable_append() 1032 1039 self.enable_remove_plot() 1033 1040 1034 1041 def set_plot_unfocus(self): 1035 1042 """ … … 1037 1044 """ 1038 1045 return 1039 1046 1040 1047 def _on_perspective_selection(self, event=None): 1041 1048 """ … … 1047 1054 perspective.on_perspective(event=None) 1048 1055 self.parent.check_multimode(perspective=perspective) 1049 1056 1050 1057 def _on_plot_selection(self, event=None): 1051 1058 """ … … 1061 1068 if combo.GetValue() != 'None': 1062 1069 panel = combo.GetClientData(selection) 1063 self.parent.on_set_plot_focus(panel) 1064 1070 self.parent.on_set_plot_focus(panel) 1071 1065 1072 def on_close_plot(self, event): 1066 1073 """ 1067 1074 clseo the panel on focus 1068 """ 1075 """ 1069 1076 self.enable_append() 1070 1077 selection = self.cb_plotpanel.GetSelection() … … 1072 1079 panel = self.cb_plotpanel.GetClientData(selection) 1073 1080 if self.parent is not None and panel is not None: 1074 wx.PostEvent(self.parent, 1081 wx.PostEvent(self.parent, 1075 1082 NewPlotEvent(group_id=panel.group_id, 1076 1083 action="delete")) 1077 1084 self.enable_remove_plot() 1078 1085 1079 1086 def set_frame(self, frame): 1080 1087 """ 1081 1088 """ 1082 1089 self.frame = frame 1083 1090 1084 1091 def get_frame(self): 1085 1092 """ 1086 1093 """ 1087 return self.frame 1088 1094 return self.frame 1095 1089 1096 def on_help(self, event): 1090 1097 """ … … 1115 1122 """ 1116 1123 self.parent.show_data_panel(event) 1117 1124 1118 1125 def set_schedule_full_draw(self, panel=None, func='del'): 1119 1126 """ … … 1121 1128 """ 1122 1129 self.parent.set_schedule_full_draw(panel, func) 1123 1130 1124 1131 def enable_remove_plot(self): 1125 1132 """ … … 1131 1138 #else: 1132 1139 # self.bt_close_plot.Enable() 1133 1140 1134 1141 def enable_remove(self): 1135 1142 """ … … 1142 1149 else: 1143 1150 self.bt_remove.Enable() 1144 1151 1145 1152 def enable_import(self): 1146 1153 """ … … 1160 1167 else: 1161 1168 self.perspective_cbox.Enable() 1162 1169 1163 1170 def enable_plot(self): 1164 1171 """ 1165 1172 enable or disable plot button 1166 1173 """ 1167 n_t = 0 1174 n_t = 0 1168 1175 n_t_t = 0 1169 1176 if self.tree_ctrl != None: … … 1176 1183 self.bt_plot.Enable() 1177 1184 self.enable_append() 1178 1185 1179 1186 def enable_append(self): 1180 1187 """ 1181 1188 enable or disable append button 1182 1189 """ 1183 n_t = 0 1190 n_t = 0 1184 1191 n_t_t = 0 1185 1192 if self.tree_ctrl != None: … … 1187 1194 if self.tree_ctrl_theory != None: 1188 1195 n_t_t = self.tree_ctrl_theory.GetCount() 1189 if n_t + n_t_t <= 0: 1196 if n_t + n_t_t <= 0: 1190 1197 self.bt_append_plot.Disable() 1191 1198 self.cb_plotpanel.Disable() … … 1196 1203 self.bt_append_plot.Enable() 1197 1204 self.cb_plotpanel.Enable() 1198 1205 1199 1206 def check_theory_to_freeze(self): 1200 1207 """ … … 1214 1221 else: 1215 1222 self.bt_freeze.Disable() 1216 1223 1217 1224 def enable_selection(self): 1218 1225 """ … … 1229 1236 else: 1230 1237 self.selection_cbox.Disable() 1231 1238 1232 1239 def show_data_button(self): 1233 1240 """ 1234 show load data and remove data button if 1241 show load data and remove data button if 1235 1242 dataloader on else hide them 1236 1243 """ … … 1238 1245 gui_style = self.parent.get_style() 1239 1246 style = gui_style & GUIFRAME.DATALOADER_ON 1240 if style == GUIFRAME.DATALOADER_ON: 1247 if style == GUIFRAME.DATALOADER_ON: 1241 1248 #self.bt_remove.Show(True) 1242 self.bt_add.Show(True) 1249 self.bt_add.Show(True) 1243 1250 else: 1244 1251 #self.bt_remove.Hide() 1245 1252 self.bt_add.Hide() 1246 except: 1253 except: 1247 1254 #self.bt_remove.Hide() 1248 self.bt_add.Hide() 1249 1255 self.bt_add.Hide() 1256 1250 1257 1251 1258 … … 1264 1271 self.list_of_ctrl = [] 1265 1272 if not data_list: 1266 return 1273 return 1267 1274 self._sizer_main = wx.BoxSizer(wx.VERTICAL) 1268 1275 self._sizer_txt = wx.BoxSizer(wx.VERTICAL) … … 1273 1280 self._panel.SetupScrolling() 1274 1281 self.__do_layout(data_list, text=text) 1275 1282 1276 1283 def __do_layout(self, data_list, text=''): 1277 1284 """ … … 1279 1286 """ 1280 1287 if not data_list or len(data_list) <= 1: 1281 return 1288 return 1282 1289 #add text 1283 1290 1284 1291 text = "Deleting these file reset some panels.\n" 1285 1292 text += "Do you want to proceed?\n" … … 1315 1322 wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10) 1316 1323 static_line = wx.StaticLine(self, -1) 1317 1324 1318 1325 self._sizer_txt.Add(self._panel, 1, wx.EXPAND|wx.LEFT|wx.RIGHT, 5) 1319 1326 self._sizer_main.Add(self._sizer_txt, 1, wx.EXPAND|wx.ALL, 10) 1320 #self._sizer_main.Add(self._data_text_ctrl, 0, 1327 #self._sizer_main.Add(self._data_text_ctrl, 0, 1321 1328 # wx.EXPAND|wx.LEFT|wx.RIGHT, 10) 1322 1329 self._sizer_main.Add(static_line, 0, wx.EXPAND, 0) … … 1324 1331 self.SetSizer(self._sizer_main) 1325 1332 self.Layout() 1326 1333 1327 1334 def get_data(self): 1328 1335 """ … … 1335 1342 temp.append(data) 1336 1343 return temp 1337 1344 1338 1345 class DataFrame(wx.Frame): 1339 1346 """ … … 1347 1354 # tied to any perspective 1348 1355 ALWAYS_ON = True 1349 1356 1350 1357 def __init__(self, parent=None, owner=None, manager=None, size=(300, 800), 1351 1358 list_of_perspective=[], list=[], *args, **kwds): … … 1357 1364 self.owner = owner 1358 1365 self._manager = manager 1359 self.panel = DataPanel(parent=self, 1366 self.panel = DataPanel(parent=self, 1360 1367 manager=manager, 1361 1368 list_of_perspective=list_of_perspective) 1362 1369 1363 1370 def load_data_list(self, list=[]): 1364 1371 """ … … 1366 1373 """ 1367 1374 self.panel.load_data_list(list=list) 1368 1369 1370 1375 1376 1377 1371 1378 from sas.sasgui.guiframe.dataFitting import Theory1D 1372 1379 from sas.sasgui.guiframe.data_state import DataState … … 1383 1390 self.msg += "name value\n" 1384 1391 return self.msg 1385 1392 1386 1393 def set_data_state(data=None, path=None, theory=None, state=None): 1387 1394 """ … … 1391 1398 dstate.set_path(path=path) 1392 1399 dstate.set_theory(theory, state) 1393 1400 1394 1401 return dstate 1395 1402 1396 1403 if __name__ == "__main__": 1397 1404 1398 1405 app = wx.App() 1399 1406 try: … … 1477 1484 #raise 1478 1485 print "error", sys.exc_value 1479 1480 app.MainLoop() 1481 1482 1486 1487 app.MainLoop() -
src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py
rfaa3ae7 ra674d0b 162 162 logging.error("Loader returned an invalid object:\n %s" % str(item)) 163 163 data_error = True 164 164 165 165 data = self.parent.create_gui_data(item, p_file) 166 166 output[data.id] = data … … 170 170 """ 171 171 """ 172 message = "" 173 log_msg = '' 172 file_errors = {} 174 173 output = {} 175 any_error = False 176 data_error = False 177 error_message = "" 174 exception_occurred = False 175 178 176 for p_file in path: 179 info = "info"180 177 basename = os.path.basename(p_file) 181 178 _, extension = os.path.splitext(basename) 182 179 if extension.lower() in EXTENSIONS: 183 any_error = True184 180 log_msg = "Data Loader cannot " 185 log_msg += "load: %s\n" % str(p_file) 186 log_msg += """Please try to open that file from "open project" """ 187 log_msg += """or "open analysis" menu\n""" 188 error_message = log_msg + "\n" 181 log_msg += "load: {}\n".format(str(p_file)) 182 log_msg += "Please try to open that file from \"open project\"" 183 log_msg += "or \"open analysis\" menu." 189 184 logging.info(log_msg) 185 file_errors[basename] = [log_msg] 190 186 continue 191 187 192 188 try: 193 message = "Loading Data... " + str(p_file) + "\n"194 self.load_update(output=output, message=message, info= info)189 message = "Loading {}...\n".format(p_file) 190 self.load_update(output=output, message=message, info="info") 195 191 temp = self.loader.load(p_file, format) 196 if temp.__class__.__name__ == "list": 197 for item in temp: 198 output, error_message, data_error = \ 199 self._process_data_and_errors(item, 200 p_file, 201 output, 202 error_message) 203 else: 192 if not isinstance(temp, list): 193 temp = [temp] 194 for item in temp: 195 error_message = "" 204 196 output, error_message, data_error = \ 205 self._process_data_and_errors(temp, 206 p_file, 207 output, 208 error_message) 197 self._process_data_and_errors(item, 198 p_file, 199 output, 200 error_message) 201 if data_error: 202 if basename in file_errors.keys(): 203 file_errors[basename] += [error_message] 204 else: 205 file_errors[basename] = [error_message] 206 self.load_update(output=output, 207 message=error_message, info="warning") 208 209 self.load_update(output=output, 210 message="Loaded {}\n".format(p_file), 211 info="info") 212 209 213 except: 210 214 logging.error(sys.exc_value) 211 any_error = True 212 if any_error or error_message != "": 213 if error_message == "": 214 error = "Error: " + str(sys.exc_info()[1]) + "\n" 215 error += "while loading Data: \n%s\n" % str(basename) 216 error_message += "The data file you selected could not be loaded.\n" 217 error_message += "Make sure the content of your file" 218 error_message += " is properly formatted.\n\n" 219 error_message += "When contacting the SasView team, mention the" 220 error_message += " following:\n%s" % str(error) 221 elif data_error: 222 base_message = "Errors occurred while loading " 223 base_message += "{0}\n".format(basename) 224 base_message += "The data file loaded but with errors.\n" 225 error_message = base_message + error_message 226 else: 227 error_message += "%s\n" % str(p_file) 228 info = "error" 229 230 if any_error or error_message: 231 self.load_update(output=output, message=error_message, info=info) 232 else: 233 message = "Loading Data Complete! " 234 message += log_msg 235 self.load_complete(output=output, error_message=error_message, 236 message=message, path=path, info='info') 215 216 error_message = "The Data file you selected could not be loaded.\n" 217 error_message += "Make sure the content of your file" 218 error_message += " is properly formatted.\n" 219 error_message += "When contacting the SasView team, mention the" 220 error_message += " following:\n" 221 error_message += "Error: " + str(sys.exc_info()[1]) 222 file_errors[basename] = [error_message] 223 self.load_update(output=output, message=error_message, info="warning") 224 225 if len(file_errors) > 0: 226 error_message = "" 227 for filename, error_array in file_errors.iteritems(): 228 error_message += "The following errors occured whilst " 229 error_message += "loading {}:\n".format(filename) 230 for message in error_array: 231 error_message += message + "\n" 232 error_message += "\n" 233 self.load_update(output=output, message=error_message, info="error") 234 235 self.load_complete(output=output, message="Loading data complete!", 236 info="info") 237 237 238 238 def load_update(self, output=None, message="", info="warning"): … … 254 254 # self.load_error(error_message) 255 255 self.parent.add_data(data_list=output) 256 257 258 -
src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py
ra47d0c8 r2387abc 552 552 self.subplot.set_xlim((xlo, xhi)) 553 553 self.subplot.set_ylim((ylo, yhi)) 554 self.graph.selected_plottable = None 554 555 555 556 … … 629 630 630 631 if self.parent.ClassName.count('wxDialog') == 0: 631 wx_id = ids.next() 632 plot_menu.Append(wx_id, '&Linear Fit', name) 633 wx.EVT_MENU(self, wx_id, self.onFitting) 634 plot_menu.AppendSeparator() 632 if plot.id != 'fit': 633 wx_id = ids.next() 634 plot_menu.Append(wx_id, '&Linear Fit', name) 635 wx.EVT_MENU(self, wx_id, self.onFitting) 636 plot_menu.AppendSeparator() 635 637 636 638 wx_id = ids.next() … … 694 696 self._slicerpop.AppendSeparator() 695 697 wx_id = ids.next() 698 self._slicerpop.Append(wx_id, '&Set Graph Range') 699 wx.EVT_MENU(self, wx_id, self.onSetRange) 700 wx_id = ids.next() 696 701 self._slicerpop.Append(wx_id, '&Reset Graph Range') 697 702 wx.EVT_MENU(self, wx_id, self.onResetGraph) … … 710 715 self.PopupMenu(self._slicerpop, pos) 711 716 717 def onSetRange(self, event): 718 # Display dialog 719 # self.subplot.set_xlim((low, high)) 720 # self.subplot.set_ylim((low, high)) 721 from sas.sasgui.plottools.RangeDialog import RangeDialog 722 d = RangeDialog(self, -1) 723 xlim = self.subplot.get_xlim() 724 ylim = self.subplot.get_ylim() 725 d.SetXRange(xlim) 726 d.SetYRange(ylim) 727 if d.ShowModal() == wx.ID_OK: 728 x_range = d.GetXRange() 729 y_range = d.GetYRange() 730 if x_range is not None and y_range is not None: 731 self.subplot.set_xlim(x_range) 732 self.subplot.set_ylim(y_range) 733 self.subplot.figure.canvas.draw_idle() 734 d.Destroy() 735 712 736 def onFreeze(self, event): 713 737 """ … … 796 820 int(curr_symbol))), curr_label) 797 821 self.appD.Bind(wx.EVT_CLOSE, self.on_AppDialog_close) 822 self.graph.selected_plottable = None 798 823 799 824 def on_AppDialog_close(self, event): -
src/sas/sasgui/guiframe/media/data_explorer_help.rst
rd85c194 rb64b87c 20 20 21 21 *NOTE! When* Data Explorer *is hidden, all data loaded will be sent directly 22 to the current active analysis perspective, if possible. When* Data Explorer *is22 to the current active analysis, if possible. When* Data Explorer *is 23 23 shown, data go first to the* Data Explorer. 24 24 … … 116 116 117 117 Click on the *Send To* button to send the currently selected data to one of the 118 perspectives (for*Fitting*, *P(r) Inversion*, or *Invariant* calculation).118 available types of analysis (*Fitting*, *P(r) Inversion*, or *Invariant* calculation). 119 119 120 The *Single*/*Batch* mode radio buttons only apply to the *Fitting* perspective.120 The *Single*/*Batch* mode radio buttons only apply to *Fitting*. 121 121 122 122 *Batch mode* provides serial (batch) fitting with one model function, that is, -
src/sas/sasgui/guiframe/media/graph_help.rst
rf93b473f re68c9bf 20 20 ^^^^^^^^^^^^^^^^^^^^^^^ 21 21 22 To invoke the *Graph Menu* simply right-click on a data/theory plot, or click 23 the *Graph Menu* (bullet list) icon in the toolbar at the bottom of the plot. 22 To invoke the *Graph Menu* simply right-click on a data/theory plot, or click 23 the *Graph Menu* (bullet list) icon in the toolbar at the bottom of the plot. 24 24 Then select a menu item. 25 25 … … 27 27 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 28 28 29 To expand a plot window, click the *Maximise* (square) icon in the top-right 29 To expand a plot window, click the *Maximise* (square) icon in the top-right 30 30 corner. 31 31 32 To shrink a plot window, click the *Restore down* (square-on-square) icon in 32 To shrink a plot window, click the *Restore down* (square-on-square) icon in 33 33 the top-right corner. 34 34 35 To hide a plot, click the *Minimise* (-) icon in the top-right corner of the 35 To hide a plot, click the *Minimise* (-) icon in the top-right corner of the 36 36 plot window. 37 37 38 To show a hidden plot, select the *Restore up* (square-on-square) icon on the 38 To show a hidden plot, select the *Restore up* (square-on-square) icon on the 39 39 minimised window. 40 40 41 To delete a plot, click the *Close* (x) icon in the top-right corner of the 41 To delete a plot, click the *Close* (x) icon in the top-right corner of the 42 42 plot window. 43 43 44 *NOTE! If a residuals graph (when fitting data) is hidden, it will not show up 44 *NOTE! If a residuals graph (when fitting data) is hidden, it will not show up 45 45 after computation.* 46 46 … … 48 48 ^^^^^^^^^^^^^^^ 49 49 50 Select the *Pan* (crossed arrows) icon in the toolbar at the bottom of the plot 51 to activate this option. Move the mouse pointer to the plot. It will change to 52 a hand. Then left-click and drag the plot around. The axis values will adjust 50 Select the *Pan* (crossed arrows) icon in the toolbar at the bottom of the plot 51 to activate this option. Move the mouse pointer to the plot. It will change to 52 a hand. Then left-click and drag the plot around. The axis values will adjust 53 53 accordingly. 54 54 55 55 To disable dragging mode, unselect the *crossed arrows* icon on the toolbar. 56 56 … … 58 58 ^^^^^^^^^^^^^^^^^^^^^^^^ 59 59 60 Select the *Zoom* (magnifying glass) button in the toolbar at the bottom of 61 the plot to activate this option. Move the mouse pointer to the plot. It will 62 change to a cross-hair. Then left-click and drag the pointer around to generate 60 Select the *Zoom* (magnifying glass) button in the toolbar at the bottom of 61 the plot to activate this option. Move the mouse pointer to the plot. It will 62 change to a cross-hair. Then left-click and drag the pointer around to generate 63 63 a region of interest. Release the mouse button to generate the new view. 64 64 65 65 To disable zoom mode, unselect the *Zoom* button on the toolbar. 66 66 67 After zooming in on a a region, the *left arrow* or *right arrow* buttons on 67 After zooming in on a a region, the *left arrow* or *right arrow* buttons on 68 68 the toolbar will switch between recent views. 69 69 70 *NOTE! If a wheel mouse is available scrolling the wheel will zoom in/out 71 on the current plot (changing both axes). Alternatively, point at the numbers 70 *NOTE! If a wheel mouse is available scrolling the wheel will zoom in/out 71 on the current plot (changing both axes). Alternatively, point at the numbers 72 72 on one axis and scroll the wheel to zoom in/out on just that axis.* 73 73 74 To return to the original view of the data, click the the *Reset* (home) icon 74 To return to the original view of the data, click the the *Reset* (home) icon 75 75 in the toolbar at the bottom of the plot (see Resetting_the_graph_ for further details). 76 76 … … 78 78 ^^^^^^^^^^^^^^^^^^^ 79 79 80 To save the current plot as an image file, right click on the plot to bring up 80 To save the current plot as an image file, right click on the plot to bring up 81 81 the *Graph Menu* (see Invoking_the_graph_menu_) and select *Save Image*. 82 Alternatively, click on the *Save* (floppy disk) icon in the toolbar at the 82 Alternatively, click on the *Save* (floppy disk) icon in the toolbar at the 83 83 bottom of the plot. 84 85 A dialog window will open. Select a folder, enter a filename, choose an output 84 85 A dialog window will open. Select a folder, enter a filename, choose an output 86 86 image type, and click *Save*. 87 87 … … 94 94 * PNG (portable network graphics) 95 95 * PS (postscript) 96 * RAW/RGBA (bitmap )96 * RAW/RGBA (bitmap, stored as 935x635 pixels of depth 8) 97 97 * SVG/SVGA (scalable vector graphics) 98 98 * TIF/TIFF (tagged iamge file) … … 101 101 ^^^^^^^^^^^^^^^ 102 102 103 To send the current plot to a printer, click on the *Print* (printer) icon in 103 To send the current plot to a printer, click on the *Print* (printer) icon in 104 104 the toolbar at the bottom of the plot. 105 105 … … 109 109 ^^^^^^^^^^^^^^^^^^^ 110 110 111 To reset the axis range of a graph to its initial values select *Reset Graph 111 To reset the axis range of a graph to its initial values select *Reset Graph 112 112 Range* on the *Graph Menu* (see Invoking_the_graph_menu_). Alternatively, use 113 113 the *Reset* (home) icon in the toolbar at the bottom of the plot. … … 133 133 134 134 From the *Graph Menu* (see Invoking_the_graph_menu_) select *Change Scale*. A 135 dialog window will appear in which it is possible to choose different 135 dialog window will appear in which it is possible to choose different 136 136 transformations of the x (usually Q) or y (usually I(Q)) axes, including: 137 137 … … 139 139 * y, 1/y, ln(y), y^2, y.(x^4), 1/sqrt(y), 140 140 * log10(y), ln(y.x), ln(y.x^2), ln(y.x^4), log10(y.x^4) 141 141 142 142 A *View* option includes short-cuts to common SAS transformations, such as: 143 143 … … 148 148 * Kratky 149 149 150 For properly corrected and scaled data, these SAS transformations can be used 151 to estimate, for example, Rg, rod diameter, or SANS incoherent background 150 For properly corrected and scaled data, these SAS transformations can be used 151 to estimate, for example, Rg, rod diameter, or SANS incoherent background 152 152 levels, via a linear fit (see Making_a_linear_fit_). 153 153 … … 158 158 159 159 From the *Graph Menu* (see Invoking_the_graph_menu_) select *Toggle Linear/Log 160 Scale* to switch between a linear to log intensity scale. The type of scale 160 Scale* to switch between a linear to log intensity scale. The type of scale 161 161 selected is written alongside the colour scale. 162 162 … … 167 167 168 168 From the *Graph Menu* (see Invoking_the_graph_menu_) select *2D Color Map* to 169 choose a different color scale for the image and/or change the maximum or 169 choose a different color scale for the image and/or change the maximum or 170 170 minimum limits of the scale. 171 171 … … 173 173 ^^^^^^^^^^^^^^^^^^^^^^^^ 174 174 175 Clicking anywhere in the plot window will cause the current coordinates to be 175 Clicking anywhere in the plot window will cause the current coordinates to be 176 176 displayed in the status bar at the very bottom-left of the SasView window. 177 177 178 178 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 179 179 … … 193 193 194 194 In the *Dataset Menu* (see Invoking_the_dataset_menu_), highlight a data set 195 and select *DataInfo* to bring up a data information dialog panel for that 195 and select *DataInfo* to bring up a data information dialog panel for that 196 196 data set. 197 197 … … 200 200 201 201 In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Save Points as 202 a File* (if 1D data) or *Save as a file(DAT)* (if 2D data). A save dialog will 202 a File* (if 1D data) or *Save as a file(DAT)* (if 2D data). A save dialog will 203 203 appear. 204 204 205 1D data can be saved in either ASCII text (.TXT) or CanSAS/SASXML (.XML) 205 1D data can be saved in either ASCII text (.TXT) or CanSAS/SASXML (.XML) 206 206 formats (see :ref:`Formats`). 207 207 … … 216 216 217 217 In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Linear Fit*. A 218 fitting dialog will appear. Set some initial parameters and data limits and 219 click *Fit*. The fitted parameter values are displayed and the resulting line 220 calculated from them is added to the plot. 218 fitting dialog will appear. Set some initial parameters and data limits and 219 click *Fit*. The fitted parameter values are displayed and the resulting line 220 calculated from them is added to the plot. 221 221 222 222 This option is most useful for performing simple Guinier, XS Guinier, and 223 Porod type analyses, for example, to estimate Rg, a rod diameter, or incoherent 223 Porod type analyses, for example, to estimate Rg, a rod diameter, or incoherent 224 224 background level, respectively. 225 225 … … 240 240 241 241 In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Show Error Bar* 242 or *Hide Error Bar* to switch between showing/hiding the errors associated 243 with the chosen dataset. 242 or *Hide Error Bar* to switch between showing/hiding the errors associated 243 with the chosen dataset. 244 244 245 245 Modify plot properties … … 247 247 248 248 In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Modify Plot 249 Property* to change the size, color, or shape of the displayed marker for the 249 Property* to change the size, color, or shape of the displayed marker for the 250 250 chosen dataset, or to change the dataset label that appears on the plot. 251 251 … … 260 260 This feature is only available with 2D data. 261 261 262 2D data averaging allows you to perform different types of averages on your 263 data. The region to be averaged is displayed in the plot window and its limits 262 2D data averaging allows you to perform different types of averages on your 263 data. The region to be averaged is displayed in the plot window and its limits 264 264 can be modified by dragging the boundaries around. 265 265 … … 277 277 * Box averaging on Qy 278 278 279 A 'slicer' will appear (except for *Perform Circular Average*) in the plot that 280 you can drag by clicking on a slicer's handle. When the handle is highlighted 279 A 'slicer' will appear (except for *Perform Circular Average*) in the plot that 280 you can drag by clicking on a slicer's handle. When the handle is highlighted 281 281 in red, it means that the slicer can move/change size. 282 282 283 *NOTE! The slicer size will reset if you try to select a region greater than 283 *NOTE! The slicer size will reset if you try to select a region greater than 284 284 the size of the data.* 285 285 286 Alternatively, once a 'slicer' is active you can also select the region to 287 average by bringing back the *Dataset Menu* and selecting *Edit Slicer 288 Parameters*. A dialog window will appear in which you can enter values to 286 Alternatively, once a 'slicer' is active you can also select the region to 287 average by bringing back the *Dataset Menu* and selecting *Edit Slicer 288 Parameters*. A dialog window will appear in which you can enter values to 289 289 define a region or select the number of points to plot (*nbins*). 290 290 291 A separate plot window will also have appeared, displaying the requested 291 A separate plot window will also have appeared, displaying the requested 292 292 average. 293 293 294 *NOTE! The displayed average only updates when input focus is moved back to 294 *NOTE! The displayed average only updates when input focus is moved back to 295 295 that window; ie, when the mouse pointer is moved onto that plot.* 296 296 297 Selecting *Box Sum* automatically brings up the 'Slicer Parameters' dialog in 297 Selecting *Box Sum* automatically brings up the 'Slicer Parameters' dialog in 298 298 order to display the average numerically, rather than graphically. 299 299 … … 303 303 ^^^^^^^^^^^^^^^^^^^^^^^^^ 304 304 305 This operation will perform an average in constant Q-rings around the (x,y) 305 This operation will perform an average in constant Q-rings around the (x,y) 306 306 pixel location of the beam center. 307 307 … … 309 309 ^^^^^^^^^^^^^^^^^^^^^^^ 310 310 311 This operation is the same as 'Unmasked Circular Average' except that any 311 This operation is the same as 'Unmasked Circular Average' except that any 312 312 masked region is excluded. 313 313 … … 317 317 This operation averages in constant Q-arcs. 318 318 319 The width of the sector is specified in degrees (+/- |delta|\|phi|\) each side 319 The width of the sector is specified in degrees (+/- |delta|\|phi|\) each side 320 320 of the central angle (|phi|\). 321 321 … … 323 323 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 324 324 325 This operation performs an average between two Q-values centered on (0,0), 325 This operation performs an average between two Q-values centered on (0,0), 326 326 and averaged over a specified number of pixels. 327 327 328 The data is returned as a function of angle (|phi|\) in degrees with zero 328 The data is returned as a function of angle (|phi|\) in degrees with zero 329 329 degrees at the 3 O'clock position. 330 330 … … 334 334 This operation performs a sum of counts in a 2D region of interest. 335 335 336 When editing the slicer parameters, the user can enter the length and the width 336 When editing the slicer parameters, the user can enter the length and the width 337 337 the rectangular slicer and the coordinates of the center of the rectangle. 338 338 … … 342 342 This operation computes an average I(Qx) for the region of interest. 343 343 344 When editing the slicer parameters, the user can control the length and the 345 width the rectangular slicer. The averaged output is calculated from constant 346 bins with rectangular shape. The resultant Q values are nominal values, that 344 When editing the slicer parameters, the user can control the length and the 345 width the rectangular slicer. The averaged output is calculated from constant 346 bins with rectangular shape. The resultant Q values are nominal values, that 347 347 is, the central value of each bin on the x-axis. 348 348 … … 352 352 This operation computes an average I(Qy) for the region of interest. 353 353 354 When editing the slicer parameters, the user can control the length and the 355 width the rectangular slicer. The averaged output is calculated from constant 356 bins with rectangular shape. The resultant Q values are nominal values, that 354 When editing the slicer parameters, the user can control the length and the 355 width the rectangular slicer. The averaged output is calculated from constant 356 bins with rectangular shape. The resultant Q values are nominal values, that 357 357 is, the central value of each bin on the x-axis. 358 358
Note: See TracChangeset
for help on using the changeset viewer.