2 Copyright 2008 Free Software Foundation, Inc.
3 This file is part of GNU Radio
5 GNU Radio Companion is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 GNU Radio Companion is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 ##@package grc.Constants
25 ######################################################################################################
27 ######################################################################################################
29 ##The current version of this code
32 ##The name to appear in the main window for a flow graph that has not been saved to file.
33 NEW_FLOGRAPH_TITLE = 'untitled'
35 ##The prefix title on the main window.
36 MAIN_WINDOW_PREFIX = "GRC"
38 ######################################################################################################
39 ## Signal block connector lengths
40 ######################################################################################################
42 ##The length that a connection must extend from the port until the length depends on the index of the port.
43 CONNECTOR_EXTENSION_INITIAL_LENGTH = 11
45 ##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.
46 CONNECTOR_EXTENSION_LENGTH = 11
48 ##The length of the connector arrow base in pixels
49 CONNECTOR_ARROW_BASE = 13
51 ##The length of the connector arrow height in pixels
52 CONNECTOR_ARROW_HEIGHT = 17
54 ######################################################################################################
55 ## Signal block rotations
56 ######################################################################################################
58 ##List of possible angles (in degrees) that a block can be rotated to.
59 POSSIBLE_ROTATIONS = (0, 90, 180, 270)
61 ##direction of rotation left.
64 ##direction of rotation right.
67 ######################################################################################################
68 ## Dimension constraints for the various windows (in pixels)
69 ######################################################################################################
71 ##main window constraints
72 MIN_WINDOW_WIDTH = 600
73 MIN_WINDOW_HEIGHT = 400
76 MIN_DIALOG_WIDTH = 500
77 MIN_DIALOG_HEIGHT = 500
79 ##static height of reports window
80 REPORTS_WINDOW_HEIGHT = 100
82 ##static width of block selection window
83 BLOCK_SELECTION_WINDOW_WIDTH = 200
85 ######################################################################################################
86 ## Constraints on displayable labels and ports
87 ######################################################################################################
90 LABEL_PADDING_WIDTH = 9
91 LABEL_PADDING_HEIGHT = 9
96 PORT_BORDER_SEPARATION = 9
99 PARAM_LABEL_FONT = 'Sans 9.5'
100 PARAM_FONT = 'Sans 7.5'
101 BLOCK_FONT = 'Sans 8'
102 PORT_FONT = 'Sans 7.5'
104 ######################################################################################################
105 ## Dragging, scrolling, and redrawing constants for the flow graph window in pixels
106 ######################################################################################################
108 ##How close can the mouse get to the window border before mouse events are ignored.
109 BORDER_PROXIMITY_SENSITIVITY = 50
111 ##How close the mouse can get to the edge of the visible window before scrolling is invoked.
112 SCROLL_PROXIMITY_SENSITIVITY = 30
114 ##When the window has to be scrolled, move it this distance in the required direction.
117 ##The redrawing sensitivity, how many seconds must pass between motion events before a redraw?
118 MOTION_DETECT_REDRAWING_SENSITIVITY = .02
120 ##How close the mouse click can be to a connection and register a connection select.
121 CONNECTION_SELECT_SENSITIVITY = 5
123 ######################################################################################################
124 # A state is recorded for each change to the flow graph, the size dictates how many states we can record
125 ######################################################################################################
127 ##The size of the state saving cache in the flow graph (for undo/redo functionality)
128 STATE_CACHE_SIZE = 42
130 ######################################################################################################
131 ## Constansts dealing with File Paths
132 ######################################################################################################
134 ##Location of external data files.
135 DATA_DIR = '@datadir@'
137 ##DTD validator for saved flow graphs.
138 FLOW_GRAPH_DTD = os.path.join(DATA_DIR, 'flow_graph.dtd')
140 ##The default file extension for flow graphs.
141 FLOW_GRAPH_FILE_EXTENSION = '.grc'
143 ##The default file extension for saving flow graph snap shots.
144 IMAGE_FILE_EXTENSION = '.png'
146 ##The default path for the open/save dialogs.
147 DEFAULT_FILE_PATH = os.getcwd()
149 ##The default icon for the gtk windows.
150 PY_GTK_ICON = os.path.join(DATA_DIR, 'grc-icon-256.png')
152 ##The users home directory.
153 HOME_DIR = os.path.expanduser('~')