Wasatch.VCPP 1.0.19
Visual C++ driver for Wasatch Photonics spectrometers
WasatchVCPP.h
Go to the documentation of this file.
1
26#pragma once
27
29// //
30// C API //
31// //
33
34// This will ensure that when the LIBRARY is being built, it will EXPORT the
35// DLL symbols, and when the library is being USED (this header is being
36// included into a customer application which is being compiled), the DLL
37// symbols will be IMPORTED.
38#if _WINDOWS
39 #ifdef WASATCHVCPPLIB_EXPORTS
40 #define DLL_API __declspec(dllexport)
41 #else
42 #define DLL_API __declspec(dllimport)
43 #endif
44#else
45 #define DLL_API
46#endif
47
49// all functions should return one of these codes unless indicated otherwise
51
52#define WP_SUCCESS 0
53#define WP_ERROR -1
54#define WP_ERROR_INVALID_SPECTROMETER -2
55#define WP_ERROR_INSUFFICIENT_STORAGE -3
56#define WP_ERROR_NO_LASER -4
57#define WP_ERROR_NOT_INGAAS -5
58#define WP_ERROR_INVALID_GAIN -256
59#define WP_ERROR_INVALID_TEMPERATURE -999
60#define WP_ERROR_INVALID_OFFSET -32768
61
62// supported log levels
63#define WP_LOG_LEVEL_DEBUG 0
64#define WP_LOG_LEVEL_INFO 1
65#define WP_LOG_LEVEL_ERROR 2
66#define WP_LOG_LEVEL_NEVER 3
67
68// Although we're using a C++ compiler (as the library is written in C++), we
69// want these function symbols to be compiled with C linkage (no C++ mangling).
70// This will ensure that the broadest range of customer languages, compilers and
71// toolchains can link to the library.
72extern "C"
73{
75 // Utility
77
83 DLL_API int wp_set_logfile_path(const char* pathname, int len);
84
89 DLL_API int wp_set_log_level(int level);
90
96 DLL_API int wp_log_debug(const char* msg, int len);
97
102 DLL_API int wp_get_library_version(char* value, int len);
103
104 DLL_API int wp_get_vignetted_spectrum_length(int specIndex);
105
106 DLL_API int wp_apply_raman_intensity_factors(int specIndex, double* spectrum, int spectrum_len, double* factors, int factors_len, int start_pixel, int end_pixel);
107
108 DLL_API int wp_has_srm_calibration(int specIndex);
109
110 DLL_API int wp_get_raman_intensity_factors(int specIndex, double* factors, int factorsLen);
111
113 // Lifecycle
115
142 DLL_API int wp_open_all_spectrometers();
143
150 DLL_API int wp_get_number_of_spectrometers();
151
154 DLL_API int wp_close_all_spectrometers();
155
159 DLL_API int wp_close_spectrometer(int specIndex);
160
164 DLL_API void wp_destroy_driver();
165
167 // EEPROM
169
175 DLL_API int wp_get_eeprom_field_count(int specIndex);
176
184 DLL_API int wp_get_eeprom_field_name(int specIndex, int index, char *value, int len);
185
220 DLL_API int wp_get_eeprom(int specIndex, const char** names, const char** values, int len);
221
230 DLL_API int wp_get_eeprom_page(int specIndex, int page, unsigned char* buf, int len);
231
232 DLL_API int wp_write_eeprom_page(int specIndex, int pageIndex, unsigned char* data, int dataLen);
233
245 DLL_API int wp_get_eeprom_field(int specIndex, const char* name, char* value, int len);
246
248 // Convenience accessors
250
259 DLL_API int wp_get_pixels(int specIndex);
260
268 DLL_API int wp_get_model(int specIndex, char* value, int len);
269
276 DLL_API int wp_get_serial_number(int specIndex, char* value, int len);
277
284 DLL_API int wp_get_wavelengths(int specIndex, double* wavelengths, int len);
285
293 DLL_API int wp_get_wavelengths_float(int specIndex, float* wavelengths, int len);
294
301 DLL_API int wp_get_wavenumbers(int specIndex, double* wavenumbers, int len);
302
310 DLL_API int wp_get_wavenumbers_float(int specIndex, float* wavenumbers, int len);
311
313 // Acquisition
315
325 DLL_API int wp_get_spectrum(int specIndex, double* spectrum, int len);
326
336 DLL_API int wp_get_spectrum_float(int specIndex, float* spectrum, int len);
337
351 DLL_API int wp_cancel_operation(int specIndex, int blocking);
352
379 DLL_API int wp_set_max_timeout_ms(int specIndex, int maxTimeoutMS);
380
387 DLL_API int wp_get_max_timeout_ms(int specIndex);
388
390 // Opcodes
392
397 DLL_API int wp_set_integration_time_ms(int specIndex, unsigned long ms);
398
404 DLL_API int wp_set_laser_enable(int specIndex, int value);
405
410 DLL_API int wp_set_laser_power_perc(int specIndex, float percent);
411
416 DLL_API int wp_set_laser_power_mW(int specIndex, float power);
417
440 DLL_API int wp_set_detector_gain(int specIndex, float value);
441
458 DLL_API int wp_set_detector_gain_odd(int specIndex, float value);
459
467 DLL_API int wp_set_detector_offset(int specIndex, int value);
468
476 DLL_API int wp_set_detector_offset_odd(int specIndex, int value);
477
485 DLL_API int wp_set_detector_tec_enable(int specIndex, int value);
486
492 DLL_API int wp_set_detector_tec_setpoint_deg_c(int specIndex, int value);
493
500 DLL_API int wp_set_high_gain_mode_enable(int specIndex, int value);
501
508 DLL_API int wp_get_firmware_version(int specIndex, char* value, int len);
509
516 DLL_API int wp_get_fpga_version(int specIndex, char* value, int len);
517
523 DLL_API float wp_get_detector_temperature_deg_c(int specIndex);
524
529 DLL_API long wp_get_integration_time_ms(int specIndex);
530
535 DLL_API int wp_get_laser_enable(int specIndex);
536
541 DLL_API float wp_get_detector_gain(int specIndex);
542
547 DLL_API float wp_get_detector_gain_odd(int specIndex);
548
553 DLL_API int wp_get_detector_offset(int specIndex);
554
559 DLL_API int wp_get_detector_offset_odd(int specIndex);
560
565 DLL_API int wp_get_detector_tec_enable(int specIndex);
566
571 DLL_API int wp_get_detector_tec_setpoint_deg_c(int specIndex);
572
577 DLL_API int wp_get_high_gain_mode_enable(int specIndex);
578
604 DLL_API int wp_send_control_msg(int specIndex,
605 unsigned char bRequest,
606 unsigned int wValue,
607 unsigned int wIndex,
608 unsigned char* data,
609 int len);
610
635 DLL_API int wp_read_control_msg(int specIndex,
636 unsigned char bRequest,
637 unsigned int wIndex,
638 unsigned char* data,
639 int len);
640}
641
643// //
644// C++ API //
645// //
647
648// We only want the following classes declared (and defined, since they're
649// inline) if this file is being #included from "calling customer code" on the
650// client side. Therefore, we wrap it in the following #ifndef, which prevents
651// the block being processed if we're actually compiling the WasatchVCPP DLL
652// itself.
653//
654// It is important to prevent these from being compiled into the DLL, because
655// otherwise the customer could end up with two "copies" of the same classes
656// (one compiled into the DLL, the other instantiated into their own application
657// when they include this header). That could create linkage collisions down
658// the road. It MIGHT not be an issue, as long as we don't "dllexport" these
659// declarations (and we're not), but I'd rather not take the chance.
660//
661// Another reason why we don't want these classes compiled into the DLL is
662// because, for ABI boundary reasons, they'd be unusable to the customer
663// that way. To be useable by the customer application, C++ types and STL
664// containers must be instantiated and compiled directly into the client
665// executable.
666//
667// See README_ARCHITECTURE.md for more.
668
669#ifndef WASATCHVCPPLIB_EXPORTS
670
671#include <vector>
672#include <string>
673#include <map>
674
675namespace WasatchVCPP
676{
693 namespace Proxy
694 {
696 //
697 // Spectrometer Proxy
698 //
700
707 {
709 // Public methods
711 public:
712
715 {
716 this->specIndex = specIndex;
717
718 readEEPROMFields();
719
720 pixels = wp_get_pixels(specIndex); // or eepromFields["activePixelsHoriz"]
721 if (pixels <= 0)
722 return;
723
724 // pre-allocate a buffer for reading spectra
725 spectrumBuf.resize(pixels);
726
727 model = eepromFields["model"];
728 serialNumber = eepromFields["serialNumber"];
729
730 wavelengths.resize(pixels);
732
733 excitationNM = (float)atof(eepromFields["excitationNM"].c_str());
734 if (excitationNM > 0)
735 {
736 wavenumbers.resize(pixels);
738 }
739 }
740
742 {
743 close();
744 }
745
748 bool close()
749 {
750 bool success = false;
751 if (specIndex >= 0)
752 {
754 specIndex = -1;
755
756 wavelengths.clear();
757 wavenumbers.clear();
758 eepromFields.clear();
759 }
760
761 return success;
762 }
763
765 // Public attributes
767 public:
769 int pixels;
770 std::string model;
771 std::string serialNumber;
772
774 std::map<std::string, std::string> eepromFields;
775
776 std::vector<double> wavelengths;
777 std::vector<double> wavenumbers;
779
781 // Public methods
783 public:
787 bool setIntegrationTimeMS(unsigned long ms)
789
793 bool setLaserEnable(bool flag)
794 { return WP_SUCCESS == wp_set_laser_enable(specIndex, flag); }
795
797 bool setDetectorGain(float value)
798 { return WP_SUCCESS == wp_set_detector_gain(specIndex, value); }
799
800 bool setLaserPowerPerc(float value)
801 {
803 }
804
805 bool setLaserPowermW(float value)
806 {
808 }
809
811 bool setDetectorGainOdd(float value)
812 { return WP_SUCCESS == wp_set_detector_gain_odd(specIndex, value); }
813
815 bool setDetectorOffset(int16_t value)
816 { return WP_SUCCESS == wp_set_detector_offset(specIndex, value); }
817
819 bool setDetectorOffsetOdd(int16_t value)
820 { return WP_SUCCESS == wp_set_detector_offset_odd(specIndex, value); }
821
823 bool setDetectorTECEnable(bool flag)
824 { return WP_SUCCESS == wp_set_detector_tec_enable(specIndex, flag ? 1 : 0); }
825
829
831 bool setHighGainMode(bool flag)
832 { return WP_SUCCESS == wp_set_high_gain_mode_enable(specIndex, flag ? 1 : 0); }
833
837
840
843
846
849
852
855
858
861
864
867 int sendControlMsg(uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint8_t* data, int len)
868 { return wp_send_control_msg(specIndex, bRequest, wValue, wIndex, data, len); }
869
872 int readControlMsg(uint8_t bRequest, uint16_t wIndex, uint8_t* data, int len)
873 { return wp_read_control_msg(specIndex, bRequest, wIndex, data, len); }
874
876 bool setMaxTimeoutMS(int maxTimeoutMS)
877 { return WP_SUCCESS == wp_set_max_timeout_ms(specIndex, maxTimeoutMS); }
878
882
884 bool cancelOperation(bool blocking=false)
885 { return WP_SUCCESS == wp_cancel_operation(specIndex, blocking ? 1 : 0); }
886
888 std::string getFirmwareVersion()
889 {
890 char buf[16];
891 wp_get_firmware_version(specIndex, buf, sizeof(buf));
892 return std::string(buf);
893 }
894
896 std::string getFPGAVersion()
897 {
898 char buf[16];
899 wp_get_fpga_version(specIndex, buf, sizeof(buf));
900 return std::string(buf);
901 }
902
910 std::vector<double> getSpectrum()
911 {
912 std::vector<double> result;
913 if (pixels > 0)
914 if (WP_SUCCESS == wp_get_spectrum(specIndex, &(spectrumBuf[0]), pixels))
915 result = spectrumBuf;
916 return result;
917 }
918
920 std::vector<uint8_t> getEEPROMPage(int page)
921 {
922 const int len = 64;
923 std::vector<uint8_t> result;
924 uint8_t buf[len] = { 0 };
925
926 if (WP_SUCCESS != wp_get_eeprom_page(specIndex, page, buf, len))
927 return result;
928
929 result.resize(len);
930 for (int i = 0; i < len; i++)
931 result[i] = buf[i];
932 return result;
933 }
934
936 std::string getEEPROMFieldName(int index)
937 {
938 char buf[64] = { 0 };
939 if (WP_SUCCESS != wp_get_eeprom_field_name(specIndex, index, buf, sizeof(buf)))
940 return std::string();
941 return std::string(buf);
942 }
943
945 std::vector<float> getWavecalCoeffs()
946 {
947 std::vector<float> v;
948 for (int i = 0; i < 5; i++)
949 v.push_back(std::stof(eepromFields["wavecalCoeffs[" + std::to_string(i) + "]"]));
950 return v;
951 }
952
953 private:
954 bool readEEPROMFields()
955 {
957 if (count <= 0)
958 return false;
959
960 const char** names = (const char**)malloc(count * sizeof(const char*));
961 const char** values = (const char**)malloc(count * sizeof(const char*));
962
963 if (WP_SUCCESS != wp_get_eeprom(specIndex, names, values, count))
964 {
965 free(names);
966 free(values);
967 return false;
968 }
969
970 for (int i = 0; i < count; i++)
971 eepromFields.insert(std::make_pair(std::string(names[i]), std::string(values[i])));
972
973 free(names);
974 free(values);
975 return true;
976 }
977 std::vector<double> spectrumBuf;
978 };
979
981 //
982 // Proxy Driver
983 //
985
988 class Driver
989 {
991 // Public methods
993 public:
996
998 bool setLogfile(const std::string& pathname)
999 { return WP_SUCCESS == wp_set_logfile_path(pathname.c_str(), (int)pathname.size()); }
1000
1002 bool setLogLevel(int level)
1003 { return WP_SUCCESS == wp_set_log_level(level); }
1004
1006 std::string getLibraryVersion()
1007 {
1008 char buf[16];
1009 wp_get_library_version(buf, sizeof(buf));
1010 return std::string(buf);
1011 }
1012
1015 {
1016 spectrometers.clear();
1017
1018 auto enumeratedCount = wp_open_all_spectrometers();
1019 if (enumeratedCount <= 0)
1020 return 0;
1021
1022 int validCount = 0;
1023 for (int index = 0; index < enumeratedCount; index++)
1024 {
1025 auto pixels = wp_get_pixels(index);
1026 if (pixels > 0)
1027 {
1028 auto spec = new Proxy::Spectrometer(index);
1029 spectrometers.insert(std::make_pair(validCount, spec));
1030 validCount++;
1031 }
1032 }
1033
1034 return validCount;
1035 }
1036
1044 {
1045 auto iter = spectrometers.find(index);
1046 if (iter == spectrometers.end())
1047 return nullptr;
1048
1049 return iter->second;
1050 }
1051
1057 {
1058 for (auto iter = spectrometers.begin(); iter != spectrometers.end(); iter++)
1059 {
1060 delete iter->second;
1061 iter->second = nullptr;
1062 }
1063 spectrometers.clear();
1064
1066 }
1067
1069 void destroy()
1070 {
1073 }
1074
1076 // Public attributes
1078 public:
1079
1082
1084 // Private attributes
1086
1087 private:
1088 std::map<int, Spectrometer*> spectrometers;
1089 };
1090 }
1091}
1092#endif
DLL_API int wp_set_detector_gain(int specIndex, float value)
Set detector gain.
Definition: WasatchVCPPWrapper.cpp:466
DLL_API int wp_get_model(int specIndex, char *value, int len)
Get the selected spectrometer's model.
Definition: WasatchVCPPWrapper.cpp:121
DLL_API int wp_open_all_spectrometers()
Connects to and initializes all enumerated USB spectrometers.
Definition: WasatchVCPPWrapper.cpp:75
DLL_API long wp_get_integration_time_ms(int specIndex)
Get the curent integration time.
Definition: WasatchVCPPWrapper.cpp:585
DLL_API int wp_get_detector_offset(int specIndex)
Get the current detector offset (on InGaAs, even pixels only).
Definition: WasatchVCPPWrapper.cpp:621
DLL_API int wp_get_max_timeout_ms(int specIndex)
Get the maximum internal timeout when waiting on blocking USB operations.
Definition: WasatchVCPPWrapper.cpp:685
DLL_API int wp_set_detector_offset(int specIndex, int value)
Set detector offset.
Definition: WasatchVCPPWrapper.cpp:490
DLL_API int wp_get_eeprom_field_count(int specIndex)
This is provided so the caller can correctly size the 'names' and 'values' arrays for a call to wp_ge...
Definition: WasatchVCPPWrapper.cpp:260
DLL_API int wp_get_detector_tec_enable(int specIndex)
Reports whether the detector TEC is enabled.
Definition: WasatchVCPPWrapper.cpp:639
DLL_API int wp_set_laser_power_mW(int specIndex, float power)
Sets laser power as a mW value.
Definition: WasatchVCPPWrapper.cpp:452
DLL_API int wp_get_spectrum(int specIndex, double *spectrum, int len)
Read one spectrum from the selected spectrometer.
Definition: WasatchVCPPWrapper.cpp:203
DLL_API int wp_set_detector_tec_enable(int specIndex, int value)
Turn the detector TEC on or off.
Definition: WasatchVCPPWrapper.cpp:514
DLL_API int wp_get_firmware_version(int specIndex, char *value, int len)
Get the firmware version of the microcontroller (FX2 or ARM).
Definition: WasatchVCPPWrapper.cpp:550
DLL_API int wp_get_detector_tec_setpoint_deg_c(int specIndex)
Get the current detector TEC setpoint in degrees Celsius.
Definition: WasatchVCPPWrapper.cpp:648
DLL_API int wp_get_wavenumbers(int specIndex, double *wavenumbers, int len)
Get the selected spectrometer's calibrated x-axis in wavenumbers (1/cm)
Definition: WasatchVCPPWrapper.cpp:167
DLL_API int wp_set_detector_gain_odd(int specIndex, float value)
On InGaAs spectrometers, configures the gain for odd-numbered pixels.
Definition: WasatchVCPPWrapper.cpp:478
DLL_API int wp_get_wavenumbers_float(int specIndex, float *wavenumbers, int len)
Get the selected spectrometer's calibrated x-axis in wavenumbers (1/cm) as float.
Definition: WasatchVCPPWrapper.cpp:185
DLL_API int wp_close_all_spectrometers()
Closes all connected spectrometers.
Definition: WasatchVCPPWrapper.cpp:89
#define WP_SUCCESS
the function completed successfully
Definition: WasatchVCPP.h:52
DLL_API int wp_read_control_msg(int specIndex, unsigned char bRequest, unsigned int wIndex, unsigned char *data, int len)
Provide direct access to reading spectrometer opcodes via USB setup packets (endpoint 0 control.
Definition: WasatchVCPPWrapper.cpp:734
DLL_API int wp_get_eeprom_field(int specIndex, const char *name, char *value, int len)
Read one stringified EEPROM field by name.
Definition: WasatchVCPPWrapper.cpp:310
DLL_API int wp_get_eeprom_field_name(int specIndex, int index, char *value, int len)
Obtain the nth ordered EEPROM field name.
Definition: WasatchVCPPWrapper.cpp:269
DLL_API void wp_destroy_driver()
Permanently releases all objects from memory.
Definition: WasatchVCPPWrapper.cpp:94
DLL_API int wp_get_eeprom_page(int specIndex, int page, unsigned char *buf, int len)
Read one page of the EEPROM in raw binary form.
DLL_API int wp_log_debug(const char *msg, int len)
Allows calling code (and wrappers) to inject lines into the library's log.
Definition: WasatchVCPPWrapper.cpp:403
DLL_API int wp_get_spectrum_float(int specIndex, float *spectrum, int len)
Read one spectrum from the selected spectrometer as float.
Definition: WasatchVCPPWrapper.cpp:231
DLL_API int wp_get_number_of_spectrometers()
Returns number of spectrometers previously opened.
Definition: WasatchVCPPWrapper.cpp:108
DLL_API int wp_get_laser_enable(int specIndex)
Reports whether laser is currently enabled (firing, or configured to do so).
Definition: WasatchVCPPWrapper.cpp:594
DLL_API int wp_set_integration_time_ms(int specIndex, unsigned long ms)
Set the spectrometer's integration time in milliseconds.
Definition: WasatchVCPPWrapper.cpp:415
DLL_API int wp_get_fpga_version(int specIndex, char *value, int len)
Get the version of the FPGA.
Definition: WasatchVCPPWrapper.cpp:563
DLL_API float wp_get_detector_gain(int specIndex)
Get the current detector gain (on InGaAs, even pixels only).
Definition: WasatchVCPPWrapper.cpp:603
DLL_API int wp_set_log_level(int level)
Sets driver log level.
Definition: WasatchVCPPWrapper.cpp:392
DLL_API int wp_get_serial_number(int specIndex, char *value, int len)
Get the selected spectrometer's serial number.
Definition: WasatchVCPPWrapper.cpp:129
DLL_API int wp_set_detector_offset_odd(int specIndex, int value)
On InGaAs spectrometers, configures the offset for odd-numbered pixels.
Definition: WasatchVCPPWrapper.cpp:502
DLL_API int wp_set_high_gain_mode_enable(int specIndex, int value)
Enable or disable "high gain" mode on InGaAs detectors.
Definition: WasatchVCPPWrapper.cpp:538
DLL_API int wp_set_laser_power_perc(int specIndex, float percent)
Sets laser power as a percentage of max power.
Definition: WasatchVCPPWrapper.cpp:439
DLL_API int wp_get_eeprom(int specIndex, const char **names, const char **values, int len)
Read a table of all EEPROM fields, as strings.
Definition: WasatchVCPPWrapper.cpp:287
DLL_API int wp_cancel_operation(int specIndex, int blocking)
If an acquisition is currently in progress, cancel it.
Definition: WasatchVCPPWrapper.cpp:666
DLL_API int wp_get_high_gain_mode_enable(int specIndex)
Reports whether "high-gain mode" is currently enabled on InGaAs detectors.
Definition: WasatchVCPPWrapper.cpp:657
DLL_API int wp_get_pixels(int specIndex)
Returns the number of pixels in the selected spectrometer.o.
Definition: WasatchVCPPWrapper.cpp:113
DLL_API int wp_set_logfile_path(const char *pathname, int len)
Sets a pathname for WasatchVCPP to write a debug logfile.
Definition: WasatchVCPPWrapper.cpp:380
DLL_API float wp_get_detector_gain_odd(int specIndex)
Get the current detector gain for odd InGaAs pixels.
Definition: WasatchVCPPWrapper.cpp:612
DLL_API int wp_send_control_msg(int specIndex, unsigned char bRequest, unsigned int wValue, unsigned int wIndex, unsigned char *data, int len)
Provide direct access to writing spectrometer opcodes via USB setup packets (endpoint 0 control.
Definition: WasatchVCPPWrapper.cpp:724
DLL_API int wp_get_wavelengths_float(int specIndex, float *wavelengths, int len)
Get the selected spectrometer's calibrated wavelength x-axis in nanometers as float.
Definition: WasatchVCPPWrapper.cpp:152
DLL_API int wp_set_laser_enable(int specIndex, int value)
Turns the laser on or off.
Definition: WasatchVCPPWrapper.cpp:427
DLL_API float wp_get_detector_temperature_deg_c(int specIndex)
Get the detector temperature.
Definition: WasatchVCPPWrapper.cpp:576
DLL_API int wp_get_wavelengths(int specIndex, double *wavelengths, int len)
Get the selected spectrometer's calibrated wavelength x-axis in nanometers.
Definition: WasatchVCPPWrapper.cpp:137
DLL_API int wp_get_detector_offset_odd(int specIndex)
Get the current detector offset for odd InGaAs pixels.
Definition: WasatchVCPPWrapper.cpp:630
DLL_API int wp_set_max_timeout_ms(int specIndex, int maxTimeoutMS)
Configure the maximum internal timeout when waiting on blocking USB operations.
Definition: WasatchVCPPWrapper.cpp:675
DLL_API int wp_close_spectrometer(int specIndex)
Closes the specified spectrometer.
Definition: WasatchVCPPWrapper.cpp:80
DLL_API int wp_set_detector_tec_setpoint_deg_c(int specIndex, int value)
Set the detector TEC setpoint.
Definition: WasatchVCPPWrapper.cpp:526
DLL_API int wp_get_library_version(char *value, int len)
Obtains the version number of the WasatchVCPP library itself.
Definition: WasatchVCPPWrapper.cpp:103
A proxy customer-facing class providing an object-oriented / STL-based interface to command and contr...
Definition: WasatchVCPP.h:989
void destroy()
Definition: WasatchVCPP.h:1069
bool setLogLevel(int level)
Definition: WasatchVCPP.h:1002
Spectrometer * getSpectrometer(int index)
Retrieve a handle to one Spectrometer.
Definition: WasatchVCPP.h:1043
bool closeAllSpectrometers()
Definition: WasatchVCPP.h:1056
std::string getLibraryVersion()
Definition: WasatchVCPP.h:1006
int openAllSpectrometers()
Definition: WasatchVCPP.h:1014
bool setLogfile(const std::string &pathname)
Definition: WasatchVCPP.h:998
int numberOfSpectrometers
number of spectrometers found (set by openAllSpectrometers)
Definition: WasatchVCPP.h:1081
Driver()
Instantiate a Proxy::Driver.
Definition: WasatchVCPP.h:995
A proxy customer-facing class providing an object-oriented / STL-based interface to command and contr...
Definition: WasatchVCPP.h:707
bool getDetectorTECEnable()
Definition: WasatchVCPP.h:857
int sendControlMsg(uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint8_t *data, int len)
Definition: WasatchVCPP.h:867
int getDetectorTECSetpointDegC()
Definition: WasatchVCPP.h:860
bool setDetectorGain(float value)
Definition: WasatchVCPP.h:797
float getDetectorGain()
Definition: WasatchVCPP.h:845
Spectrometer(int specIndex)
instantiated by WasatchVCPP::Proxy::openAllSpectrometers
Definition: WasatchVCPP.h:714
int pixels
number of pixels
Definition: WasatchVCPP.h:769
std::vector< double > getSpectrum()
Retrieve one spectrum from the spectrometer.
Definition: WasatchVCPP.h:910
bool getLaserEnable()
Definition: WasatchVCPP.h:842
int getDetectorOffsetOdd()
Definition: WasatchVCPP.h:854
bool setIntegrationTimeMS(unsigned long ms)
set integration time
Definition: WasatchVCPP.h:787
std::string getEEPROMFieldName(int index)
Definition: WasatchVCPP.h:936
std::map< std::string, std::string > eepromFields
a dictionary of EEPROM name-value pairs rendered as strings
Definition: WasatchVCPP.h:774
std::vector< double > wavelengths
expanded wavecal in nm
Definition: WasatchVCPP.h:776
bool setMaxTimeoutMS(int maxTimeoutMS)
Definition: WasatchVCPP.h:876
std::vector< uint8_t > getEEPROMPage(int page)
Definition: WasatchVCPP.h:920
bool setLaserEnable(bool flag)
set laser firing state
Definition: WasatchVCPP.h:793
bool setHighGainMode(bool flag)
Definition: WasatchVCPP.h:831
bool cancelOperation(bool blocking=false)
Definition: WasatchVCPP.h:884
int readControlMsg(uint8_t bRequest, uint16_t wIndex, uint8_t *data, int len)
Definition: WasatchVCPP.h:872
float excitationNM
configured laser excitation wavelength (Raman-only)
Definition: WasatchVCPP.h:778
bool setDetectorTECSetpointDegC(int value)
Definition: WasatchVCPP.h:827
bool setDetectorTECEnable(bool flag)
Definition: WasatchVCPP.h:823
std::string serialNumber
serial number
Definition: WasatchVCPP.h:771
std::string getFirmwareVersion()
Definition: WasatchVCPP.h:888
std::string getFPGAVersion()
Definition: WasatchVCPP.h:896
int specIndex
index of this spectrometer
Definition: WasatchVCPP.h:768
bool setDetectorOffset(int16_t value)
Definition: WasatchVCPP.h:815
float getDetectorTemperatureDegC()
Definition: WasatchVCPP.h:835
bool setDetectorGainOdd(float value)
Definition: WasatchVCPP.h:811
float getDetectorGainOdd()
Definition: WasatchVCPP.h:848
bool setDetectorOffsetOdd(int16_t value)
Definition: WasatchVCPP.h:819
int getMaxTimeoutMS()
Definition: WasatchVCPP.h:880
long getIntegrationTimeMS()
Definition: WasatchVCPP.h:839
std::vector< double > wavenumbers
expanded wavecal in 1/cm (Raman-only)
Definition: WasatchVCPP.h:777
bool getHighGainModeEnable()
Definition: WasatchVCPP.h:863
bool close()
release resources associated with this spectrometer
Definition: WasatchVCPP.h:748
std::string model
model name
Definition: WasatchVCPP.h:770
int getDetectorOffset()
Definition: WasatchVCPP.h:851
std::vector< float > getWavecalCoeffs()
convenience accessor
Definition: WasatchVCPP.h:945
Namespace encapsulating the internal implementation of WasatchVCPP; customers would not normally acce...
Definition: Driver.h:26