sicl 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +8 -8
- data/Manifest.txt +9 -9
- data/README.txt +93 -79
- data/Rakefile +78 -55
- data/ext/Makefile.bcc +81 -79
- data/ext/extconf.rb +61 -49
- data/ext/sicl.c +752 -749
- data/test/test_sicl.rb +465 -451
- metadata +55 -32
data/History.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
= 0.2.0 2007-05-12
|
2
|
-
|
3
|
-
* add build rules for bcc32 with ruby-mswin32.
|
4
|
-
* refactor testcases in test/test_sicl.rb.
|
5
|
-
|
6
|
-
= 0.1.0 2007-05-12
|
7
|
-
|
8
|
-
* Birthday!
|
1
|
+
= 0.2.0 2007-05-12
|
2
|
+
|
3
|
+
* add build rules for bcc32 with ruby-mswin32.
|
4
|
+
* refactor testcases in test/test_sicl.rb.
|
5
|
+
|
6
|
+
= 0.1.0 2007-05-12
|
7
|
+
|
8
|
+
* Birthday!
|
data/Manifest.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
History.txt
|
2
|
-
Manifest.txt
|
3
|
-
README.txt
|
4
|
-
Rakefile
|
5
|
-
|
6
|
-
ext/sicl.c
|
7
|
-
ext/extconf.rb
|
8
|
-
ext/Makefile.bcc
|
9
|
-
test/test_sicl.rb
|
1
|
+
History.txt
|
2
|
+
Manifest.txt
|
3
|
+
README.txt
|
4
|
+
Rakefile
|
5
|
+
|
6
|
+
ext/sicl.c
|
7
|
+
ext/extconf.rb
|
8
|
+
ext/Makefile.bcc
|
9
|
+
test/test_sicl.rb
|
data/README.txt
CHANGED
@@ -1,79 +1,93 @@
|
|
1
|
-
SICL/Ruby
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
Ruby
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
1
|
+
= SICL/Ruby
|
2
|
+
|
3
|
+
((<download|URL:http://rubyforge.org/projects/sicl/>))
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
SICL/Ruby is SICL(Standard Instrument Control Library) API module for
|
8
|
+
Ruby. SICL is part of the Agilent IO Libraries Suite product. SICL/Ruby
|
9
|
+
gives you a capability to control your instruments via GPIB, USB, and LAN.
|
10
|
+
|
11
|
+
== SYNOPSIS:
|
12
|
+
|
13
|
+
Please, use like this.
|
14
|
+
|
15
|
+
Example:
|
16
|
+
|
17
|
+
require 'sicl'
|
18
|
+
|
19
|
+
SICL.open('gpib0,17') do |io|
|
20
|
+
|
21
|
+
io.output('*IDN?')
|
22
|
+
|
23
|
+
puts io.enter
|
24
|
+
|
25
|
+
# ... instruments specific operations ...
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
or
|
30
|
+
|
31
|
+
Example:
|
32
|
+
|
33
|
+
require 'sicl'
|
34
|
+
|
35
|
+
io = SICL.open('gpib0,17')
|
36
|
+
|
37
|
+
io.output('*RST')
|
38
|
+
|
39
|
+
puts io.spoll
|
40
|
+
|
41
|
+
puts io.query('*IDN?')
|
42
|
+
|
43
|
+
# ... instruments specific operations ...
|
44
|
+
|
45
|
+
io.close
|
46
|
+
|
47
|
+
or
|
48
|
+
|
49
|
+
Example:
|
50
|
+
|
51
|
+
require 'sicl'
|
52
|
+
|
53
|
+
class MyInst < SICL::Instrument
|
54
|
+
def reset; output('*RST'); end
|
55
|
+
end
|
56
|
+
|
57
|
+
io = MyInst.new 'gpib0,17'
|
58
|
+
|
59
|
+
io.reset
|
60
|
+
|
61
|
+
# ... instruments specific operations ...
|
62
|
+
|
63
|
+
io.close
|
64
|
+
|
65
|
+
== DOCUMENTS:
|
66
|
+
|
67
|
+
SICL/Ruby Reference : ((<English|URL:sicl.en.html>))/((<Japanese|URL:sicl.ja.html>))
|
68
|
+
|
69
|
+
== REQUIREMENTS:
|
70
|
+
|
71
|
+
((<Aiglent IO Libraries Suite 14.2|URL:http://www.agilent.com/>))
|
72
|
+
|
73
|
+
== INSTALL:
|
74
|
+
|
75
|
+
If you can use the ((<RubyGems|URL:http://docs.rubygems.org/>)),
|
76
|
+
Please install to use the ((|gem|)) command.
|
77
|
+
|
78
|
+
$ export http_proxy='http://web-proxy:8088' # if you need
|
79
|
+
$ gem install sicl
|
80
|
+
|
81
|
+
Or not, Please build from the soruce code.
|
82
|
+
|
83
|
+
$ svn checkout svn://rubyforge.org/var/svn/sicl
|
84
|
+
$ cd sicl/ext
|
85
|
+
$ ruby extconf.rb
|
86
|
+
$ make
|
87
|
+
$ make install
|
88
|
+
|
89
|
+
== LICENSE:
|
90
|
+
|
91
|
+
(GPL ver.2)
|
92
|
+
|
93
|
+
Copyright (c) 2007, Naoki Kobayashi
|
data/Rakefile
CHANGED
@@ -1,55 +1,78 @@
|
|
1
|
-
################################################################################
|
2
|
-
#
|
3
|
-
# Copyright (c) 2007 Naoki Kobayashi
|
4
|
-
#
|
5
|
-
# This library is free software. ( except for SICL Library )
|
6
|
-
# You can distribute/modify this file under the same terms of ruby.
|
7
|
-
#
|
8
|
-
# $
|
9
|
-
#
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
s.
|
35
|
-
s.
|
36
|
-
s.
|
37
|
-
s.
|
38
|
-
s.
|
39
|
-
s.
|
40
|
-
|
41
|
-
EOF
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
1
|
+
################################################################################
|
2
|
+
#
|
3
|
+
# Copyright (c) 2007 Naoki Kobayashi
|
4
|
+
#
|
5
|
+
# This library is free software. ( except for SICL Library )
|
6
|
+
# You can distribute/modify this file under the same terms of ruby.
|
7
|
+
#
|
8
|
+
# $LastChangedDate$
|
9
|
+
# $Revision$
|
10
|
+
# $Author$
|
11
|
+
#
|
12
|
+
################################################################################
|
13
|
+
|
14
|
+
begin
|
15
|
+
require 'rubygems'
|
16
|
+
require 'rake/gempackagetask'
|
17
|
+
rescue Exception
|
18
|
+
nil
|
19
|
+
end
|
20
|
+
|
21
|
+
require "rake/clean"
|
22
|
+
require "rake/gempackagetask"
|
23
|
+
|
24
|
+
PKG_FILES = []
|
25
|
+
File.open("Manifest.txt") do |manifest|
|
26
|
+
manifest.each do |file|
|
27
|
+
PKG_FILES << file.chomp if file =~ /\w+/
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
task :default => :package
|
32
|
+
|
33
|
+
spec = Gem::Specification.new do |s|
|
34
|
+
s.name = "sicl"
|
35
|
+
s.version = "1.0.0"
|
36
|
+
s.summary = "Agilent SICL API wrapper class for Ruby."
|
37
|
+
s.autorequire = "sicl"
|
38
|
+
s.files = PKG_FILES
|
39
|
+
s.default_executable = "ext/extconf.rb"
|
40
|
+
s.extensions = ["ext/extconf.rb"]
|
41
|
+
s.description = <<EOF
|
42
|
+
SICL/Ruby is SICL(Standard Instrument Control Library) API module for Rubby. SICL is part of the Agilent IO Libraries Suite product. SICL/Ruby gives you a capability to control your instruments via GPIB, USB, and LAN.
|
43
|
+
EOF
|
44
|
+
end
|
45
|
+
|
46
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
47
|
+
pkg.need_tar_bz2 = true
|
48
|
+
pkg.need_tar_gz = true
|
49
|
+
end
|
50
|
+
|
51
|
+
task :test do
|
52
|
+
ruby "-Iext test/test_sicl.rb"
|
53
|
+
end
|
54
|
+
|
55
|
+
HTML_DIR = "html"
|
56
|
+
CLEAN << HTML_DIR
|
57
|
+
RD2_OPT = ["--out-code=euc-jp", "--with-css=style.css"]
|
58
|
+
|
59
|
+
def convertToHtml(src, dst, title)
|
60
|
+
sh "rd2 -r rd/rd2html-lib.rb #{RD2_OPT.join(" ")} --html-title='#{title}' #{src} > #{dst}"
|
61
|
+
end
|
62
|
+
|
63
|
+
task :html do
|
64
|
+
Dir::mkdir HTML_DIR unless FileTest.exists? HTML_DIR
|
65
|
+
|
66
|
+
FileUtils.cp "doc/style.css", "html/style.css"
|
67
|
+
[
|
68
|
+
["README.txt", "html/index.html", "SICL/Ruby"],
|
69
|
+
["doc/sicl.en.rd", "html/sicl.en.html", "SICL/Ruby Reference"],
|
70
|
+
["doc/sicl.ja.rd", "html/sicl.ja.html", "SICL/Ruby Reference"]
|
71
|
+
].each do |src, dst, title|
|
72
|
+
convertToHtml src, dst, title
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
task :www => :html do
|
77
|
+
sh "scp html/*.html html/*.css #{ENV['SVN_USER']}@sicl.rubyforge.org:/var/www/gforge-projects/sicl/"
|
78
|
+
end
|
data/ext/Makefile.bcc
CHANGED
@@ -1,79 +1,81 @@
|
|
1
|
-
################################################################################
|
2
|
-
#
|
3
|
-
# Copyright (c) 2007 Satoshi Nihonyanagi
|
4
|
-
# Copyright (c) 2007 Naoki Kobayashi
|
5
|
-
#
|
6
|
-
# $
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
# -
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
|
24
|
-
|
25
|
-
################################################################################
|
26
|
-
|
27
|
-
################################################################################
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
################################################################################
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
################################################################################
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
################################################################################
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
.
|
78
|
-
|
79
|
-
|
1
|
+
################################################################################
|
2
|
+
#
|
3
|
+
# Copyright (c) 2007 Satoshi Nihonyanagi
|
4
|
+
# Copyright (c) 2007 Naoki Kobayashi
|
5
|
+
#
|
6
|
+
# $LastChangedDate$
|
7
|
+
# $Revision$
|
8
|
+
# $Author$
|
9
|
+
#
|
10
|
+
# Description:
|
11
|
+
#
|
12
|
+
# You need to export three environment variables for path of header
|
13
|
+
# files and libraries if you wish to build this library.
|
14
|
+
#
|
15
|
+
# - SICL_DIR is path of Agilent IO Libraries Suite.
|
16
|
+
# - BCC_DIR is path of Borland C/C++ compiler.
|
17
|
+
# - RUBY_DIR is path of Ruby mswin32 verion.
|
18
|
+
#
|
19
|
+
# Please, make like this:)
|
20
|
+
#
|
21
|
+
# $ SICL_DIR='C:\Program Files\Agilent\IO Libraries Suite' \
|
22
|
+
# > BCC_DIR='C:\borland\bcc55' RUBY_DIR='C:\ruby-mswin32' \
|
23
|
+
# > PATH=/cygdrive/c/borland/bcc55/Bin:$PATH make -f Makefile.bcc
|
24
|
+
#
|
25
|
+
################################################################################
|
26
|
+
|
27
|
+
################################################################################
|
28
|
+
# Path definitions
|
29
|
+
################################################################################
|
30
|
+
|
31
|
+
#SICL_DIR = C:\Program Files\Agilent\IO Libraries Suite
|
32
|
+
SICL_INC_DIR = $(SICL_DIR)\include
|
33
|
+
SICL_LIB_DIR = $(SICL_DIR)\lib
|
34
|
+
|
35
|
+
#BCC_DIR = C:\borland\bcc55
|
36
|
+
BCC_INC_DIR = $(BCC_DIR)\include
|
37
|
+
BCC_LIB_DIR = $(BCC_DIR)\lib
|
38
|
+
|
39
|
+
#RUBY_DIR = C:\ruby-mswin32
|
40
|
+
RUBY_BIN_DIR = $(RUBY_DIR)\bin
|
41
|
+
RUBY_INC_DIR = $(RUBY_DIR)\lib\ruby\1.8\i386-mswin32
|
42
|
+
RUBYDLL = msvcrt-ruby18.dll
|
43
|
+
RUBYLIB = $(RUBYDLL:.dll=.lib)
|
44
|
+
|
45
|
+
################################################################################
|
46
|
+
# Compiler and linker settings
|
47
|
+
################################################################################
|
48
|
+
|
49
|
+
CC = bcc32
|
50
|
+
CFLAGS = -O2 -w-8070 -w-8004 -w-8057 \
|
51
|
+
-I"$(SICL_INC_DIR)" -I"$(RUBY_INC_DIR)" -I"$(BCC_INC_DIR)" \
|
52
|
+
-L"$(BCC_LIB_DIR)"
|
53
|
+
|
54
|
+
LD = ilink32
|
55
|
+
LDFLAGS = -L"$(BCC_LIB_DIR)" -L"$(SICL_LIB_DIR)"
|
56
|
+
|
57
|
+
################################################################################
|
58
|
+
# List of target files
|
59
|
+
################################################################################
|
60
|
+
|
61
|
+
SRCS = sicl.c
|
62
|
+
OBJS = $(SRCS:.c=.obj)
|
63
|
+
LIBS = bcsicl32.lib import32.lib cw32mt.lib $(RUBYLIB)
|
64
|
+
SICLDLL = sicl.dll
|
65
|
+
|
66
|
+
################################################################################
|
67
|
+
# Build rules
|
68
|
+
################################################################################
|
69
|
+
|
70
|
+
.PHONY: all
|
71
|
+
all: $(SICLDLL)
|
72
|
+
|
73
|
+
$(RUBYLIB): $(RUBY_BIN_DIR)\$(RUBYDLL)
|
74
|
+
implib -a $@ $?
|
75
|
+
|
76
|
+
$(SICLDLL): $(OBJS) $(RUBYLIB)
|
77
|
+
$(LD) $(LDFLAGS) -Tpd $? c0d32.obj, $(DLL), , $(LIBS),
|
78
|
+
|
79
|
+
.PHONY: clean
|
80
|
+
clean:
|
81
|
+
rm -f *~ *.obj *.lib *.tds *.map *.ilc *.ild *.ilf *.ils
|