Changeset dc5ef15 in sasview


Ignore:
Timestamp:
May 18, 2017 5:36:57 AM (8 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:
6066a3f
Parents:
2a432e7
Message:

Removed qtgui dependency on sasgui and wx SASVIEW-590

Files:
24 added
31 edited

Legend:

Unmodified
Added
Removed
  • sasview/local_config.py

    r9687d58 rdc5ef15  
    44import time 
    55import os 
    6 from sas.sasgui.guiframe.gui_style import GUIFRAME 
     6#from sas.sasgui.guiframe.gui_style import GUIFRAME 
    77import sas.sasview 
    88import logging 
     
    108108SPLASH_SCREEN_PATH = os.path.join(icon_path, "SVwelcome_mini.png") 
    109109TUTORIAL_PATH = os.path.join(media_path, "Tutorial.pdf") 
    110 DEFAULT_STYLE = GUIFRAME.MULTIPLE_APPLICATIONS|GUIFRAME.MANAGER_ON\ 
    111                     |GUIFRAME.CALCULATOR_ON|GUIFRAME.TOOLBAR_ON 
     110#DEFAULT_STYLE = GUIFRAME.MULTIPLE_APPLICATIONS|GUIFRAME.MANAGER_ON\ 
     111#                    |GUIFRAME.CALCULATOR_ON|GUIFRAME.TOOLBAR_ON 
    112112SPLASH_SCREEN_WIDTH = 512 
    113113SPLASH_SCREEN_HEIGHT = 366 
  • src/sas/qtgui/Calculators/GenericScatteringCalculator.py

    r28a09b0 rdc5ef15  
    88from PyQt4 import QtCore 
    99from twisted.internet import threads 
     10from mpl_toolkits.mplot3d import Axes3D 
    1011 
    1112import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    1213 
    13 from sas.sasgui.perspectives.calculator.load_thread import GenReader 
     14from sas.qtgui.Utilities.GenericReader import GenReader 
     15 
    1416from sas.sascalc.dataloader.data_info import Detector 
    1517from sas.sascalc.dataloader.data_info import Source 
    1618from sas.sascalc.calculator import sas_gen 
    1719 
    18 from mpl_toolkits.mplot3d import Axes3D 
     20from sas.qtgui.Plotting.Arrow3D import Arrow3D 
    1921from sas.qtgui.Plotting.PlotterBase import PlotterBase 
    20 from sas.sasgui.guiframe.dataFitting import Data2D 
    2122from sas.qtgui.Plotting.Plotter2D import Plotter2D 
    22 from sas.sasgui.guiframe.dataFitting import Data1D 
    2323from sas.qtgui.Plotting.Plotter import Plotter 
    24 from sas.sasgui.plottools.arrow3d import Arrow3D 
     24from sas.qtgui.Plotting.PlotterData import Data1D 
     25from sas.qtgui.Plotting.PlotterData import Data2D 
    2526 
    2627# Local UI 
  • src/sas/qtgui/Calculators/UnitTesting/GenericScatteringCalculatorTest.py

    r0a6e097 rdc5ef15  
    1919from sas.qtgui.Calculators.GenericScatteringCalculator import Plotter3D 
    2020 
    21 from sas.sasgui.guiframe.data_manager import DataManager 
     21from sas.qtgui.MainWindow.DataManager import DataManager 
    2222from sas.qtgui.MainWindow.GuiManager import GuiManager 
    2323from sas.qtgui.Utilities.GuiUtils import * 
  • src/sas/qtgui/MainWindow/DataExplorer.py

    rd60da0c rdc5ef15  
    1212from twisted.internet import threads 
    1313 
    14 # SAS 
     14# SASCALC 
    1515from sas.sascalc.dataloader.loader import Loader 
    16 from sas.sasgui.guiframe.data_manager import DataManager 
    17 from sas.sasgui.guiframe.dataFitting import Data1D 
    18 from sas.sasgui.guiframe.dataFitting import Data2D 
    19  
     16 
     17# QTGUI 
    2018import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    2119import sas.qtgui.Plotting.PlotHelper as PlotHelper 
     20 
     21from sas.qtgui.Plotting.PlotterData import Data1D 
     22from sas.qtgui.Plotting.PlotterData import Data2D 
    2223from sas.qtgui.Plotting.Plotter import Plotter 
    2324from sas.qtgui.Plotting.Plotter2D import Plotter2D 
     25from sas.qtgui.Plotting.MaskEditor import MaskEditor 
     26 
     27from sas.qtgui.MainWindow.DataManager import DataManager 
    2428from sas.qtgui.MainWindow.DroppableDataLoadWidget import DroppableDataLoadWidget 
    25 from sas.qtgui.Plotting.MaskEditor import MaskEditor 
    2629 
    2730import sas.qtgui.Perspectives as Perspectives 
  • src/sas/qtgui/MainWindow/GuiManager.py

    r2a432e7 rdc5ef15  
    1111 
    1212from twisted.internet import reactor 
     13 
    1314# General SAS imports 
    14  
    15 from sas.sasgui.guiframe.data_manager import DataManager 
    16 from sas.sasgui.guiframe.proxy import Connection 
     15from sas.qtgui.Utilities.ConnectionProxy import ConnectionProxy 
    1716from sas.qtgui.Utilities.SasviewLogger import XStream 
    1817from sas.qtgui.Utilities.IPythonWidget import IPythonWidget 
     
    2423from sas.qtgui.MainWindow.AboutBox import AboutBox 
    2524from sas.qtgui.MainWindow.WelcomePanel import WelcomePanel 
     25from sas.qtgui.MainWindow.DataManager import DataManager 
    2626 
    2727from sas.qtgui.Calculators.SldPanel import SldPanel 
     
    278278        """ 
    279279        version_info = {"version": "0.0.0"} 
    280         c = Connection(LocalConfig.__update_URL__, LocalConfig.UPDATE_TIMEOUT) 
     280        c = ConnectionProxy(LocalConfig.__update_URL__, LocalConfig.UPDATE_TIMEOUT) 
    281281        response = c.connect() 
    282282        if response is None: 
  • src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py

    r83eb5208 rdc5ef15  
    1313 
    1414# Local 
    15 from sas.sasgui.guiframe.dataFitting import Data1D 
     15from sas.qtgui.Plotting.PlotterData import Data1D 
    1616from sas.sascalc.dataloader.loader import Loader 
    17 from sas.sasgui.guiframe.data_manager import DataManager 
     17from sas.qtgui.MainWindow.DataManager import DataManager 
    1818 
    1919from sas.qtgui.MainWindow.DataExplorer import DataExplorerWindow 
  • src/sas/qtgui/Perspectives/Fitting/FittingLogic.py

    r2add354 rdc5ef15  
    11import numpy as np 
    22 
    3 from sas.sasgui.guiframe.dataFitting import Data1D 
    4 from sas.sasgui.guiframe.dataFitting import Data2D 
     3from sas.qtgui.Plotting.PlotterData import Data1D 
     4from sas.qtgui.Plotting.PlotterData import Data2D 
     5 
    56from sas.sascalc.dataloader.data_info import Detector 
    67from sas.sascalc.dataloader.data_info import Source 
  • src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py

    r1bc27f1 rdc5ef15  
    77 
    88from sas.qtgui.Perspectives.Fitting.FittingWidget import FittingWidget 
    9 #from FitPage import FitPage 
    109 
    1110class FittingWindow(QtGui.QTabWidget): 
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    r1bc27f1 rdc5ef15  
    66import numpy 
    77 
    8 from sas.sasgui.guiframe.dataFitting import Data1D 
    9 from sas.sasgui.guiframe.dataFitting import Data2D 
     8from sas.qtgui.Plotting.PlotterData import Data1D 
     9from sas.qtgui.Plotting.PlotterData import Data2D 
    1010 
    1111def replaceShellName(param_name, value): 
     
    363363    return [i >> d & 1 for d in xrange(digits)] 
    364364 
     365def getWeight(data, is2d, flag=None): 
     366    """ 
     367    Received flag and compute error on data. 
     368    :param flag: flag to transform error of data. 
     369    """ 
     370    weight = None 
     371    if is2d: 
     372        dy_data = data.err_data 
     373        data = data.data 
     374    else: 
     375        dy_data = data.dy 
     376        data = data.y 
     377 
     378    if flag == 0: 
     379        weight = numpy.ones_like(data) 
     380    elif flag == 1: 
     381        weight = dy_data 
     382    elif flag == 2: 
     383        weight = numpy.sqrt(numpy.abs(data)) 
     384    elif flag == 3: 
     385        weight = numpy.abs(data) 
     386    return weight 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r2a432e7 rdc5ef15  
    1717from sasmodels.sasview_model import load_standard_models 
    1818from sas.sascalc.fit.BumpsFitting import BumpsFit as Fit 
    19 from sas.sasgui.perspectives.fitting.fit_thread import FitThread 
    20  
    21 from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    22 from sas.sasgui.guiframe.dataFitting import Data1D 
    23 from sas.sasgui.guiframe.dataFitting import Data2D 
     19 
    2420import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    25 from sas.sasgui.perspectives.fitting.model_thread import Calc1D 
    26 from sas.sasgui.perspectives.fitting.model_thread import Calc2D 
    27 from sas.sasgui.perspectives.fitting.utils import get_weight 
     21from sas.qtgui.Utilities.CategoryInstaller import CategoryInstaller 
     22from sas.qtgui.Plotting.PlotterData import Data1D 
     23from sas.qtgui.Plotting.PlotterData import Data2D 
    2824 
    2925from sas.qtgui.Perspectives.Fitting.UI.FittingWidgetUI import Ui_FittingWidgetUI 
     26from sas.qtgui.Perspectives.Fitting.FitThread import FitThread 
     27from sas.qtgui.Perspectives.Fitting.ModelThread import Calc1D 
     28from sas.qtgui.Perspectives.Fitting.ModelThread import Calc2D 
    3029from sas.qtgui.Perspectives.Fitting.FittingLogic import FittingLogic 
    3130from sas.qtgui.Perspectives.Fitting import FittingUtilities 
     
    815814        """ 
    816815        # Send original data for weighting 
    817         weight = get_weight(data=data, is2d=self.is2D, flag=self.weighting) 
     816        weight = FittingUtilities.getWeight(data=data, is2d=self.is2D, flag=self.weighting) 
    818817        update_module = data.err_data if self.is2D else data.dy 
    819818        update_module = weight 
  • src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py

    r1bc27f1 rdc5ef15  
    66from PyQt4 import QtCore 
    77 
    8 from sas.sasgui.guiframe.dataFitting import Data2D 
     8from sas.qtgui.Plotting.PlotterData import Data2D 
    99 
    1010# Local UI 
  • src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py

    r1bc27f1 rdc5ef15  
    55from PyQt4 import QtCore 
    66 
    7 from sas.sasgui.guiframe.dataFitting import Data1D 
    8 from sas.sasgui.guiframe.dataFitting import Data2D 
     7from sas.qtgui.Plotting.PlotterData import Data1D 
     8from sas.qtgui.Plotting.PlotterData import Data2D 
    99 
    1010# Local UI 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingLogicTest.py

    r83eb5208 rdc5ef15  
    1111from sas.qtgui.Utilities.GuiUtils import * 
    1212from sas.qtgui.Perspectives.Fitting.FittingWidget import * 
    13 from sas.sasgui.guiframe.dataFitting import Data1D 
     13from sas.qtgui.Plotting.PlotterData import Data1D 
    1414 
    1515app = QtGui.QApplication(sys.argv) 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingPerspectiveTest.py

    r1bc27f1 rdc5ef15  
    1313# Local 
    1414import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    15 from sas.sasgui.guiframe.dataFitting import Data1D 
    16  
     15from sas.qtgui.Plotting.PlotterData import Data1D 
    1716from sas.qtgui.Perspectives.Fitting.FittingPerspective import FittingWindow 
    1817 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingUtilitiesTest.py

    r9208346 rdc5ef15  
    33from PyQt4 import QtGui 
    44 
    5 from sas.sasgui.guiframe.dataFitting import Data1D 
    6 from sas.sasgui.guiframe.dataFitting import Data2D 
     5from sas.qtgui.Plotting.PlotterData import Data1D 
     6from sas.qtgui.Plotting.PlotterData import Data2D 
    77 
    88from UnitTesting.TestUtils import WarningTestNotImplemented 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py

    r2241130 rdc5ef15  
    1717from sas.qtgui.UnitTesting.TestUtils import QtSignalSpy 
    1818 
    19 from sas.sasgui.guiframe.dataFitting import Data1D 
    20 from sas.sasgui.guiframe.dataFitting import Data2D 
     19from sas.qtgui.Plotting.PlotterData import Data1D 
     20from sas.qtgui.Plotting.PlotterData import Data2D 
    2121 
    2222app = QtGui.QApplication(sys.argv) 
  • src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py

    r83eb5208 rdc5ef15  
    1111# sas-global 
    1212from sas.sascalc.invariant import invariant 
    13 from sas.sasgui.guiframe.dataFitting import Data1D 
     13from sas.qtgui.Plotting.PlotterData import Data1D 
    1414import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    1515 
  • src/sas/qtgui/Plotting/ColorMap.py

    rcd2cc745 rdc5ef15  
    1111 
    1212from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas 
    13 from sas.sasgui.guiframe.dataFitting import Data2D 
     13from sas.qtgui.Plotting.PlotterData import Data2D 
    1414from sas.qtgui.Utilities.GuiUtils import formatNumber 
    1515from rangeSlider import RangeSlider 
  • src/sas/qtgui/Plotting/LinearFit.py

    rcd2cc745 rdc5ef15  
    77from PyQt4 import QtCore 
    88 
    9 #from sas.sasgui.transform import  
    109from sas.qtgui.Utilities.GuiUtils import formatNumber 
    11 from sas.sasgui.plottools import fittings 
    12 from sas.sasgui.plottools import transform 
    13  
    14 from sas.sasgui.plottools.LineModel import LineModel 
     10 
     11from sas.qtgui.Plotting import Fittings 
     12from sas.qtgui.Plotting import DataTransform 
     13from sas.qtgui.Plotting.LineModel import LineModel 
    1514 
    1615# Local UI 
     
    6766        self.default_A = self.model.getParam('A') 
    6867        self.default_B = self.model.getParam('B') 
    69         self.cstA = fittings.Parameter(self.model, 'A', self.default_A) 
    70         self.cstB = fittings.Parameter(self.model, 'B', self.default_B) 
    71         self.transform = transform 
     68        self.cstA = Fittings.Parameter(self.model, 'A', self.default_A) 
     69        self.cstB = Fittings.Parameter(self.model, 'B', self.default_B) 
     70        self.transform = DataTransform 
    7271 
    7372        self.setFixedSize(self.minimumSizeHint()) 
     
    123122 
    124123        # Find the fitting parameters 
    125         self.cstA = fittings.Parameter(self.model, 'A', self.default_A) 
    126         self.cstB = fittings.Parameter(self.model, 'B', self.default_B) 
     124        self.cstA = Fittings.Parameter(self.model, 'A', self.default_A) 
     125        self.cstB = Fittings.Parameter(self.model, 'B', self.default_B) 
    127126        tempdy = numpy.asarray(tempdy) 
    128127        tempdy[tempdy == 0] = 1 
     
    132131            xmax = numpy.log10(xmax) 
    133132 
    134         chisqr, out, cov = fittings.sasfit(self.model, 
     133        chisqr, out, cov = Fittings.sasfit(self.model, 
    135134                                           [self.cstA, self.cstB], 
    136135                                           tempx, tempy, tempdy, 
     
    193192                tempy  = [numpy.log10(y[i]) 
    194193                         for i in range(len(x)) if x[i] >= xmin_check] 
    195                 tempdy = [transform.errToLogX(y[i], 0, dy[i], 0) 
     194                tempdy = [DataTransform.errToLogX(y[i], 0, dy[i], 0) 
    196195                         for i in range(len(x)) if x[i] >= xmin_check] 
    197196            else: 
    198197                tempy = map(numpy.log10, y) 
    199                 tempdy = map(lambda t1,t2:transform.errToLogX(t1,0,t2,0),y,dy) 
     198                tempdy = map(lambda t1,t2:DataTransform.errToLogX(t1,0,t2,0),y,dy) 
    200199        else: 
    201200            tempy = y 
  • src/sas/qtgui/Plotting/MaskEditor.py

    rcd2cc745 rdc5ef15  
    11from PyQt4 import QtGui 
    22 
    3 from sas.sasgui.guiframe.dataFitting import Data2D 
     3from sas.qtgui.Plotting.PlotterData import Data2D 
    44 
    55# Local UI 
  • src/sas/qtgui/Plotting/Plotter.py

    r83eb5208 rdc5ef15  
    77from matplotlib.font_manager import FontProperties 
    88 
    9 from sas.sasgui.guiframe.dataFitting import Data1D 
     9from sas.qtgui.Plotting.PlotterData import Data1D 
     10 
    1011from sas.qtgui.Plotting.PlotterBase import PlotterBase 
    11 import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    1212from sas.qtgui.Plotting.AddText import AddText 
    1313from sas.qtgui.Plotting.SetGraphRange import SetGraphRange 
    1414from sas.qtgui.Plotting.LinearFit import LinearFit 
    1515from sas.qtgui.Plotting.PlotProperties import PlotProperties 
     16 
     17import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    1618import sas.qtgui.Plotting.PlotUtilities as PlotUtilities 
    1719 
  • src/sas/qtgui/Plotting/Plotter2D.py

    r83eb5208 rdc5ef15  
    1010from mpl_toolkits.mplot3d import Axes3D 
    1111 
     12from sas.sascalc.dataloader.manipulations import CircularAverage 
     13 
     14from sas.qtgui.Plotting.PlotterData import Data1D 
     15from sas.qtgui.Plotting.PlotterData import Data2D 
     16 
    1217import sas.qtgui.Plotting.PlotUtilities as PlotUtilities 
    1318import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    1419from sas.qtgui.Plotting.PlotterBase import PlotterBase 
    1520from sas.qtgui.Plotting.ColorMap import ColorMap 
    16 from sas.sasgui.guiframe.dataFitting import Data1D 
    17 from sas.sasgui.guiframe.dataFitting import Data2D 
    18 from sas.sascalc.dataloader.manipulations import CircularAverage 
    19 from sas.sasgui.guiframe.local_perspectives.plotting.binder import BindArtist 
    2021from sas.qtgui.Plotting.BoxSum import BoxSum 
    2122from sas.qtgui.Plotting.SlicerParameters import SlicerParameters 
    22 from sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer import BoxInteractorX 
    23 from sas.sasgui.guiframe.local_perspectives.plotting.AnnulusSlicer import AnnulusInteractor 
    24 from sas.sasgui.guiframe.local_perspectives.plotting.SectorSlicer import SectorInteractor 
    25 from sas.sasgui.guiframe.local_perspectives.plotting.boxSum import BoxSumCalculator 
    26 from sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer import BoxInteractorY 
     23from sas.qtgui.Plotting.Binder import BindArtist 
     24 
     25# TODO: move to sas.qtgui namespace 
     26from sas.qtgui.Plotting.Slicers.BoxSlicer import BoxInteractorX 
     27from sas.qtgui.Plotting.Slicers.BoxSlicer import BoxInteractorY 
     28from sas.qtgui.Plotting.Slicers.AnnulusSlicer import AnnulusInteractor 
     29from sas.qtgui.Plotting.Slicers.SectorSlicer import SectorInteractor 
     30from sas.qtgui.Plotting.Slicers.BoxSum import BoxSumCalculator 
    2731 
    2832# Minimum value of Z for which we will present data. 
  • src/sas/qtgui/Plotting/PlotterBase.py

    r83eb5208 rdc5ef15  
    1515 
    1616DEFAULT_CMAP = pylab.cm.jet 
    17 from sas.sasgui.plottools.binder import BindArtist 
    18  
    19 import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    20 from sas.sasgui.guiframe.dataFitting import Data1D, Data2D 
     17from sas.qtgui.Plotting.Binder import BindArtist 
     18from sas.qtgui.Plotting.PlotterData import Data1D 
     19from sas.qtgui.Plotting.PlotterData import Data2D 
     20 
    2121from sas.qtgui.Plotting.ScaleProperties import ScaleProperties 
    2222from sas.qtgui.Plotting.WindowTitle import WindowTitle 
     23import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    2324import sas.qtgui.Plotting.PlotHelper as PlotHelper 
    2425import sas.qtgui.Plotting.PlotUtilities as PlotUtilities 
  • src/sas/qtgui/Plotting/UnitTesting/ColorMapTest.py

    r83eb5208 rdc5ef15  
    1010import path_prepare 
    1111 
    12 from sas.sasgui.guiframe.dataFitting import Data2D 
     12from sas.qtgui.Plotting.PlotterData import Data2D 
    1313import sas.qtgui.Plotting.Plotter2D as Plotter2D 
    1414from UnitTesting.TestUtils import WarningTestNotImplemented 
  • src/sas/qtgui/Plotting/UnitTesting/LinearFitTest.py

    r83eb5208 rdc5ef15  
    99import path_prepare 
    1010 
    11 from sas.sasgui.guiframe.dataFitting import Data1D 
     11from sas.qtgui.Plotting.PlotterData import Data1D 
    1212import sas.qtgui.Plotting.Plotter as Plotter 
    1313 
  • src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py

    r83eb5208 rdc5ef15  
    1212import path_prepare 
    1313####### 
    14 from sas.sasgui.guiframe.dataFitting import Data1D 
    15 from sas.sasgui.guiframe.dataFitting import Data2D 
     14from sas.qtgui.Plotting.PlotterData import Data1D 
     15from sas.qtgui.Plotting.PlotterData import Data2D 
    1616from UnitTesting.TestUtils import WarningTestNotImplemented 
    1717 
  • src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py

    r83eb5208 rdc5ef15  
    1414from sas.qtgui.Plotting.ScaleProperties import ScaleProperties 
    1515from sas.qtgui.Plotting.WindowTitle import WindowTitle 
    16 #import sas.qtgui.GuiUtils as GuiUtils 
    1716from sas.qtgui.Utilities.GuiUtils import * 
    1817import sas.qtgui.Plotting.PlotHelper as PlotHelper 
  • src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py

    r83eb5208 rdc5ef15  
    1111import path_prepare 
    1212####### 
    13 from sas.sasgui.guiframe.dataFitting import Data1D 
    14 from sas.sasgui.guiframe.dataFitting import Data2D 
    15 from UnitTesting.TestUtils import WarningTestNotImplemented 
     13from sas.qtgui.Plotting.PlotterData import Data1D 
     14from sas.qtgui.Plotting.PlotterData import Data2D 
     15from sas.qtgui.UnitTesting.TestUtils import WarningTestNotImplemented 
    1616from sas.qtgui.Plotting.LinearFit import LinearFit 
    1717from sas.qtgui.Plotting.PlotProperties import PlotProperties 
  • src/sas/qtgui/Utilities/GuiUtils.py

    rad6b4e2 rdc5ef15  
    44 
    55import os 
     6import re 
    67import sys 
    78import imp 
     
    1617from PyQt4 import QtGui 
    1718 
    18 # Translate event handlers 
    19 #from sas.sasgui.guiframe.events import EVT_CATEGORY 
    20 #from sas.sasgui.guiframe.events import EVT_STATUS 
    21 #from sas.sasgui.guiframe.events import EVT_APPEND_BOOKMARK 
    22 #from sas.sasgui.guiframe.events import EVT_PANEL_ON_FOCUS 
    23 #from sas.sasgui.guiframe.events import EVT_NEW_LOAD_DATA 
    24 #from sas.sasgui.guiframe.events import EVT_NEW_COLOR 
    25 #from sas.sasgui.guiframe.events import StatusEvent 
    26 #from sas.sasgui.guiframe.events import NewPlotEvent 
    27  
    2819from periodictable import formula as Formula 
    2920 
    30 from sas.sasgui.plottools import transform 
    31 from sas.sasgui.plottools.convert_units import convert_unit 
    32 from sas.sasgui.guiframe.dataFitting import Data1D 
    33 from sas.sasgui.guiframe.dataFitting import Data2D 
     21from sas.qtgui.Plotting import DataTransform 
     22from sas.qtgui.Plotting.ConvertUnits import convertUnit 
     23 
     24from sas.qtgui.Plotting.PlotterData import Data1D 
     25from sas.qtgui.Plotting.PlotterData import Data2D 
     26 
    3427from sas.sascalc.dataloader.loader import Loader 
     28from sas.qtgui.Utilities import CustomDir 
    3529 
    3630 
     
    109103if config is None: 
    110104    config = _find_local_config('local_config', os.getcwd()) 
    111     if config is None: 
    112         # Didn't find local config, load the default 
    113         import sas.sasgui.guiframe.config as config 
    114         #logging.info("using default local_config") 
    115     else: 
    116         pass 
    117         #logging.info("found local_config in %s", os.getcwd()) 
     105    #if config is None: 
     106    #    # Didn't find local config, load the default 
     107    #    import sas.sasgui.guiframe.config as config 
     108    #    #logging.info("using default local_config") 
     109    #else: 
     110    #    pass 
     111    #    #logging.info("found local_config in %s", os.getcwd()) 
    118112else: 
    119113    pass 
    120114    #logging.info("found local_config in %s", PATH_APP) 
    121115 
    122 from sas.sasgui.guiframe.customdir  import SetupCustom 
    123 c_conf_dir = SetupCustom().setup_dir(PATH_APP) 
     116c_conf_dir = CustomDir.setup_conf_dir(PATH_APP) 
    124117 
    125118custom_config = _find_local_config('custom_config', c_conf_dir) 
     
    183176    DEFAULT_OPEN_FOLDER = PATH_APP 
    184177 
    185 DEFAULT_STYLE = config.DEFAULT_STYLE 
     178#DEFAULT_STYLE = config.DEFAULT_STYLE 
    186179 
    187180PLUGIN_STATE_EXTENSIONS = config.PLUGIN_STATE_EXTENSIONS 
     
    672665    # X 
    673666    if xLabel == "x": 
    674         data.transformX(transform.toX, transform.errToX) 
     667        data.transformX(DataTransform.toX, DataTransform.errToX) 
    675668        xLabel = "%s(%s)" % (xname, xunits) 
    676669    if xLabel == "x^(2)": 
    677         data.transformX(transform.toX2, transform.errToX2) 
    678         xunits = convert_unit(2, xunits) 
     670        data.transformX(DataTransform.toX2, DataTransform.errToX2) 
     671        xunits = convertUnit(2, xunits) 
    679672        xLabel = "%s^{2}(%s)" % (xname, xunits) 
    680673    if xLabel == "x^(4)": 
    681         data.transformX(transform.toX4, transform.errToX4) 
    682         xunits = convert_unit(4, xunits) 
     674        data.transformX(DataTransform.toX4, DataTransform.errToX4) 
     675        xunits = convertUnit(4, xunits) 
    683676        xLabel = "%s^{4}(%s)" % (xname, xunits) 
    684677    if xLabel == "ln(x)": 
    685         data.transformX(transform.toLogX, transform.errToLogX) 
     678        data.transformX(DataTransform.toLogX, DataTransform.errToLogX) 
    686679        xLabel = "\ln{(%s)}(%s)" % (xname, xunits) 
    687680    if xLabel == "log10(x)": 
    688         data.transformX(transform.toX_pos, transform.errToX_pos) 
     681        data.transformX(DataTransform.toX_pos, DataTransform.errToX_pos) 
    689682        xscale = 'log' 
    690683        xLabel = "%s(%s)" % (xname, xunits) 
    691684    if xLabel == "log10(x^(4))": 
    692         data.transformX(transform.toX4, transform.errToX4) 
    693         xunits = convert_unit(4, xunits) 
     685        data.transformX(DataTransform.toX4, DataTransform.errToX4) 
     686        xunits = convertUnit(4, xunits) 
    694687        xLabel = "%s^{4}(%s)" % (xname, xunits) 
    695688        xscale = 'log' 
     
    697690    # Y 
    698691    if yLabel == "ln(y)": 
    699         data.transformY(transform.toLogX, transform.errToLogX) 
     692        data.transformY(DataTransform.toLogX, DataTransform.errToLogX) 
    700693        yLabel = "\ln{(%s)}(%s)" % (yname, yunits) 
    701694    if yLabel == "y": 
    702         data.transformY(transform.toX, transform.errToX) 
     695        data.transformY(DataTransform.toX, DataTransform.errToX) 
    703696        yLabel = "%s(%s)" % (yname, yunits) 
    704697    if yLabel == "log10(y)": 
    705         data.transformY(transform.toX_pos, transform.errToX_pos) 
     698        data.transformY(DataTransform.toX_pos, DataTransform.errToX_pos) 
    706699        yscale = 'log' 
    707700        yLabel = "%s(%s)" % (yname, yunits) 
    708701    if yLabel == "y^(2)": 
    709         data.transformY(transform.toX2, transform.errToX2) 
    710         yunits = convert_unit(2, yunits) 
     702        data.transformY(DataTransform.toX2, DataTransform.errToX2) 
     703        yunits = convertUnit(2, yunits) 
    711704        yLabel = "%s^{2}(%s)" % (yname, yunits) 
    712705    if yLabel == "1/y": 
    713         data.transformY(transform.toOneOverX, transform.errOneOverX) 
    714         yunits = convert_unit(-1, yunits) 
     706        data.transformY(DataTransform.toOneOverX, DataTransform.errOneOverX) 
     707        yunits = convertUnit(-1, yunits) 
    715708        yLabel = "1/%s(%s)" % (yname, yunits) 
    716709    if yLabel == "y*x^(2)": 
    717         data.transformY(transform.toYX2, transform.errToYX2) 
    718         xunits = convert_unit(2, xunits) 
     710        data.transformY(DataTransform.toYX2, DataTransform.errToYX2) 
     711        xunits = convertUnit(2, xunits) 
    719712        yLabel = "%s \ \ %s^{2}(%s%s)" % (yname, xname, yunits, xunits) 
    720713    if yLabel == "y*x^(4)": 
    721         data.transformY(transform.toYX4, transform.errToYX4) 
    722         xunits = convert_unit(4, xunits) 
     714        data.transformY(DataTransform.toYX4, DataTransform.errToYX4) 
     715        xunits = convertUnit(4, xunits) 
    723716        yLabel = "%s \ \ %s^{4}(%s%s)" % (yname, xname, yunits, xunits) 
    724717    if yLabel == "1/sqrt(y)": 
    725         data.transformY(transform.toOneOverSqrtX, 
    726                                 transform.errOneOverSqrtX) 
    727         yunits = convert_unit(-0.5, yunits) 
     718        data.transformY(DataTransform.toOneOverSqrtX, DataTransform.errOneOverSqrtX) 
     719        yunits = convertUnit(-0.5, yunits) 
    728720        yLabel = "1/\sqrt{%s}(%s)" % (yname, yunits) 
    729721    if yLabel == "ln(y*x)": 
    730         data.transformY(transform.toLogXY, transform.errToLogXY) 
     722        data.transformY(DataTransform.toLogXY, DataTransform.errToLogXY) 
    731723        yLabel = "\ln{(%s \ \ %s)}(%s%s)" % (yname, xname, yunits, xunits) 
    732724    if yLabel == "ln(y*x^(2))": 
    733         data.transformY(transform.toLogYX2, transform.errToLogYX2) 
    734         xunits = convert_unit(2, xunits) 
     725        data.transformY(DataTransform.toLogYX2, DataTransform.errToLogYX2) 
     726        xunits = convertUnit(2, xunits) 
    735727        yLabel = "\ln (%s \ \ %s^{2})(%s%s)" % (yname, xname, yunits, xunits) 
    736728    if yLabel == "ln(y*x^(4))": 
    737         data.transformY(transform.toLogYX4, transform.errToLogYX4) 
    738         xunits = convert_unit(4, xunits) 
     729        data.transformY(DataTransform.toLogYX4, DataTransform.errToLogYX4) 
     730        xunits = convertUnit(4, xunits) 
    739731        yLabel = "\ln (%s \ \ %s^{4})(%s%s)" % (yname, xname, yunits, xunits) 
    740732    if yLabel == "log10(y*x^(4))": 
    741         data.transformY(transform.toYX4, transform.errToYX4) 
    742         xunits = convert_unit(4, xunits) 
     733        data.transformY(DataTransform.toYX4, DataTransform.errToYX4) 
     734        xunits = convertUnit(4, xunits) 
    743735        yscale = 'log' 
    744736        yLabel = "%s \ \ %s^{4}(%s%s)" % (yname, xname, yunits, xunits) 
     
    792784    else: 
    793785        return unit 
     786 
     787def parseName(name, expression): 
     788    """ 
     789    remove "_" in front of a name 
     790    """ 
     791    if re.match(expression, name) is not None: 
     792        word = re.split(expression, name, 1) 
     793        for item in word:            
     794            if item.lstrip().rstrip() != '': 
     795                return item 
     796    else: 
     797        return name 
  • src/sas/qtgui/Utilities/LocalConfig.py

    r83eb5208 rdc5ef15  
    44import time 
    55import os 
    6 import logging 
    76 
    8 from sas.sasgui.guiframe.gui_style import GUIFRAME 
     7#from sas.sasgui.guiframe.gui_style import GUIFRAME 
    98import sas.sasview 
    109 
     
    104103SPLASH_SCREEN_PATH = os.path.join(icon_path, "SVwelcome_mini.png") 
    105104TUTORIAL_PATH = os.path.join(media_path, "Tutorial.pdf") 
    106 DEFAULT_STYLE = GUIFRAME.MULTIPLE_APPLICATIONS|GUIFRAME.MANAGER_ON\ 
    107                     |GUIFRAME.CALCULATOR_ON|GUIFRAME.TOOLBAR_ON 
     105#DEFAULT_STYLE = GUIFRAME.MULTIPLE_APPLICATIONS|GUIFRAME.MANAGER_ON\ 
     106#                    |GUIFRAME.CALCULATOR_ON|GUIFRAME.TOOLBAR_ON 
    108107SPLASH_SCREEN_WIDTH = 512 
    109108SPLASH_SCREEN_HEIGHT = 366 
  • src/sas/qtgui/Utilities/UnitTesting/GuiUtilsTest.py

    r83eb5208 rdc5ef15  
    1212# SV imports 
    1313from sas.sascalc.dataloader.loader import Loader 
    14 from sas.sasgui.guiframe.data_manager import DataManager 
    15 from sas.sasgui.guiframe.dataFitting import Data1D 
    16 from sas.sasgui.guiframe.dataFitting import Data2D 
     14from sas.qtgui.MainWindow.DataManager import DataManager 
     15from sas.qtgui.Plotting.PlotterData import Data1D 
     16from sas.qtgui.Plotting.PlotterData import Data2D 
    1717 
    1818# Tested module 
Note: See TracChangeset for help on using the changeset viewer.