Wasatch.VCPP 1.0.19
Visual C++ driver for Wasatch Photonics spectrometers
EEPROM.h
Go to the documentation of this file.
1
8#pragma once
9
10#include "FeatureMask.h"
11#include "Logger.h"
12
13#include <cstdint>
14#include <string>
15#include <vector>
16#include <set>
17#include <map>
18
19namespace WasatchVCPP
20{
22 class EEPROM
23 {
24 public:
25
27 // Datatypes
29
30 enum class Subformats
31 {
32 SUBFORMAT_USER_DATA = 0,
33 SUBFORMAT_RAMAN_INTENSITY_CALIBRATION = 1,
34 SUBFORMAT_SPLINE_WAVECAL = 2,
35 SUBFORMAT_COUNT = 3
36 };
37
39 // Constants
41
42 static const int MAX_PAGES = 8;
43 static const int PAGE_SIZE = 64;
44
46 // Methods
48
49 EEPROM(Logger& logger);
50
51 bool parse(const std::vector<std::vector<uint8_t> >& pages);
52 bool has_srm();
53
54 void stringifyAll();
55 void stringify(const std::string& name, const std::string& value);
56 bool hasLaserPowerCalibration(void);
57 float laserPowermWToPercent(float mW);
59 // Attributes
61
62 Logger& logger;
63 std::map<std::string, std::string> stringified;
64 std::vector<std::vector<uint8_t> > pages;
65
67 // EEPROM fields
69
70 uint8_t format = 0;
71
72 std::string model;
73 std::string serialNumber;
74 uint32_t baudRate = 0;
75 bool hasCooling = false;
76 bool hasBattery = false;
77 bool hasLaser = false;
78 float excitationNM = 0;
79 uint16_t slitSizeUM = 0;
80
81 uint16_t startupIntegrationTimeMS = 0;
82 int16_t startupDetectorTemperatureDegC = 0;
83 uint8_t startupTriggeringMode = 0;
84 float detectorGain = 0;
85 int16_t detectorOffset = 0;
86 float detectorGainOdd = 0;
87 bool srm_present = false;
88 int16_t detectorOffsetOdd = 0;
89
90 float wavecalCoeffs[5] = { 0 };
91 float degCToDACCoeffs[3] = { 0 };
92 int16_t detectorTempMax = 0;
93 int16_t detectorTempMin = 0;
94 float adcToDegCCoeffs[3] = { 0 };
95 int16_t thermistorResistanceAt298K = 0;
96 int16_t thermistorBeta = 0;
97 std::string calibrationDate;
98 std::string calibrationBy;
99
100 std::string detectorName;
101 uint16_t activePixelsHoriz = 0;
102 uint16_t activePixelsVert = 0;
103 uint16_t minIntegrationTimeMS = 0;
104 uint16_t maxIntegrationTimeMS = 0;
105 uint16_t actualPixelsHoriz = 0;
106 uint16_t ROIHorizStart = 0;
107 uint16_t ROIHorizEnd = 0;
108 uint16_t ROIVertRegionStart[3] = { 0 };
109 uint16_t ROIVertRegionEnd[3] = { 0 };
110 float linearityCoeffs[5] = { 0 };
111
112 float laserPowerCoeffs[4] = { 0 };
113 float maxLaserPowerMW = 0;
114 float minLaserPowerMW = 0;
115
116 std::vector<uint8_t> userData;
117 std::string userText;
118
119 std::set<int16_t> badPixels;
120 std::string productConfiguration;
121
122 uint8_t intensityCorrectionOrder = 0;
123 std::vector<float> intensityCorrectionCoeffs;
124
125 float avgResolution = 0;
126
127 Subformats subformat;
128
129 FeatureMask featureMask;
130 };
131}
132
interface of WasatchVCPP::FeatureMask
interface of WasatchVCPP::Logger
Internal class encapsulating the EEPROM and its fields.
Definition: EEPROM.h:23
Internal class encapsulating a 16-bit set of boolean flags which indicate whether a given spectromete...
Definition: FeatureMask.h:19
Internal logger (outputs to textfile if configured).
Definition: Logger.h:18
Namespace encapsulating the internal implementation of WasatchVCPP; customers would not normally acce...
Definition: Driver.h:26