Coder Social home page Coder Social logo

Add dummy mode about openhantek6022 HOT 6 CLOSED

openhantek avatar openhantek commented on June 8, 2024
Add dummy mode

from openhantek6022.

Comments (6)

Ho-Ro avatar Ho-Ro commented on June 8, 2024

Yeah, I already thought about this enhancement, I will check what's needed to bypass the HW detection when I've got some spare time...

from openhantek6022.

Ho-Ro avatar Ho-Ro commented on June 8, 2024

I think the proposal is still valuable but after looking at it for one hour it will take a lot of work to connect too many loose ends. When I want to test the program without my scope at hand I either take a cheap saleae LA clone, e.g. from Lcsoft. It doesn't provide usable values as there is no ADC connected to the EzUSB chip, but at least the GUI works as expected in realtime. And my most portable solution is an old and no more used DVB-T stick that's also EzUSB based. I define another 6022 model and udev rule with the new "cold" VID/PID and after uploading the FW into RAM this device looks like a 6022 (without useful data).
Maybe a volunteer wants to provide a working dummy mode as a Xmas gift. 👍

from openhantek6022.

marcizhu avatar marcizhu commented on June 8, 2024

What would be required to add this feature?
I haven't looked at the code too much, but maybe adding a fake DSOModel object that generates some simple waveforms should be enough.

Another (possibly more difficult option) would be to simulate a USB hardware device from the software itself, so the main program would detect a real device and start using it as such.

from openhantek6022.

Ho-Ro avatar Ho-Ro commented on June 8, 2024

The fake model is simple, I did this as mentioned above, also creating dummy samples is one line in hantekdsocontrol.cpp. But it's more difficult to circumvent the USB device detection and handling.
It starts there:

//////// Find matching usb devices ////////

Solution would be to define a dummy device: std::unique_ptr<USBDevice> device = dummy_device; maybe derived from class USBDevice that provides a dummy_model plus some more content, but never triggers any USB communication.
The data transfer happens in hantekdsocontrol.cpp, the device is polled by a timer every 25% of expected cycle time:
/// \brief Updates the interval of the periodic thread timer.

Please check the OpenHantek developer documentation and feel free to experiment :)

from openhantek6022.

marcizhu avatar marcizhu commented on June 8, 2024

Sure! I'll take a look at it and try to add this feature to the software in the next few days! If I succeed, I'll open a PR :D

from openhantek6022.

Ho-Ro avatar Ho-Ro commented on June 8, 2024

I implemented a demo mode with edc9a26, call it with OpenHantek --demoMode or OpenHantek -d.

from openhantek6022.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.