source: orbit/python/Puzzlebox/Orbit/Configuration.py @ cb467b5

Last change on this file since cb467b5 was cb467b5, checked in by Steve Castellotti <sc@…>, 7 years ago
  • continued merge of Orbit from Jigsaw
  • Property mode set to 100644
File size: 8.7 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Puzzlebox - Orbit - Configuration
5#
6# Copyright Puzzlebox Productions, LLC (2011-2014)
7
8__changelog__ = """\
9Last Update: 2014.02.23
10"""
11
12import os, sys
13
14#####################################################################
15# General configuration
16#####################################################################
17
18DEBUG = 1
19
20CONFIGURATION_FILE_PATH = 'puzzlebox_orbit_configuration.ini'
21
22ENABLE_PYSIDE = True
23#ENABLE_PYSIDE = False
24
25INTERFACE_WINDOW_SHRINK = True
26INTERFACE_WINDOW_POSITION = None
27#INTERFACE_WINDOW_POSITION = [300, 0]
28
29ENABLE_CONTROL_PANEL = True
30
31ENABLE_RAW_EEG_DISPLAY = False
32
33if (sys.platform != 'win32'):
34        if not os.path.exists(CONFIGURATION_FILE_PATH):
35                CONFIGURATION_FILE_PATH = \
36                        os.path.join('/etc/puzzlebox_orbit', CONFIGURATION_FILE_PATH)
37
38
39#####################################################################
40# Jigsaw Configuration
41#####################################################################
42
43#####################################################################
44# Plug-in Configuration
45#####################################################################
46
47ENABLE_PLUGIN_HELP = True
48
49ENABLE_PLUGIN_SESSION = True
50
51ENABLE_PLUGIN_EEG = True
52#ENABLE_PLUGIN_EEG = False
53
54#ENABLE_PLUGIN_WEB_BROWSER = True
55ENABLE_PLUGIN_WEB_BROWSER = False
56
57ENABLE_PLUGIN_ORBIT = True
58#ENABLE_PLUGIN_ORBIT = False
59
60ENABLE_PLUGIN_BLENDER = False
61#ENABLE_PLUGIN_BLENDER = True
62
63ENABLE_PLUGIN_TRENDS = False
64#ENABLE_PLUGIN_TRENDS = True
65
66ENABLE_PLUGIN_BRAINSTORMS = False
67#ENABLE_PLUGIN_BRAINSTORMS = True
68
69ENABLE_PLUGIN_ALGORITHMS = False
70#ENABLE_PLUGIN_ALGORITHMS = True
71
72ENABLE_PLUGIN_F1 = False
73#ENABLE_PLUGIN_F1 = True
74
75
76#####################################################################
77# Help Plug-in Configuration
78#####################################################################
79
80PUZZLEBOX_FEEDBACK_URL = 'http://brainstorms.puzzlebox.info/contact_cgi.php'
81
82#DEFAULT_HELP_URL = 'http://jigsaw.puzzlebox.info/help'
83#DEFAULT_HELP_URL = 'http://jigsaw.puzzlebox.info/tracker/wiki/Help'
84DEFAULT_HELP_URL = 'http://orbit.puzzlebox.info/development'
85#DEFAULT_HELP_URL = 'file:///home/cycon/development/jigsaw/trunk/docs/help/index.html'
86
87
88#####################################################################
89# Session Plug-in Configuration
90#####################################################################
91
92SESSION_JSON_INTERFACE = '' # listen on all of host's network interfaces
93SESSION_JSON_HOST = '127.0.0.1'
94#SESSION_JSON_HOST = '*'
95SESSION_JSON_PORT = 8088
96
97SESSION_JSON_DELIMITER = '\r'
98
99
100#EXPORT_CSV_TRUNCATE_TIMEZONE = False # Remove time zone and 4th/5th/6th timer digits
101EXPORT_CSV_TRUNCATE_TIMEZONE = True # Remove time zone and 4th/5th/6th timer digits
102
103#EXPORT_CSV_SCRUB_DATA = True
104EXPORT_CSV_SCRUB_DATA = False
105
106EXPORT_CSV_RAW_DATA = False
107#EXPORT_CSV_RAW_DATA = True
108
109
110#####################################################################
111# Orbit Plug-in Configuration
112#####################################################################
113
114DEFAULT_ORBIT_AUDIO_FILE = 'throttle_hover_os_x.wav'
115
116#DEFAULT_ORBIT_AUDIO_FRAMEWORK = 'Phonon'
117DEFAULT_ORBIT_AUDIO_FRAMEWORK = 'QSound'
118
119DEFAULT_ORBIT_SESSION_GRAPHIC = 'puzzlebox_orbit-flowchart.png'
120
121DEFAULT_ORBIT_HELP_URL = 'https://orbit.puzzlebox.info/development'
122#DEFAULT_ORBIT_HELP_URL = 'file://docs/html/plugin-help-orbit/plugin-help-orbit.html'
123
124DEFAULT_ORBIT_POWER_MINIMUM = 60
125DEFAULT_ORBIT_POWER_MAXIMUM = 100
126
127ORBIT_CONTROL_SETTINGS = { \
128        'hover': { \
129                'throttle': 80, \
130                'yaw': 78, \
131                'pitch': 31
132        }, \
133        'forward': { \
134                'throttle': 80, \
135                'yaw': 78, \
136                'pitch': 50
137        }, \
138        'spinleft': { \
139                'throttle': 80, \
140                'yaw': 42, \
141                'pitch': 31
142        }, \
143        'spinright': { \
144                'throttle': 80, \
145                'yaw': 114, \
146                'pitch': 31
147        }, \
148}
149
150
151#####################################################################
152# EEG Plug-in Configuration
153#####################################################################
154
155SYNAPSE_SERVER_INTERFACE = '' # listen on all of server's network interfaces
156SYNAPSE_SERVER_HOST = '*'
157SYNAPSE_SERVER_PORT = 13854
158
159THINKGEAR_SERVER_INTERFACE = '' # listen on all network interfaces
160THINKGEAR_SERVER_HOST = '127.0.0.1'
161THINKGEAR_SERVER_PORT = 13854
162
163EMOTIV_SERVER_HOST = '127.0.0.1'
164EMOTIV_SERVER_PORT_CONTROL_PANEL = 3008
165EMOTIV_SERVER_PORT_EMOCOMPOSER = 1726
166
167#EEG_PRESERVE_RAW_DATA = True
168EEG_PRESERVE_RAW_DATA = False
169
170EMULATE_THINKGEAR_FOR_EMOTIV = True
171
172
173#####################################################################
174# Logging
175#####################################################################
176
177LOG_LEVEL_DEBUG = 2
178LOG_LEVEL_INFO = 1
179LOG_LEVEL_ERROR = 0
180LOG_LEVEL_DISABLE = -1
181
182DEFAULT_LOG_LEVEL = LOG_LEVEL_DEBUG
183DEFAULT_LOGFILE = 'jigsaw'
184
185LOGFILE_DIR = '/var/log/puzzlebox'
186LOGFILE_SUFFIX = '.log'
187LOGFILE_SUFFIX_DEBUG = '_debug.log'
188LOGFILE_SUFFIX_INFO = '_info.log'
189LOGFILE_SUFFIX_ERROR = '_error.log'
190
191SPLIT_LOGFILES = False
192
193
194#####################################################################
195# Server configuration
196#####################################################################
197
198PUZZLEBOX_DELIMITER = '\r'
199
200
201#####################################################################
202# Client configuration
203#####################################################################
204
205CLIENT_NO_REPLY_WAIT = 5 # how many seconds before considering a component dead
206
207
208#####################################################################
209# ThinkGear Connect configuration
210#####################################################################
211
212THINKGEAR_DELIMITER = '\r'
213
214#THINKGEAR_CONFIGURATION_PARAMETERS = {"enableRawOutput": False, "format": "Json"}
215THINKGEAR_CONFIGURATION_PARAMETERS = {"enableRawOutput": True, "format": "Json"}
216
217THINKGEAR_AUTHORIZATION_ENABLED = False
218
219THINKGEAR_AUTHORIZATION_REQUEST = { \
220        "appName": "Puzzlebox Jigsaw", \
221        "appKey": "2e285d7bd5565c0ea73e7e265c73f0691d932408"
222}
223
224THINKGEAR_EMULATION_MAX_EEG_POWER_VALUE = 16384
225
226
227#####################################################################
228# ThinkGear Connect Server Emulator configuration
229#####################################################################
230
231THINKGEAR_ENABLE_SIMULATE_HEADSET_DATA = False
232
233THINKGEAR_BLINK_FREQUENCY_TIMER = 6 # blink every 6 seconds
234                                    # (6 seconds is listed by Wikipedia
235                                    # as being the average number of times
236                                    # an adult blinks in a laboratory setting)
237
238THINKGEAR_DEFAULT_SAMPLE_WAVELENGTH = 30 # number of seconds from 0 to max
239                                         # and back to 0 for any given
240                                         # detection value below
241
242#THINKGEAR_ATTENTION_MULTIPLIER = 1.0
243#THINKGEAR_MEDITATION_MULTIPLIER = 0.8
244#THINKGEAR_MEDITATION_PLOT_OFFSET = 5
245
246#THINKGEAR_EEG_POWER_MULTIPLIERS = { \
247        #'delta': 1.0, \
248        #'theta': 1.0, \
249        #'lowAlpha': 1.0, \
250        #'highAlpha': 1.0, \
251        #'lowBeta': 1.0, \
252        #'highBeta': 1.0, \
253        #'lowGamma': 1.0, \
254        #'highGamma': 1.0, \
255#}
256
257
258#####################################################################
259# Client Interface configuration
260#####################################################################
261
262THINKGEAR_POWER_THRESHOLDS = { \
263       
264        'concentration': { \
265                0: 0, \
266                10: 0, \
267                20: 0, \
268                30: 0, \
269                40: 60, \
270                50: 65, \
271                60: 70, \
272                70: 75, \
273                75: 80, \
274                80: 85, \
275                90: 90, \
276                100: 90, \
277                }, \
278       
279        'relaxation': { \
280                0: 0, \
281                10: 0, \
282                20: 0, \
283                30: 0, \
284                40: 0, \
285                50: 10, \
286                60: 10, \
287                70: 15, \
288                80: 15, \
289                90: 20, \
290                100: 20, \
291                }, \
292       
293}
294
295
296#####################################################################
297# Flash socket policy handling
298#####################################################################
299
300FLASH_POLICY_FILE_REQUEST = \
301        '<policy-file-request/>%c' % 0 # NULL byte termination
302FLASH_SOCKET_POLICY_FILE = '''<?xml version="1.0"?>
303<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
304<cross-domain-policy>
305   <site-control permitted-cross-domain-policies="all" />
306   <allow-access-from domain="*" to-ports="__FLASH_SOCKET_POLICY_PORT__" />
307</cross-domain-policy>%c''' % 0
308
309
310#####################################################################
311# Configuration File Parser
312#####################################################################
313
314if os.path.exists(CONFIGURATION_FILE_PATH):
315       
316        file = open(CONFIGURATION_FILE_PATH, 'r')
317       
318        for line in file.readlines():
319                line = line.strip()
320                if len(line) == 0:
321                        continue
322                if line[0] == '#':
323                        continue
324                if line.find('=') == -1:
325                        continue
326                try:
327                        exec line
328                except:
329                        if DEBUG:
330                                print "Error recognizing Puzzlebox Jigsaw configuration option:",
331                                print line
332
333
334#####################################################################
335# Final Configuration Settings
336#####################################################################
337
338if ENABLE_PYSIDE:
339        os.environ['QT_API'] = 'pyside'
340else:
341        os.environ['QT_API'] = 'pyqt'
Note: See TracBrowser for help on using the repository browser.