@@ -1766,19 +1766,7 @@ double HantekDsoControl::setPretriggerPosition(double position) {
1766
1766
return (double )positionSamples / settings.samplerate .current ;
1767
1767
}
1768
1768
1769
- #ifdef DEBUG
1770
- // / \brief Sends bulk/control commands directly.
1771
- // / <p>
1772
- // / <b>Syntax:</b><br />
1773
- // / <br />
1774
- // / Bulk command:
1775
- // / <pre>send bulk [<em>hex data</em>]</pre>
1776
- // / %Control command:
1777
- // / <pre>send control [<em>hex code</em>] [<em>hex data</em>]</pre>
1778
- // / </p>
1779
- // / \param command The command as string (Has to be parsed).
1780
- // / \return See ::Dso::ErrorCode.
1781
- int Control::stringCommand (QString command) {
1769
+ int HantekDsoControl::stringCommand (QString command) {
1782
1770
if (!this ->device ->isConnected ())
1783
1771
return Dso::ERROR_CONNECTION;
1784
1772
@@ -1832,7 +1820,6 @@ int Control::stringCommand(QString command) {
1832
1820
1833
1821
return Dso::ERROR_UNSUPPORTED;
1834
1822
}
1835
- #endif
1836
1823
1837
1824
void HantekDsoControl::run () {
1838
1825
int errorCode = 0 ;
@@ -1842,12 +1829,9 @@ void HantekDsoControl::run() {
1842
1829
if (!this ->commandPending [command])
1843
1830
continue ;
1844
1831
1845
- #ifdef DEBUG
1846
- timestampDebug (
1847
- QString (" Sending bulk command:%1" )
1832
+ timestampDebug (QString (" Sending bulk command:%1" )
1848
1833
.arg (hexDump (this ->command [command]->data (),
1849
1834
this ->command [command]->getSize ())));
1850
- #endif
1851
1835
1852
1836
errorCode = this ->device ->bulkCommand (this ->command [command]);
1853
1837
if (errorCode < 0 ) {
@@ -1867,13 +1851,11 @@ void HantekDsoControl::run() {
1867
1851
if (!this ->controlPending [control])
1868
1852
continue ;
1869
1853
1870
- #ifdef DEBUG
1871
1854
timestampDebug (
1872
1855
QString (" Sending control command %1:%2" )
1873
1856
.arg (QString::number (this ->controlCode [control], 16 ),
1874
1857
hexDump (this ->control [control]->data (),
1875
1858
this ->control [control]->getSize ())));
1876
- #endif
1877
1859
1878
1860
errorCode = this ->device ->controlWrite (this ->controlCode [control],
1879
1861
this ->control [control]->data (),
@@ -1917,9 +1899,8 @@ void HantekDsoControl::run() {
1917
1899
}
1918
1900
break ;
1919
1901
}
1920
- # ifdef DEBUG
1902
+
1921
1903
timestampDebug (" Starting to capture" );
1922
- #endif
1923
1904
1924
1905
this ->_samplingStarted = true ;
1925
1906
@@ -1934,9 +1915,8 @@ void HantekDsoControl::run() {
1934
1915
}
1935
1916
break ;
1936
1917
}
1937
- # ifdef DEBUG
1918
+
1938
1919
timestampDebug (" Enabling trigger" );
1939
- #endif
1940
1920
1941
1921
break ;
1942
1922
@@ -1949,9 +1929,8 @@ void HantekDsoControl::run() {
1949
1929
}
1950
1930
break ;
1951
1931
}
1952
- # ifdef DEBUG
1932
+
1953
1933
timestampDebug (" Forcing trigger" );
1954
- #endif
1955
1934
1956
1935
break ;
1957
1936
@@ -1961,11 +1940,9 @@ void HantekDsoControl::run() {
1961
1940
if (errorCode < 0 )
1962
1941
qWarning (" Getting sample data failed: %s" ,
1963
1942
libUsbErrorString (errorCode).toLocal8Bit ().data ());
1964
- #ifdef DEBUG
1965
1943
else
1966
1944
timestampDebug (
1967
1945
QString (" Received %1 B of sampling data" ).arg (errorCode));
1968
- #endif
1969
1946
1970
1947
// Check if we're in single trigger mode
1971
1948
if (settings.trigger .mode == Dso::TRIGGERMODE_SINGLE &&
@@ -1978,9 +1955,7 @@ void HantekDsoControl::run() {
1978
1955
break ;
1979
1956
1980
1957
default :
1981
- #ifdef DEBUG
1982
1958
timestampDebug (" Roll mode state unknown" );
1983
- #endif
1984
1959
break ;
1985
1960
}
1986
1961
@@ -1991,19 +1966,17 @@ void HantekDsoControl::run() {
1991
1966
// Standard mode
1992
1967
this ->rollState = ROLL_STARTSAMPLING;
1993
1968
1994
- #ifdef DEBUG
1995
- int lastCaptureState = this ->captureState ;
1996
- #endif
1969
+ const int lastCaptureState = this ->captureState ;
1997
1970
this ->captureState = this ->getCaptureState ();
1998
1971
if (this ->captureState < 0 )
1999
1972
qWarning (
2000
1973
" Getting capture state failed: %s" ,
2001
1974
libUsbErrorString (this ->captureState ).toLocal8Bit ().data ());
2002
- # ifdef DEBUG
1975
+
2003
1976
else if (this ->captureState != lastCaptureState)
2004
1977
timestampDebug (
2005
1978
QString (" Capture state changed to %1" ).arg (this ->captureState ));
2006
- # endif
1979
+
2007
1980
switch (this ->captureState ) {
2008
1981
case CAPTURE_READY:
2009
1982
case CAPTURE_READY2250:
@@ -2013,11 +1986,8 @@ void HantekDsoControl::run() {
2013
1986
if (errorCode < 0 )
2014
1987
qWarning (" Getting sample data failed: %s" ,
2015
1988
libUsbErrorString (errorCode).toLocal8Bit ().data ());
2016
- #ifdef DEBUG
2017
1989
else
2018
- timestampDebug (
2019
- QString (" Received %1 B of sampling data" ).arg (errorCode));
2020
- #endif
1990
+ timestampDebug (QString (" Received %1 B of sampling data" ).arg (errorCode));
2021
1991
2022
1992
// Check if we're in single trigger mode
2023
1993
if (settings.trigger .mode == Dso::TRIGGERMODE_SINGLE &&
@@ -2054,9 +2024,8 @@ void HantekDsoControl::run() {
2054
2024
}
2055
2025
break ;
2056
2026
}
2057
- # ifdef DEBUG
2027
+
2058
2028
timestampDebug (" Enabling trigger" );
2059
- #endif
2060
2029
} else if (this ->cycleCounter >= 8 + this ->startCycle &&
2061
2030
settings.trigger .mode == Dso::TRIGGERMODE_AUTO) {
2062
2031
// Force triggering
@@ -2069,9 +2038,8 @@ void HantekDsoControl::run() {
2069
2038
}
2070
2039
break ;
2071
2040
}
2072
- # ifdef DEBUG
2041
+
2073
2042
timestampDebug (" Forcing trigger" );
2074
- #endif
2075
2043
}
2076
2044
2077
2045
if (this ->cycleCounter < 20 ||
@@ -2088,9 +2056,8 @@ void HantekDsoControl::run() {
2088
2056
}
2089
2057
break ;
2090
2058
}
2091
- # ifdef DEBUG
2059
+
2092
2060
timestampDebug (" Starting to capture" );
2093
- #endif
2094
2061
2095
2062
this ->_samplingStarted = true ;
2096
2063
this ->cycleCounter = 0 ;
0 commit comments