Skip to content

Commit

Permalink
storing some ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
samofab committed Aug 5, 2015
1 parent e3e2642 commit e04f281
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion nisa32.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var ref = require('ref');
var ffi = require('ffi');
var ArrayType = require('ref-array');
Expand All @@ -20,7 +22,12 @@ var visa32 = ffi.Library('visa32', {
});

/* idea:
module.exports = function(visaAddress) {
var self = module.exports
(for private parts to have direct access to functions)
idea:
module.exports = function(visaAddress) {
return new nisa32(visaAddress);
}
Expand All @@ -32,6 +39,35 @@ function nisa32() {
self.init = function(options, callback) { ... }
function private() { ... }
}
*/

/* plan:
var nisa32 = require('./nisa32.js');
var gpib12 = nisa32('GPIB0::12::INSTR');
gpib12.query(cmd, callback);
module.exports = createInstrument;
function createInstrument (visaAddress) {
assert.equal(typeof (visaAddress), 'string', "argument 'visaAddress' must be a string");
}
----- OR
function Nisa32(visaAddress) {
this.visaAddress = visaAddress;
}
Nisa32.prototype.query = function(queryString, callback) {
// do stuff on visaAddress with queryString
};
module.exports = Nisa32;
*/

module.exports = {
Expand Down

0 comments on commit e04f281

Please sign in to comment.