diff --git a/.gitignore b/.gitignore
index fb587492..e9e1a012 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,5 @@ firmware/hex
*.json
*.kate-swp
.directory
+.kdev4
+*.kdev4
diff --git a/docs/OpenHantek6022_User_Manual.odt b/docs/OpenHantek6022_User_Manual.odt
index 78be26df..f2b0860b 100644
Binary files a/docs/OpenHantek6022_User_Manual.odt and b/docs/OpenHantek6022_User_Manual.odt differ
diff --git a/docs/OpenHantek6022_User_Manual.pdf b/docs/OpenHantek6022_User_Manual.pdf
index 4dd25c30..8b441af0 100644
Binary files a/docs/OpenHantek6022_User_Manual.pdf and b/docs/OpenHantek6022_User_Manual.pdf differ
diff --git a/docs/images/screenshot_mainwindow.png b/docs/images/screenshot_mainwindow.png
index c89a64d9..fe787337 100644
Binary files a/docs/images/screenshot_mainwindow.png and b/docs/images/screenshot_mainwindow.png differ
diff --git a/openhantek/src/OH_BUILD.h b/openhantek/src/OH_BUILD.h
index 73fcf950..f24eb51a 100644
--- a/openhantek/src/OH_BUILD.h
+++ b/openhantek/src/OH_BUILD.h
@@ -1,2 +1,2 @@
// Do not edit, will be re-created at each commit!
-#define OH_BUILD "20191112 build 548"
+#define OH_BUILD "20191115 build 549"
diff --git a/openhantek/src/OH_VERSION.h b/openhantek/src/OH_VERSION.h
index f8afc6dc..4c0b6c36 100644
--- a/openhantek/src/OH_VERSION.h
+++ b/openhantek/src/OH_VERSION.h
@@ -1,7 +1,7 @@
// define the version that is shown on top of the program
// if undefined (for development commits) the build will be shown by OpenHantek
-#define OH_VERSION "v2.17-rc8"
+#define OH_VERSION "3.0.0"
# ifdef OH_VERSION
diff --git a/openhantek/src/dsowidget.cpp b/openhantek/src/dsowidget.cpp
index 5df04719..00b6a03a 100644
--- a/openhantek/src/dsowidget.cpp
+++ b/openhantek/src/dsowidget.cpp
@@ -84,10 +84,10 @@ DsoWidget::DsoWidget(DsoSettingsScope *scope, DsoSettingsView *view, const Dso::
markerInfoLabel->setAlignment(Qt::AlignLeft);
markerInfoLabel->setPalette(palette);
markerTimeLabel = new QLabel();
- markerTimeLabel->setAlignment(Qt::AlignRight);
+ markerTimeLabel->setAlignment(Qt::AlignLeft);
markerTimeLabel->setPalette(palette);
markerFrequencyLabel = new QLabel();
- markerFrequencyLabel->setAlignment(Qt::AlignRight);
+ markerFrequencyLabel->setAlignment(Qt::AlignLeft);
markerFrequencyLabel->setPalette(palette);
markerTimebaseLabel = new QLabel();
markerTimebaseLabel->setAlignment(Qt::AlignRight);
@@ -409,18 +409,17 @@ void DsoWidget::setMeasurementVisible(ChannelID channel) {
/// \brief Update the label about the marker measurements
void DsoWidget::updateMarkerDetails() {
- double div0 = scope->horizontal.cursor.pos[0].x();
- double div1 = scope->horizontal.cursor.pos[1].x();
- if ( div0 > div1 )
- std::swap( div0, div1 );
- double divs = div1 - div0;
- double time0 = div0 * scope->horizontal.timebase;
- double time1 = div1 * scope->horizontal.timebase;
+ double m1 = scope->horizontal.cursor.pos[0].x() + DIVS_TIME / 2; // zero at center -> zero at left margin
+ double m2 = scope->horizontal.cursor.pos[1].x() + DIVS_TIME / 2; // zero at center -> zero at left margin
+ if ( m1 > m2 )
+ std::swap( m1, m2 );
+ double divs = m2 - m1;
+ // t = 0 at trigger position
+ double time0 = ( m1 - DIVS_TIME * scope->trigger.position ) * scope->horizontal.timebase;
+ double time1 = ( m2 - DIVS_TIME * scope->trigger.position ) * scope->horizontal.timebase;
double time = divs * scope->horizontal.timebase;
- div0 += DIVS_TIME / 2; // zero at center -> zero at left margin
- div1 += DIVS_TIME / 2;
- double freq0 = div0 * scope->horizontal.frequencybase;
- double freq1 = div1 * scope->horizontal.frequencybase;
+ double freq0 = m1 * scope->horizontal.frequencybase;
+ double freq1 = m2 * scope->horizontal.frequencybase;
double freq = divs * scope->horizontal.frequencybase;
bool timeUsed = false;
bool freqUsed = false;
@@ -458,7 +457,7 @@ void DsoWidget::updateMarkerDetails() {
++index;
}
- if ( DIVS_TIME == divs || (div0 == 0 && div1 == 0) || (div0 == DIVS_TIME && div1 == DIVS_TIME) ) {
+ if ( DIVS_TIME == divs || ( m1 == 0 && m2 == 0) || ( m1 == DIVS_TIME && m2 == DIVS_TIME) ) {
// markers at left/right margins -> don't display
markerInfoLabel->setVisible( false );
markerTimeLabel->setVisible( false );
@@ -487,21 +486,27 @@ void DsoWidget::updateMarkerDetails() {
markerFrequencybaseLabel->setVisible( freqUsed );
}
markerInfoLabel->setText( mInfo );
- if ( timeUsed )
- markerTimeLabel->setText( mTime.append( "%1 -> %2, Δt: %3 " )
- .arg( valueToString( time0, UNIT_SECONDS, 4 ) )
- .arg( valueToString( time1, UNIT_SECONDS, 4 ) )
- .arg( valueToString( time, UNIT_SECONDS, 4 ) )
- );
- else
+ if ( timeUsed ) {
+ mTime += QString( "%1" ).arg( valueToString( time0, UNIT_SECONDS, 4 ) );
+ if ( time )
+ mTime += QString( " -> %1, Δt: %2 (%3) ")
+ .arg( valueToString( time1, UNIT_SECONDS, 4 ) )
+ .arg( valueToString( time, UNIT_SECONDS, 4 ) )
+ .arg( valueToString( 1/time, UNIT_HERTZ, 4) )
+ ;
+ markerTimeLabel->setText( mTime );
+ } else {
markerTimeLabel->setText( "" );
- if ( freqUsed )
- markerFrequencyLabel->setText( mFreq.append( "%1 -> %2, Δf: %3 " )
- .arg( valueToString( freq0, UNIT_HERTZ, 4) )
- .arg( valueToString( freq1, UNIT_HERTZ, 4) )
- .arg( valueToString( freq, UNIT_HERTZ, 4) )
- );
- else
+ }
+ if ( freqUsed ) {
+ mFreq += QString( "%1" ).arg( valueToString( freq0, UNIT_HERTZ, 4) );
+ if ( freq )
+ mFreq += QString( " -> %2, Δf: %3 " )
+ .arg( valueToString( freq1, UNIT_HERTZ, 4) )
+ .arg( valueToString( freq, UNIT_HERTZ, 4) )
+ ;
+ markerFrequencyLabel->setText( mFreq );
+ } else
markerFrequencyLabel->setText( "" );
}
}
@@ -524,7 +529,7 @@ void DsoWidget::updateTriggerDetails() {
tablePalette.setColor(QPalette::WindowText, view->screen.voltage[scope->trigger.source]);
settingsTriggerLabel->setPalette(tablePalette);
QString levelString = valueToString(scope->voltage[scope->trigger.source].trigger, UNIT_VOLTS, 3);
- QString pretriggerString = tr("%L1%").arg((int)(scope->trigger.position * 100 + 0.5));
+ QString pretriggerString = tr("%L1%").arg( (int)round(scope->trigger.position * 100 ) );
QString pre = Dso::slopeString(scope->trigger.slope); // trigger slope
QString post = pre; // opposite trigger slope
if ( scope->trigger.slope == Dso::Slope::Positive )
diff --git a/openhantek/src/exporting/legacyexportdrawer.cpp b/openhantek/src/exporting/legacyexportdrawer.cpp
index 4546e9fc..d342f544 100644
--- a/openhantek/src/exporting/legacyexportdrawer.cpp
+++ b/openhantek/src/exporting/legacyexportdrawer.cpp
@@ -176,18 +176,16 @@ bool LegacyExportDrawer::exportSamples(const PPresult *result, QPaintDevice* pai
painter.setPen(colorValues->text);
// Calculate variables needed for zoomed scope
- double m1 = settings->scope.getMarker(0);
- double m2 = settings->scope.getMarker(1);
+ double m1 = settings->scope.getMarker(0) + DIVS_TIME / 2; // zero at center -> zero at left margin
+ double m2 = settings->scope.getMarker(1) + DIVS_TIME / 2; // zero at center -> zero at left margin
if ( m1 > m2 )
std::swap( m1, m2 );
double divs = m2 - m1;
double zoomFactor = DIVS_TIME / divs;
double zoomOffset = (m1 + m2) / 2;
- double time1 = m1 * settings->scope.horizontal.timebase;
- double time2 = m2 * settings->scope.horizontal.timebase;
+ double time1 = ( m1 - DIVS_TIME * settings->scope.trigger.position) * settings->scope.horizontal.timebase;
+ double time2 = ( m2 - DIVS_TIME * settings->scope.trigger.position) * settings->scope.horizontal.timebase;
double time = divs * settings->scope.horizontal.timebase;
- m1 += DIVS_TIME / 2; // zero at center -> zero at left margin
- m2 += DIVS_TIME / 2;
double freq1 = m1 * settings->scope.horizontal.frequencybase;
double freq2 = m2 * settings->scope.horizontal.frequencybase;
double freq = freq2 - freq1;
@@ -221,7 +219,7 @@ bool LegacyExportDrawer::exportSamples(const PPresult *result, QPaintDevice* pai
tr("/div"),
QTextOption(Qt::AlignRight));
} else {
- stretchBase = (double)paintDevice->width() / 7;
+ stretchBase = (double)paintDevice->width() / 8;
scopeHeight = (double)paintDevice->height() - (channelCount + 4) * lineHeight;
double top = 2.5 * lineHeight + scopeHeight;
@@ -230,13 +228,18 @@ bool LegacyExportDrawer::exportSamples(const PPresult *result, QPaintDevice* pai
"t1: " + valueToString( time1, UNIT_SECONDS, 4 ), QTextOption(Qt::AlignRight));
painter.drawText(QRectF(stretchBase * 2, top, stretchBase, lineHeight),
"t2: " + valueToString( time2, UNIT_SECONDS, 4 ), QTextOption(Qt::AlignRight));
- painter.drawText(QRectF(stretchBase * 3, top, stretchBase, lineHeight),
+ if ( time ) {
+ painter.drawText(QRectF(stretchBase * 3, top, stretchBase, lineHeight),
"Δt: " + valueToString( time, UNIT_SECONDS, 4 ), QTextOption(Qt::AlignRight));
- painter.drawText(QRectF(stretchBase * 4, top, stretchBase, lineHeight),
- "f1: " + valueToString( freq1, UNIT_HERTZ, 4 ), QTextOption(Qt::AlignRight));
+ painter.drawText(QRectF(stretchBase * 4, top, stretchBase, lineHeight),
+ " (=" + valueToString( 1/time, UNIT_HERTZ, 4 ) + ")", QTextOption(Qt::AlignLeft));
+ }
painter.drawText(QRectF(stretchBase * 5, top, stretchBase, lineHeight),
- "f2: " + valueToString( freq2, UNIT_HERTZ, 4 ), QTextOption(Qt::AlignRight));
+ "f1: " + valueToString( freq1, UNIT_HERTZ, 4 ), QTextOption(Qt::AlignRight));
painter.drawText(QRectF(stretchBase * 6, top, stretchBase, lineHeight),
+ "f2: " + valueToString( freq2, UNIT_HERTZ, 4 ), QTextOption(Qt::AlignRight));
+ if ( freq)
+ painter.drawText(QRectF(stretchBase * 7, top, stretchBase, lineHeight),
"Δf: " + valueToString( freq, UNIT_HERTZ, 4 ), QTextOption(Qt::AlignRight));
}
@@ -325,12 +328,29 @@ bool LegacyExportDrawer::exportSamples(const PPresult *result, QPaintDevice* pai
break;
case Dso::GraphFormat::XY:
+ // TODO: create also XY image
break;
default:
break;
}
+ if ( !zoomed ) { // draw marker lines and trigger position
+ const double trig = DIVS_TIME * ( settings->scope.trigger.position - 0.5 );
+ const double tick = (double)DIVS_TIME / 250.0;
+ const double top = DIVS_VOLTAGE/2;
+ const double bottom = -DIVS_VOLTAGE/2;
+ const double left = -DIVS_TIME/2;
+ //const double right = DIVS_TIME/2;
+ painter.setPen( QPen(colorValues->markers, 0) );
+ // markers
+ painter.drawLine( QLineF( m1 + left, bottom - 4 * tick, m1 + left, top ) );
+ painter.drawLine( QLineF( m2 + left, bottom - 4 * tick, m2 + left, top ) );
+ // trigger point (t=0)
+ painter.drawLine( QLineF( trig - tick, top + 4 * tick, trig, top ) );
+ painter.drawLine( QLineF( trig + tick, top + 4 * tick, trig, top ) );
+ }
+
// Set DIVS_TIME / zoomFactor x DIVS_VOLTAGE matrix for zoomed
// oscillograph
painter.setMatrix(QMatrix((paintDevice->width() - 1) / DIVS_TIME * zoomFactor, 0, 0,
diff --git a/openhantek/src/selectdevice/selectsupporteddevice.cpp b/openhantek/src/selectdevice/selectsupporteddevice.cpp
index 24bee902..e50893e5 100644
--- a/openhantek/src/selectdevice/selectsupporteddevice.cpp
+++ b/openhantek/src/selectdevice/selectsupporteddevice.cpp
@@ -57,7 +57,10 @@ std::unique_ptr Upload in progress ... If the upload takes more than 30 s, please close this window If the upload takes more than 30 s, please close this window In this case, please unplug other USB devices on the same bus!
and restart the program!
and restart the program!
"
+ "You can check this under Linux with: lsusb; lsusb -t