From 71d88789924dafe1b24d4fa053f1e77b4172f29f Mon Sep 17 00:00:00 2001 From: Kyle Westhaus Date: Thu, 6 Apr 2023 22:51:23 -0700 Subject: [PATCH 1/4] Fix README typo in cs32 file format description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 05dd8de..19bda11 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ inspectrum supports the following file types: * `*.sigmf-meta, *.sigmf-data` - SigMF recordings * `*.cf32`, `*.cfile` - Complex 32-bit floating point samples (GNU Radio, osmocom_fft) * `*.cf64` - Complex 64-bit floating point samples - * `*.cs32` - Complex 16-bit signed integer samples (SDRAngel) + * `*.cs32` - Complex 32-bit signed integer samples (SDRAngel) * `*.cs16` - Complex 16-bit signed integer samples (BladeRF) * `*.cs8` - Complex 8-bit signed integer samples (HackRF) * `*.cu8` - Complex 8-bit unsigned integer samples (RTL-SDR) From 34c8ece4ccf12fe7dcf193a1c4610b64cf44a44b Mon Sep 17 00:00:00 2001 From: Kyle Westhaus Date: Thu, 6 Apr 2023 22:51:51 -0700 Subject: [PATCH 2/4] Allow specifying cs32 file format in command line Support for cs32 was added in #214 but only within sigmf files. This change surfaces that support to the -f option on the command line. --- src/inputsource.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/inputsource.cpp b/src/inputsource.cpp index ebbf749..a9f1fed 100644 --- a/src/inputsource.cpp +++ b/src/inputsource.cpp @@ -359,6 +359,9 @@ void InputSource::openFile(const char *filename) else if ((suffix == "cf64") || (suffix == "fc64")) { sampleAdapter = std::make_unique(); } + else if ((suffix == "cs32") || (suffix == "sc32") || (suffix == "c32")) { + sampleAdapter = std::make_unique(); + } else if ((suffix == "cs16") || (suffix == "sc16") || (suffix == "c16")) { sampleAdapter = std::make_unique(); } From 6dfa77565aafaf164098e956d35b5d3adb02a149 Mon Sep 17 00:00:00 2001 From: Kyle Westhaus Date: Thu, 6 Apr 2023 22:55:57 -0700 Subject: [PATCH 3/4] Include all format specifiers in README --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 19bda11..cd8ef6f 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,12 @@ Build instructions can be found here: https://github.com/miek/inspectrum/wiki/Bu ## Input inspectrum supports the following file types: * `*.sigmf-meta, *.sigmf-data` - SigMF recordings - * `*.cf32`, `*.cfile` - Complex 32-bit floating point samples (GNU Radio, osmocom_fft) - * `*.cf64` - Complex 64-bit floating point samples - * `*.cs32` - Complex 32-bit signed integer samples (SDRAngel) - * `*.cs16` - Complex 16-bit signed integer samples (BladeRF) - * `*.cs8` - Complex 8-bit signed integer samples (HackRF) - * `*.cu8` - Complex 8-bit unsigned integer samples (RTL-SDR) + * `*.cf32`, `*.fc32`, `*.cfile` - Complex 32-bit floating point samples (GNU Radio, osmocom_fft) + * `*.cf64`, `*.fc64` - Complex 64-bit floating point samples + * `*.cs32`, `*.sc32`, `*.c32` - Complex 32-bit signed integer samples (SDRAngel) + * `*.cs16`, `*.sc16`, `*.c16` - Complex 16-bit signed integer samples (BladeRF) + * `*.cs8`, `*.sc8`, `*.c8` - Complex 8-bit signed integer samples (HackRF) + * `*.cu8`, `*.uc8` - Complex 8-bit unsigned integer samples (RTL-SDR) * `*.f32` - Real 32-bit floating point samples * `*.f64` - Real 64-bit floating point samples (MATLAB) * `*.s16` - Real 16-bit signed integer samples From 7af44bc675b504e8ce48d5b17ed37a307425a9a4 Mon Sep 17 00:00:00 2001 From: Kyle Westhaus Date: Thu, 6 Apr 2023 22:56:33 -0700 Subject: [PATCH 4/4] Include format specifiers in help text Previously, the format specifiers were only included in the source repository README and the source code; this change adds the specifiers to the program help text as well. I looked at the QCommandLineOption API and there does not seem to be a way to specify a subset of allowed strings such that they are automatically included in the help text by QCommandLineParser - the canonical way is just to include the options in the matching help text as I have done in this commit. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 8b0a30d..7d3e90b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) QCoreApplication::translate("main", "Hz")); parser.addOption(rateOption); QCommandLineOption formatOption(QStringList() << "f" << "format", - QCoreApplication::translate("main", "Set file format."), + QCoreApplication::translate("main", "Set file format, options: cfile/cf32/fc32, cf64/fc64, cs32/sc32/c32, cs16/sc16/c16, cs8/sc8/c8, cu8/uc8, f32, f64, s16, s8, u8, sigmf-meta/sigmf-data."), QCoreApplication::translate("main", "fmt")); parser.addOption(formatOption);