Changeset 8289ae3 in sasview for src/sas/qtgui/MainWindow


Ignore:
Timestamp:
Mar 23, 2018 8:24:10 AM (7 years ago)
Author:
krzywon
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:
ba4e3ba
Parents:
304e42f (diff), 8ac3551 (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.
Message:

Merge branch 'ESS_GUI' into ESS_GUI_Pr

Location:
src/sas/qtgui/MainWindow
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    re90988c r8ac3551  
    473473        Notify the gui manager about the new perspective chosen. 
    474474        """ 
    475         self.communicator.perspectiveChangedSignal.emit(self.cbFitting.currentText()) 
     475        self.communicator.perspectiveChangedSignal.emit(self.cbFitting.itemText(index)) 
    476476        self.chkBatch.setEnabled(self.parent.perspective().allowBatch()) 
    477477 
    478     def displayData(self, data_list): 
     478    def displayFile(self, filename=None, is_data=True): 
    479479        """ 
    480480        Forces display of charts for the given filename 
    481481        """ 
    482         plot_to_show = data_list[0] 
    483  
    484         # passed plot is used ONLY to figure out its title, 
    485         # so all the charts related by it can be pulled from  
    486         # the data explorer indices. 
    487         filename = plot_to_show.filename 
    488         model = self.model if plot_to_show.is_data else self.theory_model 
    489  
     482        model = self.model if is_data else self.theory_model 
    490483        # Now query the model item for available plots 
    491484        plots = GuiUtils.plotsFromFilename(filename, model) 
     
    506499        if new_plots: 
    507500            self.plotData(new_plots) 
     501 
     502    def displayData(self, data_list): 
     503        """ 
     504        Forces display of charts for the given data set 
     505        """ 
     506        plot_to_show = data_list[0] 
     507        # passed plot is used ONLY to figure out its title, 
     508        # so all the charts related by it can be pulled from  
     509        # the data explorer indices. 
     510        filename = plot_to_show.filename 
     511        self.displayFile(filename=filename, is_data=plot_to_show.is_data) 
    508512 
    509513    def addDataPlot2D(self, plot_set, item): 
     
    10271031        pass 
    10281032 
     1033    def onAnalysisUpdate(self, new_perspective=""): 
     1034        """ 
     1035        Update the perspective combo index based on passed string 
     1036        """ 
     1037        assert new_perspective in Perspectives.PERSPECTIVES.keys() 
     1038        self.cbFitting.blockSignals(True) 
     1039        self.cbFitting.setCurrentIndex(self.cbFitting.findText(new_perspective)) 
     1040        self.cbFitting.blockSignals(False) 
     1041        pass 
     1042 
    10291043    def loadComplete(self, output): 
    10301044        """ 
  • src/sas/qtgui/MainWindow/GuiManager.py

    r14ec91c5 r8ac3551  
    1919 
    2020import sas.qtgui.Utilities.ObjectLibrary as ObjectLibrary 
     21from sas.qtgui.Utilities.TabbedModelEditor import TabbedModelEditor 
     22from sas.qtgui.Utilities.PluginManager import PluginManager 
    2123from sas.qtgui.MainWindow.UI.AcknowledgementsUI import Ui_Acknowledgements 
    2224from sas.qtgui.MainWindow.AboutBox import AboutBox 
     
    4749    Main SasView window functionality 
    4850    """ 
    49  
    5051    def __init__(self, parent=None): 
    5152        """ 
     
    182183        Respond to change of the perspective signal 
    183184        """ 
    184  
    185         # Save users from themselves... 
    186         #if isinstance(self._current_perspective, Perspectives.PERSPECTIVES[str(perspective_name)]): 
    187         self.setupPerspectiveMenubarOptions(self._current_perspective) 
    188         #    return 
    189  
    190185        # Close the previous perspective 
    191186        self.clearPerspectiveMenubarOptions(self._current_perspective) 
     
    197192        # Default perspective 
    198193        self._current_perspective = Perspectives.PERSPECTIVES[str(perspective_name)](parent=self) 
     194 
     195        self.setupPerspectiveMenubarOptions(self._current_perspective) 
    199196 
    200197        subwindow = self._workspace.workspace.addSubWindow(self._current_perspective) 
     
    358355        self.communicate.updateTheoryFromPerspectiveSignal.connect(self.updateTheoryFromPerspective) 
    359356        self.communicate.plotRequestedSignal.connect(self.showPlot) 
     357        self.communicate.plotFromFilenameSignal.connect(self.showPlotFromFilename) 
    360358        self.communicate.updateModelFromDataOperationPanelSignal.connect(self.updateModelFromDataOperationPanel) 
    361359 
     
    406404        self._workspace.actionFit_Results.triggered.connect(self.actionFit_Results) 
    407405        self._workspace.actionChain_Fitting.triggered.connect(self.actionChain_Fitting) 
     406        self._workspace.actionAdd_Custom_Model.triggered.connect(self.actionAdd_Custom_Model) 
    408407        self._workspace.actionEdit_Custom_Model.triggered.connect(self.actionEdit_Custom_Model) 
     408        self._workspace.actionManage_Custom_Models.triggered.connect(self.actionManage_Custom_Models) 
    409409        # Window 
    410410        self._workspace.actionCascade.triggered.connect(self.actionCascade) 
     
    417417        self._workspace.actionInversion.triggered.connect(self.actionInversion) 
    418418        self._workspace.actionInvariant.triggered.connect(self.actionInvariant) 
     419        self._workspace.actionCorfunc.triggered.connect(self.actionCorfunc) 
    419420        # Help 
    420421        self._workspace.actionDocumentation.triggered.connect(self.actionDocumentation) 
     
    662663        pass 
    663664 
     665    def actionAdd_Custom_Model(self): 
     666        """ 
     667        """ 
     668        self.model_editor = TabbedModelEditor(self) 
     669        self.model_editor.show() 
     670 
    664671    def actionEdit_Custom_Model(self): 
    665672        """ 
    666673        """ 
    667         print("actionEdit_Custom_Model TRIGGERED") 
    668         pass 
     674        self.model_editor = TabbedModelEditor(self, edit_only=True) 
     675        self.model_editor.show() 
     676 
     677    def actionManage_Custom_Models(self): 
     678        """ 
     679        """ 
     680        self.model_manager = PluginManager(self) 
     681        self.model_manager.show() 
    669682 
    670683    #============ ANALYSIS ================= 
     
    674687        """ 
    675688        self.perspectiveChanged("Fitting") 
     689        # Notify other widgets 
     690        self.filesWidget.onAnalysisUpdate("Fitting") 
    676691 
    677692    def actionInversion(self): 
     
    679694        Change to the Inversion perspective 
    680695        """ 
    681         # For now we'll just update the analysis menu status but when the inversion is implemented delete from here 
    682         self.checkAnalysisOption(self._workspace.actionInversion) 
    683         # to here and uncomment the following line 
    684696        self.perspectiveChanged("Inversion") 
     697        self.filesWidget.onAnalysisUpdate("Inversion") 
    685698 
    686699    def actionInvariant(self): 
     
    689702        """ 
    690703        self.perspectiveChanged("Invariant") 
     704        self.filesWidget.onAnalysisUpdate("Invariant") 
     705 
     706    def actionCorfunc(self): 
     707        """ 
     708        Change to the Corfunc perspective 
     709        """ 
     710        self.perspectiveChanged("Corfunc") 
     711        self.filesWidget.onAnalysisUpdate("Corfunc") 
    691712 
    692713    #============ WINDOW ================= 
     
    779800        self.filesWidget.model.appendRow(new_item) 
    780801        self._data_manager.add_data(new_datalist_item) 
     802 
     803    def showPlotFromFilename(self, filename): 
     804        """ 
     805        Pass the show plot request to the data explorer 
     806        """ 
     807        if hasattr(self, "filesWidget"): 
     808            self.filesWidget.displayFile(filename=filename, is_data=True) 
    781809 
    782810    def showPlot(self, plot): 
     
    828856        elif isinstance(perspective, Perspectives.PERSPECTIVES["Invariant"]): 
    829857            self.checkAnalysisOption(self._workspace.actionInvariant) 
    830         # elif isinstance(perspective, Perspectives.PERSPECTIVES["Inversion"]): 
    831         #     self.checkAnalysisOption(self._workspace.actionInversion) 
     858        elif isinstance(perspective, Perspectives.PERSPECTIVES["Inversion"]): 
     859            self.checkAnalysisOption(self._workspace.actionInversion) 
     860        elif isinstance(perspective, Perspectives.PERSPECTIVES["Corfunc"]): 
     861            self.checkAnalysisOption(self._workspace.actionCorfunc) 
  • src/sas/qtgui/MainWindow/MainWindow.py

    r8353d90 r8ac3551  
    3030        except Exception as ex: 
    3131            import logging 
    32             logging.error("Application failed with: ", ex) 
     32            logging.error("Application failed with: " + str(ex)) 
    3333            print("Application failed with: ", ex) 
    3434 
  • src/sas/qtgui/MainWindow/UI/MainWindowUI.ui

    r1543f0c r8ac3551  
    88    <y>0</y> 
    99    <width>915</width> 
    10     <height>527</height> 
     10    <height>762</height> 
    1111   </rect> 
    1212  </property> 
     
    2525     <y>0</y> 
    2626     <width>915</width> 
    27      <height>21</height> 
     27     <height>26</height> 
    2828    </rect> 
    2929   </property> 
     
    108108    <addaction name="actionChain_Fitting"/> 
    109109    <addaction name="separator"/> 
     110    <addaction name="actionAdd_Custom_Model"/> 
    110111    <addaction name="actionEdit_Custom_Model"/> 
     112    <addaction name="actionManage_Custom_Models"/> 
    111113   </widget> 
    112114   <widget class="QMenu" name="menuWindow"> 
     
    126128     <string>Analysis</string> 
    127129    </property> 
     130    <addaction name="actionCorfunc"/> 
    128131    <addaction name="actionFitting"/> 
     132    <addaction name="actionInvariant"/> 
    129133    <addaction name="actionInversion"/> 
    130     <addaction name="actionInvariant"/> 
    131134   </widget> 
    132135   <widget class="QMenu" name="menuHelp"> 
     
    505508   </property> 
    506509  </action> 
     510  <action name="actionAdd_Custom_Model"> 
     511   <property name="text"> 
     512    <string>Add Custom Model</string> 
     513   </property> 
     514  </action> 
     515  <action name="actionManage_Custom_Models"> 
     516   <property name="text"> 
     517    <string>Manage Custom Models</string> 
     518   </property> 
     519  </action> 
     520  <action name="actionCorfunc"> 
     521   <property name="checkable"> 
     522    <bool>true</bool> 
     523   </property> 
     524   <property name="text"> 
     525    <string>Correlation Function</string> 
     526   </property> 
     527  </action> 
    507528 </widget> 
    508529 <resources/> 
Note: See TracChangeset for help on using the changeset viewer.