예제 #1
0
 def initServer(self):
     self.dac = self.client.servers['laserdac_server']
     # first plug in slave dongle and then plug in supervisor dongle!!!!!!!!!!!
     sdr1 = RtlSdr(device_index=0)
     sdr2 = RtlSdr(device_index=1)
     self.supervisormodel = model.FreqShowModel(config.first, config.second, sdr1)
     self.slavemodel = model.FreqShowModel(config.first, config.second, sdr2)
     self.thread_supervisor = KThread(target=self.supervisor)
     self.thread_slave = KThread(target=self.slave)
예제 #2
0
파일: freqshow.py 프로젝트: Rotron/Frequer
def run():
    # Initialize pygame and SDL to use the PiTFT display and touchscreen.
    #os.putenv('SDL_VIDEODRIVER', 'fbcon')
    #os.putenv('SDL_FBDEV'      , '/dev/fb1')
    #os.putenv('SDL_MOUSEDRV'   , 'TSLIB')
    #os.putenv('SDL_MOUSEDEV'   , '/dev/input/touchscreen')
    pygame.display.init()
    pygame.font.init()
    #pygame.mouse.set_visible(False)
    # Get size of screen and create main rendering surface.
    size = (pygame.display.Info().current_w, pygame.display.Info().current_h)
    print "w: " + str(size[0])
    print "h: " + str(size[1])

    screen = pygame.display.set_mode(size, pygame.RESIZABLE)
    # Display splash screen.
    splash = pygame.image.load('freqshow_splash.png')
    screen.fill(MAIN_BG)
    screen.blit(splash, ui.align(splash.get_rect(), (0, 0, size[0], size[1])))
    pygame.display.update()
    #	splash_start = time.time()
    # Create model and controller.
    print "build model with " + str(size[0]) + ", " + str(size[0])
    fsmodel = model.FreqShowModel(size[0], size[1])
    fscontroller = controller.FreqShowController(fsmodel)
    #time.sleep(2.0)
    # Main loop to process events and render current view.
    lastclick = 0
    while True:
        # Process any events (only mouse events for now).
        for event in pygame.event.get():
            if event.type is pygame.MOUSEBUTTONDOWN \
             and (time.time() - lastclick) >= CLICK_DEBOUNCE:
                lastclick = time.time()
                fscontroller.current().click(pygame.mouse.get_pos())

        # Update and render the current view.
        fscontroller.current().render(screen)
        #fscontroller.multiview().render(screen)
        #for x in fscontroller.both_views():
        #	x.render(screen)

        #views.WaterfallSpectrogram(model, fscontroller).render(screen)
        #views.InstantSpectrogram(model, fscontroller).render(screen)
        pygame.display.update()
예제 #3
0
 os.putenv('SDL_FBDEV', '/dev/fb0')
 #os.putenv('SDL_MOUSEDRV'   , 'TSLIB')
 #os.putenv('SDL_MOUSEDEV'   , '/dev/input/touchscreen')
 pygame.display.init()
 pygame.font.init()
 pygame.mouse.set_visible(True)
 # Get size of screen and create main rendering surface.
 size = (pygame.display.Info().current_w, pygame.display.Info().current_h)
 screen = pygame.display.set_mode(size, pygame.FULLSCREEN)
 # Display splash screen.
 splash = pygame.image.load('freqshow_splash.png')
 screen.fill(MAIN_BG)
 screen.blit(splash, ui.align(splash.get_rect(), (0, 0, size[0], size[1])))
 pygame.display.update()
 splash_start = time.time()
 # Create model and controller.
 fsmodel = model.FreqShowModel(size[0], size[1])
 fscontroller = controller.FreqShowController(fsmodel)
 time.sleep(2.0)
 # Main loop to process events and render current view.
 lastclick = 0
 while True:
     # Process any events (only mouse events for now).
     for event in pygame.event.get():
         if event.type is pygame.MOUSEBUTTONDOWN \
          and (time.time() - lastclick) >= CLICK_DEBOUNCE:
             lastclick = time.time()
             fscontroller.current().click(pygame.mouse.get_pos())
     # Update and render the current view.
     fscontroller.current().render(screen)
     pygame.display.update()
예제 #4
0
파일: freqshow.py 프로젝트: Qyon/FreqShow
    # Get size of screen and create main rendering surface.
    if system() == "Windows":
        size = (800, 480)
        screen = pygame.display.set_mode(size)
    else:
        size = (pygame.display.Info().current_w, pygame.display.Info().current_h)
        screen = pygame.display.set_mode(size, pygame.FULLSCREEN)

    # Display splash screen.
    splash = pygame.image.load('freqshow_splash.png')
    screen.fill(MAIN_BG)
    screen.blit(splash, ui.align(splash.get_rect(), (0, 0, size[0], size[1])))
    pygame.display.update()
    splash_start = time.time()
    # Create model and controller.
    fsmodel = model.FreqShowModel(size[0], size[1], settings_store)
    fscontroller = controller.FreqShowController(fsmodel, rig_controller=rig_controller)
    # Main loop to process events and render current view.
    lastclick = 0

    last_render = time.time()
    freq = 68.3285
    fsmodel.set_center_freq(freq)
    fsmodel.set_center_freq_display(freq)
    last_freq_change = time.time()
    while True:
        # Process any events (only mouse events for now).
        for event in pygame.event.get():
            if event.type is pygame.MOUSEBUTTONDOWN \
                    and (time.time() - lastclick) >= CLICK_DEBOUNCE:
                lastclick = time.time()
예제 #5
0
파일: myo_raw.py 프로젝트: Rotron/Frequer
    BUTTON_FG = (255, 255, 255)  # White
    BUTTON_BORDER = (200, 200, 200)  # White/light gray
    INSTANT_LINE = (0, 255, 128)  # Bright yellow green.

    # Define gradient of colors for the waterfall graph.  Gradient goes from blue to
    # yellow to cyan to red.
    WATERFALL_GRAD = [(0, 0, 255), (0, 255, 255), (255, 255, 0), (255, 0, 0)]

    # Configure default UI and button values.
    ui.MAIN_FONT = MAIN_FONT
    ui.Button.fg_color = BUTTON_FG
    ui.Button.bg_color = BUTTON_BG
    ui.Button.border_color = BUTTON_BORDER
    ui.Button.padding_px = 2
    ui.Button.border_px = 2
    fsmodel = model.FreqShowModel(1920, 1080)
    ###

    try:
        import pygame
        from pygame.locals import *
        HAVE_PYGAME = False
    except ImportError:
        print("NOGAME")
        HAVE_PYGAME = False

    #if HAVE_PYGAME:
    #   w, h = 1200, 400
    #  scr = pygame.display.set_mode((w, h))

    last_vals = None