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

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Sun Mar 30 17:58:05 EDT 2008


Author: matju
Date: Sun Mar 30 17:58:04 2008
New Revision: 3358

Log:
[unix_time] and [#rotatificator] don't produce true grids anymore, just grid literals (good enough)

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 Sun Mar 30 17:58:04 2008
@@ -2345,12 +2345,6 @@
 \def void _0_list (...) {}
 \end class {install("gf.error",1,0);}
 
-\class UnixTime : FObject {
-	\decl void initialize ();
-};
-\def void initialize () {}
-\end class {install("unix_time2",1,3);}
-
 //****************************************************************
 
 #define OP(x) op_dict[string(#x)]

Modified: trunk/base/flow_objects.rb
==============================================================================
--- trunk/base/flow_objects.rb (original)
+++ trunk/base/flow_objects.rb Sun Mar 30 17:58:04 2008
@@ -104,16 +104,16 @@
 	end
 }
 
-GridObject.subclass("unix_time",1,3) {
-  install_rgrid 0
+FObject.subclass("unix_time",1,3) {
   def _0_bang
     t = Time.new
     tt = t.to_s
-    send_out_grid_begin 0, [tt.length], :uint8
-    send_out_grid_flow 0, tt, :uint8
+    send_out 2, t.year, t.month, t.day, t.hour, t.min, t.day
     send_out 1, t.to_i/86400, t.to_i%86400,
 	((t.to_f-t.to_f.floor)*1000000).to_i
-    send_out 2, t.year, t.month, t.day, t.hour, t.min, t.day
+    a=[]
+    for char in tt.split("") do a << char[0] end
+    send_out 0, :list, *a
   end
 }
 ### test with "shell xlogo &" -> [exec]
@@ -184,7 +184,7 @@
 	end
 }
 
-GridObject.subclass("#rotatificator",2,1) {
+FObject.subclass("#rotatificator",2,1) {
 	def _0_float(scale)
 		n = @axis[2]
 		rotator = (0...n).map {|i| (0...n).map {|j| if i==j then scale else 0 end }}
@@ -194,8 +194,7 @@
 				b = @axis[j].to_i
 				rotator[a][b] = (scale*Math.cos(th+(j-i)*Math::PI/2)).to_i
 		}}
-		send_out_grid_begin 0,[n,n]
-		send_out_grid_flow 0, rotator.flatten.pack("i#{n*n}")
+		send_out 0,:list,n,n,:"#",*rotator.flatten
 	end
 	def _0_axis(from,to,total)
 		total>=0 or raise "total-axis number incorrect"



More information about the Gridflow-cvs mailing list