OpenHantek / OpenHantek6022

OpenHantek6022 is a DSO software for Hantek USB digital signal oscilloscopes 6022BE / BL. Development OS is Debian Linux, but the program also works on FreeBSD, MacOS, RaspberryPi and Windows. No support for non-Linux related issues unless a volunteer steps in!
GNU General Public License v3.0
868 stars 153 forks source link

"Horizontal" menu disappeared #210

Closed gabopushups closed 3 years ago

gabopushups commented 3 years ago

Describe your problem

Just until last night the program was running fine, but now the "Horizontal" menu has disappeared, and I can't find any way to enable it. I've tried restarting the program, removing and re-installing it, but it still does not appear anywhere.

By right clicking the menu, all options are greyed out, and I can't tick the "Horizontal" option

image

gabopushups commented 3 years ago

I found a workaround that required modifying the code.

I went to openhantek/src/docks/ and then modified the file "HorizontalDock.cpp" by adding the function show() under the loadSettings function.

void HorizontalDock::loadSettings( DsoSettingsScope *scope ) {
    show(); // Show the missing dock
    // Set values
    setSamplerate( scope->horizontal.samplerate );
    setTimebase( scope->horizontal.timebase );
    setFormat( scope->horizontal.format );
    setCalfreq( scope->horizontal.calfreq );
}

And then had of course to rebuild the program. It's not the most elegant solution, but it worked for me.

Ho-Ro commented 3 years ago

I've never encountered this issue or heard about it. You have two easy solutions without programming:

  1. Go to menu Oscilloscope/Settings/Scope and tick the entry [X] Apply default settings after next restart Exit the program and start again.
  2. If you do not want to lose all of your settings you can reset only the window state in the persistent settings: Exit the program. Edit ~/.config/OpenHantek/DSO-6022BE_XXXXXXXXXXXX.conf (where XXX.. is the hex serial number of your device) and delete in section [window] the line state=@ByteArray(... Start the program again. I suppose that you are using Linux, under Windows delete the state settings in the registry Computer\HKEY_CURRENT_USER\SOFTWARE\OpenHantek\DSO-6022BE_XXXXXXXXXXXX\window, dunno where to look under MacOS.

If this issue shows up more often, here's a belt-and-suspender solution:

--- a/openhantek/src/mainwindow.cpp
+++ b/openhantek/src/mainwindow.cpp
@@ -162,6 +162,11 @@ MainWindow::MainWindow( HantekDsoControl *dsoControl, DsoSettings *settings, Exp
     restoreGeometry( dsoSettings->mainWindowGeometry );
     restoreState( dsoSettings->mainWindowState );

+    voltageDock->show();    // enable this dock regardless of state
+    horizontalDock->show(); // enable this dock regardless of state
+    triggerDock->show();    // enable this dock regardless of state
+    spectrumDock->show();   // enable this dock regardless of state
+
     // Central oszilloscope widget
     dsoWidget = new DsoWidget( &dsoSettings->scope, &dsoSettings->view, spec );
     setCentralWidget( dsoWidget );