Changeset d4881f6a in sasview


Ignore:
Timestamp:
Nov 15, 2017 6:52:27 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
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
Children:
c7ebb37
Parents:
fa81e94
Message:

Initial implementation of Adam Washington's Corfunc perspective.
Converted to py3/Qt5.

Location:
src/sas/qtgui
Files:
6 added
10 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Calculators/DensityPanel.py

    rfbfc488 rd4881f6a  
    1515from sas.qtgui.Calculators.UI.DensityPanel import Ui_DensityPanel 
    1616 
    17 def enum(*sequential, **named): 
    18     enums = dict(list(zip(sequential, list(range(len(sequential))))), **named) 
    19     return type('Enum', (), enums) 
     17from sas.qtgui.Utilities.GuiUtils import enum 
    2018 
    2119MODEL = enum( 
  • src/sas/qtgui/Calculators/SldPanel.py

    rfbfc488 rd4881f6a  
    1616from sas.qtgui.Calculators.UI.SldPanel import Ui_SldPanel 
    1717 
    18 def enum(*sequential, **named): 
    19     enums = dict(list(zip(sequential, list(range(len(sequential))))), **named) 
    20     return type('Enum', (), enums) 
     18from sas.qtgui.Utilities.GuiUtils import enum 
    2119 
    2220MODEL = enum( 
  • src/sas/qtgui/MainWindow/DataExplorer.py

    r53c771e rd4881f6a  
    2929 
    3030import sas.qtgui.Perspectives as Perspectives 
     31 
     32DEFAULT_PERSPECTIVE = "Fitting" 
    3133 
    3234class DataExplorerWindow(DroppableDataLoadWidget): 
     
    161163        self.cbFitting.currentIndexChanged.connect(self.updatePerspectiveCombo) 
    162164        # Set the index so we see the default (Fitting) 
    163         self.updatePerspectiveCombo(0) 
     165        self.cbFitting.setCurrentIndex(self.cbFitting.findText(DEFAULT_PERSPECTIVE)) 
    164166 
    165167    def _perspective(self): 
  • src/sas/qtgui/MainWindow/GuiManager.py

    r7c487846 rd4881f6a  
    3737import sas.qtgui.Perspectives as Perspectives 
    3838from sas.qtgui.Perspectives.Fitting.FittingPerspective import FittingWindow 
    39 from sas.qtgui.MainWindow.DataExplorer import DataExplorerWindow 
     39from sas.qtgui.MainWindow.DataExplorer import DataExplorerWindow, DEFAULT_PERSPECTIVE 
    4040 
    4141class Acknowledgements(QDialog, Ui_Acknowledgements): 
     
    6969        self.addTriggers() 
    7070 
    71         # Populate menus with dynamic data 
    72         # 
    73         # Analysis/Perspectives - potentially 
    74         # Window/current windows 
    75         # 
    76         # Widgets 
    77         # 
    78         # Current displayed perspective 
     71        # Currently displayed perspective 
    7972        self._current_perspective = None 
    8073 
    81         # Invoke the initial perspective 
    82         #self.perspectiveChanged("Fitting") 
     74        # Populate the main window with stuff 
    8375        self.addWidgets() 
    8476 
     
    674666        # For now we'll just update the analysis menu status but when the inversion is implemented delete from here 
    675667        self.checkAnalysisOption(self._workspace.actionInversion) 
    676         print("actionInversion TRIGGERED") 
    677668        # to here and uncomment the following line 
    678         # self.perspectiveChanged("Inversion") 
     669        self.perspectiveChanged("Inversion") 
    679670 
    680671    def actionInvariant(self): 
  • src/sas/qtgui/Perspectives/Invariant/InvariantUtils.py

    rf1f3e6a rd4881f6a  
    1 def enum(*sequential, **named): 
    2     enums = dict(list(zip(sequential, list(range(len(sequential))))), **named) 
    3     return type('Enum', (), enums) 
     1from sas.qtgui.Utilities.GuiUtils import enum 
    42 
    53WIDGETS = enum( 'W_FILENAME', 
  • src/sas/qtgui/Perspectives/Inversion/DMaxExplorerWidget.py

    rfa81e94 rd4881f6a  
    3030logger = logging.getLogger(__name__) 
    3131 
    32 def enum(*sequential, **named): 
    33     enums = dict(list(zip(sequential, list(range(len(sequential))))), **named) 
    34     return type('Enum', (), enums) 
     32from sas.qtgui.Utilities.GuiUtils import enum 
    3533 
    3634W = enum( 'NPTS',           #0 
  • src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py

    rfa81e94 rd4881f6a  
    3131# TODO: Easy way to scroll through results - no tabs in window(?) - 'spreadsheet' 
    3232# TODO: Method to export results in some meaningful way 
    33 class InversionWindow(QtWidgets.QTabWidget, Ui_PrInversion): 
     33#class InversionWindow(QtWidgets.QTabWidget, Ui_PrInversion): 
     34class InversionWindow(QtWidgets.QDialog, Ui_PrInversion): 
    3435    """ 
    3536    The main window for the P(r) Inversion perspective. 
     
    117118            # reset the closability flag 
    118119            self.setClosable(value=False) 
     120            # Tell the MdiArea to close the container 
     121            self.parentWidget().close() 
    119122            event.accept() 
    120123        else: 
     
    253256    def setupWindow(self): 
    254257        """Initialize base window state on init""" 
    255         self.setTabPosition(0) 
     258        #self.setTabPosition(0) 
    256259        self.enableButtons() 
    257260        self.estimateBgd.setChecked(True) 
     
    380383        for data in data_item: 
    381384            # Create initial internal mappings 
    382             self._data_list[data] = self._calculator.clone() 
     385            # TODO: in PyQt5 QStandardItem no longer can be used as dict key 
     386            # Possibly the easiest solution is to subclass QStandardItem 
     387            # and reimplement __hash__() method so it can be hashed. 
     388            self._data_list[data] = self._calculator.clone() #<- this crashes 
    383389            self._data_set = GuiUtils.dataFromItem(data) 
    384390            self.data_plot_list[data] = self.data_plot 
  • src/sas/qtgui/Perspectives/Inversion/InversionUtils.py

    rfa81e94 rd4881f6a  
    1 def enum(*sequential, **named): 
    2     enums = dict(list(zip(sequential, list(range(len(sequential))))), **named) 
    3     return type('Enum', (), enums) 
     1from sas.qtgui.Utilities.GuiUtils import enum 
    42 
    53WIDGETS = enum( 'W_FILENAME',               #0 
  • src/sas/qtgui/Perspectives/__init__.py

    rfa81e94 rd4881f6a  
    55from .Invariant.InvariantPerspective import InvariantWindow 
    66from .Inversion.InversionPerspective import InversionWindow 
     7from .Corfunc.CorfuncPerspective import CorfuncWindow 
    78 
    89PERSPECTIVES = { 
    910    FittingWindow.name: FittingWindow, 
    1011    InvariantWindow.name: InvariantWindow, 
    11     InversionWindow.name: InversionWindow 
     12    InversionWindow.name: InversionWindow, 
     13    CorfuncWindow.name: CorfuncWindow, 
    1214} 
  • src/sas/qtgui/Utilities/GuiUtils.py

    rf1f3e6a rd4881f6a  
    864864        input = input.replace(",", "") 
    865865 
     866def enum(*sequential, **named): 
     867    """Create an enumeration object from a list of strings""" 
     868    enums = dict(zip(sequential, range(len(sequential))), **named) 
     869    return type('Enum', (), enums) 
Note: See TracChangeset for help on using the changeset viewer.