[PD-cvs] pd/src desire.tk,1.1.2.7,1.1.2.8

chunlee chunlee at users.sourceforge.net
Sun Aug 21 06:34:49 CEST 2005


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7763

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
can move wires
next: dash rect selection also moves wires


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -d -r1.1.2.7 -r1.1.2.8
*** desire.tk	21 Aug 2005 02:19:49 -0000	1.1.2.7
--- desire.tk	21 Aug 2005 04:34:47 -0000	1.1.2.8
***************
*** 1165,1169 ****
          foreach obj $_($self:selection) {
          
!     		#puts "___ move object $obj ___"
      		
      		set _($obj:cx) [expr $_($obj:cx) + $cx-$old_x]
--- 1165,1169 ----
          foreach obj $_($self:selection) {
          
!     		puts "___ move object $obj ___"
      		
      		set _($obj:cx) [expr $_($obj:cx) + $cx-$old_x]
***************
*** 1180,1185 ****
  		$canvas coords ${obj}TEXT $text_pos2
  	
  			
!     		}
          
       # my move object code ends
--- 1180,1228 ----
  		$canvas coords ${obj}TEXT $text_pos2
  	
+ 		#----handles the wire update----
+ 		
+ 		#set _($self:inlets)  $ins
+     		#set _($self:outlets) $outs
  			
! 		
! 		
! 		for {set x 0} {$x<$_($obj:inlets)} {incr x} {
! 		
! 			#if {[info exists]}
! 			#puts "check -> $"
! 			if {[info exists _($obj:0:$x)]} {
! 			
! 				puts "wires at inlet $x to update --> $_($obj:0:$x)"
! 				#wire_update $_()
! 				#wire_update:: l80f8ea8 81168ae 1 81168af 0 0
! 				
! 				foreach wire_id $_($obj:0:$x) {
! 				
! 				wire_update $wire_id $_($wire_id) 
! 				wire_draw2 $wire_id $canvas
! 				}
! 				
! 			
! 			}
! 		
! 		}
! 		
! 		
! 		for {set x 0} {$x<$_($obj:outlets)} {incr x} {
! 		
! 			if {[info exists _($obj:1:$x)]} {
! 			
! 				puts "wires at outlet $x to update --> $_($obj:1:$x)"
! 				
! 				foreach wire_id $_($obj:1:$x) {
! 				
! 				wire_update $wire_id $_($wire_id) 
! 				wire_draw2 $wire_id $canvas
! 				}
! 			
! 			}
! 		
! 		}
!     }
          
       # my move object code ends
***************
*** 1617,1643 ****
  		lappend d 0 
  		
! 		#my wire code
! 		puts "d = $d"
! 		
  		#tmp only, generates id for wires
- 		
  		set wire_id [format %x [expr 0x80f8ea8 - $offset_wire]];
  		set wire_id l$wire_id
  		
  		set offset_wire [expr $offset_wire + 1]
  		
  		wire_update $wire_id $d;
  		wire_draw2 $wire_id $name;
  		
- 		#wire_update l80f8ea8 $d;
- 		#wire_draw2 l80f8ea8 $name;
- 		#wire_update 18136070 $d 
- 		#wire_draw2 18136070 $name;
  		
- 		#trace: 
- 		#wire_update:: l8146070 813ea70 0 813f160 0 0
- 		#what's the last argument of wire_update? 
- 		#wire_draw2:: l8146070 .x813e670.c
- 		#wire_draw:: l8146070 .x813e670.c 1 43 57 156 138
  		
  		#pd "$self add-wire x$wire_from x$wire_to ;"
--- 1660,1722 ----
  		lappend d 0 
  		
! #my wire code
! 	#$_($id:outlets) -> number of outlets an object has
! 	#propose: _(obj_id:flag:port_number) -> list of connections an particular in/outlet has
! 	
  		#tmp only, generates id for wires
  		set wire_id [format %x [expr 0x80f8ea8 - $offset_wire]];
  		set wire_id l$wire_id
+ 	
+ 		set from [lindex $wire_from 0]
+ 		set outlet_number [lindex $wire_from 1]
+ 		set to [lindex $wire_to 0]
+ 		set inlet_number [lindex $wire_to 1]
+ 		set inlet_flag 0
+ 		set outlet_flag 1
+ 		
+ 		
+ 		
+ 	
+ 		if {[info exists _($from:$outlet_flag:$outlet_number)]} {
+ 		
+ 			lappend _($from:$outlet_flag:$outlet_number) $wire_id
+ 		
+ 		} else {
+ 		
+ 			set _($from:$outlet_flag:$outlet_number) $wire_id
+ 			
+ 			puts "*** $from:$outlet_flag:$outlet_number ***"
+ 		
+ 		}
+ 		
+ 		
+ 		if {[info exists _($to:$inlet_flag:$inlet_number)]} {
+ 		
+ 			lappend _($to:$inlet_flag:$inlet_number) $wire_id
+ 		
+ 		} else {
+ 		
+ 			set _($to:$inlet_flag:$inlet_number) $wire_id
+ 			
+ 			puts "*** $to:$inlet_flag:$inlet_number ***"
+ 		
+ 		}
+ 	
+ 		puts "d = $d"
+ 		
+ 		
+ 		
+ 		
  		
  		set offset_wire [expr $offset_wire + 1]
  		
+ 		#propose: _($wire_id) to store sire info
+ 		#maybe don't need this
+ 		set _($wire_id) $d
+ 		
  		wire_update $wire_id $d;
  		wire_draw2 $wire_id $name;
  		
  		
  		
  		#pd "$self add-wire x$wire_from x$wire_to ;"
***************
*** 1645,1649 ****
  		puts "::::connect from $wire_from to $wire_to"
  		#::::connect from 81168af 2 to 81168ae 0
! 		#my wire code
  	}
  	
--- 1724,1729 ----
  		puts "::::connect from $wire_from to $wire_to"
  		#::::connect from 81168af 2 to 81168ae 0
! #my wire code -end
! 	
  	}
  	
***************
*** 1697,1702 ****
      		set ids {} 
      		foreach tag $element_tags {
!     			regexp {^([a-f0-9]{6,8})} $tag id
!     			lappend ids $id
      		}
      	
--- 1777,1784 ----
      		set ids {} 
      		foreach tag $element_tags {
!     			if {[regexp {^([a-f0-9]{6,8})} $tag id]} {
!     				
! 				lappend ids $id
! 			}
      		}
      	
***************
*** 1987,1988 ****
--- 2069,2078 ----
  		[lrange $d 0 3] {}
  }
+ #-----------------------------------------------------------------------------------#
+ #proc wire_status {self d} {
+ #	puts "wire_update:: $self $d"
+ #
+ #	global _
+ #	foreach [list _($self:obj1) _($self:port1) _($self:obj2) _($self:port2)] \
+ #		[lrange $d 0 3] {}
+ #}





More information about the Pd-cvs mailing list