Skip to main content
Sign in
Snippets Groups Projects
Select Git revision
  • 66e088c0a16499473e0f4faca1a25b2cac70c91a
  • master default protected
2 results

AmptekHardwareInterface.i

Blame
  • user avatar
    Christian Koernig authored
    Added optional channel to control the simulator count rate via another
    tango attribute value
    90c2ed73
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    AmptekHardwareInterface.i 1.22 KiB
    %module AmptekHardwareInterface
    
    %{
        #define SWIG_FILE_WITH_INIT
        #include "AmptekHardwareInterface.h"
    %}
    %feature("autodoc");
    %include "numpy.i"
    %include "std_string.i"
    %init %{
        import_array();
    %}
    %naturalvar AmptekSpectrum::bins;
    
    %numpy_typemaps(unsigned int      , NPY_UINT     , int)
    
    %include "stdint.i"
    %include "std_vector.i"
    %include "std_pair.i"
    
    %include exception.i       
    namespace std {
       %template(IntVector) vector<int>;
       %template(StringVector) vector<std::string>;
       %template(DoubleVector) vector<double>;
       %template(UIntVector) vector<unsigned int>;
       %template(AmptekDataPair) pair<AmptekSpectrum, AmptekStatus>;
    }
    %except {
    	try {
    		$function
    	} catch(RangeError) {
    		SWIG_exception(SWIG_ValueError, "Range Error");
    	} catch(DivisionByZero) {
    		SWIG_exception(SWIG_DivisionByZero, "Division by zero");
    	} catch(OutOfMemory) {
    		SWIG_exception(SWIG_MemoryError, "Out of memory");
    	} catch(AmptekException) {
    		SWIG_exception(SWIG_RuntimeError, "Amptek Error");
    	} catch(...) {
    		SWIG_exception(SWIG_RuntimeError,"Unknown exception");
    	}
    }
    
    %ignore AmptekSimulatorConnectionHandler::start_time;
    
    %include "include/AmptekHardwareInterface.h"
    %include "include/AmptekStatus.h"
    %include "include/AmptekSpectrum.h"