Пример #1
0
    def __init__(self, parent=None):
        super(oscilloscope, self).__init__(parent)

        self.device =  Devices.sundCardDevice()
        self.CHUNK = self.device.CHUNK    #  CHUNK is power of 2
        self.samlingRate = self.device.samlingRate # sampling/second
        self.CHANNELS = self.device.CHANNELS
        self.FORMAT = self.device.FORMAT
			
        self.ON_OFF = False   # False means OFF

        ''' Create Widget for screen'''
        
#         self.ScreenTIME = Screen.Display("Time (ms)", "Amplitude",  [0 , .022], [-1 , 1])
        self.ScreenTIME = Screen.Display("Time (ms)", "Amplitude",  [0 , .022], [-1 , 1])               
#         self.timePlotCH1  = self.ScreenTIME.plot(pen='y', )
#         self.timePlotCH2  = self.ScreenTIME.plot(pen='r', )
        
        
        self.ch1_panel = ChPanel("Ch1")
        self.ch2_panel = ChPanel("Ch2")
        
#         self.FreqRangeGroup = QtGui.QGroupBox("Time Duration (ms)")
#         self.FreRangeLayout = QtGui.QGridLayout()
#         self.SpinBoxStartFreq = QtGui.QDoubleSpinBox()
#         self.SpinBoxStopFreq  = QtGui.QDoubleSpinBox()
#         self.LabelStartFreq = QtGui.QLabel("Start")
#         self.LabelStopFreq  = QtGui.QLabel("Stop")   
#         self.SpinBoxStartFreq.setRange(0,1)
#         # self.SpinBoxStopFreq.setMinimum(0)
#         # self.SpinBoxStopFreq.setMaximum(1000000000)
#         self.SpinBoxStartFreq.setValue(0)
#         self.SpinBoxStopFreq.setValue(.022)
#         self.SpinBoxStartFreq.setSingleStep(0.01)
#         self.SpinBoxStopFreq.setSingleStep(0.01)
#         self.FreRangeLayout.addWidget(self.LabelStartFreq,0,0)
#         self.FreRangeLayout.addWidget(self.LabelStopFreq,1,0)
#         self.FreRangeLayout.addWidget(self.SpinBoxStartFreq,0,1)
#         self.FreRangeLayout.addWidget(self.SpinBoxStopFreq,1,1)
#         self.FreqRangeGroup.setLayout(self.FreRangeLayout)
#         self.SpinBoxStartFreq.valueChanged.connect(self.StartFreqChanged)
#         self.SpinBoxStopFreq.valueChanged.connect(self.StopFreqChanged)

        ''' Create power ON/OFF button '''
        self.BtnPower = QtGui.QPushButton("OFF")
        #self.BtnPower.setStyleSheet('QPushButton {color: red}')  

        ''' Layouts '''
        self.mainLayout = QtGui.QVBoxLayout()       # Main  Layout (Horizontal)

        self.ParameterLayout =  QtGui.QGridLayout() # parameter Laygout Grid
        self.ParameterLayout.setSpacing(10)
#         self.ParameterLayout.addWidget(self.FreqRangeGroup, 0,0)
        self.ParameterLayout.addWidget(self.ch1_panel, 0,1)
        self.ParameterLayout.addWidget(self.ch2_panel, 0,2)
        self.ParameterLayout.addWidget(self.BtnPower, 0,3)

        self.mainLayout.addWidget(self.ScreenTIME)
        self.mainLayout.addLayout(self.ParameterLayout)

        self.setLayout(self.mainLayout )

        #QtCore.QObject.connect(button, QtCore.SIGNAL ('clicked()'), someFunc)
        self.BtnPower.clicked.connect(self.BtnPower_clicked)
Пример #2
0
    def __init__(self, parent=None):
        super(oscilloscope, self).__init__(parent)

        self.device = Devices.sundCardDevice()
        self.CHUNK = self.device.CHUNK  #  CHUNK is power of 2
        self.samlingRate = self.device.samlingRate  # sampling/second
        self.CHANNELS = self.device.CHANNELS
        self.FORMAT = self.device.FORMAT

        self.ON_OFF = False  # False means OFF
        ''' Create Widget for screen'''

        #         self.ScreenTIME = Screen.Display("Time (ms)", "Amplitude",  [0 , .022], [-1 , 1])
        self.ScreenTIME = Screen.Display("Time (ms)", "Amplitude", [0, .022],
                                         [-1, 1])
        #         self.timePlotCH1  = self.ScreenTIME.plot(pen='y', )
        #         self.timePlotCH2  = self.ScreenTIME.plot(pen='r', )

        self.ch1_panel = ChPanel("Ch1")
        self.ch2_panel = ChPanel("Ch2")

        #         self.FreqRangeGroup = QtGui.QGroupBox("Time Duration (ms)")
        #         self.FreRangeLayout = QtGui.QGridLayout()
        #         self.SpinBoxStartFreq = QtGui.QDoubleSpinBox()
        #         self.SpinBoxStopFreq  = QtGui.QDoubleSpinBox()
        #         self.LabelStartFreq = QtGui.QLabel("Start")
        #         self.LabelStopFreq  = QtGui.QLabel("Stop")
        #         self.SpinBoxStartFreq.setRange(0,1)
        #         # self.SpinBoxStopFreq.setMinimum(0)
        #         # self.SpinBoxStopFreq.setMaximum(1000000000)
        #         self.SpinBoxStartFreq.setValue(0)
        #         self.SpinBoxStopFreq.setValue(.022)
        #         self.SpinBoxStartFreq.setSingleStep(0.01)
        #         self.SpinBoxStopFreq.setSingleStep(0.01)
        #         self.FreRangeLayout.addWidget(self.LabelStartFreq,0,0)
        #         self.FreRangeLayout.addWidget(self.LabelStopFreq,1,0)
        #         self.FreRangeLayout.addWidget(self.SpinBoxStartFreq,0,1)
        #         self.FreRangeLayout.addWidget(self.SpinBoxStopFreq,1,1)
        #         self.FreqRangeGroup.setLayout(self.FreRangeLayout)
        #         self.SpinBoxStartFreq.valueChanged.connect(self.StartFreqChanged)
        #         self.SpinBoxStopFreq.valueChanged.connect(self.StopFreqChanged)
        ''' Create power ON/OFF button '''
        self.BtnPower = QtGui.QPushButton("OFF")
        #self.BtnPower.setStyleSheet('QPushButton {color: red}')
        ''' Layouts '''
        self.mainLayout = QtGui.QVBoxLayout()  # Main  Layout (Horizontal)

        self.ParameterLayout = QtGui.QGridLayout()  # parameter Laygout Grid
        self.ParameterLayout.setSpacing(10)
        #         self.ParameterLayout.addWidget(self.FreqRangeGroup, 0,0)
        self.ParameterLayout.addWidget(self.ch1_panel, 0, 1)
        self.ParameterLayout.addWidget(self.ch2_panel, 0, 2)
        self.ParameterLayout.addWidget(self.BtnPower, 0, 3)

        self.mainLayout.addWidget(self.ScreenTIME)
        self.mainLayout.addLayout(self.ParameterLayout)

        self.setLayout(self.mainLayout)

        #QtCore.QObject.connect(button, QtCore.SIGNAL ('clicked()'), someFunc)
        self.BtnPower.clicked.connect(self.BtnPower_clicked)
    def __init__(self, parent=None):
        super(spectrumAnalyzer, self).__init__(parent)
		
		
        self.device =  Devices.sundCardDevice()
        self.CHUNK = self.device.CHUNK    #  CHUNK is power of 2
        self.samlingRate = self.device.samlingRate # sampling/second
        self.CHANNELS = self.device.CHANNELS
        self.FORMAT = self.device.FORMAT
        self.OneSideFFT_points = self.CHUNK/2 + 1      #Calculate the of one-side FFF points.
        self.window = np.ones(self.CHUNK)
				
        self.ON_OFF = False   # False means OFF

        ''' Create Widget for screen'''
        self.ScreenFFT =  Screen.Display("Frequency (Hz)", "Magnitude",  [0,8000], [0,1.5])
        
        ''' Create list box of Frequency range'''
        self.FreqRangeGroup = QtGui.QGroupBox("Frequency Rang (Hz)")
        self.FreRangeLayout = QtGui.QGridLayout()
        self.SpinBoxStartFreq = QtGui.QSpinBox()
        self.SpinBoxStopFreq  = QtGui.QSpinBox()
        self.LabelStartFreq = QtGui.QLabel("Start")
        self.LabelStopFreq  = QtGui.QLabel("Stop")
        self.SpinBoxStartFreq.setMinimum(0)
        self.SpinBoxStartFreq.setMaximum(1000000)
        self.SpinBoxStopFreq.setMinimum(0)
        self.SpinBoxStopFreq.setMaximum(1000000000)
        self.SpinBoxStartFreq.setValue(0)
        self.SpinBoxStopFreq.setValue(1000)
        self.FreRangeLayout.addWidget(self.LabelStartFreq,0,0)
        self.FreRangeLayout.addWidget(self.LabelStopFreq,1,0)
        self.FreRangeLayout.addWidget(self.SpinBoxStartFreq,0,1)
        self.FreRangeLayout.addWidget(self.SpinBoxStopFreq,1,1)
        self.FreqRangeGroup.setLayout(self.FreRangeLayout)
        self.SpinBoxStartFreq.valueChanged[int].connect(self.StartFreqChanged)
        self.SpinBoxStopFreq.valueChanged[int].connect(self.StopFreqChanged)

        ''' Create List box of Windows functions Menu'''
        self.comBoxWinFunction = QtGui.QComboBox()
        self.comBoxWinFunction.addItem("Rectangular")
        self.comBoxWinFunction.addItem("Hamming ")
        self.comBoxWinFunction.addItem("Hanning ")
        self.comBoxWinFunction.addItem("Bartlett ")
        self.comBoxWinFunction.addItem("Blackman ")

        ''' Create power ON/OFF button '''
        self.BtnPower = QtGui.QPushButton("OFF")
        #self.BtnPower.setStyleSheet('QPushButton {color: red}')  

        ''' Layouts '''
        self.mainLayout = QtGui.QVBoxLayout()       # Main  Layout (Horizontal)

        self.ParameterLayout =  QtGui.QGridLayout() # parameter Laygout Grid
        self.ParameterLayout.setSpacing(10)
        self.ParameterLayout.addWidget(self.FreqRangeGroup, 0,0)
        self.ParameterLayout.addWidget(self.comBoxWinFunction, 0,1)
        self.ParameterLayout.addWidget(self.BtnPower, 0,2)

        self.mainLayout.addWidget(self.ScreenFFT)
        self.mainLayout.addLayout(self.ParameterLayout)

        self.setLayout(self.mainLayout )


        #QtCore.QObject.connect(button, QtCore.SIGNAL ('clicked()'), someFunc)
        self.BtnPower.clicked.connect(self.BtnPower_clicked)
        self.comBoxWinFunction.currentIndexChanged[int].connect(self.SelectWindowsFun)
Пример #4
0
    def __init__(self, parent=None):
        super(spectrumAnalyzer, self).__init__(parent)

        self.device = Devices.sundCardDevice()
        self.CHUNK = self.device.CHUNK  #  CHUNK is power of 2
        self.samlingRate = self.device.samlingRate  # sampling/second
        self.CHANNELS = self.device.CHANNELS
        self.FORMAT = self.device.FORMAT
        self.OneSideFFT_points = self.CHUNK / 2 + 1  #Calculate the of one-side FFF points.
        self.window = np.ones(self.CHUNK)

        self.ON_OFF = False  # False means OFF
        ''' Create Widget for screen'''
        self.ScreenFFT = Screen.Display("Frequency (Hz)", "Magnitude",
                                        [0, 8000], [0, 1.5])
        ''' Create list box of Frequency range'''
        self.FreqRangeGroup = QtGui.QGroupBox("Frequency Rang (Hz)")
        self.FreRangeLayout = QtGui.QGridLayout()
        self.SpinBoxStartFreq = QtGui.QSpinBox()
        self.SpinBoxStopFreq = QtGui.QSpinBox()
        self.LabelStartFreq = QtGui.QLabel("Start")
        self.LabelStopFreq = QtGui.QLabel("Stop")
        self.SpinBoxStartFreq.setMinimum(0)
        self.SpinBoxStartFreq.setMaximum(1000000)
        self.SpinBoxStopFreq.setMinimum(0)
        self.SpinBoxStopFreq.setMaximum(1000000000)
        self.SpinBoxStartFreq.setValue(0)
        self.SpinBoxStopFreq.setValue(1000)
        self.FreRangeLayout.addWidget(self.LabelStartFreq, 0, 0)
        self.FreRangeLayout.addWidget(self.LabelStopFreq, 1, 0)
        self.FreRangeLayout.addWidget(self.SpinBoxStartFreq, 0, 1)
        self.FreRangeLayout.addWidget(self.SpinBoxStopFreq, 1, 1)
        self.FreqRangeGroup.setLayout(self.FreRangeLayout)
        self.SpinBoxStartFreq.valueChanged[int].connect(self.StartFreqChanged)
        self.SpinBoxStopFreq.valueChanged[int].connect(self.StopFreqChanged)
        ''' Create List box of Windows functions Menu'''
        self.comBoxWinFunction = QtGui.QComboBox()
        self.comBoxWinFunction.addItem("Rectangular")
        self.comBoxWinFunction.addItem("Hamming ")
        self.comBoxWinFunction.addItem("Hanning ")
        self.comBoxWinFunction.addItem("Bartlett ")
        self.comBoxWinFunction.addItem("Blackman ")
        ''' Create power ON/OFF button '''
        self.BtnPower = QtGui.QPushButton("OFF")
        #self.BtnPower.setStyleSheet('QPushButton {color: red}')
        ''' Layouts '''
        self.mainLayout = QtGui.QVBoxLayout()  # Main  Layout (Horizontal)

        self.ParameterLayout = QtGui.QGridLayout()  # parameter Laygout Grid
        self.ParameterLayout.setSpacing(10)
        self.ParameterLayout.addWidget(self.FreqRangeGroup, 0, 0)
        self.ParameterLayout.addWidget(self.comBoxWinFunction, 0, 1)
        self.ParameterLayout.addWidget(self.BtnPower, 0, 2)

        self.mainLayout.addWidget(self.ScreenFFT)
        self.mainLayout.addLayout(self.ParameterLayout)

        self.setLayout(self.mainLayout)

        #QtCore.QObject.connect(button, QtCore.SIGNAL ('clicked()'), someFunc)
        self.BtnPower.clicked.connect(self.BtnPower_clicked)
        self.comBoxWinFunction.currentIndexChanged[int].connect(
            self.SelectWindowsFun)