Commit bff9d5aea9ffcede0ad18269dcf8d8a1f228bc1c

Authored by oliverhaag
1 parent 5f0cf293

Exact pixelation in GlScope and documentation updates

openhantek/ChangeLog
@@ -136,3 +136,10 @@ @@ -136,3 +136,10 @@
136 136
137 2011-12-02 Oliver Haag <oliver.haag@gmail.com> 137 2011-12-02 Oliver Haag <oliver.haag@gmail.com>
138 * Moved values needed to control gain into lists, initialized in connectDevice 138 * Moved values needed to control gain into lists, initialized in connectDevice
  139 +
  140 +2012-07-08 Oliver Haag <oliver.haag@gmail.com>
  141 +* Exact pixelation in GlScope and LevelSlider
  142 +
  143 +2012-09-01 Oliver Haag <oliver.haag@gmail.com>
  144 +* Updated documentation with first DSO-2250 details
  145 +* General documentation improvements
openhantek/mainpage.dox
@@ -50,7 +50,7 @@ After building it, you can just run the fwget.sh script inside the openhantek-ex @@ -50,7 +50,7 @@ After building it, you can just run the fwget.sh script inside the openhantek-ex
50 </pre> 50 </pre>
51 You can also do it manually by placing the DSO*1.SYS file into the same directory and running the built binary: 51 You can also do it manually by placing the DSO*1.SYS file into the same directory and running the built binary:
52 <pre> 52 <pre>
53 - $ ./openhantek-extractfw <driver file> 53 + $ ./openhantek-extractfw &lt;driver file&gt;
54 </pre> 54 </pre>
55 This should create two .hex files that should be placed into /usr/local/share/hantek/. 55 This should create two .hex files that should be placed into /usr/local/share/hantek/.
56 \subsection ssec_firmware Installing the firmware 56 \subsection ssec_firmware Installing the firmware
openhantek/src/dso.cpp
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 30
31 namespace Dso { 31 namespace Dso {
32 /// \brief Return string representation of the given channel mode. 32 /// \brief Return string representation of the given channel mode.
33 - /// \param mode The #ChannelMode that should be returned as string. 33 + /// \param mode The ::ChannelMode that should be returned as string.
34 /// \return The string that should be used in labels etc., empty when invalid. 34 /// \return The string that should be used in labels etc., empty when invalid.
35 QString channelModeString(ChannelMode mode) { 35 QString channelModeString(ChannelMode mode) {
36 switch(mode) { 36 switch(mode) {
@@ -44,7 +44,7 @@ namespace Dso { @@ -44,7 +44,7 @@ namespace Dso {
44 } 44 }
45 45
46 /// \brief Return string representation of the given graph format. 46 /// \brief Return string representation of the given graph format.
47 - /// \param format The #GraphFormat that should be returned as string. 47 + /// \param format The ::GraphFormat that should be returned as string.
48 /// \return The string that should be used in labels etc. 48 /// \return The string that should be used in labels etc.
49 QString graphFormatString(GraphFormat format) { 49 QString graphFormatString(GraphFormat format) {
50 switch(format) { 50 switch(format) {
@@ -58,7 +58,7 @@ namespace Dso { @@ -58,7 +58,7 @@ namespace Dso {
58 } 58 }
59 59
60 /// \brief Return string representation of the given channel coupling. 60 /// \brief Return string representation of the given channel coupling.
61 - /// \param coupling The #Coupling that should be returned as string. 61 + /// \param coupling The ::Coupling that should be returned as string.
62 /// \return The string that should be used in labels etc. 62 /// \return The string that should be used in labels etc.
63 QString couplingString(Coupling coupling) { 63 QString couplingString(Coupling coupling) {
64 switch(coupling) { 64 switch(coupling) {
@@ -74,7 +74,7 @@ namespace Dso { @@ -74,7 +74,7 @@ namespace Dso {
74 } 74 }
75 75
76 /// \brief Return string representation of the given math mode. 76 /// \brief Return string representation of the given math mode.
77 - /// \param mode The #MathMode that should be returned as string. 77 + /// \param mode The ::MathMode that should be returned as string.
78 /// \return The string that should be used in labels etc. 78 /// \return The string that should be used in labels etc.
79 QString mathModeString(MathMode mode) { 79 QString mathModeString(MathMode mode) {
80 switch(mode) { 80 switch(mode) {
@@ -90,7 +90,7 @@ namespace Dso { @@ -90,7 +90,7 @@ namespace Dso {
90 } 90 }
91 91
92 /// \brief Return string representation of the given trigger mode. 92 /// \brief Return string representation of the given trigger mode.
93 - /// \param mode The #TriggerMode that should be returned as string. 93 + /// \param mode The ::TriggerMode that should be returned as string.
94 /// \return The string that should be used in labels etc. 94 /// \return The string that should be used in labels etc.
95 QString triggerModeString(TriggerMode mode) { 95 QString triggerModeString(TriggerMode mode) {
96 switch(mode) { 96 switch(mode) {
@@ -106,7 +106,7 @@ namespace Dso { @@ -106,7 +106,7 @@ namespace Dso {
106 } 106 }
107 107
108 /// \brief Return string representation of the given trigger slope. 108 /// \brief Return string representation of the given trigger slope.
109 - /// \param slope The #Slope that should be returned as string. 109 + /// \param slope The ::Slope that should be returned as string.
110 /// \return The string that should be used in labels etc. 110 /// \return The string that should be used in labels etc.
111 QString slopeString(Slope slope) { 111 QString slopeString(Slope slope) {
112 switch(slope) { 112 switch(slope) {
@@ -120,7 +120,7 @@ namespace Dso { @@ -120,7 +120,7 @@ namespace Dso {
120 } 120 }
121 121
122 /// \brief Return string representation of the given dft window function. 122 /// \brief Return string representation of the given dft window function.
123 - /// \param window The #WindowFunction that should be returned as string. 123 + /// \param window The ::WindowFunction that should be returned as string.
124 /// \return The string that should be used in labels etc. 124 /// \return The string that should be used in labels etc.
125 QString windowFunctionString(WindowFunction window) { 125 QString windowFunctionString(WindowFunction window) {
126 switch(window) { 126 switch(window) {
@@ -160,7 +160,7 @@ namespace Dso { @@ -160,7 +160,7 @@ namespace Dso {
160 } 160 }
161 161
162 /// \brief Return string representation of the given graph interpolation mode. 162 /// \brief Return string representation of the given graph interpolation mode.
163 - /// \param interpolation The #InterpolationMode that should be returned as string. 163 + /// \param interpolation The ::InterpolationMode that should be returned as string.
164 /// \return The string that should be used in labels etc. 164 /// \return The string that should be used in labels etc.
165 QString interpolationModeString(InterpolationMode interpolation) { 165 QString interpolationModeString(InterpolationMode interpolation) {
166 switch(interpolation) { 166 switch(interpolation) {
openhantek/src/dsowidget.h
@@ -110,7 +110,7 @@ class DsoWidget : public QWidget { @@ -110,7 +110,7 @@ class DsoWidget : public QWidget {
110 void updateSpectrumUsed(unsigned int channel, bool used); 110 void updateSpectrumUsed(unsigned int channel, bool used);
111 111
112 // Vertical axis 112 // Vertical axis
113 - void updateVoltageCoupling(unsigned int channel); 113 + void updateVoltageCoupling(unsigned int channel);
114 void updateMathMode(); 114 void updateMathMode();
115 void updateVoltageGain(unsigned int channel); 115 void updateVoltageGain(unsigned int channel);
116 void updateVoltageUsed(unsigned int channel, bool used); 116 void updateVoltageUsed(unsigned int channel, bool used);
openhantek/src/glgenerator.cpp
@@ -310,13 +310,12 @@ void GlGenerator::generateGrid() { @@ -310,13 +310,12 @@ void GlGenerator::generateGrid() {
310 310
311 // Border 311 // Border
312 this->vaGrid[2].setSize(4 * 2); 312 this->vaGrid[2].setSize(4 * 2);
313 - // The 1e-4 offsets avoid that the border is outside our drawing area  
314 - this->vaGrid[2].data[0] = -DIVS_TIME / 2 + 1e-4;  
315 - this->vaGrid[2].data[1] = -DIVS_VOLTAGE / 2 + 1e-4;  
316 - this->vaGrid[2].data[2] = DIVS_TIME / 2 - 1e-4;  
317 - this->vaGrid[2].data[3] = -DIVS_VOLTAGE / 2 + 1e-4;  
318 - this->vaGrid[2].data[4] = DIVS_TIME / 2 - 1e-4;  
319 - this->vaGrid[2].data[5] = DIVS_VOLTAGE / 2 - 1e-4;  
320 - this->vaGrid[2].data[6] = -DIVS_TIME / 2 + 1e-4;  
321 - this->vaGrid[2].data[7] = DIVS_VOLTAGE / 2 - 1e-4; 313 + this->vaGrid[2].data[0] = -DIVS_TIME / 2;
  314 + this->vaGrid[2].data[1] = -DIVS_VOLTAGE / 2;
  315 + this->vaGrid[2].data[2] = DIVS_TIME / 2;
  316 + this->vaGrid[2].data[3] = -DIVS_VOLTAGE / 2;
  317 + this->vaGrid[2].data[4] = DIVS_TIME / 2;
  318 + this->vaGrid[2].data[5] = DIVS_VOLTAGE / 2;
  319 + this->vaGrid[2].data[6] = -DIVS_TIME / 2;
  320 + this->vaGrid[2].data[7] = DIVS_VOLTAGE / 2;
322 } 321 }
openhantek/src/glscope.cpp
@@ -181,10 +181,15 @@ void GlScope::paintGL() { @@ -181,10 +181,15 @@ void GlScope::paintGL() {
181 /// \param height The new height of the widget. 181 /// \param height The new height of the widget.
182 void GlScope::resizeGL(int width, int height) { 182 void GlScope::resizeGL(int width, int height) {
183 glViewport(0, 0, (GLint) width, (GLint) height); 183 glViewport(0, 0, (GLint) width, (GLint) height);
184 - //glViewport(1, 0, (GLint) width - 1, (GLint) height - 1); 184 +
185 glMatrixMode(GL_PROJECTION); 185 glMatrixMode(GL_PROJECTION);
  186 +
  187 + // Set axes to div-scale and apply correction for exact pixelization
186 glLoadIdentity(); 188 glLoadIdentity();
187 - glOrtho(-DIVS_TIME / 2, DIVS_TIME / 2, -DIVS_VOLTAGE / 2, DIVS_VOLTAGE / 2, -1.0, 1.0); 189 + GLdouble pixelizationWidthCorrection = (width > 0) ? (GLdouble) width / (width - 1) : 1;
  190 + GLdouble pixelizationHeightCorrection = (height > 0) ? (GLdouble) height / (height - 1) : 1;
  191 + glOrtho(-(DIVS_TIME / 2) * pixelizationWidthCorrection, (DIVS_TIME / 2) * pixelizationWidthCorrection, -(DIVS_VOLTAGE / 2) * pixelizationHeightCorrection, (DIVS_VOLTAGE / 2) * pixelizationHeightCorrection, -1.0, 1.0);
  192 +
188 glMatrixMode(GL_MODELVIEW); 193 glMatrixMode(GL_MODELVIEW);
189 } 194 }
190 195
openhantek/src/hantek/control.cpp
@@ -285,14 +285,14 @@ namespace Hantek { @@ -285,14 +285,14 @@ namespace Hantek {
285 /// \param value The data value that contains the trigger point. 285 /// \param value The data value that contains the trigger point.
286 /// \return The calculated trigger point for the given data. 286 /// \return The calculated trigger point for the given data.
287 unsigned short int Control::calculateTriggerPoint(unsigned short int value) { 287 unsigned short int Control::calculateTriggerPoint(unsigned short int value) {
288 - unsigned short int result = value;  
289 - 288 + unsigned short int result = value;
  289 +
290 // Each set bit inverts all bits with a lower value 290 // Each set bit inverts all bits with a lower value
291 for(unsigned short int bitValue = 1; bitValue; bitValue <<= 1) 291 for(unsigned short int bitValue = 1; bitValue; bitValue <<= 1)
292 if(result & bitValue) 292 if(result & bitValue)
293 result ^= bitValue - 1; 293 result ^= bitValue - 1;
294 -  
295 - return result; 294 +
  295 + return result;
296 } 296 }
297 297
298 /// \brief Gets the current state. 298 /// \brief Gets the current state.
@@ -546,7 +546,6 @@ namespace Hantek { @@ -546,7 +546,6 @@ namespace Hantek {
546 // Determine the command version we need for this model 546 // Determine the command version we need for this model
547 bool unsupported = false; 547 bool unsupported = false;
548 switch(this->device->getModel()) { 548 switch(this->device->getModel()) {
549 - case MODEL_DSO2100:  
550 case MODEL_DSO2150: 549 case MODEL_DSO2150:
551 unsupported = true; 550 unsupported = true;
552 551
openhantek/src/hantek/control.h
@@ -72,7 +72,7 @@ namespace Hantek { @@ -72,7 +72,7 @@ namespace Hantek {
72 }; 72 };
73 73
74 ////////////////////////////////////////////////////////////////////////////// 74 //////////////////////////////////////////////////////////////////////////////
75 - /// \struct ControlSpecificationCommandsControlValues hantek/control.h 75 + /// \struct ControlSpecificationCommandsValues hantek/control.h
76 /// \brief Stores the control value codes used for this device. 76 /// \brief Stores the control value codes used for this device.
77 struct ControlSpecificationCommandsValues { 77 struct ControlSpecificationCommandsValues {
78 ControlValue offsetLimits; ///< Code for channel offset limits 78 ControlValue offsetLimits; ///< Code for channel offset limits
@@ -137,7 +137,7 @@ namespace Hantek { @@ -137,7 +137,7 @@ namespace Hantek {
137 }; 137 };
138 138
139 ////////////////////////////////////////////////////////////////////////////// 139 //////////////////////////////////////////////////////////////////////////////
140 - /// \struct ControlSettingsSamplerate hantek/control.h 140 + /// \struct ControlSettingsTrigger hantek/control.h
141 /// \brief Stores the current trigger settings of the device. 141 /// \brief Stores the current trigger settings of the device.
142 struct ControlSettingsTrigger { 142 struct ControlSettingsTrigger {
143 double level[HANTEK_CHANNELS]; ///< The trigger level for each channel in V 143 double level[HANTEK_CHANNELS]; ///< The trigger level for each channel in V
@@ -150,7 +150,7 @@ namespace Hantek { @@ -150,7 +150,7 @@ namespace Hantek {
150 }; 150 };
151 151
152 ////////////////////////////////////////////////////////////////////////////// 152 //////////////////////////////////////////////////////////////////////////////
153 - /// \struct ControlSettingsSamplerate hantek/control.h 153 + /// \struct ControlSettingsVoltage hantek/control.h
154 /// \brief Stores the current amplification settings of the device. 154 /// \brief Stores the current amplification settings of the device.
155 struct ControlSettingsVoltage { 155 struct ControlSettingsVoltage {
156 unsigned int gain; ///< The gain id 156 unsigned int gain; ///< The gain id
openhantek/src/hantek/device.cpp
@@ -460,7 +460,7 @@ namespace Hantek { @@ -460,7 +460,7 @@ namespace Hantek {
460 } 460 }
461 461
462 /// \brief Gets the speed of the connection. 462 /// \brief Gets the speed of the connection.
463 - /// \return The #ConnectionSpeed of the USB connection. 463 + /// \return The ::ConnectionSpeed of the USB connection.
464 int Device::getConnectionSpeed() { 464 int Device::getConnectionSpeed() {
465 int errorCode; 465 int errorCode;
466 ControlGetSpeed response; 466 ControlGetSpeed response;
@@ -473,7 +473,7 @@ namespace Hantek { @@ -473,7 +473,7 @@ namespace Hantek {
473 } 473 }
474 474
475 /// \brief Get the oscilloscope model. 475 /// \brief Get the oscilloscope model.
476 - /// \return The #Model of the connected Hantek DSO. 476 + /// \return The ::Model of the connected Hantek DSO.
477 Model Device::getModel() { 477 Model Device::getModel() {
478 return this->model; 478 return this->model;
479 } 479 }
openhantek/src/hantek/device.h
@@ -79,8 +79,8 @@ namespace Hantek { @@ -79,8 +79,8 @@ namespace Hantek {
79 79
80 protected: 80 protected:
81 // Lists for enums 81 // Lists for enums
82 - QList<unsigned short int> modelIds; ///< Product ID for each #Model  
83 - QStringList modelStrings; ///< The name as QString for each #Model 82 + QList<unsigned short int> modelIds; ///< Product ID for each ::Model
  83 + QStringList modelStrings; ///< The name as QString for each ::Model
84 84
85 // Command buffers 85 // Command buffers
86 ControlBeginCommand *beginCommandControl; ///< Buffer for the CONTROL_BEGINCOMMAND control command 86 ControlBeginCommand *beginCommandControl; ///< Buffer for the CONTROL_BEGINCOMMAND control command
openhantek/src/hantek/types.cpp
@@ -135,13 +135,13 @@ namespace Hantek { @@ -135,13 +135,13 @@ namespace Hantek {
135 } 135 }
136 136
137 /// \brief Get the bufferSize value in Tsr1Bits. 137 /// \brief Get the bufferSize value in Tsr1Bits.
138 - /// \return The #BufferSizeId value. 138 + /// \return The ::BufferSizeId value.
139 unsigned char BulkSetTriggerAndSamplerate::getBufferSize() { 139 unsigned char BulkSetTriggerAndSamplerate::getBufferSize() {
140 return ((Tsr1Bits *) &(this->array[2]))->bufferSize; 140 return ((Tsr1Bits *) &(this->array[2]))->bufferSize;
141 } 141 }
142 142
143 /// \brief Set the bufferSize in Tsr1Bits to the given value. 143 /// \brief Set the bufferSize in Tsr1Bits to the given value.
144 - /// \param value The new #BufferSizeId value. 144 + /// \param value The new ::BufferSizeId value.
145 void BulkSetTriggerAndSamplerate::setBufferSize(unsigned char value) { 145 void BulkSetTriggerAndSamplerate::setBufferSize(unsigned char value) {
146 ((Tsr1Bits *) &(this->array[2]))->bufferSize = value; 146 ((Tsr1Bits *) &(this->array[2]))->bufferSize = value;
147 } 147 }
@@ -623,7 +623,7 @@ namespace Hantek { @@ -623,7 +623,7 @@ namespace Hantek {
623 /// \param triggerPositionPost The TriggerPositionPost value. 623 /// \param triggerPositionPost The TriggerPositionPost value.
624 /// \param usedPre The TriggerPositionUsedPre value. 624 /// \param usedPre The TriggerPositionUsedPre value.
625 /// \param usedPost The TriggerPositionUsedPost value. 625 /// \param usedPost The TriggerPositionUsedPost value.
626 - /// \param bufferSize The #BufferSizeId value. 626 + /// \param bufferSize The ::BufferSizeId value.
627 BulkSetBuffer5200::BulkSetBuffer5200(unsigned short int triggerPositionPre, unsigned short int triggerPositionPost, unsigned char usedPre, unsigned char usedPost, unsigned char bufferSize) : Helper::DataArray<unsigned char>(10) { 627 BulkSetBuffer5200::BulkSetBuffer5200(unsigned short int triggerPositionPre, unsigned short int triggerPositionPost, unsigned char usedPre, unsigned char usedPost, unsigned char bufferSize) : Helper::DataArray<unsigned char>(10) {
628 this->init(); 628 this->init();
629 629
@@ -661,37 +661,37 @@ namespace Hantek { @@ -661,37 +661,37 @@ namespace Hantek {
661 } 661 }
662 662
663 /// \brief Get the TriggerPositionUsedPre value. 663 /// \brief Get the TriggerPositionUsedPre value.
664 - /// \return The #DTriggerPositionUsed value for the pre position. 664 + /// \return The ::DTriggerPositionUsed value for the pre position.
665 unsigned char BulkSetBuffer5200::getUsedPre() { 665 unsigned char BulkSetBuffer5200::getUsedPre() {
666 return this->array[4]; 666 return this->array[4];
667 } 667 }
668 668
669 /// \brief Set the TriggerPositionUsedPre to the given value. 669 /// \brief Set the TriggerPositionUsedPre to the given value.
670 - /// \param value The new #DTriggerPositionUsed value for the pre position. 670 + /// \param value The new ::DTriggerPositionUsed value for the pre position.
671 void BulkSetBuffer5200::setUsedPre(unsigned char value) { 671 void BulkSetBuffer5200::setUsedPre(unsigned char value) {
672 this->array[4] = value; 672 this->array[4] = value;
673 } 673 }
674 674
675 /// \brief Get the TriggerPositionUsedPost value. 675 /// \brief Get the TriggerPositionUsedPost value.
676 - /// \return The #DTriggerPositionUsed value for the post position. 676 + /// \return The ::DTriggerPositionUsed value for the post position.
677 unsigned char BulkSetBuffer5200::getUsedPost() { 677 unsigned char BulkSetBuffer5200::getUsedPost() {
678 return ((DBufferBits *) &(this->array[8]))->triggerPositionUsed; 678 return ((DBufferBits *) &(this->array[8]))->triggerPositionUsed;
679 } 679 }
680 680
681 /// \brief Set the TriggerPositionUsedPost to the given value. 681 /// \brief Set the TriggerPositionUsedPost to the given value.
682 - /// \param value The new #DTriggerPositionUsed value for the post position. 682 + /// \param value The new ::DTriggerPositionUsed value for the post position.
683 void BulkSetBuffer5200::setUsedPost(unsigned char value) { 683 void BulkSetBuffer5200::setUsedPost(unsigned char value) {
684 ((DBufferBits *) &(this->array[8]))->triggerPositionUsed = value; 684 ((DBufferBits *) &(this->array[8]))->triggerPositionUsed = value;
685 } 685 }
686 686
687 /// \brief Get the bufferSize value in DBufferBits. 687 /// \brief Get the bufferSize value in DBufferBits.
688 - /// \return The #BufferSizeId value. 688 + /// \return The ::BufferSizeId value.
689 unsigned char BulkSetBuffer5200::getBufferSize() { 689 unsigned char BulkSetBuffer5200::getBufferSize() {
690 return ((DBufferBits *) &(this->array[8]))->bufferSize; 690 return ((DBufferBits *) &(this->array[8]))->bufferSize;
691 } 691 }
692 692
693 /// \brief Set the bufferSize in DBufferBits to the given value. 693 /// \brief Set the bufferSize in DBufferBits to the given value.
694 - /// \param value The new #BufferSizeId value. 694 + /// \param value The new ::BufferSizeId value.
695 void BulkSetBuffer5200::setBufferSize(unsigned char value) { 695 void BulkSetBuffer5200::setBufferSize(unsigned char value) {
696 ((DBufferBits *) &(this->array[8]))->bufferSize = value; 696 ((DBufferBits *) &(this->array[8]))->bufferSize = value;
697 } 697 }
@@ -728,25 +728,25 @@ namespace Hantek { @@ -728,25 +728,25 @@ namespace Hantek {
728 } 728 }
729 729
730 /// \brief Get the triggerSource value in ETsrBits. 730 /// \brief Get the triggerSource value in ETsrBits.
731 - /// \return The #TriggerSource value. 731 + /// \return The ::TriggerSource value.
732 unsigned char BulkSetTrigger5200::getTriggerSource() { 732 unsigned char BulkSetTrigger5200::getTriggerSource() {
733 return ((ETsrBits *) &(this->array[2]))->triggerSource; 733 return ((ETsrBits *) &(this->array[2]))->triggerSource;
734 } 734 }
735 735
736 /// \brief Set the triggerSource in ETsrBits to the given value. 736 /// \brief Set the triggerSource in ETsrBits to the given value.
737 - /// \param value The new #TriggerSource value. 737 + /// \param value The new ::TriggerSource value.
738 void BulkSetTrigger5200::setTriggerSource(unsigned char value) { 738 void BulkSetTrigger5200::setTriggerSource(unsigned char value) {
739 ((ETsrBits *) &(this->array[2]))->triggerSource = value; 739 ((ETsrBits *) &(this->array[2]))->triggerSource = value;
740 } 740 }
741 741
742 /// \brief Get the usedChannels value in ETsrBits. 742 /// \brief Get the usedChannels value in ETsrBits.
743 - /// \return The #UsedChannels value. 743 + /// \return The ::UsedChannels value.
744 unsigned char BulkSetTrigger5200::getUsedChannels() { 744 unsigned char BulkSetTrigger5200::getUsedChannels() {
745 return ((ETsrBits *) &(this->array[2]))->usedChannels; 745 return ((ETsrBits *) &(this->array[2]))->usedChannels;
746 } 746 }
747 747
748 /// \brief Set the usedChannels in ETsrBits to the given value. 748 /// \brief Set the usedChannels in ETsrBits to the given value.
749 - /// \param value The new #UsedChannels value. 749 + /// \param value The new ::UsedChannels value.
750 void BulkSetTrigger5200::setUsedChannels(unsigned char value) { 750 void BulkSetTrigger5200::setUsedChannels(unsigned char value) {
751 ((ETsrBits *) &(this->array[2]))->usedChannels = value; 751 ((ETsrBits *) &(this->array[2]))->usedChannels = value;
752 } 752 }
openhantek/src/hantek/types.h
@@ -51,6 +51,7 @@ namespace Hantek { @@ -51,6 +51,7 @@ namespace Hantek {
51 /// \brief All supported bulk commands. 51 /// \brief All supported bulk commands.
52 /// Indicies given in square brackets specify byte numbers in little endian format. 52 /// Indicies given in square brackets specify byte numbers in little endian format.
53 enum BulkCode { 53 enum BulkCode {
  54 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
54 /// <p> 55 /// <p>
55 /// This command sets channel and trigger filter: 56 /// This command sets channel and trigger filter:
56 /// <table> 57 /// <table>
@@ -66,8 +67,10 @@ namespace Hantek { @@ -66,8 +67,10 @@ namespace Hantek {
66 /// </tr> 67 /// </tr>
67 /// </table> 68 /// </table>
68 /// </p> 69 /// </p>
  70 + /// <p><br /></p>
69 BULK_SETFILTER, 71 BULK_SETFILTER,
70 72
  73 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150]</em>
71 /// <p> 74 /// <p>
72 /// This command sets trigger and timebase: 75 /// This command sets trigger and timebase:
73 /// <table> 76 /// <table>
@@ -101,8 +104,10 @@ namespace Hantek { @@ -101,8 +104,10 @@ namespace Hantek {
101 /// <p> 104 /// <p>
102 /// The TriggerPosition sets the position of the pretrigger in samples. The left side (0 %) is 0x77660 when using the small buffer and 0x78000 when using the large buffer. 105 /// The TriggerPosition sets the position of the pretrigger in samples. The left side (0 %) is 0x77660 when using the small buffer and 0x78000 when using the large buffer.
103 /// </p> 106 /// </p>
  107 + /// <p><br /></p>
104 BULK_SETTRIGGERANDSAMPLERATE, 108 BULK_SETTRIGGERANDSAMPLERATE,
105 109
  110 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
106 /// <p> 111 /// <p>
107 /// This command forces triggering: 112 /// This command forces triggering:
108 /// <table> 113 /// <table>
@@ -112,8 +117,10 @@ namespace Hantek { @@ -112,8 +117,10 @@ namespace Hantek {
112 /// </tr> 117 /// </tr>
113 /// </table> 118 /// </table>
114 /// </p> 119 /// </p>
  120 + /// <p><br /></p>
115 BULK_FORCETRIGGER, 121 BULK_FORCETRIGGER,
116 122
  123 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
117 /// <p> 124 /// <p>
118 /// This command starts to capture data: 125 /// This command starts to capture data:
119 /// <table> 126 /// <table>
@@ -123,8 +130,10 @@ namespace Hantek { @@ -123,8 +130,10 @@ namespace Hantek {
123 /// </tr> 130 /// </tr>
124 /// </table> 131 /// </table>
125 /// </p> 132 /// </p>
  133 + /// <p><br /></p>
126 BULK_STARTSAMPLING, 134 BULK_STARTSAMPLING,
127 135
  136 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
128 /// <p> 137 /// <p>
129 /// This command sets the trigger: 138 /// This command sets the trigger:
130 /// <table> 139 /// <table>
@@ -134,8 +143,10 @@ namespace Hantek { @@ -134,8 +143,10 @@ namespace Hantek {
134 /// </tr> 143 /// </tr>
135 /// </table> 144 /// </table>
136 /// </p> 145 /// </p>
  146 + /// <p><br /></p>
137 BULK_ENABLETRIGGER, 147 BULK_ENABLETRIGGER,
138 148
  149 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
139 /// <p> 150 /// <p>
140 /// This command reads data from the hardware: 151 /// This command reads data from the hardware:
141 /// <table> 152 /// <table>
@@ -180,8 +191,10 @@ namespace Hantek { @@ -180,8 +191,10 @@ namespace Hantek {
180 /// </tr> 191 /// </tr>
181 /// </table> 192 /// </table>
182 /// </p> 193 /// </p>
  194 + /// <p><br /></p>
183 BULK_GETDATA, 195 BULK_GETDATA,
184 196
  197 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
185 /// <p> 198 /// <p>
186 /// This command checks the capture state: 199 /// This command checks the capture state:
187 /// <table> 200 /// <table>
@@ -195,7 +208,7 @@ namespace Hantek { @@ -195,7 +208,7 @@ namespace Hantek {
195 /// The oscilloscope returns it's capture state and the trigger point. Not sure about this, looks like 248 16-bit words with nearly constant values. These can be converted to the start address of the data in the buffer (See Hantek::Control::calculateTriggerPoint): 208 /// The oscilloscope returns it's capture state and the trigger point. Not sure about this, looks like 248 16-bit words with nearly constant values. These can be converted to the start address of the data in the buffer (See Hantek::Control::calculateTriggerPoint):
196 /// <table> 209 /// <table>
197 /// <tr> 210 /// <tr>
198 - /// <td>#CaptureState</td> 211 + /// <td>::CaptureState</td>
199 /// <td>0x00</td> 212 /// <td>0x00</td>
200 /// <td>TriggerPoint[0]</td> 213 /// <td>TriggerPoint[0]</td>
201 /// <td>TriggerPoint[1]</td> 214 /// <td>TriggerPoint[1]</td>
@@ -203,8 +216,10 @@ namespace Hantek { @@ -203,8 +216,10 @@ namespace Hantek {
203 /// </tr> 216 /// </tr>
204 /// </table> 217 /// </table>
205 /// </p> 218 /// </p>
  219 + /// <p><br /></p>
206 BULK_GETCAPTURESTATE, 220 BULK_GETCAPTURESTATE,
207 221
  222 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
208 /// <p> 223 /// <p>
209 /// This command sets the gain: 224 /// This command sets the gain:
210 /// <table> 225 /// <table>
@@ -219,10 +234,12 @@ namespace Hantek { @@ -219,10 +234,12 @@ namespace Hantek {
219 /// <td>0x00</td> 234 /// <td>0x00</td>
220 /// </tr> 235 /// </tr>
221 /// </table> 236 /// </table>
222 - /// It is usually used in combination with #CONTROL_SETRELAYS. 237 + /// It is usually used in combination with ::CONTROL_SETRELAYS.
223 /// </p> 238 /// </p>
  239 + /// <p><br /></p>
224 BULK_SETGAIN, 240 BULK_SETGAIN,
225 241
  242 + /// <em>[]</em>
226 /// <p> 243 /// <p>
227 /// This command sets the logical data (Not used in official Hantek software): 244 /// This command sets the logical data (Not used in official Hantek software):
228 /// <table> 245 /// <table>
@@ -238,8 +255,10 @@ namespace Hantek { @@ -238,8 +255,10 @@ namespace Hantek {
238 /// </tr> 255 /// </tr>
239 /// </table> 256 /// </table>
240 /// </p> 257 /// </p>
  258 + /// <p><br /></p>
241 BULK_SETLOGICALDATA, 259 BULK_SETLOGICALDATA,
242 260
  261 + /// <em>[::MODEL_DSO2250]</em>
243 /// <p> 262 /// <p>
244 /// This command reads the logical data (Not used in official Hantek software): 263 /// This command reads the logical data (Not used in official Hantek software):
245 /// <table> 264 /// <table>
@@ -258,10 +277,12 @@ namespace Hantek { @@ -258,10 +277,12 @@ namespace Hantek {
258 /// </tr> 277 /// </tr>
259 /// </table> 278 /// </table>
260 /// </p> 279 /// </p>
  280 + /// <p><br /></p>
261 BULK_GETLOGICALDATA, 281 BULK_GETLOGICALDATA,
262 282
  283 + /// <em>[]</em>
263 /// <p> 284 /// <p>
264 - /// This command isn't used for the DSO-2090 and DSO-5200: 285 + /// This command isn't used for any supported model:
265 /// <table> 286 /// <table>
266 /// <tr> 287 /// <tr>
267 /// <td>0x0a</td> 288 /// <td>0x0a</td>
@@ -269,19 +290,25 @@ namespace Hantek { @@ -269,19 +290,25 @@ namespace Hantek {
269 /// </tr> 290 /// </tr>
270 /// </table> 291 /// </table>
271 /// </p> 292 /// </p>
  293 + /// <p><br /></p>
272 BULK_UNKNOWN_0A, 294 BULK_UNKNOWN_0A,
273 - 295 +
  296 + /// <em>[::MODEL_DSO2250]</em>
274 /// <p> 297 /// <p>
275 - /// This command isn't used for the DSO-2090 and DSO-5200: 298 + /// This command is used for the DSO-2250:
276 /// <table> 299 /// <table>
277 /// <tr> 300 /// <tr>
278 /// <td>0x0b</td> 301 /// <td>0x0b</td>
279 - /// <td>...</td> 302 + /// <td>0x00</td>
  303 + /// <td>(unknown)</td>
  304 + /// <td>0x00</td>
280 /// </tr> 305 /// </tr>
281 /// </table> 306 /// </table>
282 /// </p> 307 /// </p>
  308 + /// <p><br /></p>
283 BULK_UNKNOWN_0B, 309 BULK_UNKNOWN_0B,
284 - 310 +
  311 + /// <em>[::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
285 /// <p> 312 /// <p>
286 /// This command sets the sampling rate for the DSO-5200: 313 /// This command sets the sampling rate for the DSO-5200:
287 /// <table> 314 /// <table>
@@ -296,12 +323,14 @@ namespace Hantek { @@ -296,12 +323,14 @@ namespace Hantek {
296 /// </table> 323 /// </table>
297 /// </p> 324 /// </p>
298 /// <p> 325 /// <p>
299 - /// The values are similar to the ones used on the DSO-2090. The formula is a bit different here:<br /> 326 + /// The values are similar to the ones used with ::BULK_SETTRIGGERANDSAMPLERATE. The formula is a bit different here:<br />
300 /// <i>Samplerate = SamplerateMax / (2comp(SamplerateSlow) * 2 + 4 - SamplerateFast)</i><br /> 327 /// <i>Samplerate = SamplerateMax / (2comp(SamplerateSlow) * 2 + 4 - SamplerateFast)</i><br />
301 /// SamplerateMax is 100 MS/s for the DSO-5200 in default configuration and 250 MS/s in fast rate mode though, the modifications regarding buffer size are the the same that apply for the DSO-2090. 328 /// SamplerateMax is 100 MS/s for the DSO-5200 in default configuration and 250 MS/s in fast rate mode though, the modifications regarding buffer size are the the same that apply for the DSO-2090.
302 /// </p> 329 /// </p>
  330 + /// <p><br /></p>
303 BULK_SETSAMPLERATE5200, 331 BULK_SETSAMPLERATE5200,
304 332
  333 + /// <em>[::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
305 /// <p> 334 /// <p>
306 /// This command sets the trigger position and buffer size for the DSO-5200: 335 /// This command sets the trigger position and buffer size for the DSO-5200:
307 /// <table> 336 /// <table>
@@ -310,7 +339,7 @@ namespace Hantek { @@ -310,7 +339,7 @@ namespace Hantek {
310 /// <td>0x00</td> 339 /// <td>0x00</td>
311 /// <td>TriggerPositionPre[0]</td> 340 /// <td>TriggerPositionPre[0]</td>
312 /// <td>TriggerPositionPre[1]</td> 341 /// <td>TriggerPositionPre[1]</td>
313 - /// <td>#DTriggerPositionUsed</td> 342 + /// <td>::DTriggerPositionUsed</td>
314 /// </tr> 343 /// </tr>
315 /// </table> 344 /// </table>
316 /// <table> 345 /// <table>
@@ -326,8 +355,10 @@ namespace Hantek { @@ -326,8 +355,10 @@ namespace Hantek {
326 /// <p> 355 /// <p>
327 /// The TriggerPositionPre and TriggerPositionPost values set the pretrigger position. Both values have a range from 0xd7ff (0xc7ff for 14 kiS buffer) to 0xfffe. On the left side (0 %) the TriggerPositionPre value is minimal, on the right side (100 %) it is maximal. The TriggerPositionPost value is maximal for 0 % and minimal for 100%. 356 /// The TriggerPositionPre and TriggerPositionPost values set the pretrigger position. Both values have a range from 0xd7ff (0xc7ff for 14 kiS buffer) to 0xfffe. On the left side (0 %) the TriggerPositionPre value is minimal, on the right side (100 %) it is maximal. The TriggerPositionPost value is maximal for 0 % and minimal for 100%.
328 /// </p> 357 /// </p>
  358 + /// <p><br /></p>
329 BULK_SETBUFFER5200, 359 BULK_SETBUFFER5200,
330 360
  361 + /// <em>[::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
331 /// <p> 362 /// <p>
332 /// This command sets the channel and trigger settings for the DSO-5200: 363 /// This command sets the channel and trigger settings for the DSO-5200:
333 /// <table> 364 /// <table>
@@ -343,25 +374,56 @@ namespace Hantek { @@ -343,25 +374,56 @@ namespace Hantek {
343 /// </tr> 374 /// </tr>
344 /// </table> 375 /// </table>
345 /// </p> 376 /// </p>
  377 + /// <p><br /></p>
346 BULK_SETTRIGGER5200, 378 BULK_SETTRIGGER5200,
347 -  
348 - BULK_COUNT ///< Total number of commands 379 +
  380 + /// <em>[::MODEL_DSO2250]</em>
  381 + /// <p>
  382 + /// This command is used for the DSO-2250:
  383 + /// <table>
  384 + /// <tr>
  385 + /// <td>0x0f</td>
  386 + /// <td>0x00</td>
  387 + /// <td>(unknown)</td>
  388 + /// <td>(unknown)</td>
  389 + /// <td>(unknown)</td>
  390 + /// <td>(unknown)</td>
  391 + /// </tr>
  392 + /// </table>
  393 + /// <table>
  394 + /// <tr>
  395 + /// <td>(unknown)</td>
  396 + /// <td>(unknown)</td>
  397 + /// <td>(unknown)</td>
  398 + /// <td>(unknown)</td>
  399 + /// <td>(unknown)</td>
  400 + /// <td>(unknown)</td>
  401 + /// </tr>
  402 + /// </table>
  403 + /// </p>
  404 + /// <p><br /></p>
  405 + BULK_UNKNOWN_0F,
  406 +
  407 + BULK_COUNT
349 }; 408 };
350 409
351 ////////////////////////////////////////////////////////////////////////////// 410 //////////////////////////////////////////////////////////////////////////////
352 /// \enum ControlCode hantek/types.h 411 /// \enum ControlCode hantek/types.h
353 /// \brief All supported control commands. 412 /// \brief All supported control commands.
354 enum ControlCode { 413 enum ControlCode {
  414 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
355 /// <p> 415 /// <p>
356 - /// The 0xa2 control read/write command gives access to a #ControlValue. 416 + /// The 0xa2 control read/write command gives access to a ::ControlValue.
357 /// </p> 417 /// </p>
  418 + /// <p><br /></p>
358 CONTROL_VALUE = 0xa2, 419 CONTROL_VALUE = 0xa2,
359 420
  421 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
360 /// <p> 422 /// <p>
361 /// The 0xb2 control read command gets the speed level of the USB connection: 423 /// The 0xb2 control read command gets the speed level of the USB connection:
362 /// <table> 424 /// <table>
363 /// <tr> 425 /// <tr>
364 - /// <td>#ConnectionSpeed</td> 426 + /// <td>::ConnectionSpeed</td>
365 /// <td>0x00</td> 427 /// <td>0x00</td>
366 /// <td>0x00</td> 428 /// <td>0x00</td>
367 /// <td>0x00</td> 429 /// <td>0x00</td>
@@ -374,16 +436,18 @@ namespace Hantek { @@ -374,16 +436,18 @@ namespace Hantek {
374 /// </tr> 436 /// </tr>
375 /// </table> 437 /// </table>
376 /// </p> 438 /// </p>
  439 + /// <p><br /></p>
377 CONTROL_GETSPEED = 0xb2, 440 CONTROL_GETSPEED = 0xb2,
378 441
  442 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
379 /// <p> 443 /// <p>
380 /// The 0xb3 control write command is sent before any bulk command: 444 /// The 0xb3 control write command is sent before any bulk command:
381 /// <table> 445 /// <table>
382 /// <tr> 446 /// <tr>
383 /// <td>0x0f</td> 447 /// <td>0x0f</td>
384 - /// <td>#CommandIndex</td>  
385 - /// <td>#CommandIndex</td>  
386 - /// <td>#CommandIndex</td> 448 + /// <td>::BulkIndex</td>
  449 + /// <td>::BulkIndex</td>
  450 + /// <td>::BulkIndex</td>
387 /// <td>0x00</td> 451 /// <td>0x00</td>
388 /// <td>0x00</td> 452 /// <td>0x00</td>
389 /// <td>0x00</td> 453 /// <td>0x00</td>
@@ -393,8 +457,10 @@ namespace Hantek { @@ -393,8 +457,10 @@ namespace Hantek {
393 /// </tr> 457 /// </tr>
394 /// </table> 458 /// </table>
395 /// </p> 459 /// </p>
  460 + /// <p><br /></p>
396 CONTROL_BEGINCOMMAND = 0xb3, 461 CONTROL_BEGINCOMMAND = 0xb3,
397 462
  463 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
398 /// <p> 464 /// <p>
399 /// The 0xb4 control write command sets the channel offsets: 465 /// The 0xb4 control write command sets the channel offsets:
400 /// <table> 466 /// <table>
@@ -423,8 +489,10 @@ namespace Hantek { @@ -423,8 +489,10 @@ namespace Hantek {
423 /// </tr> 489 /// </tr>
424 /// </table> 490 /// </table>
425 /// </p> 491 /// </p>
  492 + /// <p><br /></p>
426 CONTROL_SETOFFSET = 0xb4, 493 CONTROL_SETOFFSET = 0xb4,
427 494
  495 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
428 /// <p> 496 /// <p>
429 /// The 0xb5 control write command sets the internal relays: 497 /// The 0xb5 control write command sets the internal relays:
430 /// <table> 498 /// <table>
@@ -460,6 +528,7 @@ namespace Hantek { @@ -460,6 +528,7 @@ namespace Hantek {
460 /// <p> 528 /// <p>
461 /// The limits are <= instead of < for the 10 bit models, since those support voltages up to 10 V. 529 /// The limits are <= instead of < for the 10 bit models, since those support voltages up to 10 V.
462 /// </p> 530 /// </p>
  531 + /// <p><br /></p>
463 CONTROL_SETRELAYS = 0xb5 532 CONTROL_SETRELAYS = 0xb5
464 }; 533 };
465 534
@@ -467,17 +536,33 @@ namespace Hantek { @@ -467,17 +536,33 @@ namespace Hantek {
467 /// \enum ControlValue hantek/types.h 536 /// \enum ControlValue hantek/types.h
468 /// \brief All supported values for control commands. 537 /// \brief All supported values for control commands.
469 enum ControlValue { 538 enum ControlValue {
  539 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
  540 + /// <p>
470 /// Value 0x08 is the calibration data for the channels offsets. It holds the offset value for the top and bottom of the scope screen for every gain step on every channel. The data is stored as a three-dimensional array:<br /> 541 /// Value 0x08 is the calibration data for the channels offsets. It holds the offset value for the top and bottom of the scope screen for every gain step on every channel. The data is stored as a three-dimensional array:<br />
471 - /// <i>channelLevels[channel][#Gain][#LevelOffset]</i> 542 + /// <i>channelLevels[channel][GainId][::LevelOffset]</i>
  543 + /// </p>
  544 + /// <p><br /></p>
472 VALUE_OFFSETLIMITS = 0x08, 545 VALUE_OFFSETLIMITS = 0x08,
473 546
  547 + /// <em>[::MODEL_DSO2090, ::MODEL_DSO2150, ::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
  548 + /// <p>
474 /// Value 0x0a is the address of the device. It has a length of one byte. 549 /// Value 0x0a is the address of the device. It has a length of one byte.
  550 + /// </p>
  551 + /// <p><br /></p>
475 VALUE_DEVICEADDRESS = 0x0a, 552 VALUE_DEVICEADDRESS = 0x0a,
476 553
477 - /// Value 0x60 is the calibration data for the fast rate mode on the DSO-5200. It's used to correct the level differences between the two merged channels to avoid . 554 + /// <em>[::MODEL_DSO2250, ::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
  555 + /// <p>
  556 + /// Value 0x60 is the calibration data for the fast rate mode on the DSO-2250, DSO-5200 and DSO-5200A. It's used to correct the level differences between the two merged channels to avoid deterministic noise.
  557 + /// </p>
  558 + /// <p><br /></p>
478 VALUE_CALIBRATIONDATA = 0x60, 559 VALUE_CALIBRATIONDATA = 0x60,
479 560
480 - /// Value 0x70 contains correction values for the ETS functionality of the DSO-5200. 561 + /// <em>[::MODEL_DSO5200, ::MODEL_DSO5200A]</em>
  562 + /// <p>
  563 + /// Value 0x70 contains correction values for the ETS functionality of the DSO-5200 and DSO-5200A.
  564 + /// </p>
  565 + /// <p><br /></p>
481 VALUE_VOLTAGELIMITS = 0x70 566 VALUE_VOLTAGELIMITS = 0x70
482 }; 567 };
483 568
@@ -485,9 +570,12 @@ namespace Hantek { @@ -485,9 +570,12 @@ namespace Hantek {
485 /// \enum Model hantek/types.h 570 /// \enum Model hantek/types.h
486 /// \brief All supported Hantek DSO models. 571 /// \brief All supported Hantek DSO models.
487 enum Model { 572 enum Model {
488 - MODEL_UNKNOWN = -1,  
489 - MODEL_DSO2090, MODEL_DSO2100, MODEL_DSO2150, MODEL_DSO2250,  
490 - MODEL_DSO5200, MODEL_DSO5200A, 573 + MODEL_UNKNOWN = -1, ///< Unknown model
  574 + MODEL_DSO2090, ///< %Hantek DSO-2090 USB
  575 + MODEL_DSO2150, ///< %Hantek DSO-2150 USB
  576 + MODEL_DSO2250, ///< %Hantek DSO-2250 USB
  577 + MODEL_DSO5200, ///< %Hantek DSO-5200 USB
  578 + MODEL_DSO5200A, ///< %Hantek DSO-5200A USB
491 MODEL_COUNT 579 MODEL_COUNT
492 }; 580 };
493 581
@@ -551,7 +639,7 @@ namespace Hantek { @@ -551,7 +639,7 @@ namespace Hantek {
551 COMMANDINDEX_0 = 0x03, ///< Used most of the time 639 COMMANDINDEX_0 = 0x03, ///< Used most of the time
552 COMMANDINDEX_1 = 0x0a, 640 COMMANDINDEX_1 = 0x0a,
553 COMMANDINDEX_2 = 0x09, 641 COMMANDINDEX_2 = 0x09,
554 - COMMANDINDEX_3 = 0x01, ///< Used for #BULK_SETTRIGGERANDSAMPLERATE sometimes 642 + COMMANDINDEX_3 = 0x01, ///< Used for ::BULK_SETTRIGGERANDSAMPLERATE sometimes
555 COMMANDINDEX_4 = 0x02, 643 COMMANDINDEX_4 = 0x02,
556 COMMANDINDEX_5 = 0x08 644 COMMANDINDEX_5 = 0x08
557 }; 645 };
@@ -597,7 +685,7 @@ namespace Hantek { @@ -597,7 +685,7 @@ namespace Hantek {
597 /// \brief Trigger and samplerate bits (Byte 1). 685 /// \brief Trigger and samplerate bits (Byte 1).
598 struct Tsr1Bits { 686 struct Tsr1Bits {
599 unsigned char triggerSource:2; ///< The trigger source, see Hantek::TriggerSource 687 unsigned char triggerSource:2; ///< The trigger source, see Hantek::TriggerSource
600 - unsigned char bufferSize:3; ///< See #BufferSizeId 688 + unsigned char bufferSize:3; ///< See ::BufferSizeId
601 unsigned char samplerateFast:3; ///< samplerate value for fast sampling rates 689 unsigned char samplerateFast:3; ///< samplerate value for fast sampling rates
602 }; 690 };
603 691
@@ -615,8 +703,8 @@ namespace Hantek { @@ -615,8 +703,8 @@ namespace Hantek {
615 /// \struct DBufferBits hantek/types.h 703 /// \struct DBufferBits hantek/types.h
616 /// \brief Buffer mode bits for 0x0d command. 704 /// \brief Buffer mode bits for 0x0d command.
617 struct DBufferBits { 705 struct DBufferBits {
618 - unsigned char triggerPositionUsed:3; ///< See #DTriggerPositionUsed  
619 - unsigned char bufferSize:3; ///< See #BufferSizeId 706 + unsigned char triggerPositionUsed:3; ///< See ::DTriggerPositionUsed
  707 + unsigned char bufferSize:3; ///< See ::BufferSizeId
620 unsigned char reserved:2; ///< Unused bits 708 unsigned char reserved:2; ///< Unused bits
621 }; 709 };
622 710
openhantek/src/levelslider.cpp
@@ -329,9 +329,9 @@ void LevelSlider::mouseMoveEvent(QMouseEvent *event) { @@ -329,9 +329,9 @@ void LevelSlider::mouseMoveEvent(QMouseEvent *event) {
329 // Get new value 329 // Get new value
330 double value; 330 double value;
331 if(this->_direction == Qt::RightArrow || this->_direction == Qt::LeftArrow) 331 if(this->_direction == Qt::RightArrow || this->_direction == Qt::LeftArrow)
332 - value = this->slider[pressedSlider]->maximum - (this->slider[pressedSlider]->maximum - this->slider[pressedSlider]->minimum) * (event->y() - this->_preMargin) / (this->height() - this->_preMargin - this->_postMargin - 1); 332 + value = this->slider[pressedSlider]->maximum - (this->slider[pressedSlider]->maximum - this->slider[pressedSlider]->minimum) * ((double) event->y() - this->_preMargin + 0.5) / (this->height() - this->_preMargin - this->_postMargin - 1);
333 else 333 else
334 - value = this->slider[pressedSlider]->minimum + (this->slider[pressedSlider]->maximum - this->slider[pressedSlider]->minimum) * (event->x() - this->_preMargin) / (this->width() - this->_preMargin - this->_postMargin - 1); 334 + value = this->slider[pressedSlider]->minimum + (this->slider[pressedSlider]->maximum - this->slider[pressedSlider]->minimum) * ((double) event->x() - this->_preMargin + 0.5) / (this->width() - this->_preMargin - this->_postMargin - 1);
335 335
336 // Move the slider 336 // Move the slider
337 if(event->modifiers() & Qt::AltModifier) 337 if(event->modifiers() & Qt::AltModifier)
@@ -491,18 +491,18 @@ QRect LevelSlider::calculateRect(int sliderId) { @@ -491,18 +491,18 @@ QRect LevelSlider::calculateRect(int sliderId) {
491 if(this->slider[sliderId]->text.isEmpty()) { 491 if(this->slider[sliderId]->text.isEmpty()) {
492 this->slider[sliderId]->rect = QRect( 492 this->slider[sliderId]->rect = QRect(
493 0, // Start at the left side 493 0, // Start at the left side
494 - // The needle should be center-aligned  
495 - (long) (this->height() - this->_preMargin - this->_postMargin - 1) * (this->slider[sliderId]->maximum - this->slider[sliderId]->value) / (this->slider[sliderId]->maximum - this->slider[sliderId]->minimum) + this->_preMargin - 3, 494 + // The needle should be center-aligned, 0.5 pixel offset for exact pixelization
  495 + (long) ((double) (this->height() - this->_preMargin - this->_postMargin - 1) * (this->slider[sliderId]->maximum - this->slider[sliderId]->value) / (this->slider[sliderId]->maximum - this->slider[sliderId]->minimum) + 0.5f) + this->_preMargin - 3,
496 this->sliderWidth, // Fill the whole width 496 this->sliderWidth, // Fill the whole width
497 - 7 // The needle is 5 px wide 497 + 7 // The needle is 7 px wide
498 ); 498 );
499 } 499 }
500 // Or a thin needle with text? 500 // Or a thin needle with text?
501 else { 501 else {
502 this->slider[sliderId]->rect = QRect( 502 this->slider[sliderId]->rect = QRect(
503 0, // Start at the left side 503 0, // Start at the left side
504 - // The needle is at the bottom, the text above it  
505 - (long) (this->height() - this->_preMargin - this->_postMargin - 1) * (this->slider[sliderId]->maximum - this->slider[sliderId]->value) / (this->slider[sliderId]->maximum - this->slider[sliderId]->minimum), 504 + // The needle is at the bottom, the text above it, 0.5 pixel offset for exact pixelization
  505 + (long) ((double) (this->height() - this->_preMargin - this->_postMargin - 1) * (this->slider[sliderId]->maximum - this->slider[sliderId]->value) / (this->slider[sliderId]->maximum - this->slider[sliderId]->minimum) + 0.5f),
506 this->sliderWidth, // Fill the whole width 506 this->sliderWidth, // Fill the whole width
507 this->preMargin() + 1 // Use the full margin 507 this->preMargin() + 1 // Use the full margin
508 ); 508 );
@@ -513,10 +513,10 @@ QRect LevelSlider::calculateRect(int sliderId) { @@ -513,10 +513,10 @@ QRect LevelSlider::calculateRect(int sliderId) {
513 // Is it a triangular needle? 513 // Is it a triangular needle?
514 if(this->slider[sliderId]->text.isEmpty()) { 514 if(this->slider[sliderId]->text.isEmpty()) {
515 this->slider[sliderId]->rect = QRect( 515 this->slider[sliderId]->rect = QRect(
516 - // The needle should be center-aligned  
517 - (long) (this->width() - this->_preMargin - this->_postMargin - 1) * (this->slider[sliderId]->value - this->slider[sliderId]->minimum) / (this->slider[sliderId]->maximum - this->slider[sliderId]->minimum) + this->_preMargin - 3, 516 + // The needle should be center-aligned, 0.5 pixel offset for exact pixelization
  517 + (long) ((double) (this->width() - this->_preMargin - this->_postMargin - 1) * (this->slider[sliderId]->value - this->slider[sliderId]->minimum) / (this->slider[sliderId]->maximum - this->slider[sliderId]->minimum) + 0.5f) + this->_preMargin - 3,
518 0, // Start at the top 518 0, // Start at the top
519 - 7, // The needle is 5 px wide 519 + 7, // The needle is 7 px wide
520 this->sliderWidth // Fill the whole height 520 this->sliderWidth // Fill the whole height
521 ); 521 );
522 } 522 }
@@ -524,8 +524,8 @@ QRect LevelSlider::calculateRect(int sliderId) { @@ -524,8 +524,8 @@ QRect LevelSlider::calculateRect(int sliderId) {
524 else { 524 else {
525 int sliderLength = this->fontMetrics().size(0, this->slider[sliderId]->text).width() + 2; 525 int sliderLength = this->fontMetrics().size(0, this->slider[sliderId]->text).width() + 2;
526 this->slider[sliderId]->rect = QRect( 526 this->slider[sliderId]->rect = QRect(
527 - // The needle is at the right side, the text before it  
528 - (long) (this->width() - this->_preMargin - this->_postMargin - 1) * (this->slider[sliderId]->value - this->slider[sliderId]->minimum) / (this->slider[sliderId]->maximum - this->slider[sliderId]->minimum) + this->_preMargin - sliderLength + 1, 527 + // The needle is at the right side, the text before it, 0.5 pixel offset for exact pixelization
  528 + (long) ((double) (this->width() - this->_preMargin - this->_postMargin - 1) * (this->slider[sliderId]->value - this->slider[sliderId]->minimum) / (this->slider[sliderId]->maximum - this->slider[sliderId]->minimum) + 0.5f) + this->_preMargin - sliderLength + 1,
529 0, // Start at the top 529 0, // Start at the top
530 sliderLength, // The width depends on the text 530 sliderLength, // The width depends on the text
531 this->sliderWidth // Fill the whole height 531 this->sliderWidth // Fill the whole height