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

Windows: MSVC2017: changes in sdrbase (1)

This commit is contained in:
f4exb 2018-11-12 14:04:16 +01:00
parent 696e7324a4
commit 6708a6b700
17 changed files with 244 additions and 115 deletions

View File

@ -143,7 +143,7 @@ public:
bool IsZero() const
{
return m_t == 0;
return m_t == 0.0;
}
private:
#ifdef RTP_HAVE_QUERYPERFORMANCECOUNTER

View File

@ -46,41 +46,33 @@ public:
virtual QByteArray serialize() const = 0;
virtual bool deserialize(const QByteArray& data) = 0;
#ifdef _MSC_VER
virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) response;
errorMessage = "Not implemented"; return 501;
}
virtual int webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) force;
(void) channelSettingsKeys;
(void) response;
errorMessage = "Not implemented"; return 501;
}
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
#else
virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response __attribute__((unused)),
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
virtual int webapiSettingsPutPatch(
bool force __attribute__((unused)),
const QStringList& channelSettingsKeys __attribute__((unused)),
SWGSDRangel::SWGChannelSettings& response __attribute__((unused)),
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response __attribute__((unused)),
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
#endif
{
(void) response;
errorMessage = "Not implemented"; return 501;
}
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }

View File

@ -38,29 +38,40 @@ public:
virtual void getIdentifier(QString& id) = 0;
virtual void getTitle(QString& title) = 0;
virtual void setName(const QString& name) { m_name = name; };
virtual QString getName() const { return m_name; };
virtual void setName(const QString& name) { m_name = name; }
virtual QString getName() const { return m_name; }
virtual qint64 getCenterFrequency() const = 0;
virtual QByteArray serialize() const = 0;
virtual bool deserialize(const QByteArray& data) = 0;
virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response __attribute__((unused)),
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) response;
errorMessage = "Not implemented"; return 501;
}
virtual int webapiSettingsPutPatch(
bool force __attribute__((unused)),
const QStringList& channelSettingsKeys __attribute__((unused)),
SWGSDRangel::SWGChannelSettings& response __attribute__((unused)),
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) force;
(void) channelSettingsKeys;
(void) response;
errorMessage = "Not implemented"; return 501;
}
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response __attribute__((unused)),
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) response;
errorMessage = "Not implemented"; return 501;
}
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }

View File

@ -21,7 +21,7 @@
#include <QProcess>
Command::Command() :
m_currentProcess(0),
m_currentProcess(nullptr),
m_currentProcessState(QProcess::NotRunning),
m_isInError(false),
m_currentProcessError(QProcess::UnknownError),
@ -30,10 +30,8 @@ Command::Command() :
m_currentProcessExitStatus(QProcess::NormalExit),
m_currentProcessPid(0)
{
m_currentProcessStartTimeStamp.tv_sec = 0;
m_currentProcessStartTimeStamp.tv_usec = 0;
m_currentProcessFinishTimeStamp.tv_sec = 0;
m_currentProcessFinishTimeStamp.tv_usec = 0;
m_currentProcessStartTimeStamp = 0;
m_currentProcessFinishTimeStamp = 0;
resetToDefaults();
}
@ -48,7 +46,7 @@ Command::Command(const Command& command) :
m_keyModifiers(command.m_keyModifiers),
m_associateKey(command.m_associateKey),
m_release(command.m_release),
m_currentProcess(0),
m_currentProcess(nullptr),
m_currentProcessState(QProcess::NotRunning),
m_isInError(false),
m_currentProcessError(QProcess::UnknownError),
@ -57,10 +55,8 @@ Command::Command(const Command& command) :
m_currentProcessExitStatus(QProcess::NormalExit),
m_currentProcessPid(0)
{
m_currentProcessStartTimeStamp.tv_sec = 0;
m_currentProcessStartTimeStamp.tv_usec = 0;
m_currentProcessFinishTimeStamp.tv_sec = 0;
m_currentProcessFinishTimeStamp.tv_usec = 0;
m_currentProcessStartTimeStamp = 0;
m_currentProcessFinishTimeStamp = 0;
}
Command::~Command()
@ -85,7 +81,7 @@ void Command::resetToDefaults()
m_command = "";
m_argString = "";
m_key = static_cast<Qt::Key>(0);
m_keyModifiers = Qt::NoModifier,
m_keyModifiers = Qt::NoModifier;
m_associateKey = false;
m_release = false;
}
@ -202,7 +198,7 @@ void Command::run(const QString& apiAddress, int apiPort, int deviceSetIndex)
connect(m_currentProcess, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(processStateChanged(QProcess::ProcessState)));
m_currentProcess->setProcessChannelMode(QProcess::MergedChannels);
gettimeofday(&m_currentProcessStartTimeStamp, 0);
m_currentProcessStartTimeStamp = clock();
m_currentProcess->start(m_currentProcessCommandLine);
}
@ -258,7 +254,7 @@ void Command::processStateChanged(QProcess::ProcessState newState)
void Command::processError(QProcess::ProcessError error)
{
//qDebug("Command::processError: %d state: %d", error, m_currentProcessState);
gettimeofday(&m_currentProcessFinishTimeStamp, 0);
m_currentProcessFinishTimeStamp = clock();
m_currentProcessError = error;
m_isInError = true;
@ -275,14 +271,14 @@ void Command::processError(QProcess::ProcessError error)
disconnect(m_currentProcess, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(processStateChanged(QProcess::ProcessState)));
m_currentProcess->deleteLater(); // make sure other threads can still access it until all events have been processed
m_currentProcess = 0; // for this thread it can assume it was deleted
m_currentProcess = nullptr; // for this thread it can assume it was deleted
}
}
void Command::processFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
//qDebug("Command::processFinished: (%d) %d", exitCode, exitStatus);
gettimeofday(&m_currentProcessFinishTimeStamp, 0);
m_currentProcessFinishTimeStamp = clock();
m_currentProcessExitCode = exitCode;
m_currentProcessExitStatus = exitStatus;
m_hasExited = true;
@ -297,5 +293,5 @@ void Command::processFinished(int exitCode, QProcess::ExitStatus exitStatus)
disconnect(m_currentProcess, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(processStateChanged(QProcess::ProcessState)));
m_currentProcess->deleteLater(); // make sure other threads can still access it until all events have been processed
m_currentProcess = 0; // for this thread it can assume it was deleted
m_currentProcess = nullptr; // for this thread it can assume it was deleted
}

View File

@ -23,7 +23,7 @@
#include <QMetaType>
#include <QObject>
#include <QProcess>
#include <sys/time.h>
#include <time.h>
#include "export.h"
@ -63,8 +63,8 @@ public:
bool getLastProcessError(QProcess::ProcessError& error) const;
bool getLastProcessExit(int& exitCode, QProcess::ExitStatus& exitStatus) const;
const QString& getLastProcessLog() const;
struct timeval getLastProcessStartTimestamp() const { return m_currentProcessStartTimeStamp; }
struct timeval getLastProcessFinishTimestamp() const { return m_currentProcessFinishTimeStamp; }
clock_t getLastProcessStartTimestamp() const { return m_currentProcessStartTimeStamp; }
clock_t getLastProcessFinishTimestamp() const { return m_currentProcessFinishTimeStamp; }
const QString& getLastProcessCommandLine() const { return m_currentProcessCommandLine; }
qint64 getLastProcessPid() const { return m_currentProcessPid; }
@ -107,8 +107,8 @@ private:
int m_currentProcessExitCode;
QProcess::ExitStatus m_currentProcessExitStatus;
QString m_log;
struct timeval m_currentProcessStartTimeStamp;
struct timeval m_currentProcessFinishTimeStamp;
clock_t m_currentProcessStartTimeStamp;
clock_t m_currentProcessFinishTimeStamp;
QString m_currentProcessCommandLine;
qint64 m_currentProcessPid;

View File

@ -35,7 +35,7 @@ public:
virtual void start() = 0;
virtual void stop() = 0;
virtual void pull(Sample& sample) = 0;
virtual void pullAudio(int nbSamples __attribute__((unused))) {}
virtual void pullAudio(int nbSamples) { (void) nbSamples; }
/** direct feeding of sample source FIFO */
void feed(SampleSourceFifo* sampleFifo, int nbSamples)

View File

@ -54,31 +54,54 @@ public:
virtual bool handleMessage(const Message& message) = 0;
virtual int webapiSettingsGet(
SWGSDRangel::SWGDeviceSettings& response __attribute__((unused)),
SWGSDRangel::SWGDeviceSettings& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) response;
errorMessage = "Not implemented";
return 501;
}
virtual int webapiSettingsPutPatch(
bool force __attribute__((unused)), //!< true to force settings = put
const QStringList& deviceSettingsKeys __attribute__((unused)),
SWGSDRangel::SWGDeviceSettings& response __attribute__((unused)),
bool force, //!< true to force settings = put
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) force;
(void) deviceSettingsKeys;
(void) response;
errorMessage = "Not implemented";
return 501;
}
virtual int webapiRunGet(
SWGSDRangel::SWGDeviceState& response __attribute__((unused)),
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) response;
errorMessage = "Not implemented";
return 501;
}
virtual int webapiRun(bool run __attribute__((unused)),
SWGSDRangel::SWGDeviceState& response __attribute__((unused)),
virtual int webapiRun(bool run,
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) run;
(void) response;
errorMessage = "Not implemented";
return 501;
}
virtual int webapiReportGet(
SWGSDRangel::SWGDeviceReport& response __attribute__((unused)),
SWGSDRangel::SWGDeviceReport& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) response;
errorMessage = "Not implemented";
return 501;
}
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setMessageQueueToGUI(MessageQueue *queue) = 0; // pure virtual so that child classes must have to deal with this

View File

@ -61,31 +61,54 @@ public:
virtual bool handleMessage(const Message& message) = 0;
virtual int webapiSettingsGet(
SWGSDRangel::SWGDeviceSettings& response __attribute__((unused)),
SWGSDRangel::SWGDeviceSettings& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) response;
errorMessage = "Not implemented";
return 501;
}
virtual int webapiSettingsPutPatch(
bool force __attribute__((unused)), //!< true to force settings = put
const QStringList& deviceSettingsKeys __attribute__((unused)),
SWGSDRangel::SWGDeviceSettings& response __attribute__((unused)),
bool force, //!< true to force settings = put
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) force;
(void) deviceSettingsKeys;
(void) response;
errorMessage = "Not implemented";
return 501;
}
virtual int webapiRunGet(
SWGSDRangel::SWGDeviceState& response __attribute__((unused)),
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) response;
errorMessage = "Not implemented";
return 501;
}
virtual int webapiRun(bool run __attribute__((unused)),
SWGSDRangel::SWGDeviceState& response __attribute__((unused)),
virtual int webapiRun(bool run,
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) run;
(void) response;
errorMessage = "Not implemented";
return 501;
}
virtual int webapiReportGet(
SWGSDRangel::SWGDeviceReport& response __attribute__((unused)),
SWGSDRangel::SWGDeviceReport& response,
QString& errorMessage)
{ errorMessage = "Not implemented"; return 501; }
{
(void) response;
errorMessage = "Not implemented";
return 501;
}
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
virtual void setMessageQueueToGUI(MessageQueue *queue) = 0; // pure virtual so that child classes must have to deal with this

View File

@ -21,6 +21,7 @@
///////////////////////////////////////////////////////////////////////////////////
#include "freqlockcomplex.h"
#define _USE_MATH_DEFINES
#include <math.h>
FreqLockComplex::FreqLockComplex() :

View File

@ -38,7 +38,11 @@ struct SDRBASE_API HBFIRFilterTraits<16>
static const int32_t hbOrder = 16;
static const int32_t hbShift = 12;
static const int16_t hbMod[16+6];
#ifdef _MSC_VER
__declspec(align(16)) static const int32_t hbCoeffs[4];
#else
static const int32_t hbCoeffs[4] __attribute__ ((aligned (16)));
#endif
static const double hbCoeffsF[4];
};
@ -48,7 +52,11 @@ struct SDRBASE_API HBFIRFilterTraits<32>
static const int32_t hbOrder = 32;
static const int32_t hbShift = 12;
static const int16_t hbMod[32+6];
#ifdef _MSC_VER
__declspec(align(32)) static const int32_t hbCoeffs[8];
#else
static const int32_t hbCoeffs[8] __attribute__ ((aligned (32)));
#endif
static const double hbCoeffsF[8];
};
@ -58,7 +66,11 @@ struct SDRBASE_API HBFIRFilterTraits<48>
static const int32_t hbOrder = 48;
static const int32_t hbShift = 12;
static const int16_t hbMod[48+6];
#ifdef _MSC_VER
__declspec(align(16)) static const int32_t hbCoeffs[12];
#else
static const int32_t hbCoeffs[12] __attribute__ ((aligned (16)));
#endif
static const double hbCoeffsF[12];
};
@ -68,7 +80,11 @@ struct SDRBASE_API HBFIRFilterTraits<64>
static const int32_t hbOrder = 64;
static const int32_t hbShift = 12;
static const int16_t hbMod[64+6];
#ifdef _MSC_VER
__declspec(align(32)) static const int32_t hbCoeffs[16];
#else
static const int32_t hbCoeffs[16] __attribute__ ((aligned (32)));
#endif
static const float hbCoeffsF[16];
};
@ -78,7 +94,11 @@ struct SDRBASE_API HBFIRFilterTraits<80>
static const int32_t hbOrder = 80;
static const int32_t hbShift = 14;
static const int16_t hbMod[80+6];
#ifdef _MSC_VER
__declspec(align(16)) static const int32_t hbCoeffs[20];
#else
static const int32_t hbCoeffs[20] __attribute__ ((aligned (16)));
#endif
static const double hbCoeffsF[20];
};
@ -88,7 +108,11 @@ struct SDRBASE_API HBFIRFilterTraits<96>
static const int32_t hbOrder = 96;
static const int32_t hbShift = 16;
static const int16_t hbMod[96+6];
#ifdef _MSC_VER
__declspec(align(32)) static const int32_t hbCoeffs[24];
#else
static const int32_t hbCoeffs[24] __attribute__ ((aligned (32)));
#endif
static const double hbCoeffsF[24];
};
@ -98,7 +122,11 @@ struct SDRBASE_API HBFIRFilterTraits<112>
static const int32_t hbOrder = 112;
static const int32_t hbShift = 18;
static const int16_t hbMod[112+6];
#ifdef _MSC_VER
__declspec(align(16)) static const int32_t hbCoeffs[28];
#else
static const int32_t hbCoeffs[28] __attribute__ ((aligned (16)));
#endif
static const double hbCoeffsF[28];
};
@ -108,7 +136,11 @@ struct SDRBASE_API HBFIRFilterTraits<128>
static const int32_t hbOrder = 128;
static const int32_t hbShift = 20;
static const int16_t hbMod[128+6];
#ifdef _MSC_VER
__declspec(align(16)) static const int32_t hbCoeffs[32];
#else
static const int32_t hbCoeffs[32] __attribute__ ((aligned (16)));
#endif
static const double hbCoeffsF[32];
};

View File

@ -11,8 +11,9 @@ NullSink::~NullSink()
{
}
bool NullSink::init(const Message& message __attribute__((unused)))
bool NullSink::init(const Message& message)
{
(void) message
return false;
}

View File

@ -95,7 +95,7 @@ protected:
* Callback method to produce multiple outputs from the current phase value in m_phase
* and/or the sin and cos values in m_psin and m_pcos
*/
virtual void processPhase(Real *samples_out __attribute__((unused))) const {};
virtual void processPhase(Real *samples_out) const { (void) samples_out; }
private:
Real m_minfreq, m_maxfreq;

View File

@ -21,6 +21,7 @@
///////////////////////////////////////////////////////////////////////////////////
#include <complex.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include "phaselockcomplex.h"

View File

@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#define _USE_MATH_DEFINES
#include <math.h>
#include "projector.h"

View File

@ -73,7 +73,7 @@ public:
};
typedef QList<SamplingDevice> SamplingDevices;
virtual ~PluginInterface() { };
virtual ~PluginInterface() { }
virtual const PluginDescriptor& getPluginDescriptor() const = 0;
virtual void initPlugin(PluginAPI* pluginAPI) = 0;
@ -81,44 +81,76 @@ public:
// channel Rx plugins
virtual PluginInstanceGUI* createRxChannelGUI(
DeviceUISet *deviceUISet __attribute__((unused)),
BasebandSampleSink *rxChannel __attribute__((unused)))
{ return 0; }
DeviceUISet *deviceUISet,
BasebandSampleSink *rxChannel)
{
(void) deviceUISet;
(void) rxChannel;
return nullptr;
}
virtual BasebandSampleSink* createRxChannelBS(
DeviceSourceAPI *deviceAPI __attribute__((unused)) )
{ return 0; }
DeviceSourceAPI *deviceAPI)
{
(void) deviceAPI;
return nullptr;
}
virtual ChannelSinkAPI* createRxChannelCS(
DeviceSourceAPI *deviceAPI __attribute__((unused)) )
{ return 0; }
DeviceSourceAPI *deviceAPI)
{
(void) deviceAPI;
return nullptr;
}
// channel Tx plugins
virtual PluginInstanceGUI* createTxChannelGUI(
DeviceUISet *deviceUISet __attribute__((unused)),
BasebandSampleSource *txChannel __attribute__((unused)))
{ return 0; }
DeviceUISet *deviceUISet,
BasebandSampleSource *txChannel)
{
(void) deviceUISet;
(void) txChannel;
return nullptr;
}
virtual BasebandSampleSource* createTxChannelBS(
DeviceSinkAPI *deviceAPI __attribute__((unused)) )
{ return 0; }
DeviceSinkAPI *deviceAPI)
{
(void) deviceAPI;
return nullptr;
}
virtual ChannelSourceAPI* createTxChannelCS(
DeviceSinkAPI *deviceAPI __attribute__((unused)) )
{ return 0; }
DeviceSinkAPI *deviceAPI)
{
(void) deviceAPI;
return nullptr;
}
// device source plugins only
virtual SamplingDevices enumSampleSources() { return SamplingDevices(); }
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId __attribute__((unused)),
QWidget **widget __attribute__((unused)),
DeviceUISet *deviceUISet __attribute__((unused)))
{ return 0; }
const QString& sourceId,
QWidget **widget,
DeviceUISet *deviceUISet)
{
(void) sourceId;
(void) widget;
(void) deviceUISet;
return nullptr;
}
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused))) { return 0; } // creates the input "core"
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput( // creates the input "core"
const QString& sourceId,
DeviceSourceAPI *deviceAPI)
{
(void) sourceId;
(void) deviceAPI;
return nullptr;
}
virtual void deleteSampleSourcePluginInstanceGUI(PluginInstanceGUI *ui);
virtual void deleteSampleSourcePluginInstanceInput(DeviceSampleSource *source);
@ -127,12 +159,25 @@ public:
virtual SamplingDevices enumSampleSinks() { return SamplingDevices(); }
virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(
const QString& sinkId __attribute__((unused)),
QWidget **widget __attribute__((unused)),
DeviceUISet *deviceUISet __attribute__((unused)))
{ return 0; }
const QString& sinkId,
QWidget **widget,
DeviceUISet *deviceUISet)
{
(void) sinkId;
(void) widget;
(void) deviceUISet;
return nullptr;
}
virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput( // creates the output "core"
const QString& sinkId,
DeviceSinkAPI *deviceAPI)
{
(void) sinkId;
(void) deviceAPI;
return nullptr;
}
virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused))) { return 0; } // creates the output "core"
virtual void deleteSampleSinkPluginInstanceGUI(PluginInstanceGUI *ui);
virtual void deleteSampleSinkPluginInstanceOutput(DeviceSampleSink *sink);
};

View File

@ -30,10 +30,13 @@ QMAKE_CXXFLAGS += -std=c++11
CONFIG(Release):build_subdir = release
CONFIG(Debug):build_subdir = debug
CONFIG(MSVC):DEFINES += sdrbase_EXPORTS
CONFIG(ANDROID):INCLUDEPATH += /opt/softs/boost_1_60_0
CONFIG(MINGW32):INCLUDEPATH += "C:\softs\boost_1_66_0"
CONFIG(MINGW64):INCLUDEPATH += "C:\softs\boost_1_66_0"
CONFIG(MSVC):INCLUDEPATH += "C:\softs\boost_1_66_0"
CONFIG(MINGW32):INCLUDEPATH += "C:\softs\serialDV"
CONFIG(MINGW64):INCLUDEPATH += "C:\softs\serialDV"

View File

@ -39,24 +39,24 @@ void CommandOutputDialog::refresh()
ui->commandText->setText(m_command.getLastProcessCommandLine());
ui->processPid->setText(QString("%1").arg(m_command.getLastProcessPid()));
if (m_command.getLastProcessStartTimestamp().tv_sec == 0) {
if (m_command.getLastProcessStartTimestamp() == 0) {
ui->startTime->setText(("..."));
}
else
{
struct timeval tv = m_command.getLastProcessStartTimestamp();
QDateTime dt = QDateTime::fromMSecsSinceEpoch(tv.tv_sec * 1000LL + tv.tv_usec / 1000LL);
clock_t tv = m_command.getLastProcessStartTimestamp();
QDateTime dt = QDateTime::fromMSecsSinceEpoch((tv * 1000LL) / CLOCKS_PER_SEC);
QString dateStr = dt.toString("yyyy-MM-dd HH:mm:ss.zzz");
ui->startTime->setText(dateStr);
}
if (m_command.getLastProcessFinishTimestamp().tv_sec == 0) {
if (m_command.getLastProcessFinishTimestamp() == 0) {
ui->endTime->setText(("..."));
}
else
{
struct timeval tv = m_command.getLastProcessFinishTimestamp();
QDateTime dt = QDateTime::fromMSecsSinceEpoch(tv.tv_sec * 1000LL + tv.tv_usec / 1000LL);
clock_t tv = m_command.getLastProcessFinishTimestamp();
QDateTime dt = QDateTime::fromMSecsSinceEpoch((tv * 1000LL) / CLOCKS_PER_SEC);
QString dateStr = dt.toString("yyyy-MM-dd HH:mm:ss.zzz");
ui->endTime->setText(dateStr);
}
@ -64,7 +64,7 @@ void CommandOutputDialog::refresh()
ui->runningState->setChecked(m_command.getLastProcessState() == QProcess::Running);
QProcess::ProcessError processError;
if (m_command.getLastProcessStartTimestamp().tv_sec == 0) // not started
if (m_command.getLastProcessStartTimestamp() == 0) // not started
{
ui->errorText->setText("...");
ui->exitCode->setText("-");