FileSink: give .sdriq extension to provided file name automatically. Fixes #780

pull/788/head
f4exb 2021-02-19 15:53:43 +01:00
rodzic ecc27467c1
commit b865d995a4
2 zmienionych plików z 23 dodań i 1 usunięć

Wyświetl plik

@ -264,10 +264,28 @@ void FileSinkSink::applySettings(const FileSinkSettings& settings, bool force)
<< "m_fileRecordName: " << settings.m_fileRecordName
<< "force: " << force;
QString fileRecordName = settings.m_fileRecordName;
if ((settings.m_fileRecordName != m_settings.m_fileRecordName) || force)
{
QStringList dotBreakout = settings.m_fileRecordName.split(QLatin1Char('.'));
if (dotBreakout.size() > 1) {
QString extension = dotBreakout.last();
if (extension != "sdriq") {
dotBreakout.last() = "sdriq";
}
}
else
{
dotBreakout.append("sdriq");
}
fileRecordName = dotBreakout.join(QLatin1Char('.'));
QString fileBase;
FileRecordInterface::RecordType recordType = FileRecordInterface::guessTypeFromFileName(settings.m_fileRecordName, fileBase);
FileRecordInterface::RecordType recordType = FileRecordInterface::guessTypeFromFileName(fileRecordName, fileBase);
if (recordType == FileRecordInterface::RecordTypeSdrIQ)
{
@ -293,6 +311,7 @@ void FileSinkSink::applySettings(const FileSinkSettings& settings, bool force)
}
m_settings = settings;
m_settings.m_fileRecordName = fileRecordName;
}
void FileSinkSink::squelchRecording(bool squelchOpen)

Wyświetl plik

@ -13,6 +13,9 @@ Each recording is written in a new file with the starting timestamp before the `
- Given file name: `test.first.sdriq` then a recording file will be like: `test.2020-08-05T22_00_07_974.sdriq`
- Given file name: `record.test.first.sdriq` then a recording file will be like: `reocrd.test.2020-08-05T21_39_52_974.sdriq`
If a filename is given without `.sdriq` extension then the `.sdriq` extension is appended automatically before the above algorithm is applied.
If a filename is given with an extension different of `.sdriq` then the extension is replaced by `.sdriq` automatically before the above algorithm is applied.
<h2>Interface</h2>
![File Sink plugin GUI](../../../doc/img/FileSink_plugin.png)