mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-28 06:24:10 +01:00
LP-597 fixes from review
- m_timer_tick -> m_timerTick - rename signals: setPlaybackPosition -> playbackPositionChanged & setBeginAndEndTimes -> timesChanged - remove extraneous parentheses - make pretty
This commit is contained in:
parent
ba0869c2d2
commit
bafc40fefa
@ -42,7 +42,7 @@ LogFile::LogFile(QObject *parent) : QIODevice(parent),
|
||||
m_providedTimeStamp(0),
|
||||
m_beginTimeStamp(0),
|
||||
m_endTimeStamp(0),
|
||||
m_timer_tick(0)
|
||||
m_timerTick(0)
|
||||
{
|
||||
connect(&m_timer, &QTimer::timeout, this, &LogFile::timerFired);
|
||||
}
|
||||
@ -154,7 +154,7 @@ void LogFile::timerFired()
|
||||
if (m_replayState != PLAYING) {
|
||||
return;
|
||||
}
|
||||
m_timer_tick++;
|
||||
m_timerTick++;
|
||||
|
||||
if (m_file.bytesAvailable() > TIMESTAMP_SIZE_BYTES) {
|
||||
int time;
|
||||
@ -210,8 +210,8 @@ void LogFile::timerFired()
|
||||
emit readyRead();
|
||||
|
||||
// rate-limit slider bar position updates to 10 updates per second
|
||||
if (m_timer_tick % 10 == 0) {
|
||||
emit setPlaybackPosition(m_nextTimeStamp);
|
||||
if (m_timerTick % 10 == 0) {
|
||||
emit playbackPositionChanged(m_nextTimeStamp);
|
||||
}
|
||||
// read next timestamp
|
||||
if (m_file.bytesAvailable() < (qint64)sizeof(m_nextTimeStamp)) {
|
||||
@ -262,7 +262,7 @@ bool LogFile::startReplay()
|
||||
return false;
|
||||
}
|
||||
|
||||
m_timer_tick = 0;
|
||||
m_timerTick = 0;
|
||||
|
||||
if (!m_file.isOpen() || m_timer.isActive()) {
|
||||
return false;
|
||||
@ -552,7 +552,7 @@ bool LogFile::buildIndex()
|
||||
}
|
||||
}
|
||||
|
||||
emit setBeginAndEndTimes(m_beginTimeStamp, m_endTimeStamp);
|
||||
emit timesChanged(m_beginTimeStamp, m_endTimeStamp);
|
||||
|
||||
// reset the read pointer to the start of the file
|
||||
m_file.seek(0);
|
||||
|
@ -97,10 +97,10 @@ protected slots:
|
||||
|
||||
signals:
|
||||
void replayStarted();
|
||||
void replayFinished(); // Emitted on error during replay or when logfile disconnected
|
||||
void replayCompleted(); // Emitted at the end of normal logfile playback
|
||||
void setPlaybackPosition(quint32);
|
||||
void setBeginAndEndTimes(quint32, quint32);
|
||||
void replayFinished(); // Emitted on error during replay or when logfile disconnected
|
||||
void replayCompleted(); // Emitted at the end of normal logfile playback
|
||||
void playbackPositionChanged(quint32);
|
||||
void timesChanged(quint32, quint32);
|
||||
|
||||
protected:
|
||||
QByteArray m_dataBuffer;
|
||||
@ -123,7 +123,7 @@ private:
|
||||
qint32 m_providedTimeStamp;
|
||||
quint32 m_beginTimeStamp;
|
||||
quint32 m_endTimeStamp;
|
||||
quint32 m_timer_tick;
|
||||
quint32 m_timerTick;
|
||||
QVector<quint32> m_timeStamps;
|
||||
QVector<qint64> m_timeStampPositions;
|
||||
|
||||
|
@ -81,8 +81,8 @@ void LoggingGadgetWidget::setPlugin(LoggingPlugin *p)
|
||||
|
||||
// Feedback from logfile to GUI
|
||||
connect(loggingPlugin, &LoggingPlugin::stateChanged, this, &LoggingGadgetWidget::stateChanged);
|
||||
connect(logFile, &LogFile::setBeginAndEndTimes, this, &LoggingGadgetWidget::setBeginAndEndTimes);
|
||||
connect(logFile, &LogFile::setPlaybackPosition, this, &LoggingGadgetWidget::setPlaybackPosition);
|
||||
connect(logFile, &LogFile::timesChanged, this, &LoggingGadgetWidget::setBeginAndEndTimes);
|
||||
connect(logFile, &LogFile::playbackPositionChanged, this, &LoggingGadgetWidget::setPlaybackPosition);
|
||||
connect(logFile, &LogFile::replayStarted, this, &LoggingGadgetWidget::enableWidgets);
|
||||
connect(logFile, &LogFile::replayFinished, this, &LoggingGadgetWidget::disableWidgets);
|
||||
connect(logFile, &LogFile::replayCompleted, this, &LoggingGadgetWidget::stopButtonAction);
|
||||
@ -96,7 +96,7 @@ void LoggingGadgetWidget::setPlugin(LoggingPlugin *p)
|
||||
|
||||
void LoggingGadgetWidget::playButtonAction()
|
||||
{
|
||||
ReplayState replayState = (loggingPlugin->getLogfile())->getReplayState();
|
||||
ReplayState replayState = loggingPlugin->getLogfile()->getReplayState();
|
||||
|
||||
if (replayState != PLAYING) {
|
||||
emit resumeReplay(m_logging->playbackPosition->value());
|
||||
@ -109,7 +109,7 @@ void LoggingGadgetWidget::playButtonAction()
|
||||
|
||||
void LoggingGadgetWidget::pauseButtonAction()
|
||||
{
|
||||
ReplayState replayState = (loggingPlugin->getLogfile())->getReplayState();
|
||||
ReplayState replayState = loggingPlugin->getLogfile()->getReplayState();
|
||||
|
||||
if (replayState == PLAYING) {
|
||||
emit pauseReplay();
|
||||
|
Loading…
Reference in New Issue
Block a user