Constants.py

Go to the documentation of this file.
00001 """
00002 Copyright 2008 Free Software Foundation, Inc.
00003 This file is part of GNU Radio
00004 
00005 GNU Radio Companion is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU General Public License
00007 as published by the Free Software Foundation; either version 2
00008 of the License, or (at your option) any later version.
00009 
00010 GNU Radio Companion is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
00018 """
00019 ##@package grc.Constants
00020 #Global constants
00021 #@author Josh Blum
00022 
00023 import os
00024 
00025 ######################################################################################################
00026 ## Global Titles
00027 ######################################################################################################
00028 
00029 ##The current version of this code
00030 VERSION = 'reloaded (trunk)'
00031 
00032 ##The name to appear in the main window for a flow graph that has not been saved to file.
00033 NEW_FLOGRAPH_TITLE = 'untitled'
00034 
00035 ##The prefix title on the main window.
00036 MAIN_WINDOW_PREFIX = "GRC"
00037 
00038 ######################################################################################################
00039 ## Signal block connector lengths
00040 ######################################################################################################
00041 
00042 ##The length that a connection must extend from the port until the length depends on the index of the port.
00043 CONNECTOR_EXTENSION_INITIAL_LENGTH = 11
00044 
00045 ##The length that a connection must extend from the initial length times the index of the port, after this length, the connection may have a bend.
00046 CONNECTOR_EXTENSION_LENGTH = 11
00047 
00048 ##The length of the connector arrow base in pixels
00049 CONNECTOR_ARROW_BASE = 13
00050 
00051 ##The length of the connector arrow height in pixels
00052 CONNECTOR_ARROW_HEIGHT = 17
00053 
00054 ######################################################################################################
00055 ## Signal block rotations
00056 ######################################################################################################
00057 
00058 ##List of possible angles (in degrees) that a block can be rotated to.
00059 POSSIBLE_ROTATIONS = (0, 90, 180, 270)
00060 
00061 ##direction of rotation left.
00062 DIR_LEFT = 'left'
00063 
00064 ##direction of rotation right.
00065 DIR_RIGHT = 'right'
00066 
00067 ######################################################################################################
00068 ## Dimension constraints for the various windows (in pixels)
00069 ######################################################################################################
00070 
00071 ##main window constraints
00072 MIN_WINDOW_WIDTH = 600
00073 MIN_WINDOW_HEIGHT = 400
00074 
00075 ##dialog constraints
00076 MIN_DIALOG_WIDTH = 500
00077 MIN_DIALOG_HEIGHT = 500
00078 
00079 ##static height of reports window
00080 REPORTS_WINDOW_HEIGHT = 100
00081 
00082 ##static width of block selection window
00083 BLOCK_SELECTION_WINDOW_WIDTH = 200
00084 
00085 ######################################################################################################
00086 ## Constraints on displayable labels and ports
00087 ######################################################################################################
00088 
00089 LABEL_SEPARATION = 3
00090 LABEL_PADDING_WIDTH = 9
00091 LABEL_PADDING_HEIGHT = 9
00092 
00093 PORT_SEPARATION = 17
00094 PORT_HEIGHT = 15
00095 PORT_WIDTH = 25
00096 PORT_BORDER_SEPARATION = 9
00097 MAX_NUM_PORTS = 7
00098 
00099 PARAM_LABEL_FONT = 'Sans 9.5'
00100 PARAM_FONT = 'Sans 7.5'
00101 BLOCK_FONT = 'Sans 8'
00102 PORT_FONT = 'Sans 7.5'
00103 
00104 ######################################################################################################
00105 ## Dragging, scrolling, and redrawing constants for the flow graph window in pixels
00106 ######################################################################################################
00107 
00108 ##How close can the mouse get to the window border before mouse events are ignored.
00109 BORDER_PROXIMITY_SENSITIVITY = 50
00110 
00111 ##How close the mouse can get to the edge of the visible window before scrolling is invoked.
00112 SCROLL_PROXIMITY_SENSITIVITY = 30
00113 
00114 ##When the window has to be scrolled, move it this distance in the required direction.
00115 SCROLL_DISTANCE = 15
00116 
00117 ##The redrawing sensitivity, how many seconds must pass between motion events before a redraw?
00118 MOTION_DETECT_REDRAWING_SENSITIVITY = .02
00119 
00120 ##How close the mouse click can be to a connection and register a connection select.
00121 CONNECTION_SELECT_SENSITIVITY = 5
00122 
00123 ######################################################################################################
00124 # A state is recorded for each change to the flow graph, the size dictates how many states we can record
00125 ######################################################################################################
00126 
00127 ##The size of the state saving cache in the flow graph (for undo/redo functionality)
00128 STATE_CACHE_SIZE = 42
00129 
00130 ######################################################################################################
00131 ## Constansts dealing with File Paths
00132 ######################################################################################################
00133 
00134 ##Location of the python src directory.
00135 SRC_DIR = os.path.abspath(os.path.dirname(__file__))
00136 
00137 ##Location of external data files.
00138 DATA_DIR = os.path.join(SRC_DIR, 'data')
00139 
00140 ##DTD validator for saved flow graphs.
00141 FLOW_GRAPH_DTD = os.path.join(DATA_DIR, 'flow_graph.dtd')
00142 
00143 ##The default file extension for flow graphs.
00144 FLOW_GRAPH_FILE_EXTENSION = '.grc'
00145 
00146 ##The default file extension for saving flow graph snap shots.
00147 IMAGE_FILE_EXTENSION = '.png'
00148 
00149 ##The default path for the open/save dialogs.
00150 DEFAULT_FILE_PATH = os.getcwd()
00151 
00152 ##The default icon for the gtk windows.
00153 PY_GTK_ICON = os.path.join(DATA_DIR, 'grc-icon-256.png')
00154 
00155 ##The users home directory.
00156 HOME_DIR = os.path.expanduser('~')
00157 

Generated on Sat Aug 23 02:00:11 2008 for GNU Radio Companion by  doxygen 1.5.4