source: rc/puzzlebox_brainstorms_configuration.py @ 26

Last change on this file since 26 was 26, checked in by sc, 12 years ago

server:

  • now listening on all server's interfaces

configuration:

  • now listening on all server's interfaces

client:

client_interface:

File size: 3.5 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Puzzlebox - Brainstorms - Configuration
5#
6# Copyright Steven M. Castellotti (2010)
7#
8# Portions of this code have been previously
9# released under the GNU Pulic License (GPL) version 2
10# and is Copyright Steven M. Castellotti (2010)
11# For more information please refer to http://www.gnu.org/copyleft/gpl.htm
12#
13# Last Update: 2010.02.01
14#
15#####################################################################
16
17import os
18
19#####################################################################
20# General configuration
21#####################################################################
22
23DEBUG = 1
24
25#####################################################################
26# Logging
27#####################################################################
28
29LOG_LEVEL_DEBUG = 2
30LOG_LEVEL_INFO = 1
31LOG_LEVEL_ERROR = 0
32LOG_LEVEL_DISABLE = -1
33
34DEFAULT_LOG_LEVEL = LOG_LEVEL_DEBUG
35DEFAULT_LOGFILE = 'puzzlebox'
36
37LOGFILE_DIR = '/var/log/puzzlebox'
38LOGFILE_SUFFIX = '.log'
39LOGFILE_SUFFIX_DEBUG = '_debug.log'
40LOGFILE_SUFFIX_INFO = '_info.log'
41LOGFILE_SUFFIX_ERROR = '_error.log'
42
43SPLIT_LOGFILES = False
44
45#BRAINSTORMS_LOGFILE = 'brainstorms'
46
47
48#####################################################################
49# Network addresses
50#####################################################################
51
52SERVER_INTERFACE = '' # listen on all of server's network interfaces
53SERVER_HOST = '192.168.1.150'
54SERVER_PORT = 8194
55
56
57#####################################################################
58# Remote Control configuration
59#####################################################################
60
61BLUETOOTH_DEVICE = '/dev/rfcomm0'
62MOTORS_MOUNTED_BACKWARDS = True
63MOTOR_PORT_RIGHT = 'a'
64MOTOR_PORT_LEFT = 'b'
65DEFAULT_RC_COMMAND = 'test_drive'
66
67
68#####################################################################
69# Server configuration
70#####################################################################
71
72MAX_COMPONENTS = 16
73
74
75#####################################################################
76# Client configuration
77#####################################################################
78
79MAX_CONNECTION_ATTEMPTS = 5
80HEALTH_CHECK_CONNECTION_ATTEMPTS = 5
81NO_REPLY_WAIT = 10 # how many seconds before considering a component dead
82
83
84#####################################################################
85# Client Interface configuration
86#####################################################################
87
88DISPLAY_WINDOW_X_COORDINATE = 0
89DISPLAY_WINDOW_Y_COORDINATE = 0
90DISPLAY_WINDOW_X_DIMENSION = 254
91DISPLAY_WINDOW_Y_DIMENSION = 424
92
93#WINDOW_BACKGROUND_COLOR = (255,255,255) # white background
94#WINDOW_BACKGROUND_COLOR = (128,128,128) # grey background
95#WINDOW_BACKGROUND_COLOR = (64,64,64)    # dark grek background
96WINDOW_BACKGROUND_COLOR = (0,0,0)       # black background
97
98IMAGE_DIRECTORY = os.path.join(os.getcwd(), 'images')
99
100BUTTON_LAYOUT = { \
101        'name': 'Button Layout', \
102        'buttons': [ \
103                     ['1-upper_left-white.png', '1-upper_left-orange.png',
104                       0, 0, 'turn_left'], \
105                     ['2-up-white.png', '2-up-orange.png', \
106                       98, 0, 'drive_forward'], \
107                     ['3-upper_right-white.png', '3-upper_right-orange.png', \
108                       157, 0, 'turn_right'], \
109                     ['7-lower_left-white.png', '7-lower_left-orange.png', \
110                       0, 220, 'turn_left_in_reverse'], \
111                     ['8-down-white.png', '8-down-orange.png', \
112                       98, 220, 'drive_reverse'], \
113                     ['9-lower_right-white.png', '9-lower_right-orange.png', \
114                       157, 220, 'turn_right_in_reverse'], \
115                   ]
116}
Note: See TracBrowser for help on using the repository browser.