Exemplo n.º 1
0
            runtime.sendToWebServer(msg)

            app_conf = None

            # Start the exp runtime
            #
            cmd, _ = runtime.start(app_config_file_name,pjoin(configurationDirectory,
                                                        new_iohubconfig_rpath))
            # Experiment Session complete, close it out.
            #
            runtime.close()
            runtime = None
        elif cmd == "CLOSE_EXP_SESSION":            
            if runtime:
                runtime.close()
                runtime._close()
                runtime = None
            cmd = None
        elif cmd == "EXIT_PROGRAM":
            if runtime:
                runtime.close()
                runtime._close()
                runtime = None
                core.quit()
            return None
        time.sleep(0.1)
    print("Data Collection Service Stopped.")
if __name__ == "__main__":
    configurationDirectory = psychopy.iohub.module_directory(main)
    # run the main function, which starts the experiment runtime
    main(configurationDirectory)