diff --git a/include/AmptekStatus.h b/include/AmptekStatus.h index 9ff6cb7a23a03d32e83757489f3009b896945afd..bacc99f3c344a149f91464da174362cceb3c42b3 100644 --- a/include/AmptekStatus.h +++ b/include/AmptekStatus.h @@ -12,33 +12,34 @@ public: AmptekStatus(const byte* raw, std::chrono::time_point<std::chrono::system_clock> timestamp); AmptekStatus(); ~AmptekStatus(); - int FastCount(); - int SlowCount(); - double DeadTime(); - double AccTime(); - double RealTime(); - int FirmwareMajor(); - int FirmwareMinor(); - int FirmwareBuild(); - int FpgaMajor(); - int FpgaMinor(); - int SerialNb(); - double HighVoltage(); - double DetectorTemp(); - int BoardTemp(); - bool IsPresetTimeReached(); - bool IsEnabled(); - bool IsPresetCountReached(); - bool IsGated(); - int FpgaClock(); - int DeviceType(); - double TecVoltage(); - - bool ListModeLMMO(); - int ListModeClock(); - int ListModeSync(); - bool SequentialBufferRunning(); - int SequentialBufferIndex(); + int FastCount() const; + int SlowCount() const; + int GpCount() const; + double DeadTime() const; + double AccTime() const; + double RealTime() const; + int FirmwareMajor() const; + int FirmwareMinor() const; + int FirmwareBuild() const; + int FpgaMajor() const; + int FpgaMinor() const; + int SerialNb() const; + double HighVoltage() const; + double DetectorTemp() const; + int BoardTemp() const; + bool IsPresetTimeReached() const; + bool IsEnabled() const; + bool IsPresetCountReached() const; + bool IsGated() const; + int FpgaClock() const; + int DeviceType() const; + double TecVoltage() const; + + bool ListModeLMMO() const; + int ListModeClock() const; + int ListModeSync() const; + bool SequentialBufferRunning() const; + int SequentialBufferIndex() const; double AgeMillis() const; diff --git a/python/AmptekHardwareInterface.py b/python/AmptekHardwareInterface.py index ef98f02e7ef5849791de87783b2be96a5c5ea4c4..02b4bf78a9a15a1a6d70b140e051e34151a027dd 100644 --- a/python/AmptekHardwareInterface.py +++ b/python/AmptekHardwareInterface.py @@ -1,22 +1,15 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 3.0.12 +# Version 3.0.8 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. -from sys import version_info as _swig_python_version_info -if _swig_python_version_info >= (2, 7, 0): - def swig_import_helper(): - import importlib - pkg = __name__.rpartition('.')[0] - mname = '.'.join((pkg, '_AmptekHardwareInterface')).lstrip('.') - try: - return importlib.import_module(mname) - except ImportError: - return importlib.import_module('_AmptekHardwareInterface') - _AmptekHardwareInterface = swig_import_helper() - del swig_import_helper -elif _swig_python_version_info >= (2, 6, 0): + + + + +from sys import version_info +if version_info >= (2, 6, 0): def swig_import_helper(): from os.path import dirname import imp @@ -26,27 +19,22 @@ elif _swig_python_version_info >= (2, 6, 0): except ImportError: import _AmptekHardwareInterface return _AmptekHardwareInterface - try: - _mod = imp.load_module('_AmptekHardwareInterface', fp, pathname, description) - finally: - if fp is not None: + if fp is not None: + try: + _mod = imp.load_module('_AmptekHardwareInterface', fp, pathname, description) + finally: fp.close() - return _mod + return _mod _AmptekHardwareInterface = swig_import_helper() del swig_import_helper else: import _AmptekHardwareInterface -del _swig_python_version_info - +del version_info try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'. -try: - import builtins as __builtin__ -except ImportError: - import __builtin__ def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): @@ -68,22 +56,37 @@ def _swig_setattr(self, class_type, name, value): return _swig_setattr_nondynamic(self, class_type, name, value, 0) -def _swig_getattr(self, class_type, name): +def _swig_getattr_nondynamic(self, class_type, name, static=1): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name, None) if method: return method(self) - raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name)) + if (not static): + return object.__getattr__(self, name) + else: + raise AttributeError(name) + +def _swig_getattr(self, class_type, name): + return _swig_getattr_nondynamic(self, class_type, name, 0) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: + except Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) +try: + _object = object + _newclass = 1 +except AttributeError: + class _object: + pass + _newclass = 0 + + def _swig_setattr_nondynamic_method(set): def set_attr(self, name, value): @@ -236,7 +239,7 @@ class IntVector(object): this = _AmptekHardwareInterface.new_IntVector(*args) try: self.this.append(this) - except __builtin__.Exception: + except Exception: self.this = this def push_back(self, x): @@ -346,7 +349,7 @@ class StringVector(object): this = _AmptekHardwareInterface.new_StringVector(*args) try: self.this.append(this) - except __builtin__.Exception: + except Exception: self.this = this def push_back(self, x): @@ -456,7 +459,7 @@ class DoubleVector(object): this = _AmptekHardwareInterface.new_DoubleVector(*args) try: self.this.append(this) - except __builtin__.Exception: + except Exception: self.this = this def push_back(self, x): @@ -566,7 +569,7 @@ class UIntVector(object): this = _AmptekHardwareInterface.new_UIntVector(*args) try: self.this.append(this) - except __builtin__.Exception: + except Exception: self.this = this def push_back(self, x): @@ -597,10 +600,20 @@ class UIntVector(object): UIntVector_swigregister = _AmptekHardwareInterface.UIntVector_swigregister UIntVector_swigregister(UIntVector) + +_AmptekHardwareInterface.SPECLEN_swigconstant(_AmptekHardwareInterface) SPECLEN = _AmptekHardwareInterface.SPECLEN + +_AmptekHardwareInterface.NOT_CONNECTED_swigconstant(_AmptekHardwareInterface) NOT_CONNECTED = _AmptekHardwareInterface.NOT_CONNECTED + +_AmptekHardwareInterface.ON_swigconstant(_AmptekHardwareInterface) ON = _AmptekHardwareInterface.ON + +_AmptekHardwareInterface.RECORDING_swigconstant(_AmptekHardwareInterface) RECORDING = _AmptekHardwareInterface.RECORDING + +_AmptekHardwareInterface.ERROR_swigconstant(_AmptekHardwareInterface) ERROR = _AmptekHardwareInterface.ERROR class AmptekHardwareInterface(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') @@ -610,7 +623,7 @@ class AmptekHardwareInterface(object): this = _AmptekHardwareInterface.new_AmptekHardwareInterface() try: self.this.append(this) - except __builtin__.Exception: + except Exception: self.this = this __swig_destroy__ = _AmptekHardwareInterface.delete_AmptekHardwareInterface __del__ = lambda self: None @@ -686,6 +699,8 @@ class AmptekHardwareInterface(object): AmptekHardwareInterface_swigregister = _AmptekHardwareInterface.AmptekHardwareInterface_swigregister AmptekHardwareInterface_swigregister(AmptekHardwareInterface) + +_AmptekHardwareInterface.STATUS_SIZE_swigconstant(_AmptekHardwareInterface) STATUS_SIZE = _AmptekHardwareInterface.STATUS_SIZE class AmptekStatus(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') @@ -695,7 +710,7 @@ class AmptekStatus(object): this = _AmptekHardwareInterface.new_AmptekStatus(*args) try: self.this.append(this) - except __builtin__.Exception: + except Exception: self.this = this __swig_destroy__ = _AmptekHardwareInterface.delete_AmptekStatus __del__ = lambda self: None @@ -706,6 +721,9 @@ class AmptekStatus(object): def SlowCount(self): return _AmptekHardwareInterface.AmptekStatus_SlowCount(self) + def GpCount(self): + return _AmptekHardwareInterface.AmptekStatus_GpCount(self) + def DeadTime(self): return _AmptekHardwareInterface.AmptekStatus_DeadTime(self) @@ -794,7 +812,7 @@ class AmptekSpectrum(object): this = _AmptekHardwareInterface.new_AmptekSpectrum(*args) try: self.this.append(this) - except __builtin__.Exception: + except Exception: self.this = this def AgeMillis(self): diff --git a/python/AmptekHardwareInterface_wrap.cpp b/python/AmptekHardwareInterface_wrap.cpp index 696f3ab6f49a0c7927df6b61bd3d5fff9fe99ac9..01284bc2266d26cdf52ece2f2e412109b8f7381c 100644 --- a/python/AmptekHardwareInterface_wrap.cpp +++ b/python/AmptekHardwareInterface_wrap.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.12 + * Version 3.0.8 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -106,11 +106,9 @@ template <typename T> T SwigValueInit() { #endif /* exporting methods */ -#if defined(__GNUC__) -# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY -# endif +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY # endif #endif @@ -670,16 +668,16 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) { char d = *(c++); unsigned char uu; if ((d >= '0') && (d <= '9')) - uu = (unsigned char)((d - '0') << 4); + uu = ((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) - uu = (unsigned char)((d - ('a'-10)) << 4); + uu = ((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) - uu |= (unsigned char)(d - '0'); + uu |= (d - '0'); else if ((d >= 'a') && (d <= 'f')) - uu |= (unsigned char)(d - ('a'-10)); + uu |= (d - ('a'-10)); else return (char *) 0; *u = uu; @@ -862,6 +860,10 @@ PyString_FromFormat(const char *fmt, ...) { } #endif +/* Add PyObject_Del for old Pythons */ +#if PY_VERSION_HEX < 0x01060000 +# define PyObject_Del(op) PyMem_DEL((op)) +#endif #ifndef PyObject_DEL # define PyObject_DEL PyObject_Del #endif @@ -976,7 +978,6 @@ typedef destructor freefunc; #if PY_VERSION_HEX < 0x03020000 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) -#define Py_hash_t long #endif /* ----------------------------------------------------------------------------- @@ -1925,6 +1926,7 @@ SwigPyObject_TypeOnce(void) { static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else @@ -1935,7 +1937,7 @@ SwigPyObject_TypeOnce(void) { sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyObject_dealloc, /* tp_dealloc */ - 0, /* tp_print */ + 0, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else @@ -1943,7 +1945,7 @@ SwigPyObject_TypeOnce(void) { #endif (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ #else (cmpfunc)SwigPyObject_compare, /* tp_compare */ #endif @@ -1953,7 +1955,7 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - 0, /* tp_str */ + 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -2116,6 +2118,7 @@ SwigPyPacked_TypeOnce(void) { static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX>=0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else @@ -3064,7 +3067,7 @@ static swig_module_info swig_module = {swig_types, 30, 0, 0, 0, 0}; #endif #define SWIG_name "_AmptekHardwareInterface" -#define SWIGVERSION 0x030012 +#define SWIGVERSION 0x030008 #define SWIG_VERSION SWIGVERSION @@ -3175,7 +3178,6 @@ namespace swig { #endif -#include <typeinfo> #include <stdexcept> @@ -3325,7 +3327,7 @@ SWIG_AsVal_double (PyObject *obj, double *val) return SWIG_OK; #if PY_VERSION_HEX < 0x03000000 } else if (PyInt_Check(obj)) { - if (val) *val = (double) PyInt_AsLong(obj); + if (val) *val = PyInt_AsLong(obj); return SWIG_OK; #endif } else if (PyLong_Check(obj)) { @@ -3446,109 +3448,23 @@ SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) } -#include <limits.h> -#if !defined(SWIG_NO_LLONG_MAX) -# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) -# define LLONG_MAX __LONG_LONG_MAX__ -# define LLONG_MIN (-LLONG_MAX - 1LL) -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) -# endif -#endif - - -#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE) -# define SWIG_LONG_LONG_AVAILABLE -#endif - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - unsigned long long v = PyLong_AsUnsignedLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - unsigned long v; - res = SWIG_AsVal_unsigned_SS_long (obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - res = SWIG_AsVal_double (obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -#endif - return res; -} -#endif - - SWIGINTERNINLINE int SWIG_AsVal_size_t (PyObject * obj, size_t *val) { - int res = SWIG_TypeError; -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(size_t) <= sizeof(unsigned long)) { -#endif - unsigned long v; - res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else if (sizeof(size_t) <= sizeof(unsigned long long)) { - unsigned long long v; - res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); - } -#endif + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); return res; } - #define SWIG_From_long PyInt_FromLong - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_long_SS_long (long long value) -{ - return ((value < LONG_MIN) || (value > LONG_MAX)) ? - PyLong_FromLongLong(value) : PyInt_FromLong(static_cast< long >(value)); -} -#endif + #define SWIG_From_long PyLong_FromLong SWIGINTERNINLINE PyObject * SWIG_From_ptrdiff_t (ptrdiff_t value) { -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(ptrdiff_t) <= sizeof(long)) { -#endif - return SWIG_From_long (static_cast< long >(value)); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else { - /* assume sizeof(ptrdiff_t) <= sizeof(long long) */ - return SWIG_From_long_SS_long (static_cast< long long >(value)); - } -#endif + return SWIG_From_long (static_cast< long >(value)); } @@ -3602,65 +3518,12 @@ SWIG_AsVal_long (PyObject *obj, long* val) } -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_long_SS_long (PyObject *obj, long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - long long v = PyLong_AsLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - long v; - res = SWIG_AsVal_long (obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - const double mant_min = -mant_max; - double d; - res = SWIG_AsVal_double (obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, mant_min, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, mant_min, mant_max)) { - if (val) *val = (long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -#endif - return res; -} -#endif - - SWIGINTERNINLINE int SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val) { - int res = SWIG_TypeError; -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(ptrdiff_t) <= sizeof(long)) { -#endif - long v; - res = SWIG_AsVal_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else if (sizeof(ptrdiff_t) <= sizeof(long long)) { - long long v; - res = SWIG_AsVal_long_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v); - } -#endif + long v; + int res = SWIG_AsVal_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v); return res; } @@ -3701,21 +3564,8 @@ namespace swig { return traits<typename noconst_traits<Type >::noconst_type >::type_name(); } - template <class Type> struct traits_info { - static swig_type_info *type_query(std::string name) { - name += " *"; - return SWIG_TypeQuery(name.c_str()); - } - static swig_type_info *type_info() { - static swig_type_info *info = type_query(type_name<Type>()); - return info; - } - }; - - /* - Partial specialization for pointers (traits_info) - */ - template <class Type> struct traits_info<Type *> { + template <class Type> + struct traits_info { static swig_type_info *type_query(std::string name) { name += " *"; return SWIG_TypeQuery(name.c_str()); @@ -3732,7 +3582,7 @@ namespace swig { } /* - Partial specialization for pointers (traits) + Partial specialization for pointers */ template <class Type> struct traits <Type *> { typedef pointer_category category; @@ -3802,8 +3652,7 @@ namespace swig { struct traits_asptr { static int asptr(PyObject *obj, Type **val) { Type *p; - swig_type_info *descriptor = type_info<Type>(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; + int res = SWIG_ConvertPtr(obj, (void**)&p, type_info<Type>(), 0); if (SWIG_IsOK(res)) { if (val) *val = p; } @@ -3951,7 +3800,7 @@ namespace swig { namespace std { template <> - struct less <PyObject *> + struct less <PyObject *>: public binary_function<PyObject *, PyObject *, bool> { bool operator()(PyObject * v, PyObject *w) const @@ -3976,7 +3825,7 @@ namespace std { }; template <> - struct less <swig::SwigPtr_PyObject> + struct less <swig::SwigPtr_PyObject>: public binary_function<swig::SwigPtr_PyObject, swig::SwigPtr_PyObject, bool> { bool operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const @@ -3986,7 +3835,7 @@ namespace std { }; template <> - struct less <swig::SwigVar_PyObject> + struct less <swig::SwigVar_PyObject>: public binary_function<swig::SwigVar_PyObject, swig::SwigVar_PyObject, bool> { bool operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const @@ -4049,7 +3898,7 @@ namespace swig { if (step == 0) { throw std::invalid_argument("slice step cannot be zero"); } else if (step > 0) { - // Required range: 0 <= i < size, 0 <= j < size, i <= j + // Required range: 0 <= i < size, 0 <= j < size if (i < 0) { ii = 0; } else if (i < (Difference)size) { @@ -4057,15 +3906,13 @@ namespace swig { } else if (insert && (i >= (Difference)size)) { ii = (Difference)size; } - if (j < 0) { + if ( j < 0 ) { jj = 0; } else { jj = (j < (Difference)size) ? j : (Difference)size; } - if (jj < ii) - jj = ii; } else { - // Required range: -1 <= i < size-1, -1 <= j < size-1, i >= j + // Required range: -1 <= i < size-1, -1 <= j < size-1 if (i < -1) { ii = -1; } else if (i < (Difference) size) { @@ -4078,8 +3925,6 @@ namespace swig { } else { jj = (j < (Difference)size ) ? j : (Difference)(size-1); } - if (ii < jj) - ii = jj; } } @@ -4105,13 +3950,6 @@ namespace swig { seq->erase(position); } - template <class Sequence> - struct traits_reserve { - static void reserve(Sequence & /*seq*/, typename Sequence::size_type /*n*/) { - // This should be specialized for types that support reserve - } - }; - template <class Sequence, class Difference> inline Sequence* getslice(const Sequence* self, Difference i, Difference j, Py_ssize_t step) { @@ -4129,7 +3967,6 @@ namespace swig { return new Sequence(sb, se); } else { Sequence *sequence = new Sequence(); - swig::traits_reserve<Sequence>::reserve(*sequence, (jj - ii + step - 1) / step); typename Sequence::const_iterator it = sb; while (it!=se) { sequence->push_back(*it); @@ -4140,16 +3977,17 @@ namespace swig { } } else { Sequence *sequence = new Sequence(); - swig::traits_reserve<Sequence>::reserve(*sequence, (ii - jj - step - 1) / -step); - typename Sequence::const_reverse_iterator sb = self->rbegin(); - typename Sequence::const_reverse_iterator se = self->rbegin(); - std::advance(sb,size-ii-1); - std::advance(se,size-jj-1); - typename Sequence::const_reverse_iterator it = sb; - while (it!=se) { - sequence->push_back(*it); - for (Py_ssize_t c=0; c<-step && it!=se; ++c) - it++; + if (ii > jj) { + typename Sequence::const_reverse_iterator sb = self->rbegin(); + typename Sequence::const_reverse_iterator se = self->rbegin(); + std::advance(sb,size-ii-1); + std::advance(se,size-jj-1); + typename Sequence::const_reverse_iterator it = sb; + while (it!=se) { + sequence->push_back(*it); + for (Py_ssize_t c=0; c<-step && it!=se; ++c) + it++; + } } return sequence; } @@ -4163,11 +4001,12 @@ namespace swig { Difference jj = 0; swig::slice_adjust(i, j, step, size, ii, jj, true); if (step > 0) { + if (jj < ii) + jj = ii; if (step == 1) { size_t ssize = jj - ii; if (ssize <= is.size()) { // expanding/staying the same size - swig::traits_reserve<Sequence>::reserve(*self, self->size() - ssize + is.size()); typename Sequence::iterator sb = self->begin(); typename InputSeq::const_iterator isit = is.begin(); std::advance(sb,ii); @@ -4201,6 +4040,8 @@ namespace swig { } } } else { + if (jj > ii) + jj = ii; size_t replacecount = (ii - jj - step - 1) / -step; if (is.size() != replacecount) { char msg[1024]; @@ -4226,33 +4067,37 @@ namespace swig { Difference jj = 0; swig::slice_adjust(i, j, step, size, ii, jj, true); if (step > 0) { - typename Sequence::iterator sb = self->begin(); - std::advance(sb,ii); - if (step == 1) { - typename Sequence::iterator se = self->begin(); - std::advance(se,jj); - self->erase(sb,se); - } else { - typename Sequence::iterator it = sb; - size_t delcount = (jj - ii + step - 1) / step; + if (jj > ii) { + typename Sequence::iterator sb = self->begin(); + std::advance(sb,ii); + if (step == 1) { + typename Sequence::iterator se = self->begin(); + std::advance(se,jj); + self->erase(sb,se); + } else { + typename Sequence::iterator it = sb; + size_t delcount = (jj - ii + step - 1) / step; + while (delcount) { + it = self->erase(it); + for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) + it++; + delcount--; + } + } + } + } else { + if (ii > jj) { + typename Sequence::reverse_iterator sb = self->rbegin(); + std::advance(sb,size-ii-1); + typename Sequence::reverse_iterator it = sb; + size_t delcount = (ii - jj - step - 1) / -step; while (delcount) { - it = self->erase(it); - for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) + it = typename Sequence::reverse_iterator(self->erase((++it).base())); + for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) it++; delcount--; } } - } else { - typename Sequence::reverse_iterator sb = self->rbegin(); - std::advance(sb,size-ii-1); - typename Sequence::reverse_iterator it = sb; - size_t delcount = (ii - jj - step - 1) / -step; - while (delcount) { - it = typename Sequence::reverse_iterator(self->erase((++it).base())); - for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) - it++; - delcount--; - } } } } @@ -4708,6 +4553,16 @@ namespace swig } +#include <limits.h> +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif +#endif + + SWIGINTERN int SWIG_AsVal_int (PyObject * obj, int *val) { @@ -4771,8 +4626,8 @@ namespace swig { static int asptr(PyObject *obj, sequence **seq) { if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) { sequence *p; - swig_type_info *descriptor = swig::type_info<sequence>(); - if (descriptor && SWIG_IsOK(::SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0))) { + if (::SWIG_ConvertPtr(obj,(void**)&p, + swig::type_info<sequence>(),0) == SWIG_OK) { if (seq) *seq = p; return SWIG_OLDOBJ; } @@ -4811,7 +4666,7 @@ namespace swig { #ifdef SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS swig_type_info *desc = swig::type_info<sequence>(); if (desc && desc->clientdata) { - return SWIG_InternalNewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); + return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); } #endif size_type size = seq.size(); @@ -4832,13 +4687,6 @@ namespace swig { namespace swig { - template <class T> - struct traits_reserve<std::vector<T> > { - static void reserve(std::vector<T> &seq, typename std::vector<T>::size_type n) { - seq.reserve(n); - } - }; - template <class T> struct traits_asptr<std::vector<T> > { static int asptr(PyObject *obj, std::vector<T> **vec) { @@ -4881,33 +4729,14 @@ SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_long (unsigned long value) { return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); -} - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_unsigned_SS_long_SS_long (unsigned long long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLongLong(value) : PyInt_FromLong(static_cast< long >(value)); + PyLong_FromUnsignedLong(value) : PyLong_FromLong(static_cast< long >(value)); } -#endif SWIGINTERNINLINE PyObject * SWIG_From_size_t (size_t value) { -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(size_t) <= sizeof(unsigned long)) { -#endif - return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value)); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else { - /* assume sizeof(size_t) <= sizeof(unsigned long long) */ - return SWIG_From_unsigned_SS_long_SS_long (static_cast< unsigned long long >(value)); - } -#endif + return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value)); } SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg____getslice__(std::vector< int > *self,std::vector< int >::difference_type i,std::vector< int >::difference_type j){ @@ -5007,18 +4836,13 @@ SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { #if PY_VERSION_HEX>=0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (PyBytes_Check(obj)) -#else if (PyUnicode_Check(obj)) -#endif #else if (PyString_Check(obj)) #endif { char *cstr; Py_ssize_t len; #if PY_VERSION_HEX>=0x03000000 -#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) if (!alloc && cptr) { /* We can't allow converting without allocation, since the internal representation of string in Python 3 is UCS-2/UCS-4 but we require @@ -5027,9 +4851,8 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) return SWIG_RuntimeError; } obj = PyUnicode_AsUTF8String(obj); - if(alloc) *alloc = SWIG_NEWOBJ; -#endif PyBytes_AsStringAndSize(obj, &cstr, &len); + if(alloc) *alloc = SWIG_NEWOBJ; #else PyString_AsStringAndSize(obj, &cstr, &len); #endif @@ -5050,34 +4873,26 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) if (*alloc == SWIG_NEWOBJ) #endif { - *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); + *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1))); *alloc = SWIG_NEWOBJ; } else { *cptr = cstr; *alloc = SWIG_OLDOBJ; } } else { -#if PY_VERSION_HEX>=0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - *cptr = PyBytes_AsString(obj); -#else - assert(0); /* Should never reach here with Unicode strings in Python 3 */ -#endif -#else + #if PY_VERSION_HEX>=0x03000000 + assert(0); /* Should never reach here in Python 3 */ + #endif *cptr = SWIG_Python_str_AsChar(obj); -#endif } } if (psize) *psize = len + 1; -#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) +#if PY_VERSION_HEX>=0x03000000 Py_XDECREF(obj); #endif return SWIG_OK; } else { #if defined(SWIG_PYTHON_2_UNICODE) -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) -#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" -#endif #if PY_VERSION_HEX<0x03000000 if (PyUnicode_Check(obj)) { char *cstr; Py_ssize_t len; @@ -5088,7 +4903,7 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { if (cptr) { if (alloc) *alloc = SWIG_NEWOBJ; - *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); + *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1))); } if (psize) *psize = len + 1; @@ -5175,15 +4990,11 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); } else { #if PY_VERSION_HEX >= 0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#else #if PY_VERSION_HEX >= 0x03010000 return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape"); #else return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); #endif -#endif #else return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); #endif @@ -6453,7 +6264,7 @@ fail: SWIGINTERN PyObject *SwigPyIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_swig__SwigPyIterator, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -8371,7 +8182,7 @@ fail: SWIGINTERN PyObject *IntVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -10319,7 +10130,7 @@ fail: SWIGINTERN PyObject *StringVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -12237,7 +12048,7 @@ fail: SWIGINTERN PyObject *DoubleVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -14155,11 +13966,66 @@ fail: SWIGINTERN PyObject *UIntVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_unsigned_int_std__allocatorT_unsigned_int_t_t, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } +SWIGINTERN PyObject *SPECLEN_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *module; + PyObject *d; + if (!PyArg_ParseTuple(args,(char*)"O:swigconstant", &module)) return NULL; + d = PyModule_GetDict(module); + if (!d) return NULL; + SWIG_Python_SetConstant(d, "SPECLEN",SWIG_From_int(static_cast< int >(8192))); + return SWIG_Py_Void(); +} + + +SWIGINTERN PyObject *NOT_CONNECTED_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *module; + PyObject *d; + if (!PyArg_ParseTuple(args,(char*)"O:swigconstant", &module)) return NULL; + d = PyModule_GetDict(module); + if (!d) return NULL; + SWIG_Python_SetConstant(d, "NOT_CONNECTED",SWIG_From_int(static_cast< int >(NOT_CONNECTED))); + return SWIG_Py_Void(); +} + + +SWIGINTERN PyObject *ON_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *module; + PyObject *d; + if (!PyArg_ParseTuple(args,(char*)"O:swigconstant", &module)) return NULL; + d = PyModule_GetDict(module); + if (!d) return NULL; + SWIG_Python_SetConstant(d, "ON",SWIG_From_int(static_cast< int >(ON))); + return SWIG_Py_Void(); +} + + +SWIGINTERN PyObject *RECORDING_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *module; + PyObject *d; + if (!PyArg_ParseTuple(args,(char*)"O:swigconstant", &module)) return NULL; + d = PyModule_GetDict(module); + if (!d) return NULL; + SWIG_Python_SetConstant(d, "RECORDING",SWIG_From_int(static_cast< int >(RECORDING))); + return SWIG_Py_Void(); +} + + +SWIGINTERN PyObject *ERROR_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *module; + PyObject *d; + if (!PyArg_ParseTuple(args,(char*)"O:swigconstant", &module)) return NULL; + d = PyModule_GetDict(module); + if (!d) return NULL; + SWIG_Python_SetConstant(d, "ERROR",SWIG_From_int(static_cast< int >(ERROR))); + return SWIG_Py_Void(); +} + + SWIGINTERN PyObject *_wrap_new_AmptekHardwareInterface(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; AmptekHardwareInterface *result = 0 ; @@ -14928,11 +14794,22 @@ fail: SWIGINTERN PyObject *AmptekHardwareInterface_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_AmptekHardwareInterface, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } +SWIGINTERN PyObject *STATUS_SIZE_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *module; + PyObject *d; + if (!PyArg_ParseTuple(args,(char*)"O:swigconstant", &module)) return NULL; + d = PyModule_GetDict(module); + if (!d) return NULL; + SWIG_Python_SetConstant(d, "STATUS_SIZE",SWIG_From_int(static_cast< int >(64))); + return SWIG_Py_Void(); +} + + SWIGINTERN PyObject *_wrap_new_AmptekStatus__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; byte *arg1 = (byte *) 0 ; @@ -15087,10 +14964,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_FastCount(PyObject *SWIGUNUSEDPARM(self) if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_FastCount",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FastCount" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FastCount" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->FastCount(); + result = (int)((AmptekStatus const *)arg1)->FastCount(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15109,10 +14986,32 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_SlowCount(PyObject *SWIGUNUSEDPARM(self) if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_SlowCount",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_SlowCount" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_SlowCount" "', argument " "1"" of type '" "AmptekStatus const *""'"); + } + arg1 = reinterpret_cast< AmptekStatus * >(argp1); + result = (int)((AmptekStatus const *)arg1)->SlowCount(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_AmptekStatus_GpCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + AmptekStatus *arg1 = (AmptekStatus *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + int result; + + if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_GpCount",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_GpCount" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->SlowCount(); + result = (int)((AmptekStatus const *)arg1)->GpCount(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15131,10 +15030,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_DeadTime(PyObject *SWIGUNUSEDPARM(self), if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_DeadTime",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_DeadTime" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_DeadTime" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (double)(arg1)->DeadTime(); + result = (double)((AmptekStatus const *)arg1)->DeadTime(); resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: @@ -15153,10 +15052,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_AccTime(PyObject *SWIGUNUSEDPARM(self), if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_AccTime",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_AccTime" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_AccTime" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (double)(arg1)->AccTime(); + result = (double)((AmptekStatus const *)arg1)->AccTime(); resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: @@ -15175,10 +15074,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_RealTime(PyObject *SWIGUNUSEDPARM(self), if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_RealTime",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_RealTime" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_RealTime" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (double)(arg1)->RealTime(); + result = (double)((AmptekStatus const *)arg1)->RealTime(); resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: @@ -15197,10 +15096,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_FirmwareMajor(PyObject *SWIGUNUSEDPARM(s if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_FirmwareMajor",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FirmwareMajor" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FirmwareMajor" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->FirmwareMajor(); + result = (int)((AmptekStatus const *)arg1)->FirmwareMajor(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15219,10 +15118,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_FirmwareMinor(PyObject *SWIGUNUSEDPARM(s if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_FirmwareMinor",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FirmwareMinor" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FirmwareMinor" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->FirmwareMinor(); + result = (int)((AmptekStatus const *)arg1)->FirmwareMinor(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15241,10 +15140,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_FirmwareBuild(PyObject *SWIGUNUSEDPARM(s if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_FirmwareBuild",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FirmwareBuild" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FirmwareBuild" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->FirmwareBuild(); + result = (int)((AmptekStatus const *)arg1)->FirmwareBuild(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15263,10 +15162,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_FpgaMajor(PyObject *SWIGUNUSEDPARM(self) if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_FpgaMajor",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FpgaMajor" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FpgaMajor" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->FpgaMajor(); + result = (int)((AmptekStatus const *)arg1)->FpgaMajor(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15285,10 +15184,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_FpgaMinor(PyObject *SWIGUNUSEDPARM(self) if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_FpgaMinor",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FpgaMinor" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FpgaMinor" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->FpgaMinor(); + result = (int)((AmptekStatus const *)arg1)->FpgaMinor(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15307,10 +15206,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_SerialNb(PyObject *SWIGUNUSEDPARM(self), if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_SerialNb",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_SerialNb" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_SerialNb" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->SerialNb(); + result = (int)((AmptekStatus const *)arg1)->SerialNb(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15329,10 +15228,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_HighVoltage(PyObject *SWIGUNUSEDPARM(sel if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_HighVoltage",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_HighVoltage" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_HighVoltage" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (double)(arg1)->HighVoltage(); + result = (double)((AmptekStatus const *)arg1)->HighVoltage(); resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: @@ -15351,10 +15250,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_DetectorTemp(PyObject *SWIGUNUSEDPARM(se if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_DetectorTemp",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_DetectorTemp" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_DetectorTemp" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (double)(arg1)->DetectorTemp(); + result = (double)((AmptekStatus const *)arg1)->DetectorTemp(); resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: @@ -15373,10 +15272,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_BoardTemp(PyObject *SWIGUNUSEDPARM(self) if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_BoardTemp",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_BoardTemp" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_BoardTemp" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->BoardTemp(); + result = (int)((AmptekStatus const *)arg1)->BoardTemp(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15395,10 +15294,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_IsPresetTimeReached(PyObject *SWIGUNUSED if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_IsPresetTimeReached",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_IsPresetTimeReached" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_IsPresetTimeReached" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (bool)(arg1)->IsPresetTimeReached(); + result = (bool)((AmptekStatus const *)arg1)->IsPresetTimeReached(); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -15417,10 +15316,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_IsEnabled(PyObject *SWIGUNUSEDPARM(self) if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_IsEnabled",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_IsEnabled" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_IsEnabled" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (bool)(arg1)->IsEnabled(); + result = (bool)((AmptekStatus const *)arg1)->IsEnabled(); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -15439,10 +15338,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_IsPresetCountReached(PyObject *SWIGUNUSE if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_IsPresetCountReached",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_IsPresetCountReached" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_IsPresetCountReached" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (bool)(arg1)->IsPresetCountReached(); + result = (bool)((AmptekStatus const *)arg1)->IsPresetCountReached(); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -15461,10 +15360,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_IsGated(PyObject *SWIGUNUSEDPARM(self), if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_IsGated",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_IsGated" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_IsGated" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (bool)(arg1)->IsGated(); + result = (bool)((AmptekStatus const *)arg1)->IsGated(); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -15483,10 +15382,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_FpgaClock(PyObject *SWIGUNUSEDPARM(self) if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_FpgaClock",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FpgaClock" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_FpgaClock" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->FpgaClock(); + result = (int)((AmptekStatus const *)arg1)->FpgaClock(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15505,10 +15404,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_DeviceType(PyObject *SWIGUNUSEDPARM(self if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_DeviceType",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_DeviceType" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_DeviceType" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->DeviceType(); + result = (int)((AmptekStatus const *)arg1)->DeviceType(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15527,10 +15426,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_TecVoltage(PyObject *SWIGUNUSEDPARM(self if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_TecVoltage",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_TecVoltage" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_TecVoltage" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (double)(arg1)->TecVoltage(); + result = (double)((AmptekStatus const *)arg1)->TecVoltage(); resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: @@ -15549,10 +15448,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_ListModeLMMO(PyObject *SWIGUNUSEDPARM(se if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_ListModeLMMO",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_ListModeLMMO" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_ListModeLMMO" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (bool)(arg1)->ListModeLMMO(); + result = (bool)((AmptekStatus const *)arg1)->ListModeLMMO(); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -15571,10 +15470,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_ListModeClock(PyObject *SWIGUNUSEDPARM(s if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_ListModeClock",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_ListModeClock" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_ListModeClock" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->ListModeClock(); + result = (int)((AmptekStatus const *)arg1)->ListModeClock(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15593,10 +15492,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_ListModeSync(PyObject *SWIGUNUSEDPARM(se if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_ListModeSync",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_ListModeSync" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_ListModeSync" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->ListModeSync(); + result = (int)((AmptekStatus const *)arg1)->ListModeSync(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15615,10 +15514,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_SequentialBufferRunning(PyObject *SWIGUN if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_SequentialBufferRunning",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_SequentialBufferRunning" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_SequentialBufferRunning" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (bool)(arg1)->SequentialBufferRunning(); + result = (bool)((AmptekStatus const *)arg1)->SequentialBufferRunning(); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -15637,10 +15536,10 @@ SWIGINTERN PyObject *_wrap_AmptekStatus_SequentialBufferIndex(PyObject *SWIGUNUS if (!PyArg_ParseTuple(args,(char *)"O:AmptekStatus_SequentialBufferIndex",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AmptekStatus, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_SequentialBufferIndex" "', argument " "1"" of type '" "AmptekStatus *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AmptekStatus_SequentialBufferIndex" "', argument " "1"" of type '" "AmptekStatus const *""'"); } arg1 = reinterpret_cast< AmptekStatus * >(argp1); - result = (int)(arg1)->SequentialBufferIndex(); + result = (int)((AmptekStatus const *)arg1)->SequentialBufferIndex(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -15672,7 +15571,7 @@ fail: SWIGINTERN PyObject *AmptekStatus_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_AmptekStatus, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -16038,7 +15937,7 @@ fail: SWIGINTERN PyObject *AmptekSpectrum_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; + if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_AmptekSpectrum, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -16199,6 +16098,11 @@ static PyMethodDef SwigMethods[] = { { (char *)"UIntVector_capacity", _wrap_UIntVector_capacity, METH_VARARGS, NULL}, { (char *)"delete_UIntVector", _wrap_delete_UIntVector, METH_VARARGS, NULL}, { (char *)"UIntVector_swigregister", UIntVector_swigregister, METH_VARARGS, NULL}, + { (char *)"SPECLEN_swigconstant", SPECLEN_swigconstant, METH_VARARGS, NULL}, + { (char *)"NOT_CONNECTED_swigconstant", NOT_CONNECTED_swigconstant, METH_VARARGS, NULL}, + { (char *)"ON_swigconstant", ON_swigconstant, METH_VARARGS, NULL}, + { (char *)"RECORDING_swigconstant", RECORDING_swigconstant, METH_VARARGS, NULL}, + { (char *)"ERROR_swigconstant", ERROR_swigconstant, METH_VARARGS, NULL}, { (char *)"new_AmptekHardwareInterface", _wrap_new_AmptekHardwareInterface, METH_VARARGS, NULL}, { (char *)"delete_AmptekHardwareInterface", _wrap_delete_AmptekHardwareInterface, METH_VARARGS, NULL}, { (char *)"AmptekHardwareInterface_connectUSB", _wrap_AmptekHardwareInterface_connectUSB, METH_VARARGS, NULL}, @@ -16225,10 +16129,12 @@ static PyMethodDef SwigMethods[] = { { (char *)"AmptekHardwareInterface_GetTextConfiguration", _wrap_AmptekHardwareInterface_GetTextConfiguration, METH_VARARGS, NULL}, { (char *)"AmptekHardwareInterface_GetState", _wrap_AmptekHardwareInterface_GetState, METH_VARARGS, NULL}, { (char *)"AmptekHardwareInterface_swigregister", AmptekHardwareInterface_swigregister, METH_VARARGS, NULL}, + { (char *)"STATUS_SIZE_swigconstant", STATUS_SIZE_swigconstant, METH_VARARGS, NULL}, { (char *)"new_AmptekStatus", _wrap_new_AmptekStatus, METH_VARARGS, NULL}, { (char *)"delete_AmptekStatus", _wrap_delete_AmptekStatus, METH_VARARGS, NULL}, { (char *)"AmptekStatus_FastCount", _wrap_AmptekStatus_FastCount, METH_VARARGS, NULL}, { (char *)"AmptekStatus_SlowCount", _wrap_AmptekStatus_SlowCount, METH_VARARGS, NULL}, + { (char *)"AmptekStatus_GpCount", _wrap_AmptekStatus_GpCount, METH_VARARGS, NULL}, { (char *)"AmptekStatus_DeadTime", _wrap_AmptekStatus_DeadTime, METH_VARARGS, NULL}, { (char *)"AmptekStatus_AccTime", _wrap_AmptekStatus_AccTime, METH_VARARGS, NULL}, { (char *)"AmptekStatus_RealTime", _wrap_AmptekStatus_RealTime, METH_VARARGS, NULL}, @@ -16776,6 +16682,7 @@ extern "C" { static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else @@ -17007,13 +16914,13 @@ SWIG_init(void) { static PyGetSetDef thisown_getset_def = { (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure }; + PyObject *metatype_args; PyTypeObject *builtin_pytype; int builtin_base_count; swig_type_info *builtin_basetype; PyObject *tuple; PyGetSetDescrObject *static_getset; PyTypeObject *metatype; - PyTypeObject *swigpyobject; SwigPyClientData *cd; PyObject *public_interface, *public_symbol; PyObject *this_descr; @@ -17028,9 +16935,14 @@ SWIG_init(void) { (void)static_getset; (void)self; - /* Metaclass is used to implement static member variables */ - metatype = SwigPyObjectType(); + /* metatype is used to implement static member variables. */ + metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type); + assert(metatype_args); + metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL); assert(metatype); + Py_DECREF(metatype_args); + metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro; + assert(PyType_Ready(metatype) >= 0); #endif /* Fix SwigMethods to carry the callback ptrs when needed */ @@ -17048,15 +16960,13 @@ SWIG_init(void) { SWIG_InitializeModule(0); #ifdef SWIGPYTHON_BUILTIN - swigpyobject = SwigPyObject_TypeOnce(); - SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); assert(SwigPyObject_stype); cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; if (!cd) { SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; - SwigPyObject_clientdata.pytype = swigpyobject; - } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { + SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce(); + } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) { PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); # if PY_VERSION_HEX >= 0x03000000 return NULL; @@ -17090,12 +17000,6 @@ SWIG_init(void) { import_array(); - SWIG_Python_SetConstant(d, "SPECLEN",SWIG_From_int(static_cast< int >(8192))); - SWIG_Python_SetConstant(d, "NOT_CONNECTED",SWIG_From_int(static_cast< int >(NOT_CONNECTED))); - SWIG_Python_SetConstant(d, "ON",SWIG_From_int(static_cast< int >(ON))); - SWIG_Python_SetConstant(d, "RECORDING",SWIG_From_int(static_cast< int >(RECORDING))); - SWIG_Python_SetConstant(d, "ERROR",SWIG_From_int(static_cast< int >(ERROR))); - SWIG_Python_SetConstant(d, "STATUS_SIZE",SWIG_From_int(static_cast< int >(64))); #if PY_VERSION_HEX >= 0x03000000 return m; #else diff --git a/src/AmptekStatus.cpp b/src/AmptekStatus.cpp index 3fac9e905b2371c94c0914be12bfdb251cb9f46f..6ff61761338d870ed3359e2f12543ad497f6f402 100644 --- a/src/AmptekStatus.cpp +++ b/src/AmptekStatus.cpp @@ -32,7 +32,7 @@ double AmptekStatus::AgeMillis() const{ * * @return int */ -int AmptekStatus::FastCount(){ +int AmptekStatus::FastCount() const{ return mergeBytes(raw_status[3],raw_status[2],raw_status[1],raw_status[0]); } @@ -43,17 +43,25 @@ int AmptekStatus::FastCount(){ * * @return int counts */ -int AmptekStatus::SlowCount(){ +int AmptekStatus::SlowCount() const{ return mergeBytes(raw_status[7],raw_status[6],raw_status[5],raw_status[4]); } +/** + * @brief Current Count in the General Purpose Counter + * + * @return int + */ +int AmptekStatus::GpCount() const{ + return mergeBytes(raw_status[11],raw_status[10],raw_status[9],raw_status[8]); +} /** * @brief Dead time of the current acquisition * * @return double dead time in per cent */ -double AmptekStatus::DeadTime(){ +double AmptekStatus::DeadTime() const{ int sc = SlowCount(); int fc = FastCount(); @@ -74,7 +82,7 @@ double AmptekStatus::DeadTime(){ * * @return double time in seconds */ -double AmptekStatus::AccTime(){ +double AmptekStatus::AccTime() const{ return 0.001*raw_status[12] + 0.1 * mergeBytes(raw_status[15],raw_status[14],raw_status[13]); } @@ -84,7 +92,7 @@ double AmptekStatus::AccTime(){ * * @return double time in seconds */ -double AmptekStatus::RealTime(){ +double AmptekStatus::RealTime() const{ return 0.001 * mergeBytes(raw_status[23],raw_status[22],raw_status[21],raw_status[20]); } @@ -95,7 +103,7 @@ double AmptekStatus::RealTime(){ * * @return int */ -int AmptekStatus::FirmwareMajor(){ +int AmptekStatus::FirmwareMajor() const{ return (raw_status[24] >> 4); } @@ -106,7 +114,7 @@ int AmptekStatus::FirmwareMajor(){ * * @return int */ -int AmptekStatus::FirmwareMinor(){ +int AmptekStatus::FirmwareMinor() const{ return(raw_status[24] & ~(0x0F << 4)); } @@ -117,7 +125,7 @@ int AmptekStatus::FirmwareMinor(){ * * @return int */ -int AmptekStatus::FirmwareBuild(){ +int AmptekStatus::FirmwareBuild() const{ return(raw_status[37] & ~(0x0F << 4)); } @@ -127,7 +135,7 @@ int AmptekStatus::FirmwareBuild(){ * * @return int */ -int AmptekStatus::FpgaMajor(){ +int AmptekStatus::FpgaMajor() const{ return (raw_status[25] >> 4); } @@ -138,7 +146,7 @@ int AmptekStatus::FpgaMajor(){ * * @return int */ -int AmptekStatus::FpgaMinor(){ +int AmptekStatus::FpgaMinor() const{ return(raw_status[25] & ~(0x0F << 4)); } @@ -149,7 +157,7 @@ int AmptekStatus::FpgaMinor(){ * * @return int */ -int AmptekStatus::SerialNb(){ +int AmptekStatus::SerialNb() const{ return mergeBytes(raw_status[29],raw_status[28],raw_status[27],raw_status[26]); } @@ -160,7 +168,7 @@ int AmptekStatus::SerialNb(){ * * @return double in volts */ -double AmptekStatus::HighVoltage(){ +double AmptekStatus::HighVoltage() const{ return 0.5 * static_cast<signed_word16>( mergeBytes(raw_status[30],raw_status[31]) ); } @@ -171,7 +179,7 @@ double AmptekStatus::HighVoltage(){ * * @return double temperature in Kelvin */ -double AmptekStatus::DetectorTemp(){ +double AmptekStatus::DetectorTemp() const{ return 0.1 * mergeBytes(raw_status[32] & ~(0x0F << 4),raw_status[33]); } @@ -181,7 +189,7 @@ double AmptekStatus::DetectorTemp(){ * * @return int in deg Celsius */ -int AmptekStatus::BoardTemp(){ +int AmptekStatus::BoardTemp() const{ return raw_status[34]; } @@ -192,7 +200,7 @@ int AmptekStatus::BoardTemp(){ * @return true if acquisition was stopped due to reaching the set preset time * @return false if not reached or not set */ -bool AmptekStatus::IsPresetTimeReached(){ +bool AmptekStatus::IsPresetTimeReached() const{ return raw_status[35] & (1 << 7); } @@ -203,7 +211,7 @@ bool AmptekStatus::IsPresetTimeReached(){ * @return true if acquisition is running * @return false otherwise */ -bool AmptekStatus::IsEnabled(){ +bool AmptekStatus::IsEnabled() const{ return raw_status[35] & (1 << 5); } @@ -214,7 +222,7 @@ bool AmptekStatus::IsEnabled(){ * @return true if acquisition was stopped due to reaching the set preset counts * @return false if not reached or not set */ -bool AmptekStatus::IsPresetCountReached(){ +bool AmptekStatus::IsPresetCountReached() const{ return raw_status[35] & (1 << 4); } @@ -225,7 +233,7 @@ bool AmptekStatus::IsPresetCountReached(){ * @return true if gate active (rejecting counts) * @return false if disabled or deactivated (accepting counts) */ -bool AmptekStatus::IsGated(){ +bool AmptekStatus::IsGated() const{ return !( raw_status[35] & (1 << 3) ); } @@ -235,7 +243,7 @@ bool AmptekStatus::IsGated(){ * * @return int clock speed in MHz */ -int AmptekStatus::FpgaClock(){ +int AmptekStatus::FpgaClock() const{ return raw_status[36] & (1 << 1) ? 80 : 20; } @@ -246,7 +254,7 @@ int AmptekStatus::FpgaClock(){ * * @return int 0: DP5, 1: PX5, 2: DP5G, 3: MCA8000D, 4: TB5, 5: DP5-X */ -int AmptekStatus::DeviceType(){ +int AmptekStatus::DeviceType() const{ return raw_status[39]; } @@ -257,7 +265,7 @@ int AmptekStatus::DeviceType(){ * * @return double voltage in volts */ -double AmptekStatus::TecVoltage(){ +double AmptekStatus::TecVoltage() const{ return 1./758.5 * mergeBytes(raw_status[40],raw_status[41]); } @@ -269,7 +277,7 @@ double AmptekStatus::TecVoltage(){ * @return true deadtime correction feature enabled * @return false normal list mode operation */ -bool AmptekStatus::ListModeLMMO(){ +bool AmptekStatus::ListModeLMMO() const{ return raw_status[43] & (1 << 3); } @@ -279,7 +287,7 @@ bool AmptekStatus::ListModeLMMO(){ * * @return int list mode clock speed in nanoseconds */ -int AmptekStatus::ListModeClock(){ +int AmptekStatus::ListModeClock() const{ int multiplier = ListModeSync() == 1 ? 1000 : 1; return raw_status[43] & (1 << 2) ? multiplier * 1000 : multiplier * 100; } @@ -290,7 +298,7 @@ int AmptekStatus::ListModeClock(){ * * @return int 0: internal, 1: no timetag, 2: external, 3: frame */ -int AmptekStatus::ListModeSync(){ +int AmptekStatus::ListModeSync() const{ return raw_status[43] & 0b11; } @@ -301,7 +309,7 @@ int AmptekStatus::ListModeSync(){ * @return true if running * @return false if finished or disabled */ -bool AmptekStatus::SequentialBufferRunning(){ +bool AmptekStatus::SequentialBufferRunning() const{ return raw_status[46] & (1 << 1); } @@ -310,7 +318,7 @@ bool AmptekStatus::SequentialBufferRunning(){ * * @return int current buffer index */ -int AmptekStatus::SequentialBufferIndex(){ +int AmptekStatus::SequentialBufferIndex() const{ return ( (raw_status[46] & (0b1)) << 8) + raw_status[47]; // 9 bit value }