Package grc.gui.elements.FlowGraph


Classes

class  FlowGraph

Functions

def get_drawing_area
def get_gc
def get_pixmap
def get_size
def set_size
def get_window
def get_scroll_pane
def get_ctrl_mask
def add_new_block
def copy_to_clipboard
def paste_from_clipboard
def type_controller_modify_selected
def port_controller_modify_selected
def param_modify_selected
def enable_selected
def move_selected
def rotate_selected
def remove_selected
def draw
def update
def unselect
def what_is_selected
def get_selected_connections
def get_selected_blocks
def get_selected_block
def get_selected_elements
def get_selected_element
def update_selected_elements
def handle_mouse_button_press
def handle_mouse_button_release
def handle_mouse_motion

Variables

 _selected_elements
 element_moved
 _old_selected_port
 _new_selected_port
 press_coor
 time
 mouse_pressed


Detailed Description

A flow graph structure for storing signal blocks and their connections.
Author:
Josh Blum

Function Documentation

def grc.gui.elements.FlowGraph.add_new_block (   self,
  key 
)

Add a block of the given key to this flow graph.

Parameters:
key the block key

Definition at line 90 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.copy_to_clipboard (   self  ) 

Copy the selected blocks and connections into the clipboard.

Returns:
the clipboard

Definition at line 111 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.draw (   self  ) 

Draw the background and grid if enabled. Draw all of the elements in this flow graph onto the pixmap. Draw the pixmap to the drawable window of this flow graph.

Definition at line 304 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.enable_selected (   self,
  enable 
)

Enable/disable the selected blocks.

Parameters:
enable true to enable
Returns:
true if changed

Definition at line 240 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_ctrl_mask (   self  ) 

Definition at line 88 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_drawing_area (   self  ) 

Definition at line 81 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_gc (   self  ) 

Definition at line 82 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_pixmap (   self  ) 

Definition at line 83 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_scroll_pane (   self  ) 

Definition at line 87 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_selected_block (   self  ) 

Get the selected block when a block or port is selected.

Returns:
a block or None

Definition at line 425 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_selected_blocks (   self  ) 

Get a group of selected blocks.

Returns:
sub set of blocks in this flow graph

Definition at line 415 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_selected_connections (   self  ) 

Get a group of selected connections.

Returns:
sub set of connections in this flow graph

Definition at line 405 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_selected_element (   self  ) 

Get the selected element.

Returns:
a block, port, or connection or None

Definition at line 439 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_selected_elements (   self  ) 

Get the group of selected elements.

Returns:
sub set of elements in this flow graph

Definition at line 432 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_size (   self  ) 

Definition at line 84 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.get_window (   self  ) 

Definition at line 86 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.handle_mouse_button_press (   self,
  left_click,
  double_click,
  coordinate 
)

Event Handlers A mouse button is pressed, only respond to left clicks. Find the selected element. Attempt a new connection if possible. Open the block params window on a double click. Update the selection state of the flow graph.

Definition at line 493 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.handle_mouse_button_release (   self,
  left_click,
  coordinate 
)

A mouse button is released, record the state.

Definition at line 511 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.handle_mouse_motion (   self,
  coordinate 
)

The mouse has moved, respond to mouse dragging. Move a selected element to the new coordinate. Auto-scroll the scroll bars at the boundaries.

Definition at line 535 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.move_selected (   self,
  delta_coordinate 
)

Move the element and by the change in coordinates.

Parameters:
delta_coordinate the change in coordinates

Definition at line 253 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.param_modify_selected (   self  ) 

Create and show a param modification dialog for the selected block.

Returns:
true if parameters were changed

Definition at line 230 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.paste_from_clipboard (   self,
  clipboard 
)

Paste the blocks and connections from the clipboard.

Parameters:
clipboard the nested data of blocks, connections

Definition at line 137 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.port_controller_modify_selected (   self,
  direction 
)

Change port controller for the selected signal blocks.

Parameters:
direction +1 or -1
Returns:
true for changed

Definition at line 207 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.remove_selected (   self  ) 

Remove selected elements

Returns:
true if changed.

Definition at line 293 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.rotate_selected (   self,
  direction 
)

Rotate the selected blocks by 90 degrees.

Parameters:
direction DIR_LEFT or DIR_RIGHT
Returns:
true if changed, otherwise false.

Definition at line 262 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.set_size (   self,
  args 
)

Definition at line 85 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.type_controller_modify_selected (   self,
  direction 
)

Change the registered type controller for the selected signal blocks.

Parameters:
direction +1 or -1
Returns:
true for change

Definition at line 182 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.unselect (   self  ) 

Get Selected Set selected elements to an empty set.

Definition at line 366 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.update (   self  ) 

Update highlighting so only the selected is highlighted. Call update on all elements. Resize the window if size changed.

Definition at line 345 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.update_selected_elements (   self  ) 

Update the selected elements. The update behavior depends on the state of the mouse button. When the mouse button pressed the selection will change when the control mask is set or the new selection is not in the current group. When the mouse button is released the selection will change when the mouse has moved and the control mask is set or the current group is empty. Attempt to make a new connection if the old and ports are filled. If the control mask is set, merge with the current elements.

Definition at line 446 of file FlowGraph.py.

def grc.gui.elements.FlowGraph.what_is_selected (   self,
  coor,
  coor_m = None 
)

What is selected? At the given coordinate, return the elements found to be selected. If coor_m is unspecified, return a list of only the first element found to be selected: Iterate though the elements backwardssince top elements are at the end of the list. If an element is selected, place it at the end of the list so that is is drawn last, and hence on top. Update the selected port information.

Parameters:
coor the coordinate of the mouse click
coor_m the coordinate for multi select
Returns:
the selected blocks and connections or an empty list

Definition at line 372 of file FlowGraph.py.


Variable Documentation

grc::gui::elements::FlowGraph._new_selected_port

Definition at line 402 of file FlowGraph.py.

grc::gui::elements::FlowGraph._old_selected_port

Definition at line 401 of file FlowGraph.py.

grc::gui::elements::FlowGraph._selected_elements

Definition at line 177 of file FlowGraph.py.

grc::gui::elements::FlowGraph.element_moved

Definition at line 260 of file FlowGraph.py.

grc::gui::elements::FlowGraph.mouse_pressed

Definition at line 504 of file FlowGraph.py.

grc::gui::elements::FlowGraph.press_coor

Definition at line 501 of file FlowGraph.py.

grc::gui::elements::FlowGraph.time

Definition at line 503 of file FlowGraph.py.


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