[Gridflow-cvs] [svn] commit: r3498 - /trunk/base/flow_objects.rb

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Mon Apr 14 17:34:51 EDT 2008


Author: matju
Date: Mon Apr 14 17:34:50 2008
New Revision: 3498

Log:
remove classes [parallel_port] and Linux::ParallelPort

Modified:
    trunk/base/flow_objects.rb

Modified: trunk/base/flow_objects.rb
==============================================================================
--- trunk/base/flow_objects.rb (original)
+++ trunk/base/flow_objects.rb Mon Apr 14 17:34:50 2008
@@ -266,71 +266,6 @@
 	def ioctl_intp_in(arg1)       ioctl(arg1,s="blah"); return s.unpack("l")[0] end
 end
 
-=begin
-  if using a DB-25 female connector as found on a PC,
-  then the pin numbering is like:
-  13 _____ 1
-  25 \___/ 14
-
-  1 = STROBE = the clock line is a square wave, often at 9600 Hz,
-      which determines the data rate in usual circumstances.
-  2..9 = D0..D7 = the eight ordinary data bits
-  10 = -ACK (status bit 6 ?)
-  11 = BUSY (status bit 7)
-  12 = PAPER_END (status bit 5)
-  13 = SELECT (status bit 4 ?)
-  14 = -AUTOFD
-  15 = -ERROR (status bit 3 ?)
-  16 = -INIT
-  17 = -SELECT_IN
-  18..25 = GROUND
-=end
-module Linux; module ParallelPort
-	def self.ioctl_reader(sym,cmd_in)  module_eval %{def #{sym};    ioctl_intp_in( #{cmd_in})                                   end} end
-	def self.ioctl_writer(sym,cmd_out) module_eval %{def #{sym}=(v);ioctl_intp_out(#{cmd_out},v); #{sym} if respond_to? :#{sym} end} end
-	def self.ioctl_accessor(sym,cmd_in,cmd_out)
-		ioctl_reader(sym,cmd_in)
-		ioctl_writer(sym,cmd_out)
-	end
-	LPCHAR = 0x0601
-	LPCAREFUL = 0x0609 # obsoleted??? wtf?
-	LPGETSTATUS = 0x060b # return LP_S(minor)
-	LPGETFLAGS = 0x060e # get status flags
-	ioctl_reader :port_flags , :LPGETFLAGS
-	ioctl_reader :port_status, :LPGETSTATUS
-	ioctl_writer :port_careful,:LPCAREFUL
-	ioctl_writer :port_char,   :LPCHAR
-end end
-FObject.subclass("parallel_port",1,3) {
-  def initialize(port,manually=0)
-    @f = File.open(port.to_s,"r+")
-    @f.extend Linux::ParallelPort
-    @status = nil
-    @flags = nil
-    @manually = manually!=0
-    @clock = (if @manually then nil else Clock.new self end)
-    @clock.delay 0 if @clock
-  end
-  def delete; @clock.unset unless @manually; @f.close end
-  def _0_float(x) @f.write x.to_i.chr; @f.flush end
-  def call
-    flags = @f.port_flags
-    send_out 2, flags if @flags != flags
-    @flags = flags
-    status = @f.port_status
-    send_out 1, status if @status != status
-    @status = status
-    @clock.delay 20 if @clock
-  end
-  def _0_bang
-    @status = @flags = nil
-    call
-  end
-  # outlet 0 reserved (future use)
-}
-
-# end of devices4ruby
-
 # experimental
 FObject.subclass("rubyarray",2,2) {
   def initialize() @a=[]; @i=0; end



More information about the Gridflow-cvs mailing list