Skip to content

Commit

Permalink
Merge branch 'fgrieu-signed-windows-inf-files'
Browse files Browse the repository at this point in the history
Easier install on Windows

Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>
  • Loading branch information
Ho-Ro committed Dec 23, 2021
2 parents 31c5ee2 + b10be56 commit 9916cf3
Show file tree
Hide file tree
Showing 17 changed files with 392 additions and 7 deletions.
29 changes: 29 additions & 0 deletions cmake/libusb_on_windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,24 @@ endif()

# set file names for lib and associated inf/cat files
set(LIBUSB_7Z "${CMAKE_CURRENT_LIST_DIR}/libusb-1.0.21-win.7z")
# use "old" cat/inf files provided by VictorEEV
set(HANTEK_6022B_CAT "${CMAKE_CURRENT_LIST_DIR}/Hantek_6022B.cat")
set(HANTEK_6022B_INF "${CMAKE_CURRENT_LIST_DIR}/Hantek_6022B.inf")
# use "new" cat/inf files provided by fgrieu (PR #251)
set(INF_DIR "${CMAKE_CURRENT_LIST_DIR}/../utils/signed-windows-inf-files")
set(HANTEK_6022BE_LOADER_CAT "${INF_DIR}/Hantek_6022BE_loader.cat")
set(HANTEK_6022BE_LOADER_INF "${INF_DIR}/Hantek_6022BE_loader.inf")
set(HANTEK_6022BE_OPENHT_CAT "${INF_DIR}/Hantek_6022BE_openht.cat")
set(HANTEK_6022BE_OPENHT_INF "${INF_DIR}/Hantek_6022BE_openht.inf")
set(HANTEK_6022BE_SIGROK_CAT "${INF_DIR}/Hantek_6022BE_sigrok.cat")
set(HANTEK_6022BE_SIGROK_INF "${INF_DIR}/Hantek_6022BE_sigrok.inf")
set(HANTEK_6022BL_LOADER_CAT "${INF_DIR}/Hantek_6022BL_loader.cat")
set(HANTEK_6022BL_LOADER_INF "${INF_DIR}/Hantek_6022BL_loader.inf")
set(HANTEK_6022BL_OPENHT_CAT "${INF_DIR}/Hantek_6022BL_openht.cat")
set(HANTEK_6022BL_OPENHT_INF "${INF_DIR}/Hantek_6022BL_openht.inf")
set(HANTEK_6022BL_SIGROK_CAT "${INF_DIR}/Hantek_6022BL_sigrok.cat")
set(HANTEK_6022BL_SIGROK_INF "${INF_DIR}/Hantek_6022BL_sigrok.inf")
set(README_INSTALL_TXT "${INF_DIR}/README_INSTALL.txt")
set(LIBUSB_DIR "${CMAKE_BINARY_DIR}/libusb-1.0.21-win")

execute_process(
Expand All @@ -37,6 +53,19 @@ add_custom_command(TARGET ${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LIBUSB_DIR}/${ARCH}/libusb-1.0.dll" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022B_CAT}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022B_INF}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BE_LOADER_CAT}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BE_LOADER_INF}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BE_OPENHT_CAT}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BE_OPENHT_INF}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BE_SIGROK_CAT}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BE_SIGROK_INF}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BL_LOADER_CAT}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BL_LOADER_INF}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BL_OPENHT_CAT}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BL_OPENHT_INF}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BL_SIGROK_CAT}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${HANTEK_6022BL_SIGROK_INF}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${README_INSTALL_TXT}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMENT "Copy libusb-1 dlls and inf/cat files for ${PROJECT_NAME}"
)

10 changes: 5 additions & 5 deletions docs/developer_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ In `Roll` mode the latest sample values are always put at the end of the result
this rolls the displayed trace permanently to the left.
The conversion uses either the factory calibration values from EEPROM or from a user supplied config file.
Read more about [calibration](https://github.com/Ho-Ro/Hantek6022API/blob/main/README.md#create-calibration-values-for-openhantek).
* `searchTriggerPosition()`
* `searchTriggeredPosition()`
* Checks if the signal is triggered and calculates the starting point for a stable display.
The time distance to the following opposite slope is measured and displayed as pulse width in the top row.
* `provideTriggeredData()` handles the trigger mode:
Expand Down Expand Up @@ -223,12 +223,12 @@ becomes true again. The reused samples are emitted at lower speed (every 20 ms)
* which creates a third MATH channel as one of these data sample combinations:
`CH1 + CH2`, `CH1 - CH2`, `CH2 - CH1`, `CH1 * CH2`, `CH1 AC` or `CH2 AC`.
* `SpectrumGenerator::process()`
* For each active channel:
* For each active channel:
* Calculate the peak-to-peak, DC (average), AC (rms) and effective value ( sqrt( DC² + AC² ) ).
* Apply a user selected window function and scale the result accordingly.
* Calculate the spectrum of the AC part of the signal scaled as dBV. fft: f(t) F(ω)
* Calculate the spectrum of the AC part of the signal scaled as dBV. FFT: f(t) ∘⎯ F(ω)
* Calculate the autocorrelation to get the frequency of the signal:
* Calculate power spectrum |F(ω)|² and do an ifft: F(ω) ∙ F(ω) f(t) ⊗ f(t) (autocorrelation, i.e. convolution of f(t) with f(t))
* Calculate power spectrum |F(ω)|² and do an IFFT: F(ω) ∙ F(ω) ⎯∘ f(t) ⊗ f(t) (autocorrelation, i.e. convolution of f(t) with f(t))
* This is quite inaccurate at high frequencies. In these cases the first peak value of the spectrum is used.
* Calculate the THD (optional): `THD = sqrt( power_of_harmonics / power_of_fundamental )`
* `GraphGenerator::process()`
Expand All @@ -240,7 +240,7 @@ becomes true again. The reused samples are emitted at lower speed (every 20 ms)
The procedure takes care of interpolating in *Step* or *Sinc* mode and it will also create the histogram if enabled.
* `GraphGenerator::generateGraphsTYspectrum()` creates up to three (SP1, SP2, SPM) spectral traces.
* Finally `PostProcessing` emits the signal `processingFinished()` that is connected to:
* `ExporterRegistry::input()` that takes care of exporting to CSV data.
* `ExporterRegistry::input()` that takes care of exporting to CSV or JSON data.
* `MainWindow::showNewData()`.
* which calls `DsoWidget::showNew()` that calls `GlScope::showData()` that calls `Graph::writeData()`.

Expand Down
2 changes: 1 addition & 1 deletion openhantek/src/OH_BUILD.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Do not edit, will be re-created at each commit!
#define OH_BUILD "20211216 - commit 940"
#define OH_BUILD "20211223 - commit 944"
2 changes: 1 addition & 1 deletion openhantek/src/OH_VERSION.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// next line shall define either OH_VERSION or LAST_OH_VERSION
//
#define OH_VERSION "3.2.5"
#define LAST_OH_VERSION "3.2.5"


// do not edit below
Expand Down
Binary file not shown.
53 changes: 53 additions & 0 deletions utils/signed-windows-inf-files/Hantek_6022BE_loader.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
; Installs WinUsb for Hantek 6022BE loader

[Version]
Signature = "$Windows NT$"
Class = USBDevice
ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider = %ManufacturerName%
CatalogFile=Hantek_6022BE_loader.cat
DriverVer = 12/23/2021, 21.12.23.4
PnpLockDown=1

; ========== Manufacturer/Models sections ===========

[Manufacturer]
%ManufacturerName% = Standard,NTamd64,NTx86

[Standard.NTamd64]
%DeviceName% = USB_Install, USB\VID_04B4&PID_6022

[Standard.NTx86]
%DeviceName% = USB_Install, USB\VID_04B4&PID_6022

; =================== Installation ===================

[USB_Install]
Include=winusb.inf
Needs=WINUSB.NT

[USB_Install.Services]
Include=winusb.inf
AddService=WinUsb,0x00000002,WinUsb_ServiceInstall

[WinUsb_ServiceInstall]
DisplayName = %WinUsb_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys

[USB_Install.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
; By default, USBDevice class uses iProduct descriptor to name the device
; The following line (uncommented) forces using %DeviceName%
HKR,,FriendlyName,,%DeviceName%
HKR,,DeviceInterfaceGUIDs,0x10000,"{C4B9C054-04B4-6022-367C-22756B7032DB}"

[Strings]
ManufacturerName="Hantek"
ClassName="Universal Serial Bus devices"
WinUsb_SvcDesc="WinUSB Driver"
DeviceName="Hantek 6022BE loader"
Binary file not shown.
53 changes: 53 additions & 0 deletions utils/signed-windows-inf-files/Hantek_6022BE_openht.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
; Installs WinUsb for Hantek 6022BE openht

[Version]
Signature = "$Windows NT$"
Class = USBDevice
ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider = %ManufacturerName%
CatalogFile=Hantek_6022BE_openht.cat
DriverVer = 12/23/2021, 21.12.23.4
PnpLockDown=1

; ========== Manufacturer/Models sections ===========

[Manufacturer]
%ManufacturerName% = Standard,NTamd64,NTx86

[Standard.NTamd64]
%DeviceName% = USB_Install, USB\VID_04B5&PID_6022

[Standard.NTx86]
%DeviceName% = USB_Install, USB\VID_04B5&PID_6022

; =================== Installation ===================

[USB_Install]
Include=winusb.inf
Needs=WINUSB.NT

[USB_Install.Services]
Include=winusb.inf
AddService=WinUsb,0x00000002,WinUsb_ServiceInstall

[WinUsb_ServiceInstall]
DisplayName = %WinUsb_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys

[USB_Install.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
; By default, USBDevice class uses iProduct descriptor to name the device
; The following line (uncommented) forces using %DeviceName%
HKR,,FriendlyName,,%DeviceName%
HKR,,DeviceInterfaceGUIDs,0x10000,"{C4B9C054-04B5-6022-367C-22756B7032DB}"

[Strings]
ManufacturerName="Hantek"
ClassName="Universal Serial Bus devices"
WinUsb_SvcDesc="WinUSB Driver"
DeviceName="Hantek 6022BE openht"
Binary file not shown.
53 changes: 53 additions & 0 deletions utils/signed-windows-inf-files/Hantek_6022BE_sigrok.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
; Installs WinUsb for Hantek 6022BE sigrok

[Version]
Signature = "$Windows NT$"
Class = USBDevice
ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider = %ManufacturerName%
CatalogFile=Hantek_6022BE_sigrok.cat
DriverVer = 12/23/2021, 21.12.23.4
PnpLockDown=1

; ========== Manufacturer/Models sections ===========

[Manufacturer]
%ManufacturerName% = Standard,NTamd64,NTx86

[Standard.NTamd64]
%DeviceName% = USB_Install, USB\VID_1D50&PID_608E&REV_0000

[Standard.NTx86]
%DeviceName% = USB_Install, USB\VID_1D50&PID_608E&REV_0000

; =================== Installation ===================

[USB_Install]
Include=winusb.inf
Needs=WINUSB.NT

[USB_Install.Services]
Include=winusb.inf
AddService=WinUsb,0x00000002,WinUsb_ServiceInstall

[WinUsb_ServiceInstall]
DisplayName = %WinUsb_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys

[USB_Install.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
; By default, USBDevice class uses iProduct descriptor to name the device
; The following line (uncommented) forces using %DeviceName%
HKR,,FriendlyName,,%DeviceName%
HKR,,DeviceInterfaceGUIDs,0x10000,"{C4B9C054-1D50-608E-0000-22756B7032DB}"

[Strings]
ManufacturerName="Hantek"
ClassName="Universal Serial Bus devices"
WinUsb_SvcDesc="WinUSB Driver"
DeviceName="Hantek 6022BE sigrok"
Binary file not shown.
53 changes: 53 additions & 0 deletions utils/signed-windows-inf-files/Hantek_6022BL_loader.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
; Installs WinUsb for Hantek 6022BL loader

[Version]
Signature = "$Windows NT$"
Class = USBDevice
ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider = %ManufacturerName%
CatalogFile=Hantek_6022BL_loader.cat
DriverVer = 12/23/2021, 21.12.23.4
PnpLockDown=1

; ========== Manufacturer/Models sections ===========

[Manufacturer]
%ManufacturerName% = Standard,NTamd64,NTx86

[Standard.NTamd64]
%DeviceName% = USB_Install, USB\VID_04B4&PID_602A

[Standard.NTx86]
%DeviceName% = USB_Install, USB\VID_04B4&PID_602A

; =================== Installation ===================

[USB_Install]
Include=winusb.inf
Needs=WINUSB.NT

[USB_Install.Services]
Include=winusb.inf
AddService=WinUsb,0x00000002,WinUsb_ServiceInstall

[WinUsb_ServiceInstall]
DisplayName = %WinUsb_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys

[USB_Install.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
; By default, USBDevice class uses iProduct descriptor to name the device
; The following line (uncommented) forces using %DeviceName%
HKR,,FriendlyName,,%DeviceName%
HKR,,DeviceInterfaceGUIDs,0x10000,"{C4B9C054-04B4-602A-367C-22756B7032DB}"

[Strings]
ManufacturerName="Hantek"
ClassName="Universal Serial Bus devices"
WinUsb_SvcDesc="WinUSB Driver"
DeviceName="Hantek 6022BL loader"
Binary file not shown.
53 changes: 53 additions & 0 deletions utils/signed-windows-inf-files/Hantek_6022BL_openht.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
; Installs WinUsb for Hantek 6022BL openht

[Version]
Signature = "$Windows NT$"
Class = USBDevice
ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider = %ManufacturerName%
CatalogFile=Hantek_6022BL_openht.cat
DriverVer = 12/23/2021, 21.12.23.4
PnpLockDown=1

; ========== Manufacturer/Models sections ===========

[Manufacturer]
%ManufacturerName% = Standard,NTamd64,NTx86

[Standard.NTamd64]
%DeviceName% = USB_Install, USB\VID_04B5&PID_602A

[Standard.NTx86]
%DeviceName% = USB_Install, USB\VID_04B5&PID_602A

; =================== Installation ===================

[USB_Install]
Include=winusb.inf
Needs=WINUSB.NT

[USB_Install.Services]
Include=winusb.inf
AddService=WinUsb,0x00000002,WinUsb_ServiceInstall

[WinUsb_ServiceInstall]
DisplayName = %WinUsb_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys

[USB_Install.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
; By default, USBDevice class uses iProduct descriptor to name the device
; The following line (uncommented) forces using %DeviceName%
HKR,,FriendlyName,,%DeviceName%
HKR,,DeviceInterfaceGUIDs,0x10000,"{C4B9C054-04B5-602A-367C-22756B7032DB}"

[Strings]
ManufacturerName="Hantek"
ClassName="Universal Serial Bus devices"
WinUsb_SvcDesc="WinUSB Driver"
DeviceName="Hantek 6022BL openht"
Binary file not shown.
Loading

0 comments on commit 9916cf3

Please sign in to comment.