diff options
Diffstat (limited to 'ofxHelios/src/ofxHelios.h')
| -rw-r--r-- | ofxHelios/src/ofxHelios.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/ofxHelios/src/ofxHelios.h b/ofxHelios/src/ofxHelios.h new file mode 100644 index 0000000..d873706 --- /dev/null +++ b/ofxHelios/src/ofxHelios.h @@ -0,0 +1,78 @@ +// +// ofxHelios.h +// +// +// Created by Tim Redfern Nov 2017 +// +// it would be good if ofxHelios could inherit the current transform + +#ifndef ofxHelios_h +#define ofxHelios_h +#define OFXHELIOS_VERSION 0.1 +#define OFXHELIOS_NODEVICE -1 +#include "ofMain.h" +#include "colourPolyline.h" + +#define BUFFER_POINTS 2048 + +#include <HeliosDac.h> + +class ofxHelios : public ofThread +{ +public: + + ofxHelios(int _pps=20000,int _device = 0) + { + int numdevices=dac.OpenDevices(); + for (int i=0;i<numdevices;i++){ + ofLogNotice() << "ofxHelios v "<<OFXHELIOS_VERSION<<": found laser DAC: firmware v "<<dac.GetFirmwareVersion(i); + } + if (!numdevices){ + ofLogNotice() << "ofxHelios v "<<OFXHELIOS_VERSION<<": no devices found"; + + } + if (_device>=numdevices){ + ofLogNotice() << "ofxHelios v "<<OFXHELIOS_VERSION<<": could not open device "<<_device; + device=OFXHELIOS_NODEVICE; + } + else { + device=_device; + pps=_pps; + //dac.SetShutter(device,true); + } + } + + ~ofxHelios() + { + //stopThread(); + } + + void set_pts(int n){ + pps=n; + ofLogNotice() << "ofxHelios v "<<OFXHELIOS_VERSION<<": set point output to "<<pps; + } + void set_intensity(int i){ + laserintensity=i; + ofLogNotice() << "ofxHelios v "<<OFXHELIOS_VERSION<<": set intensity to "<<laserintensity; + } + int get_pts(){ + return pps; + } + int draw(colourPolyline &line, int intensity=255); + int draw(ofPolyline &points,ofColor colour=ofColor(255,255,255),int intensity=255); + int draw(vector <ofPolyline> &points,ofColor colour=ofColor(255,255,255),int intensity=255); + + void threadedFunction(); + + //isReady() + + private: + + int device; + HeliosDac dac; + int pps; + int laserintensity; + +}; + +#endif |
