-
Notifications
You must be signed in to change notification settings - Fork 0
/
AndorFRAPPA.h
108 lines (96 loc) · 3.44 KB
/
AndorFRAPPA.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
///////////////////////////////////////////////////////////////////////////////
// FILE: AndorFRAPPA.h
// PROJECT: Micro-Manager
// SUBSYSTEM: DeviceAdapters
//-----------------------------------------------------------------------------
// DESCRIPTION: Andor FRAPPA adapter control using RS-232 via
// tillmic{,64}.dll.
//
// COPYRIGHT: Pariksheet Nanda, 2014-2015
//
// LICENSE: LGPL-3+
//
// This file is part of AndorFRAPPA.
//
// AndorFRAPPA is free software: you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either
// version 3 of the License, or (at your option) any later
// version.
//
// AndorFRAPPA is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General
// Public License along with AndorFRAPPA. If not, see
// <http://www.gnu.org/licenses/>.
//
// AUTHORS: Pariksheet Nanda <[email protected]>
#ifndef _AndorFRAPPA_H_
#define _AndorFRAPPA_H_
#include "DeviceBase.h"
#include "MMDevice.h"
#include <string>
typedef std::vector<LSM_Coordinate> LSM_Region;
class AndorFRAPPA : public CGalvoBase<AndorFRAPPA>
{
public:
AndorFRAPPA(void);
~AndorFRAPPA(void);
// Device API.
int Initialize();
int Shutdown();
void GetName(char* pszName) const;
bool Busy();
// Galvo API.
int PointAndFire(double x, double y, double time_us);
int SetSpotInterval(double pulseInterval_us);
int SetPosition(double x, double y);
int GetPosition(double& x, double& y);
int SetIlluminationState(bool on);
double GetXRange();
double GetYRange();
int AddPolygonVertex(int polygonIndex, double x, double y);
int DeletePolygons();
int RunSequence();
int LoadPolygons();
int SetPolygonRepetitions(int repetitions);
int RunPolygons();
int StopSequence();
int GetChannel(char* channelName);
// Property Action Handlers.
int OnPort(MM::PropertyBase* pProp, MM::ActionType eAct);
int OnGalvoImagingAngle(MM::PropertyBase* pProp, MM::ActionType eAct);
int OnLaserOnTime(MM::PropertyBase* pProp, MM::ActionType eAct);
int OnExecutionTime(MM::PropertyBase* pProp, MM::ActionType eAct);
// int OnCalibrationMode(MM::PropertyBase* pProp, MM::ActionType eAct);
private:
void* handle_;
bool initialized_;
std::string port_;
bool busy_;
long calibrationMode_;
/**
* A TILL protocol handle is required when any 2D region needs to be
* uploaded to the FRAPPA.
*/
void* protocolHandle_;
std::vector<LSM_Region> polygons_;
double currentX_;
double currentY_;
double galvoImagingAngle_;
double dwellTime_us_;
long regionRepeats_;
double laserOnTime_ms_;
double executionTime_ms_;
// Helper functions.
double GalvoDegreesToRawPosition(double degrees);
double GalvoRawPositionToDegrees(double position);
int SetGalvoImagingAngle();
double SetDwellTime(double time_us);
//int SafeStoreSequence(tStringList sequenceList);
//void RunDummyCalibration(bool laser2);
};
#endif // _AndorFRAPPA_H_