Skip to content

Commit

Permalink
Save (offset) calibration file as *.ini
Browse files Browse the repository at this point in the history
Unique offset/gain calibration file:
Linux, Unix, macOS:
"$HOME/.config/OpenHantek/DSO-6022BE_NNNNNNNNNNNN_calibration.ini"
Windows:
"%APPDATA%\OpenHantek\DSO-6022BE_NNNNNNNNNNNN_calibration.ini"

Signed-off-by: Martin <[email protected]>
  • Loading branch information
Ho-Ro committed Mar 13, 2022
1 parent 74aaa56 commit f0e0cca
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 13 deletions.
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 "20220312 - commit 965"
#define OH_BUILD "20220313 - commit 966"
8 changes: 5 additions & 3 deletions openhantek/src/hantekdso/hantekdsocontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ HantekDsoControl::HantekDsoControl( ScopeDevice *device, const DSOModel *model,
// Apply special requirements by the devices model
model->applyRequirements( this );
getCalibrationFromEEPROM();
// unique offset/gain calibration file "DSO-6022BE_NNNNNNNNNNNN_calibration.conf" in ".config/OpenHantek"
// unique offset/gain calibration file:
// Linux, Unix, macOS: "$HOME/.config/OpenHantek/DSO-6022BE_NNNNNNNNNNNN_calibration.ini"
// Windows: "%APPDATA%\OpenHantek\DSO-6022BE_NNNNNNNNNNNN_calibration.ini"
calibrationSettings = std::unique_ptr< QSettings >(
new QSettings( QCoreApplication::organizationName(),
new QSettings( QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(),
scopeDevice->getModel()->name + "_" + scopeDevice->getSerialNumber() + "_calibration" ) );
// load the offsets (persistent, saved at shutdown)
// load the offsets (persistent, saved at shutdown as "*.ini" file, )
calibrationSettings->beginGroup( "offset" );
for ( int ch = 0; ch < HANTEK_CHANNEL_NUMBER; ++ch ) {
calibrationSettings->beginGroup( "ch" + QString::number( ch ) );
Expand Down
2 changes: 1 addition & 1 deletion openhantek/translations/openhantek_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@
<translation type="vanished">Konnte Kanalpegeldaten des Oszilloskops nicht lesen</translation>
</message>
<message>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="504"/>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="508"/>
<source>Couldn&apos;t get calibration data from oscilloscope&apos;s EEPROM. Use a config file for calibration!</source>
<translation>Konnte Kalibrierdaten des Oszilloskops nicht lesen, benutze eine config-Datei für die Kalibrierung!</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion openhantek/translations/openhantek_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@
<translation type="vanished">No se pudieron obtener los datos de calibración del osciloscopio</translation>
</message>
<message>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="504"/>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="508"/>
<source>Couldn&apos;t get calibration data from oscilloscope&apos;s EEPROM. Use a config file for calibration!</source>
<translation>No se pudieron obtener los datos de calibración del osciloscopio. ¡Usa un archivo de configuración para la calibración!</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion openhantek/translations/openhantek_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@
<translation type="vanished">Impossible d&apos;obtenir les données de niveau du canal depuis l&apos;oscilloscope</translation>
</message>
<message>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="504"/>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="508"/>
<source>Couldn&apos;t get calibration data from oscilloscope&apos;s EEPROM. Use a config file for calibration!</source>
<translation>Impossible d&apos;obtenir les données de niveau du canal depuis l&apos;oscilloscope. Utilisez un fichier de configuration pour la calibration !</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion openhantek/translations/openhantek_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@
<context>
<name>HantekDsoControl</name>
<message>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="504"/>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="508"/>
<source>Couldn&apos;t get calibration data from oscilloscope&apos;s EEPROM. Use a config file for calibration!</source>
<translation>Impossibile ottenere i dati di calibrazione dall&apos;EEPROM dell&apos;oscilloscopio. Utilizzare un file di configurazione per la calibrazione!</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion openhantek/translations/openhantek_pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@
<translation type="vanished">Nie można uzyskać danych o poziomie kanału z oscyloskopu</translation>
</message>
<message>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="504"/>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="508"/>
<source>Couldn&apos;t get calibration data from oscilloscope&apos;s EEPROM. Use a config file for calibration!</source>
<translation>Nie można pobrać danych kalibracyjnych z pamięci EEPROM oscyloskopu. Użyj pliku konfiguracyjnego do kalibracji!</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion openhantek/translations/openhantek_pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@
<translation type="vanished">Não foi possível obter dados do canal do osciloscópio</translation>
</message>
<message>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="504"/>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="508"/>
<source>Couldn&apos;t get calibration data from oscilloscope&apos;s EEPROM. Use a config file for calibration!</source>
<translation>Não foi possível obter dados de calibração a partir da EEPROM do osciloscópio. Use um arquivo de configuração para a calibração!</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion openhantek/translations/openhantek_ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@
<context>
<name>HantekDsoControl</name>
<message>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="504"/>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="508"/>
<source>Couldn&apos;t get calibration data from oscilloscope&apos;s EEPROM. Use a config file for calibration!</source>
<translation>Не удалось получить данные калибровки из EEPROM осциллографа. Используйте файл конфигурации для калибровки!</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion openhantek/translations/openhantek_sv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@
<context>
<name>HantekDsoControl</name>
<message>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="504"/>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="508"/>
<source>Couldn&apos;t get calibration data from oscilloscope&apos;s EEPROM. Use a config file for calibration!</source>
<translation>Kunde inte hämta kalibreringsdata från oscilloskopets EEPROM. Använd en konfigurationsfil för kalibrering!</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion openhantek/translations/openhantek_zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@
<translation type="vanished">获取示波器通道数据失败</translation>
</message>
<message>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="504"/>
<location filename="../src/hantekdso/hantekdsocontrol.cpp" line="508"/>
<source>Couldn&apos;t get calibration data from oscilloscope&apos;s EEPROM. Use a config file for calibration!</source>
<translation>从示波器EEPOM获取校准数据失败,请使用配置文件进行校准!</translation>
</message>
Expand Down

0 comments on commit f0e0cca

Please sign in to comment.