Esempio n. 1
0
#
# get joystick range
#
joy_range = load_calibration()

#
# Start THREAD
#
poll_thread = THREAD(joy_range, logfilename, joy_input)
poll_thread.daemon = True
poll_thread.start()

##############################
# Start DISPLAY
mode = DISPLAY('USB connection', poll_thread, task_info, FPS, fullscreen_on, debug_mode)

mode.task_info['subject_id'] = subject_id

#
# write header
#
log_header(poll_thread.logfile, poll_thread.joy_status, mode.task_info, poll_thread.joy_range, min_median_ref)

#
# Start Labjack
#
if param['start_emg'] or param['run_stimulation'] or param['monitor_emg']:
    import labjack_interface as lji
    lji.reset()
    mode.task_info['description'] = 'start labjack'
Esempio n. 2
0
from display import DISPLAY
from worldmap import MainMenuInterface

if __name__ == '__main__':
    DISPLAY.setup()
    m = MainMenuInterface()
    m.activate()
    m.display()
    DISPLAY.main()

Esempio n. 3
0
#
# get joystick range
#
joy_range = load_calibration()

#
# Start THREAD
#
poll_thread = THREAD(joy_range, logfilename, joy_input)
poll_thread.daemon = True
poll_thread.start()

##############################
# Start DISPLAY
mode = DISPLAY('USB connection', poll_thread, task_info, FPS, fullscreen_on,
               debug_mode)

mode.task_info['subject_id'] = subject_id

#
# write header
#
log_header(poll_thread.logfile, poll_thread.joy_status, mode.task_info,
           poll_thread.joy_range, min_median_ref)

#
# Start Labjack
#
if param['start_emg'] or param['run_stimulation'] or param['monitor_emg']:
    import labjack_interface as lji
    lji.reset()
Esempio n. 4
0
#
print "Enter the ID: "
subject_id = raw_input()
logfilename = get_logfile(subject_id,'calibration')

#
# start THREAD
#
poll_thread = THREAD(joy_range, logfilename, joy_input)
poll_thread.daemon = True
poll_thread.start()

#
# start DISPLAY
#
mode = DISPLAY('USB connection', poll_thread, task_info, FPS, fullscreen_on)

#
# write header
#
log_header(poll_thread.logfile, poll_thread.joy_status, mode.task_info)


#
# display calibration
#
mode.display.fill(colors.BLACK)
mode.display_text('CALIBRATION', colors.RED, 100, datetime.now(), 5)
mode.display_text(calibration_string[0], colors.RED, 50, datetime.now(), 2)

running_calibration = True
Esempio n. 5
0
import pygame
from pygame.locals import KEYDOWN
from display import DISPLAY

#############################
# Import colors
import colors

#############################
# Import parameters
from parameters import FPS, fullscreen_on

#
# Start DISPLAY
#
mode = DISPLAY('USB connection', None, None, FPS, fullscreen_on)

running = True
#
# Fill screen in black - edged in white
#
mode.display.fill(colors.BLACK)
mode.display_edges()

#
# display all targets
#
mode.display_all_targets()
mode.update()

while running:
param = param_task

#
# Import target creation function
#
from utils import create_targets_list


mode_sequence = True
list_seq_targets = create_targets_list(param, 2)

#
# Start DISPLAY
#

mode = DISPLAY(None, None, task_info, FPS, fullscreen_on)

position_target = 0

# Training == target random
list_seq_targets = create_targets_list(param_task, 2)

print list_seq_targets

running = True
keep_learning = True


mode.task_info['numTarget'] = 0

Esempio n. 7
0
#
param = param_task

#
# Import target creation function
#
from utils import create_targets_list

mode_sequence = True
list_seq_targets = create_targets_list(param, 2)

#
# Start DISPLAY
#

mode = DISPLAY(None, None, task_info, FPS, fullscreen_on)

position_target = 0

# Training == target random
list_seq_targets = create_targets_list(param_task, 2)

print list_seq_targets

running = True
keep_learning = True

mode.task_info['numTarget'] = 0

while running:
    if keep_learning:
Esempio n. 8
0
#
# Start THREAD
#
poll_thread = THREAD(None, None, joy_input)
poll_thread.daemon = True
poll_thread.start()

#
# Get param for the sequence
#
param = param_rest

#
# Start DISPLAY
#
mode = DISPLAY('USB connection', None, None, FPS, fullscreen_on)

running = True
#
# Fill screen in black - edged in white
#
mode.display.fill(colors.BLACK)
mode.display_edges()

#
# display all targets
#
mode.display_all_targets()
mode.update()

#
Esempio n. 9
0
# Start THREAD
#
poll_thread = THREAD(None, None, joy_input)
poll_thread.daemon = True
poll_thread.start()


#
# Get param for the sequence
#
param = param_rest

#
# Start DISPLAY
#
mode = DISPLAY('USB connection', None, None, FPS, fullscreen_on)

running = True
#
# Fill screen in black - edged in white
#
mode.display.fill(colors.BLACK)
mode.display_edges()

#
# display all targets
#
mode.display_all_targets()
mode.update()

#
Esempio n. 10
0
#############################
# Import parameters
from parameters import FPS, fullscreen_on, lj_monitor_emg, emg_buffer, debug_mode

#
# Input subject id
#
print "Enter the ID: "
subject_id = raw_input()
logfilename = get_logfile(subject_id,'calibration')

#
# Start DISPLAY
#
mode = DISPLAY('USB connection', None, None, FPS, fullscreen_on, debug_mode)

running = True
#
# Fill screen in black - edged in white
#
mode.display.fill(colors.BLACK)
mode.display_edges()

#
# display all targets
#
rt_plot = lji_rt.AnalogPlot(lj_monitor_emg, emg_buffer, debug_mode)

# Calibration get_minmax
get_minmax = True