[Gridflow-cvs] [svn] commit: r3233 - in /trunk/base: flow_objects.c flow_objects.rb

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Mar 19 02:29:36 EDT 2008


Author: matju
Date: Wed Mar 19 02:29:36 2008
New Revision: 3233

Log:
removed old code for [#print]

Modified:
    trunk/base/flow_objects.c
    trunk/base/flow_objects.rb

Modified: trunk/base/flow_objects.c
==============================================================================
--- trunk/base/flow_objects.c (original)
+++ trunk/base/flow_objects.c Wed Mar 19 02:29:36 2008
@@ -361,7 +361,7 @@
 	dump_dims(head,in);
 	if (in->dim->prod()==0) post("%s",head.str().data());
 } GRID_END
-\classinfo { install("#print2",1,1); }
+\classinfo { install("#print",1,1); }
 \end class
 
 /* **************************************************************** */

Modified: trunk/base/flow_objects.rb
==============================================================================
--- trunk/base/flow_objects.rb (original)
+++ trunk/base/flow_objects.rb Wed Mar 19 02:29:36 2008
@@ -105,108 +105,6 @@
 		publish if fps>0.001
 		@history.clear
 		@duration = 0
-	end
-}
-
-GridObject.subclass("#print",1,0) {
-	install_rgrid 0, true
-	attr_accessor :name
-	def initialize(name=nil)
-		super # don't forget super!!!
-		if name then @name = name.to_s+": " else @name="" end
-		@base=10; @format="d"; @trunc=70; @maxrows=50
-	end
-	def end_hook; end # other hijackability
-	def format
-		case @nt
-		when :float32; '%6.6f'
-		when :float64; '%14.14f'
-		else "%#{@columns}#{@format}" end
-	end
-	def _0_base(x)
-		@format = (case x
-		when 2; "b"
-		when 8; "o"
-		when 10; "d"
-		when 16; "x"
-		else raise "base #{x} not supported" end)
-		@base = x
-	end
-	def _0_trunc(x)
-		x=x.to_f
-		(0..240)===x or raise "out of range (not in 0..240 range)"
-		@trunc = x
-	end
-	def _0_maxrows(x) @maxrows = x.to_i end
-	def make_columns udata
-		# @columns = 10; return
-		min = udata.min
-		max = udata.max
-		@columns = "" # huh?
-		@columns = [
-			sprintf(format,min).length,
-			sprintf(format,max).length].max
-	end
-	def unpack data
-		ps = GridFlow.packstring_for_nt @nt
-		data.unpack ps
-	end
-	def _0_rgrid_begin
-		@dim = inlet_dim 0
-		@nt = inlet_nt 0
-		@data = ""
-	end
-	def _0_rgrid_flow(data) @data << data end
-	def _0_rgrid_end
-		head = "#{name}Dim[#{@dim.join','}]"
-		head << "(#{@nt})" if @nt!=:int32
-		head << ": "
-		n=1; @dim.each {|x| n*=x }
-		if n==0 then
-			post head
-                elsif @dim.length > 3 then
-			post head+" (not printed)"
-		elsif @dim.length < 2 then
-			udata = unpack @data
-			make_columns udata
-			post trunc(head + dump(udata))
-		elsif @dim.length == 2 then
-			post head
-			udata = unpack @data
-			make_columns udata
-			sz = udata.length/@dim[0] if @dim[0]>0
-			rown = 1
-			for row in 0... at dim[0] do
-				post trunc(dump(udata[sz*row,sz]))
-				rown += 1
-				(post "..."; break) if rown>@maxrows
-			end
-		elsif @dim.length == 3 then
-			post head
-			make_columns unpack(@data)
-			sz = @data.length/@dim[0] if @dim[0]>0
-			sz2 = sz/@dim[1]
-			rown = 1
-			for row in 0... at dim[0]
-				column=0; str=""
-				for col in 0... at dim[1]
-					str << "(" << dump(unpack(@data[sz*row+sz2*col,sz2])) << ")"
-					break if str.length>@trunc
-				end
-				post trunc(str)
-				rown += 1
-				(post "..."; break) if rown>@maxrows
-			end
-		end
-		@data, at dim, at nt = nil
-		end_hook
-	end
-	def dump(udata,sep=" ")
-		f = format
-		udata.map{|x| sprintf f,x }.join sep
-	end
-	def trunc s
-		if s.length>@trunc then s[0... at trunc]+" [...]" else s end
 	end
 }
 



More information about the Gridflow-cvs mailing list