Commit dd5fde1ce7d34d9686f85dd8cce14622558d217c

Authored by David Graeff
Committed by David Gräff
1 parent 79301088

Add first part of a developer documentation

openhantek/readme.md 0 → 100644
  1 +# OpenHantek developer documentation
  2 +
  3 +This document explains the basic data flow and concepts used and should be amended
  4 +whenever a new concept is added to the code base.
  5 +Detailed information about an implementation are to be found in the specific directory readmes though.
  6 +
  7 +## Directory structure
  8 +
  9 +The *res* folder contains mostly binary resource data that are bundled with the executable,
  10 +like icons, images and firmwares.
  11 +
  12 +The *translations* folder contains translations in the Qt format. Use Qt linguist
  13 +as a handy graphical interface to translate OpenHantek.
  14 +
  15 +The source code within *src* can be divided into a **core**, that is responsible for device communication,
  16 +data acquisition and post processing and the **graphical interface** with several custom widgets,
  17 +a configuration interface and an OpenGL renderer.
  18 +
  19 +### Core structure
  20 +
  21 +The raw device communcation takes place in the *src/usb* directory, especially via the `USBDevice` class.
  22 +To find suitable devices, the `FindDevices` class in the same folder is used. Firmware upload is realized
  23 +via the `ezusb` helper methods and the `UploadFirmware` class.
  24 +
  25 +The hantek protocol structures and constants are defined within `src/hantekprotocol`.
  26 +
  27 +The heart of OpenHantek is the `src/hantekdso` folder and its `hantekdsocontrol` class. All supported
  28 +models, based on the `DsoModel` class, are implemented within a subfolder `src/hantekdso/models` and automatically register themself
  29 +to a `ModelRegistry` class. A model is based on (contains) a specification, the `ControlSpecification` class.
  30 +
  31 +The `hantekdsocontrol` class keeps track of the devices current state (samplerate, selected gain, activated channels, etc)
  32 +via the `ControlSettings` class and field.
  33 +It outputs the channel separated unprocessed samples via a `samplesAvailable(DSOsamples*)` signal.
  34 +
  35 +Before the data is presented to the GUI it arrives in the `src/post/postprocessing` class. Several post
  36 +processing classes are to be found in this directory as well.
  37 +
  38 +### Graphical interface structure
  39 +
  40 +The initial dialog for device selection is realized in *src/selectdevice* where several models
  41 +and dialogs are implemented. This is basically a graphical wrapper around the `src/usb/finddevices` class.
  42 +
  43 +You will find the configuration dialog pages to be implemented in *src/configdialog*.
  44 +
  45 +Custom widgets like a LevelSlider with a unit suffix reside in *src/widgets*, the custom main window docks are
  46 +in *src/docks*.
  47 +
  48 +The code that is responsible for exporting data to images or to the printer is stored in *src/exporting*.
  49 +
  50 +The main window itself doesn't do and shouldn't do much more than connecting signals/slots between the core part
  51 +and the graphical part.
  52 +
  53 +All OpenGL rendering takes place in the `GlScope` class. A helper class `GlScopeGraph` contains exactly one
  54 +data sample snapshot including all channels for voltage and spectrum and a pointer to the respective GPU buffer.
  55 +`GlScope` works for OpenGL 3.2 and OpenGL ES 2.0, but this needs to be decided at compile time. Usually Qt
  56 +selects the right interface.
  57 +
  58 +## Data flow
  59 +
  60 +To be written
openhantek/src/usb/readme.md
@@ -4,4 +4,3 @@ USB transfer functionality. @@ -4,4 +4,3 @@ USB transfer functionality.
4 4
5 # Dependency 5 # Dependency
6 Files in this directory should NOT depend on anything outside of this directory. 6 Files in this directory should NOT depend on anything outside of this directory.
7 -An exception are classes from the `utils` folder.