Commit fba5d6e44fcb42e4f44cd8655c2d13b9087136c8

Authored by oliverhaag
1 parent 6051268f

Mac OS X fix

openhantek/ChangeLog
... ... @@ -199,3 +199,7 @@
199 199  
200 200 2012-11-27 Oliver Haag <oliver.haag@gmail.com>
201 201 * Bugfix: Hantek::Control::setChannelUsed used setTrigger instead of setChannels
  202 +
  203 +2012-12-04 Oliver Haag <oliver.haag@gmail.com>
  204 +* Workaround for stacked QGLWidget on Mac OS X
  205 +* Bugfix: Check for connected scope on setSamplerate/setRecordTime
... ...
openhantek/src/dsowidget.cpp
... ... @@ -64,6 +64,12 @@ DsoWidget::DsoWidget(DsoSettings *settings, DataAnalyzer *dataAnalyzer, QWidget
64 64 this->zoomScope->setGenerator(this->generator);
65 65 this->zoomScope->setZoomMode(true);
66 66  
  67 +#ifdef OS_DARWIN
  68 + // Workaround for https://bugreports.qt-project.org/browse/QTBUG-8580
  69 + this->mainScope->hide();
  70 + this->mainScope->show();
  71 +#endif
  72 +
67 73 // The offset sliders for all possible channels
68 74 this->offsetSlider = new LevelSlider(Qt::RightArrow);
69 75 for(int channel = 0; channel < this->settings->scope.voltage.count(); ++channel) {
... ...
openhantek/src/hantek/control.cpp
... ... @@ -1040,6 +1040,9 @@ namespace Hantek {
1040 1040 /// \param samplerate The samplerate that should be met (S/s), 0.0 to restore current samplerate.
1041 1041 /// \return The samplerate that has been set, 0.0 on error.
1042 1042 double Control::setSamplerate(double samplerate) {
  1043 + if(!this->device->isConnected())
  1044 + return 0.0;
  1045 +
1043 1046 if(samplerate == 0.0) {
1044 1047 samplerate = this->settings.samplerate.target.samplerate;
1045 1048 }
... ... @@ -1067,6 +1070,9 @@ namespace Hantek {
1067 1070 /// \param duration The record time duration that should be met (s), 0.0 to restore current record time.
1068 1071 /// \return The record time duration that has been set, 0.0 on error.
1069 1072 double Control::setRecordTime(double duration) {
  1073 + if(!this->device->isConnected())
  1074 + return 0.0;
  1075 +
1070 1076 if(duration == 0.0) {
1071 1077 duration = this->settings.samplerate.target.duration;
1072 1078 }
... ...