Example #1
0
def dac_thread():
    global OBJ

    ps = PointStream()
    ps.objects.append(OBJ)

    ps.showBlankingPath = False
    ps.showTrackingPath = False
    ps.blankingSamplePts = 10
    ps.trackingSamplePts = 10

    while True:
        try:
            d = dac.DAC(dac.find_first_dac())
            d.play_stream(ps)

        except KeyboardInterrupt:
            sys.exit()

        except Exception as e:
            import sys, traceback
            print '\n---------------------'
            print 'Exception: %s' % e
            print '- - - - - - - - - - -'
            traceback.print_tb(sys.exc_info()[2])
            print "\n"
Example #2
0
def dac_thread():
	global SQUARE
	global SQUARE_X, SQUARE_Y
	global SQUARE_R, SQUARE_G, SQUARE_B
	global SQUARE_SIZE_MIN

	ps = PointStream()

	SQUARE = Square(0, 0, SQUARE_R, SQUARE_G, SQUARE_B,
			radius = SQUARE_SIZE_MIN)

	ps.objects.append(SQUARE)

	while True:
		try:
			d = dac.DAC(dac.find_first_dac())
			d.play_stream(ps)

		except KeyboardInterrupt:
			sys.exit()

		except Exception as e:
			import sys, traceback
			print '\n---------------------'
			print 'Exception: %s' % e
			print '- - - - - - - - - - -'
			traceback.print_tb(sys.exc_info()[2])
			print "\n"
Example #3
0
def dac_thread():
	global OBJ

	ps = PointStream()
	ps.objects.append(OBJ)

	ps.showBlankingPath = False
	ps.showTrackingPath = False
	ps.blankingSamplePts = 10
	ps.trackingSamplePts = 10

	while True:
		try:
			d = dac.DAC(dac.find_first_dac())
			d.play_stream(ps)

		except KeyboardInterrupt:
			sys.exit()

		except Exception as e:
			import sys, traceback
			print '\n---------------------'
			print 'Exception: %s' % e
			print '- - - - - - - - - - -'
			traceback.print_tb(sys.exc_info()[2])
			print "\n"
Example #4
0
def dac_thread():
    while True:
        try:
            d = dac.DAC(dac.find_first_dac())
            d.play_stream(ps)
            print "Testing"
        except:
            pass
def dac_thread():
	while True:
		try:
			d = dac.DAC(dac.find_first_dac())
			d.play_stream(ps)
		except Exception as e:
			print e
			pass
Example #6
0
def dac_thread():
	while True:
		try:
			d = dac.DAC(dac.find_first_dac())
			d.play_stream(ps)
			print "Testing"
		except:
			pass
Example #7
0
def dac_thread():
    while True:
        try:
            d = dac.DAC(dac.find_first_dac())
            d.play_stream(ps)
        except Exception as e:
            import sys, traceback
            print '\n---------------------'
            print 'Exception: %s' % e
            print '- - - - - - - - - - -'
            traceback.print_tb(sys.exc_info()[2])
            print "\n"
            pass
Example #8
0
def dac_thread():
	while True:
		try:
			d = dac.DAC(dac.find_first_dac())
			d.play_stream(ps)
		except Exception as e:
			import sys, traceback
			print '\n---------------------'
			print 'Exception: %s' % e
			print '- - - - - - - - - - -'
			traceback.print_tb(sys.exc_info()[2])
			print "\n"
			pass
def dac_thread():
    """Send stuff to the laser pj"""
    while True:
        try:
            d = dac.DAC(dac.find_first_dac())
            d.play_stream(OBJ)

        except KeyboardInterrupt:
            sys.exit()

        except:
            # Hopefully the galvos aren't melting...
            print "EXCEPTION"
            time.sleep(0.01)
            continue
Example #10
0
def dac_thread():
    global ps

    d = dac.DAC(dac.find_first_dac())

    while True:
        try:
            d.play_stream(ps)
        except KeyboardInterrupt:
            sys.exit()
        except Exception as e:
            print 'exception', e
            # Reset playback so galvos keep spinning
            d.last_status.playback_state = 0
            d.last_status.fullness = 1799
Example #11
0
def dac_thread():
	global ps

	d = dac.DAC(dac.find_first_dac())

	while True:
		try:
			d.play_stream(ps)
		except KeyboardInterrupt:
			sys.exit()
		except Exception as e:
			print 'exception', e
			# Reset playback so galvos keep spinning
			d.last_status.playback_state = 0
			d.last_status.fullness = 1799
def dac_thread():
    """Send stuff to the laser pj"""
    while True:
        try:
            d = dac.DAC(dac.find_first_dac())
            d.play_stream(OBJ)

        except KeyboardInterrupt:
            sys.exit()

        except:
            # Hopefully the galvos aren't melting...
            print "EXCEPTION"
            time.sleep(0.01)
            continue
Example #13
0
def dac_thread():
	"""Pretty boring... Standard DAC thread."""
	global ps
	while True:
		try:
			d = dac.DAC(dac.find_first_dac())
			d.play_stream(ps)

		except Exception as e:
			import sys, traceback
			print '\n---------------------'
			print 'Exception: %s' % e
			print '- - - - - - - - - - -'
			traceback.print_tb(sys.exc_info()[2])
			print "\n"
			pass
Example #14
0
def dac_thread():
	global PS
	while True:
		try:
			d = dac.DAC(dac.find_first_dac())
			d.play_stream(PS)

		except KeyboardInterrupt:
			sys.exit()

		except Exception as e:
			import sys, traceback
			print '\n---------------------'
			print 'Exception: %s' % e
			print '- - - - - - - - - - -'
			traceback.print_tb(sys.exc_info()[2])
			print "\n"
Example #15
0
		def t():
			# TODO: Reoptimize below.
			# TODO: Does this belong here?
			# TODO: Where does anything belong?
			while True:
				try:
					d = dac.DAC(dac.find_first_dac())
					d.play_stream(self.stream)

				except KeyboardInterrupt:
					sys.exit()

				except Exception as e:
					import sys, traceback
					print '\n---------------------'
					print 'DacThread Exception: %s' % e
					print '- - - - - - - - - - -'
					traceback.print_tb(sys.exc_info()[2])
					print "\n"
Example #16
0
def dac_thread():
	global SINEW
	global WAVE_PERIODS

	ps = PointStream()
	#ps.showTracking = True
	#ps.showBlanking = True
	ps.trackingSamplePts = 50
	ps.blankingSamplePts = 50

	SINEW = SineWave(0, 0, COLOR_R/LASER_POWER_DENOM,
							COLOR_G/LASER_POWER_DENOM,
							COLOR_B/LASER_POWER_DENOM)

	SINEW.numPeriods = WAVE_PERIODS
	SINEW.width = WAVE_WIDTH
	SINEW.sineAmp = WAVE_AMPLITUDE_MAGNITUDE

	SINEW.x = ORIGIN_X
	SINEW.y = ORIGIN_Y

	#SQUARE.x = SQUARE_X
	#SQUARE.y = SQUARE_Y

	ps.objects.append(SINEW)

	while True:
		try:
			d = dac.DAC(dac.find_first_dac())
			d.play_stream(ps)

		except KeyboardInterrupt:
			sys.exit()

		except Exception as e:
			import sys, traceback
			print '\n---------------------'
			print 'Exception: %s' % e
			print '- - - - - - - - - - -'
			traceback.print_tb(sys.exc_info()[2])
			print "\n"
			pass
Example #17
0
def dac_thread():
    global objs
    global ps

    for obj in objs:
        ps.objects.append(obj)

    while True:
        try:
            d = dac.DAC(dac.find_first_dac())
            d.play_stream(ps)

        except KeyboardInterrupt:
            sys.exit()

        except Exception as e:
            import sys, traceback
            print '\n---------------------'
            print 'Exception: %s' % e
            print '- - - - - - - - - - -'
            traceback.print_tb(sys.exc_info()[2])
            print "\n"
Example #18
0
def dac_thread():
	global objs
	global ps

	for obj in objs:
		ps.objects.append(obj)

	while True:
		try:
			d = dac.DAC(dac.find_first_dac())
			d.play_stream(ps)

		except KeyboardInterrupt:
			sys.exit()

		except Exception as e:
			import sys, traceback
			print '\n---------------------'
			print 'Exception: %s' % e
			print '- - - - - - - - - - -'
			traceback.print_tb(sys.exc_info()[2])
			print "\n"
Example #19
0
def dac_thread():
	global l

	ps = PointStream()
	#ps.showTracking = True
	#ps.showBlanking = True
	ps.trackingSamplePts = 5
	ps.blankingSamplePts = 50

	l = Tunnel(0, 0, COLOR_R/LASER_POWER_DENOM,
							COLOR_G/LASER_POWER_DENOM,
							COLOR_B/LASER_POWER_DENOM)

	l.x = ORIGIN_X
	l.y = ORIGIN_Y

	#SQUARE.x = SQUARE_X
	#SQUARE.y = SQUARE_Y

	ps.objects.append(l)

	while True:
		try:
			d = dac.DAC(dac.find_first_dac())
			d.play_stream(ps)

		except KeyboardInterrupt:
			sys.exit()

		except Exception as e:
			import sys, traceback
			print '\n---------------------'
			print 'Exception: %s' % e
			print '- - - - - - - - - - -'
			traceback.print_tb(sys.exc_info()[2])
			print "\n"
Example #20
0
                y = int(math.sin(i) * rad)
                yield (x, y, CMAX / LASER_POWER_DENOM,
                       CMAX / LASER_POWER_DENOM, CMAX / LASER_POWER_DENOM)

    def __init__(self):
        self.called = False
        self.stream = self.produce()

    def read(self, n):
        d = [self.stream.next() for i in xrange(n)]
        return d


while True:
    try:
        """
		while 1:
			d = dac.find_first_dac()
			print d
			print ''
			time.sleep(2)
		"""
        d = dac.DAC(dac.find_first_dac())
        ps = CirclePointStream()
        d.play_stream(ps)
    except KeyboardInterrupt:
        sys.exit()
    except Exception as e:
        print e
        continue
Example #21
0
SAMPLE_PTS = 100 # 30 and below very damaging to galvos
X = 0
Y = -9000


class PointPointStream(object):
	def produce(self):
		while True:
			yield (X, Y, CMAX/LASER_POWER_DENOM,
					CMAX/LASER_POWER_DENOM,
					CMAX/LASER_POWER_DENOM)

	def __init__(self):
		self.called = False
		self.stream = self.produce()

	def read(self, n):
		d = [self.stream.next() for i in xrange(n)]
		return d

while True:
	try:
		d = dac.DAC(dac.find_first_dac())
		ps = PointPointStream()
		d.play_stream(ps)
	except KeyboardInterrupt:
		sys.exit()
	except Exception as e:
		print e
		continue