Esempio n. 1
0
 def __init__(self):
     super(DataViewer, self).__init__()
     self.comboList = ComboList.ComboList()
     self.settings = SettingsWidget()
     self.calcPlot = CalculatorPlot(parent=self)
     self.setupGUI()
     # default plots will be drawn with multiple y and single x
     self.mainAxis = 'x'
     self.sliderParam = self.settings.config()['Main parameters']['slider']
     self.timeParam = self.settings.config()['Main parameters']['time']
     # no legend at first (there is no data)
     self.legend = None
     self.currentDataSetName = None
     # cursors are movable items to point the failure points
     self.cursors = []
     self.dataSetButtons = {} # list of items in the dataset section of the menu bar
     '''
     Note:
         indices = piece of all data indices, corresponding to the 
         values interval, contrained by the slider
         THE VIEWER PLOTTS DATA using indices!!!!
     '''
     self.data = None # dictionary with full current data set
     self.indices = None # array with indices for the current interval
     self.comments = {}
     self.allComments = {}
     self.allData = {} # here we keep data for different datasets
     self.allCursors = {} # cursors for different dataset
     self.allIndices = {} # contains all truncated indices
     self.allSampleLengths = {}
     self.allUnits = {}
     # self.settings.okButton.pressed.connect(self.settings.hide)
     self.exitButton.triggered.connect(sys.exit)
     self.settingsButton.triggered.connect(self.settings.show)
     self.loadButton.triggered.connect(self.requestLoad)
     self.addSceneButton.triggered.connect(self.addSceneToCombo)
     self.showComboDataButton.triggered.connect(self.comboList.show)
     self.calcPlotButton.triggered.connect(self.runCalcPlot)
     self.calcPlotButton.setDisabled(True)
     ####
     # connect cursors
     self.plt.sigRangeChanged.connect(self.scaleCursors)
     self.addPointButton.triggered.connect(self.addCursor)
     self.removePointButton.triggered.connect(self.removeCursor)
     self.drawCirclesButton.triggered.connect(self.plotMohrCircles)
     #  Finally enable the save button
     self.saveButton.triggered.connect(self.save)
     self.setStatus('Ready')