コード例 #1
0
def reader(q):
	pico = picopy.Pico3k()
	n_captures = 100
	pico.setChannel("A", coupling="DC", VRange='500mV')
	pico.setChannel("B", coupling="DC", VRange='500mV')
	(sampleInterval, noSamples, maxSamples) = pico.setSamplingInterval(0.00001,0.0035)

	#trigger = picopy.EdgeTrigger(channel='B', threshold=-0.35, direction='FALLING')
	#pico.set_trigger(trigger)
	pico.setSimpleTrigger(trigSrc="B", threshold_V=-0.350, direction='FALLING',
							 timeout_ms=10, enabled=True,delay=0)

	for i in range(50):

		r = pico.capture_prep_block( number_of_frames=n_captures, downsample=1, downsample_mode='NONE',
			return_scaled_array=1)
		q.put(r)
	pico.close()
	q.put('done')
コード例 #2
0
p = pg.plot()
p.setWindowTitle('pyqtgraph example: PlotSpeedTest')

#p.setRange(QtCore.QRectF(0, -10, 5000, 20))
p.setLabel('bottom', 'Index', units='B')
curveA = p.plot(pen=(255, 0, 0))
curveB = p.plot(pen=(0, 255, 0))
curves = []

#curve.setFillBrush((0, 0, 100, 100))
#curve.setFillLevel(0)

#lr = pg.LinearRegionItem([100, 4900])
#p.addItem(lr)
ps = picopy.Pico3k()

n_captures = 50

if conf == "lab":
    ps.setChannel("A", coupling="DC", VRange='50mV')
    ps.setChannel("B", coupling="DC", VRange='50mV')
    (sampleInterval, noSamples,
     maxSamples) = ps.setSamplingInterval(2e-7, 15e-6)
    ps.setSimpleTrigger(trigSrc="ext",
                        threshold_V=0.020,
                        direction='RISING',
                        timeout_ms=10,
                        enabled=True,
                        delay=0)
else:
コード例 #3
0
 def test_delete_and_reinit(self):
     # sleep for a second to let things settle down
     time.sleep(1)
     global pico
     pico = None
     pico = picopy.Pico3k()
コード例 #4
0
 def test_reinitialise_fail(self):
     with self.assertRaisesRegexp(status.PicoError, 'PICO_NOT_FOUND'):
         picopy.Pico3k(pico.get_hardware_info()['serial_string'])
コード例 #5
0
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

import unittest

import picopy
import picopy.pico_status as status

import copy
import math
import time

pico = picopy.Pico3k()


class Pico3kTest(unittest.TestCase):
    def test_valid_setup(self):

        self.assertTrue(pico.get_hardware_info()['hardware_variant'] in
                        picopy.pico3k.capability_dict)

    def test_reinitialise_fail(self):
        with self.assertRaisesRegexp(status.PicoError, 'PICO_NOT_FOUND'):
            picopy.Pico3k(pico.get_hardware_info()['serial_string'])

    def test_delete_and_reinit(self):
        # sleep for a second to let things settle down
        time.sleep(1)
コード例 #6
0
    def initPico(self):

        #self.ps.open()
        self.ps = picopy.Pico3k()
        self.pico_set()