summaryrefslogtreecommitdiff
path: root/ofxHelios/src/ofxHelios.h
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2018-01-28 22:20:49 +0000
committerTim Redfern <tim@getdrop.com>2018-01-28 22:20:49 +0000
commit64c89ab53447a004002ec0b0db94fd0a1e632cf6 (patch)
tree65ce3b4802bbb0656cc1a8c843c81d7a3fcda8c9 /ofxHelios/src/ofxHelios.h
parent404746784ce6ef2b87c396a12451947fee28b244 (diff)
POC driver
Diffstat (limited to 'ofxHelios/src/ofxHelios.h')
-rw-r--r--ofxHelios/src/ofxHelios.h78
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