~ubuntu-branches/ubuntu/intrepid/comedilib/intrepid

« back to all changes in this revision

Viewing changes to swig/ruby/README

  • Committer: Bazaar Package Importer
  • Author(s): David Schleef
  • Date: 2004-11-04 11:43:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041104114351-a50kaei5yamka8r6
Tags: 0.7.22-2
It helps if the shared library is actually in the package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
This directory contains files for building a Ruby extension library
 
2
for Comedi.
 
3
 
 
4
Instructions for building by hand (you shouldn't need to do this):
 
5
 
 
6
    1.  Type 'ruby setup.rb config'. This configures for the local
 
7
        environment.
 
8
 
 
9
    2.  Type 'ruby setup.rb setup'. This builds the extension library.
 
10
 
 
11
    3.  Type 'ruby setup.rb install'. This installs the extension
 
12
        library and the file lib/comedi.rb, which provides more
 
13
        Ruby-like method syntax.
 
14
 
 
15
The file 'lib/comedi.rb' provides syntactic sugar in four forms:
 
16
 
 
17
1.  Method names without the 'comedi_' prefix. The Comedi module
 
18
    disambiguates the namespace. For example, you can say
 
19
    'dev = Comedi::open()' instead of 'dev = Comedi::comedi_open()'.
 
20
 
 
21
2.  Instance methods that take an explicit receiver instead of
 
22
    expecting the target object as an initial argument. For example:
 
23
    'comedi_close(dev)' can be written as 'dev.close'.
 
24
 
 
25
3.  A pre-defined IO object and an accessor method to simplify
 
26
    reading from the file descriptor associated with the comedi device.
 
27
    Data from comedi device 'dev' can be read by 'dev.ios.read'.
 
28
 
 
29
4.  A ComediError exception class. If the underlying comedi
 
30
    function returns an error indication, the ruby method will raise
 
31
    ComediError.  If the comedi function returns both a status and a
 
32
    value (e.g., comedi_data_read), the status is not returned by the
 
33
    ruby method unless it carries information in addition to indication
 
34
    of failure (e.g., comedi_command_test).
 
35
 
 
36
5.  Ruby booleans. Comedi functions that return C integer boolean values
 
37
    (comedi_range_is_chan_specific, comedi_maxdata_is_chan_specific)
 
38
    have corresponding boolean ruby methods with '?' appended to the
 
39
    method name.
 
40
 
 
41
Files in 'demo' are straight ports of their C counterparts from the
 
42
Comedilib 'demo' directory. They illustrate the basics of programming
 
43
Comedi commands using Ruby.
 
44
 
 
45
For completeness, the set of method definitions invoked by 'comedi.rb'
 
46
is as follows:
 
47
 
 
48
    # Module: Comedi
 
49
 
 
50
    def open(*args)
 
51
        value = comedi_open(*args)
 
52
        raise ComediError.new if value.nil?
 
53
        return value
 
54
    end
 
55
 
 
56
    # Module: Comedi
 
57
 
 
58
    def parse_calibration_file(*args)
 
59
        value = comedi_parse_calibration_file(*args)
 
60
        raise ComediError.new if value.nil?
 
61
        return value
 
62
    end
 
63
 
 
64
    # Module: Comedi
 
65
 
 
66
    def loglevel(*args)
 
67
        value = comedi_loglevel(*args)
 
68
        return value
 
69
    end
 
70
 
 
71
    # Module: Comedi
 
72
 
 
73
    def perror(*args)
 
74
        value = comedi_perror(*args)
 
75
        return value
 
76
    end
 
77
 
 
78
    # Module: Comedi
 
79
 
 
80
    def strerrno(*args)
 
81
        value = comedi_strerrno(*args)
 
82
        return value
 
83
    end
 
84
 
 
85
    # Module: Comedi
 
86
 
 
87
    def errno(*args)
 
88
        value = comedi_errno(*args)
 
89
        return value
 
90
    end
 
91
 
 
92
    # Module: Comedi
 
93
 
 
94
    def to_phys(*args)
 
95
        value = comedi_to_phys(*args)
 
96
        return value
 
97
    end
 
98
 
 
99
    # Module: Comedi
 
100
 
 
101
    def from_phys(*args)
 
102
        value = comedi_from_phys(*args)
 
103
        return value
 
104
    end
 
105
 
 
106
    # Module: Comedi
 
107
 
 
108
    def set_global_oor_behavior(*args)
 
109
        value = comedi_set_global_oor_behavior(*args)
 
110
        return value
 
111
    end
 
112
 
 
113
    # Module: SWIG::TYPE_p_comedi_t
 
114
 
 
115
    def close(*args)
 
116
        value = comedi_close(self, *args)
 
117
        raise ComediError.new if value == -1
 
118
        return value
 
119
    end
 
120
 
 
121
    # Module: SWIG::TYPE_p_comedi_t
 
122
 
 
123
    def fileno(*args)
 
124
        value = comedi_fileno(self, *args)
 
125
        raise ComediError.new if value == -1
 
126
        return value
 
127
    end
 
128
 
 
129
    # Module: SWIG::TYPE_p_comedi_t
 
130
 
 
131
    def get_subdevice_type(*args)
 
132
        value = comedi_get_subdevice_type(self, *args)
 
133
        raise ComediError.new if value == -1
 
134
        return value
 
135
    end
 
136
 
 
137
    # Module: SWIG::TYPE_p_comedi_t
 
138
 
 
139
    def find_subdevice_by_type(*args)
 
140
        value = comedi_find_subdevice_by_type(self, *args)
 
141
        raise ComediError.new if value == -1
 
142
        return value
 
143
    end
 
144
 
 
145
    # Module: SWIG::TYPE_p_comedi_t
 
146
 
 
147
    def get_read_subdevice(*args)
 
148
        value = comedi_get_read_subdevice(self, *args)
 
149
        raise ComediError.new if value == -1
 
150
        return value
 
151
    end
 
152
 
 
153
    # Module: SWIG::TYPE_p_comedi_t
 
154
 
 
155
    def get_write_device(*args)
 
156
        value = comedi_get_write_device(self, *args)
 
157
        raise ComediError.new if value == -1
 
158
        return value
 
159
    end
 
160
 
 
161
    # Module: SWIG::TYPE_p_comedi_t
 
162
 
 
163
    def get_subdevice_flags(*args)
 
164
        value = comedi_get_subdevice_flags(self, *args)
 
165
        raise ComediError.new if value == -1
 
166
        return value
 
167
    end
 
168
 
 
169
    # Module: SWIG::TYPE_p_comedi_t
 
170
 
 
171
    def get_n_channels(*args)
 
172
        value = comedi_get_n_channels(self, *args)
 
173
        raise ComediError.new if value == -1
 
174
        return value
 
175
    end
 
176
 
 
177
    # Module: SWIG::TYPE_p_comedi_t
 
178
 
 
179
    def range_is_chan_specific?(*args)
 
180
        value = comedi_range_is_chan_specific(self, *args)
 
181
        raise ComediError.new if value == -1
 
182
        return ret == 1
 
183
    end
 
184
 
 
185
    # Module: SWIG::TYPE_p_comedi_t
 
186
 
 
187
    def maxdata_is_chan_specific?(*args)
 
188
        value = comedi_maxdata_is_chan_specific(self, *args)
 
189
        raise ComediError.new if value == -1
 
190
        return ret == 1
 
191
    end
 
192
 
 
193
    # Module: SWIG::TYPE_p_comedi_t
 
194
 
 
195
    def get_n_ranges(*args)
 
196
        value = comedi_get_n_ranges(self, *args)
 
197
        raise ComediError.new if value == -1
 
198
        return value
 
199
    end
 
200
 
 
201
    # Module: SWIG::TYPE_p_comedi_t
 
202
 
 
203
    def find_range(*args)
 
204
        value = comedi_find_range(self, *args)
 
205
        raise ComediError.new if value == -1
 
206
        return value
 
207
    end
 
208
 
 
209
    # Module: SWIG::TYPE_p_comedi_t
 
210
 
 
211
    def get_buffer_size(*args)
 
212
        value = comedi_get_buffer_size(self, *args)
 
213
        raise ComediError.new if value == -1
 
214
        return value
 
215
    end
 
216
 
 
217
    # Module: SWIG::TYPE_p_comedi_t
 
218
 
 
219
    def get_max_buffer_size(*args)
 
220
        value = comedi_get_max_buffer_size(self, *args)
 
221
        raise ComediError.new if value == -1
 
222
        return value
 
223
    end
 
224
 
 
225
    # Module: SWIG::TYPE_p_comedi_t
 
226
 
 
227
    def set_buffer_size(*args)
 
228
        value = comedi_set_buffer_size(self, *args)
 
229
        raise ComediError.new if value == -1
 
230
        return value
 
231
    end
 
232
 
 
233
    # Module: SWIG::TYPE_p_comedi_t
 
234
 
 
235
    def trigger(*args)
 
236
        value = comedi_trigger(self, *args)
 
237
        raise ComediError.new if value == -1
 
238
        return value
 
239
    end
 
240
 
 
241
    # Module: SWIG::TYPE_p_comedi_t
 
242
 
 
243
    def do_insnlist(*args)
 
244
        value = comedi_do_insnlist(self, *args)
 
245
        raise ComediError.new if value == -1
 
246
        return value
 
247
    end
 
248
 
 
249
    # Module: SWIG::TYPE_p_comedi_t
 
250
 
 
251
    def do_insn(*args)
 
252
        value = comedi_do_insn(self, *args)
 
253
        raise ComediError.new if value == -1
 
254
        return value
 
255
    end
 
256
 
 
257
    # Module: SWIG::TYPE_p_comedi_t
 
258
 
 
259
    def lock(*args)
 
260
        value = comedi_lock(self, *args)
 
261
        raise ComediError.new if value == -1
 
262
        return value
 
263
    end
 
264
 
 
265
    # Module: SWIG::TYPE_p_comedi_t
 
266
 
 
267
    def unlock(*args)
 
268
        value = comedi_unlock(self, *args)
 
269
        raise ComediError.new if value == -1
 
270
        return value
 
271
    end
 
272
 
 
273
    # Module: SWIG::TYPE_p_comedi_t
 
274
 
 
275
    def data_read_hint(*args)
 
276
        value = comedi_data_read_hint(self, *args)
 
277
        raise ComediError.new if value == -1
 
278
        return value
 
279
    end
 
280
 
 
281
    # Module: SWIG::TYPE_p_comedi_t
 
282
 
 
283
    def data_write(*args)
 
284
        value = comedi_data_write(self, *args)
 
285
        raise ComediError.new if value == -1
 
286
        return value
 
287
    end
 
288
 
 
289
    # Module: SWIG::TYPE_p_comedi_t
 
290
 
 
291
    def dio_config(*args)
 
292
        value = comedi_dio_config(self, *args)
 
293
        raise ComediError.new if value == -1
 
294
        return value
 
295
    end
 
296
 
 
297
    # Module: SWIG::TYPE_p_comedi_t
 
298
 
 
299
    def dio_write(*args)
 
300
        value = comedi_dio_write(self, *args)
 
301
        raise ComediError.new if value == -1
 
302
        return value
 
303
    end
 
304
 
 
305
    # Module: SWIG::TYPE_p_comedi_t
 
306
 
 
307
    def cancel(*args)
 
308
        value = comedi_cancel(self, *args)
 
309
        raise ComediError.new if value == -1
 
310
        return value
 
311
    end
 
312
 
 
313
    # Module: SWIG::TYPE_p_comedi_t
 
314
 
 
315
    def command(*args)
 
316
        value = comedi_command(self, *args)
 
317
        raise ComediError.new if value == -1
 
318
        return value
 
319
    end
 
320
 
 
321
    # Module: SWIG::TYPE_p_comedi_t
 
322
 
 
323
    def poll(*args)
 
324
        value = comedi_poll(self, *args)
 
325
        raise ComediError.new if value == -1
 
326
        return value
 
327
    end
 
328
 
 
329
    # Module: SWIG::TYPE_p_comedi_t
 
330
 
 
331
    def set_max_buffer_size(*args)
 
332
        value = comedi_set_max_buffer_size(self, *args)
 
333
        raise ComediError.new if value == -1
 
334
        return value
 
335
    end
 
336
 
 
337
    # Module: SWIG::TYPE_p_comedi_t
 
338
 
 
339
    def get_buffer_contents(*args)
 
340
        value = comedi_get_buffer_contents(self, *args)
 
341
        raise ComediError.new if value == -1
 
342
        return value
 
343
    end
 
344
 
 
345
    # Module: SWIG::TYPE_p_comedi_t
 
346
 
 
347
    def mark_buffer_read(*args)
 
348
        value = comedi_mark_buffer_read(self, *args)
 
349
        raise ComediError.new if value == -1
 
350
        return value
 
351
    end
 
352
 
 
353
    # Module: SWIG::TYPE_p_comedi_t
 
354
 
 
355
    def get_buffer_offset(*args)
 
356
        value = comedi_get_buffer_offset(self, *args)
 
357
        raise ComediError.new if value == -1
 
358
        return value
 
359
    end
 
360
 
 
361
    # Module: SWIG::TYPE_p_comedi_t
 
362
 
 
363
    def data_read(*args)
 
364
        status, value = comedi_data_read(self, *args)
 
365
        raise ComediError.new if status == -1
 
366
        return value
 
367
    end
 
368
 
 
369
    # Module: SWIG::TYPE_p_comedi_t
 
370
 
 
371
    def data_read_delayed(*args)
 
372
        status, value = comedi_data_read_delayed(self, *args)
 
373
        raise ComediError.new if status == -1
 
374
        return value
 
375
    end
 
376
 
 
377
    # Module: SWIG::TYPE_p_comedi_t
 
378
 
 
379
    def dio_read(*args)
 
380
        status, value = comedi_dio_read(self, *args)
 
381
        raise ComediError.new if status == -1
 
382
        return value
 
383
    end
 
384
 
 
385
    # Module: SWIG::TYPE_p_comedi_t
 
386
 
 
387
    def dio_bitfield(*args)
 
388
        status, value = comedi_dio_bitfield(self, *args)
 
389
        raise ComediError.new if status == -1
 
390
        return value
 
391
    end
 
392
 
 
393
    # Module: SWIG::TYPE_p_comedi_t
 
394
 
 
395
    def get_cmd_src_mask(*args)
 
396
        status, value = comedi_get_cmd_src_mask(self, *args)
 
397
        raise ComediError.new if status == -1
 
398
        return value
 
399
    end
 
400
 
 
401
    # Module: SWIG::TYPE_p_comedi_t
 
402
 
 
403
    def get_cmd_generic_timed(*args)
 
404
        status, value = comedi_get_cmd_generic_timed(self, *args)
 
405
        raise ComediError.new if status == -1
 
406
        return value
 
407
    end
 
408
 
 
409
    # Module: SWIG::TYPE_p_comedi_t
 
410
 
 
411
    def command_test(*args)
 
412
        status, value = comedi_command_test(self, *args)
 
413
        raise ComediError.new if status == -1
 
414
        return status, value
 
415
    end
 
416
 
 
417
    # Module: SWIG::TYPE_p_comedi_t
 
418
 
 
419
    def get_maxdata(*args)
 
420
        value = comedi_get_maxdata(self, *args)
 
421
        raise ComediError.new if value == 0
 
422
        return value
 
423
    end
 
424
 
 
425
    # Module: SWIG::TYPE_p_comedi_t
 
426
 
 
427
    def apply_calibration(*args)
 
428
        value = comedi_apply_calibration(self, *args)
 
429
        raise ComediError.new if value < 0
 
430
        return value
 
431
    end
 
432
 
 
433
    # Module: SWIG::TYPE_p_comedi_t
 
434
 
 
435
    def apply_parsed_calibration(*args)
 
436
        value = comedi_apply_parsed_calibration(self, *args)
 
437
        raise ComediError.new if value < 0
 
438
        return value
 
439
    end
 
440
 
 
441
    # Module: SWIG::TYPE_p_comedi_t
 
442
 
 
443
    def get_driver_name(*args)
 
444
        value = comedi_get_driver_name(self, *args)
 
445
        raise ComediError.new if value.nil?
 
446
        return value
 
447
    end
 
448
 
 
449
    # Module: SWIG::TYPE_p_comedi_t
 
450
 
 
451
    def get_board_name(*args)
 
452
        value = comedi_get_board_name(self, *args)
 
453
        raise ComediError.new if value.nil?
 
454
        return value
 
455
    end
 
456
 
 
457
    # Module: SWIG::TYPE_p_comedi_t
 
458
 
 
459
    def get_range(*args)
 
460
        value = comedi_get_range(self, *args)
 
461
        raise ComediError.new if value.nil?
 
462
        return value
 
463
    end
 
464
 
 
465
    # Module: SWIG::TYPE_p_comedi_t
 
466
 
 
467
    def get_default_calibration_path(*args)
 
468
        value = comedi_get_default_calibration_path(self, *args)
 
469
        raise ComediError.new if value.nil?
 
470
        return value
 
471
    end
 
472
 
 
473
    # Module: SWIG::TYPE_p_comedi_t
 
474
 
 
475
    def get_n_subdevices(*args)
 
476
        value = comedi_get_n_subdevices(self, *args)
 
477
        return value
 
478
    end
 
479
 
 
480
    # Module: SWIG::TYPE_p_comedi_t
 
481
 
 
482
    def get_version_code(*args)
 
483
        value = comedi_get_version_code(self, *args)
 
484
        return value
 
485
    end
 
486
 
 
487
    # Module: Comedi::Comedi_sv_t
 
488
 
 
489
    def sv_init(*args)
 
490
        value = comedi_sv_init(self, *args)
 
491
        raise ComediError.new if value == -1
 
492
        return value
 
493
    end
 
494
 
 
495
    # Module: Comedi::Comedi_sv_t
 
496
 
 
497
    def sv_update(*args)
 
498
        value = comedi_sv_update(self, *args)
 
499
        raise ComediError.new if value == -1
 
500
        return value
 
501
    end
 
502
 
 
503
    # Module: Comedi::Comedi_sv_t
 
504
 
 
505
    def sv_measure(*args)
 
506
        status, value = comedi_sv_measure(self, *args)
 
507
        raise ComediError.new if status == -1
 
508
        return value
 
509
    end
 
510
 
 
511
    # Module: Comedi::Comedi_calibration_t
 
512
 
 
513
    def cleanup_calibration_file(*args)
 
514
        value = comedi_cleanup_calibration_file(self, *args)
 
515
        return value
 
516
    end
 
517
 
 
518
Steven Jenkins
 
519
steven.jenkins@ieee.org
 
520
2004-03-02