source: rc/puzzlebox_brainstorms_configuration.py @ 18

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

configuration:

  • button layout added

client_interface_button:

  • initial checking as distinct module

client_interface:

  • button initializing and drawing added

client_interface_component:

  • initial checking as distinct module
File size: 3.4 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#MONITORING_LOGFILE = 'monitoring'
46#MONITORING_FAILLOG = 'monitoring_failure'
47#XORG_RESET_LOGFILE = 'xorg_reset'
48
49
50#####################################################################
51# Network addresses
52#####################################################################
53
54#SERVER_HOST = '127.0.0.1'
55SERVER_HOST = '192.168.1.150'
56#SERVER_HOST = ''
57SERVER_PORT = 8194
58
59
60#####################################################################
61# Remote Control configuration
62#####################################################################
63
64BLUETOOTH_DEVICE = '/dev/rfcomm0'
65MOTORS_MOUNTED_BACKWARDS = True
66MOTOR_PORT_RIGHT = 'a'
67MOTOR_PORT_LEFT = 'b'
68DEFAULT_RC_COMMAND = 'test_drive'
69
70
71#####################################################################
72# Server configuration
73#####################################################################
74
75MAX_COMPONENTS = 16
76
77
78#####################################################################
79# Client configuration
80#####################################################################
81
82MAX_CONNECTION_ATTEMPTS = 5
83HEALTH_CHECK_CONNECTION_ATTEMPTS = 5
84NO_REPLY_WAIT = 10 # how many seconds before considering a component dead
85
86
87#####################################################################
88# Client Interface configuration
89#####################################################################
90
91DISPLAY_WINDOW_X_COORDINATE = 0
92DISPLAY_WINDOW_Y_COORDINATE = 0
93DISPLAY_WINDOW_X_DIMENSION = 800
94DISPLAY_WINDOW_Y_DIMENSION = 480
95
96#WINDOW_BACKGROUND_COLOR = (255,255,255) # white background
97#WINDOW_BACKGROUND_COLOR = (128,128,128) # grey background
98#WINDOW_BACKGROUND_COLOR = (64,64,64)    # dark grek background
99WINDOW_BACKGROUND_COLOR = (0,0,0)       # black background
100
101IMAGE_DIRECTORY = os.path.join(os.getcwd(), 'images')
102
103BUTTON_LAYOUT = { \
104        'name': 'Button Layout', \
105        'buttons': [ \
106                     ['2-up-orange.png', '2-up-yellow.png', \
107                       37, 0, 'drive_forward'], \
108                     ['4-left-orange.png', '4-left-yellow.png',
109                       0, 37, 'turn_left'], \
110                     ['5-center.png', '5-center.png',
111                       37, 37, None], \
112                     ['6-right-orange.png', '6-right-yellow.png', \
113                       74, 37, 'turn_left'], \
114                     ['9-lower_right-orange.png', '9-lower_right-yellow.png', \
115                       74, 74, 'turn_left'], \
116                   ]
117}
Note: See TracBrowser for help on using the repository browser.