source: remote_control/puzzlebox_brainstorms_configuration.py @ 44

Last change on this file since 44 was 44, checked in by sc, 11 years ago

setup:

  • work towards distributable .exe files

configuration:

  • minor comment tweaks
File size: 4.5 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Puzzlebox - Brainstorms - Configuration
5#
6# Copyright Puzzlebox Productions, LLC (2010)
7#
8# This code is released under the GNU Pulic License (GPL) version 2
9# For more information please refer to http://www.gnu.org/copyleft/gpl.html
10#
11# Last Update: 2010.06.01
12#
13#####################################################################
14
15import os, sys
16import pygame
17
18#####################################################################
19# General configuration
20#####################################################################
21
22DEBUG = 1
23
24DISCRETE_CONTROL_COMMANDS = True
25
26#####################################################################
27# Logging
28#####################################################################
29
30LOG_LEVEL_DEBUG = 2
31LOG_LEVEL_INFO = 1
32LOG_LEVEL_ERROR = 0
33LOG_LEVEL_DISABLE = -1
34
35DEFAULT_LOG_LEVEL = LOG_LEVEL_DEBUG
36DEFAULT_LOGFILE = 'puzzlebox'
37
38LOGFILE_DIR = '/var/log/puzzlebox'
39LOGFILE_SUFFIX = '.log'
40LOGFILE_SUFFIX_DEBUG = '_debug.log'
41LOGFILE_SUFFIX_INFO = '_info.log'
42LOGFILE_SUFFIX_ERROR = '_error.log'
43
44SPLIT_LOGFILES = False
45
46#BRAINSTORMS_LOGFILE = 'brainstorms'
47
48
49#####################################################################
50# Network addresses
51#####################################################################
52
53SERVER_INTERFACE = '' # listen on all of server's network interfaces
54#SERVER_HOST = '172.16.1.1'
55SERVER_HOST = '127.0.0.1' # localhost
56SERVER_PORT = 8194
57
58
59#####################################################################
60# Remote Control configuration
61#####################################################################
62
63if (sys.platform == 'win32'):
64        BLUETOOTH_DEVICE = 'COM1'
65else:
66        BLUETOOTH_DEVICE = '/dev/rfcomm0'
67
68MOTORS_MOUNTED_BACKWARDS = True
69MOTOR_PORT_RIGHT = 'a'
70MOTOR_PORT_LEFT = 'b'
71DEFAULT_RC_COMMAND = 'test_drive'
72
73
74#####################################################################
75# Server configuration
76#####################################################################
77
78MAX_COMPONENTS = 16
79
80
81#####################################################################
82# Client configuration
83#####################################################################
84
85MAX_CONNECTION_ATTEMPTS = 5
86HEALTH_CHECK_CONNECTION_ATTEMPTS = 5
87NO_REPLY_WAIT = 10 # how many seconds before considering a component dead
88
89
90#####################################################################
91# Client Interface configuration
92#####################################################################
93
94DISPLAY_WINDOW_X_COORDINATE = 0
95DISPLAY_WINDOW_Y_COORDINATE = 0
96DISPLAY_WINDOW_X_DIMENSION = 254
97DISPLAY_WINDOW_Y_DIMENSION = 424
98
99#WINDOW_BACKGROUND_COLOR = (255,255,255) # white background
100#WINDOW_BACKGROUND_COLOR = (128,128,128) # grey background
101#WINDOW_BACKGROUND_COLOR = (64,64,64)    # dark grek background
102WINDOW_BACKGROUND_COLOR = (0,0,0)       # black background
103
104IMAGE_DIRECTORY = os.path.join(os.getcwd(), 'images')
105
106# Keyboard key reference at http://www.pygame.org/docs/ref/key.html#pygame.key
107BUTTON_LAYOUT = { \
108       
109        'left': { \
110                'command': 'turn_left', \
111                'active': False, \
112                'button_image': '1-upper_left-white.png', \
113                'activated_image': '1-upper_left-orange.png', \
114                'image_x': 0, \
115                'image_y': 0, \
116                'match_keys': [pygame.K_LEFT, pygame.K_a, pygame.K_q]
117                }, \
118       
119        'forward': { \
120                'command': 'drive_forward', \
121                'active': False, \
122                'button_image': '2-up-white.png', \
123                'activated_image': '2-up-orange.png', \
124                'image_x': 98, \
125                'image_y': 0, \
126                'match_keys': [pygame.K_UP, pygame.K_w]
127                }, \
128       
129        'right': { \
130                'command': 'turn_right', \
131                'active': False, \
132                'button_image': '3-upper_right-white.png', \
133                'activated_image': '3-upper_right-orange.png', \
134                'image_x': 157, \
135                'image_y': 0, \
136                'match_keys': [pygame.K_RIGHT, pygame.K_d, pygame.K_e]
137                }, \
138       
139        'reverse_left': { \
140                'command': 'turn_left_in_reverse', \
141                'active': False, \
142                'button_image': '7-lower_left-white.png', \
143                'activated_image': '7-lower_left-orange.png', \
144                'image_x': 0, \
145                'image_y': 220, \
146                'match_keys': [pygame.K_z]
147                }, \
148       
149        'reverse': { \
150                'command': 'drive_reverse', \
151                'active': False, \
152                'button_image': '8-down-white.png', \
153                'activated_image': '8-down-orange.png', \
154                'image_x': 98, \
155                'image_y': 220, \
156                'match_keys': [pygame.K_DOWN, pygame.K_s, pygame.K_x]
157                }, \
158       
159        'reverse_right': { \
160                'command': 'turn_right_in_reverse', \
161                'active': False, \
162                'button_image': '9-lower_right-white.png', \
163                'activated_image': '9-lower_right-orange.png', \
164                'image_x': 157, \
165                'image_y': 220, \
166                'match_keys': [pygame.K_PAGEDOWN, pygame.K_c]
167                }, \
168       
169} # BUTTON_LAYOUT
170
Note: See TracBrowser for help on using the repository browser.