1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-21 23:55:13 -05:00

Merge pull request #177 from beta-tester/dev

modified unique file name
This commit is contained in:
f4exb 2018-05-11 10:14:11 +02:00 committed by GitHub
commit 251b93f97a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 20 additions and 13 deletions

View File

@ -308,7 +308,7 @@ bool AirspyInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -325,7 +325,7 @@ bool AirspyHFInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -280,7 +280,7 @@ bool BladerfInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -250,7 +250,7 @@ bool FCDProInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -244,7 +244,7 @@ bool FCDProPlusInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -263,7 +263,7 @@ bool HackRFInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -692,7 +692,7 @@ bool LimeSDRInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -197,7 +197,7 @@ bool PerseusInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -195,7 +195,7 @@ bool PlutoSDRInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -309,7 +309,7 @@ bool RTLSDRInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -190,7 +190,7 @@ bool SDRdaemonSourceInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -304,7 +304,7 @@ bool SDRPlayInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -182,7 +182,7 @@ bool TestSourceInput::handleMessage(const Message& message)
if (m_settings.m_fileRecordName.size() != 0) { if (m_settings.m_fileRecordName.size() != 0) {
m_fileSink->setFileName(m_settings.m_fileRecordName); m_fileSink->setFileName(m_settings.m_fileRecordName);
} else { } else {
m_fileSink->setFileName(QString("rec%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThhmmss"))); m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
} }
m_fileSink->startRecording(); m_fileSink->startRecording();

View File

@ -4,6 +4,7 @@
#include "util/message.h" #include "util/message.h"
#include <QDebug> #include <QDebug>
#include <QDateTime>
FileRecord::FileRecord() : FileRecord::FileRecord() :
BasebandSampleSink(), BasebandSampleSink(),
@ -42,6 +43,11 @@ void FileRecord::setFileName(const QString& filename)
} }
} }
void FileRecord::genUniqueFileName(uint deviceUID)
{
setFileName(QString("rec%1_%2.sdriq").arg(deviceUID).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddTHH_mm_ss_zzz")));
}
void FileRecord::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly __attribute__((unused))) void FileRecord::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly __attribute__((unused)))
{ {
// if no recording is active, send the samples to /dev/null // if no recording is active, send the samples to /dev/null

View File

@ -29,6 +29,7 @@ public:
quint64 getByteCount() const { return m_byteCount; } quint64 getByteCount() const { return m_byteCount; }
void setFileName(const QString& filename); void setFileName(const QString& filename);
void genUniqueFileName(uint deviceUID);
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly); virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly);
virtual void start(); virtual void start();