VERBOSE_DEBUG = False
-class sngAioError (common.PycomediError) :
+class SngAioError (common.PycomediError) :
"Single point Analog IO error"
pass
common.PyComediIO.__init__(self, devtype=c.COMEDI_SUBD_AO, output=True, **kwargs)
def write(self, data) :
if len(data) != self.nchan :
- raise sngAioError, "data length %d != the number of channels (%d)" % (len(data), self.nchan)
+ raise SngAioError, "data length %d != the number of channels (%d)" % (len(data), self.nchan)
for i in range(self.nchan) :
self.write_chan_index(i, data[i])
print "p = ", p_value # probablility of measuring this ?slope? for non-correlated, normally-distruibuted data
print "err = ", std_err # root mean sqared error of best fit
if gradient < .7 or p_value > 0.05 :
- raise sngAioError, "Out channel %d != in channel %d" % (channel, channel)
+ raise SngAioError, "Out channel %d != in channel %d" % (channel, channel)
residual = zeros((len(out_data),))
for i in range(len(out_data)) :
pred_y = intercept + gradient * out_data[i]
import common
-class dioError (common.PycomediError):
+class SngDioError (common.PycomediError):
"Digital IO error"
pass
rc = c.comedi_dio_config(self.dev, self.subdev, chan, c.COMEDI_OUTPUT)
if rc != 1 : # yes, comedi_dio_config returns 1 on success, -1 on failure, as of comedilib-0.8.1
self._comedi.comedi_perror("comedi_dio_config")
- raise dioError, 'comedi_dio_config("%s", %d, %d, %d) returned %d' % (self.filename, self.subdev, chan, c.COMEDI_OUTPUT, rc)
+ raise SngDioError, 'comedi_dio_config("%s", %d, %d, %d) returned %d' % (self.filename, self.subdev, chan, c.COMEDI_OUTPUT, rc)
self.output = True
def set_to_input(self) :
"switch all the channels associated with this object to be inputs"
rc = c.comedi_dio_config(self.dev, self.subdev, chan, c.COMEDI_INPUT)
if rc != 1 :
self._comedi.comedi_perror("comedi_dio_config")
- raise dioError, 'comedi_dio_config("%s", %d, %d, %d) returned %d' % (self.filename, self.subdev, chan, c.COMEDI_INPUT, rc)
+ raise SngDioError, 'comedi_dio_config("%s", %d, %d, %d) returned %d' % (self.filename, self.subdev, chan, c.COMEDI_INPUT, rc)
self.output = False
def write_port(self, data) :
"""inputs: