10#ifdef USE_LIBUSB_WIN32
12#define WPVCPP_UDEV_TYPE usb_dev_handle
16#define WPVCPP_UDEV_TYPE libusb_device_handle
45 InvalidSpectrometer = -2,
46 InsufficientStorage = -3,
50 InvalidTemperature = -999,
51 InvalidOffset = -32768
65 std::vector<double> wavelengths;
66 std::vector<double> wavenumbers;
85 std::string firmwareVersion;
86 std::string fpgaVersion;
87 int integrationTimeMS = 1;
88 bool laserEnabled =
false;
89 bool laserPowerHighResolution =
true;
90 bool laserPowerRequireModulation =
false;
91 bool modEnabled =
false;
92 float laserPowerMw = 0.0;
93 float modWidthus = 0.0;
94 float modPeriodus = 0.0;
95 float laserPowerPerc = 0.0;
96 float lastAppliedLaserPower = 0.0;
97 float nextAppliedLaserPower = 0.0;
98 int detectorTECSetointDegC = ErrorCodes::InvalidTemperature;
99 bool srm_in_EEPROM =
false;
102 bool setIntegrationTimeMS(
unsigned long ms);
103 bool setLaserEnable(
bool flag);
104 bool setDetectorGain(
float value);
105 bool setDetectorGainOdd(
float value);
106 bool setDetectorOffset(int16_t value);
107 bool setDetectorOffsetOdd(int16_t value);
108 bool setDetectorTECEnable(
bool flag);
109 bool setDetectorTECSetpointDegC(
int value);
110 bool setHighGainModeEnable(
bool flag);
111 bool setLaserPowerPerc(
float percent);
112 std::string getFirmwareVersion();
113 std::string getFPGAVersion();
115 float getDetectorTemperatureDegC();
116 unsigned long getIntegrationTimeMS();
117 bool getLaserEnable();
120 int getDetectorOffset();
121 int getDetectorOffsetOdd();
122 bool getDetectorTECEnable();
123 int getDetectorTECSetpointDegC();
124 bool getHighGainModeEnable();
127 int sendCmd(uint8_t bRequest, uint16_t wValue = 0, uint16_t wIndex = 0, uint8_t* data = NULL,
int len = 0);
128 bool setModEnable(
bool flag);
129 bool setModPeriodus(
int us);
130 bool setModWidthus(
int us);
131 int getModEnabled(
void);
132 uint64_t getModPeriodus(
void);
133 bool setLaserPowermW(
float mW_in);
134 std::vector<uint8_t>
getCmd(uint8_t bRequest,
int len, uint16_t wIndex=0,
int fullLen=0);
137 std::vector<double> getSpectrum();
144 WPVCPP_UDEV_TYPE* udev =
nullptr;
146 std::vector<uint8_t> endpoints;
147 std::vector<uint8_t> bufSubspectrum;
148 int pixelsPerEndpoint = 0;
150 bool detectorTECSetpointHasBeenSet =
false;
151 bool acquiring =
false;
152 bool operationCancelled =
false;
153 int cancelledIntegrationTimeMS = 0;
154 bool lastAcquisitionWasCancelled =
false;
156 std::mutex mutAcquisition;
169 std::vector<uint16_t> getSubspectrum(uint8_t ep,
long allocatedMS);
170 long generateTotalWaitMS();
173 int sendCmd(uint8_t bRequest, uint16_t wValue, uint16_t wIndex, std::vector<uint8_t> data);
174 std::vector<uint8_t> getCmd2(uint16_t wValue,
int len, uint16_t wIndex=0,
int fullLen=0);
175 std::vector<uint8_t> getCmdReal(uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
int len,
int fullLen);
178 bool isSuccess(
unsigned char opcode,
int result);
179 uint16_t serializeGain(
float value);
180 float deserializeGain(
const std::vector<uint8_t>& data);
181 inline unsigned long clamp(
unsigned long value,
unsigned long min,
unsigned long max);
interface of WasatchVCPP::EEPROM
interface of WasatchVCPP::Logger
This is an internal class encapsulating state and control of all connected spectrometers.
Definition: Driver.h:55
Internal class encapsulating the EEPROM and its fields.
Definition: EEPROM.h:23
Internal logger (outputs to textfile if configured).
Definition: Logger.h:18
Internal class encapsulating state and control of one spectrometer.
Definition: Spectrometer.h:37
float getDetectorGain()
Definition: Spectrometer.cpp:807
float getDetectorGainOdd()
Definition: Spectrometer.cpp:811
int maxTimeoutMS
Other Wasatch drivers don't really have this concept...basically, all blocking reads to bulk endpoint...
Definition: Spectrometer.h:81
bool isInGaAs()
Definition: Spectrometer.cpp:1005
int sendCmd(uint8_t bRequest, uint16_t wValue=0, uint16_t wIndex=0, uint8_t *data=NULL, int len=0)
Write data to the spectrometer.
Definition: Spectrometer.cpp:855
int32_t getDetectorTemperatureRaw()
Definition: Spectrometer.cpp:483
std::vector< uint8_t > getCmd(uint8_t bRequest, int len, uint16_t wIndex=0, int fullLen=0)
This is the standard "getter opcode" function.
Definition: Spectrometer.cpp:900
ErrorCodes
keep synchronized with WasatchVCPP.h WP_ERROR_*
Definition: Spectrometer.h:42
bool cancelOperation(bool blocking)
Attempt to cancel an ongoing integration.
Definition: Spectrometer.cpp:525
Namespace encapsulating the internal implementation of WasatchVCPP; customers would not normally acce...
Definition: Driver.h:26