Moved a lot of the frame playback window functionality to a new class. This allows the functionality to be run
on a separate thread. The performance is a lot better and "use original timing" is now reasonably accurate.
This commit is contained in:
+8
-23
@@ -2,26 +2,15 @@
|
||||
#define FRAMEPLAYBACKWINDOW_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QElapsedTimer>
|
||||
#include <QListWidget>
|
||||
#include <QTimer>
|
||||
#include "can_structs.h"
|
||||
#include "framefileio.h"
|
||||
#include "frameplaybackobject.h"
|
||||
|
||||
namespace Ui {
|
||||
class FramePlaybackWindow;
|
||||
}
|
||||
|
||||
//one entry in the sequence of data to use
|
||||
struct SequenceItem
|
||||
{
|
||||
QString filename;
|
||||
QVector<CANFrame> data;
|
||||
QHash<int, bool> idFilters;
|
||||
int maxLoops;
|
||||
int currentLoopCount;
|
||||
};
|
||||
|
||||
class FramePlaybackWindow : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -39,12 +28,12 @@ private slots:
|
||||
void btnFwdOneClick();
|
||||
void btnDeleteCurrSeq();
|
||||
void changePlaybackSpeed(int newSpeed);
|
||||
void changeBurstRate(int burst);
|
||||
void changeLooping(bool check);
|
||||
void changeSendingBus(int newIdx);
|
||||
void changeIDFiltering(QListWidgetItem *item);
|
||||
void btnSelectAllClick();
|
||||
void btnSelectNoneClick();
|
||||
void timerTriggered();
|
||||
void btnLoadFile();
|
||||
void btnLoadLive();
|
||||
void seqTableCellClicked(int row, int col);
|
||||
@@ -53,33 +42,29 @@ private slots:
|
||||
void saveFilters();
|
||||
void loadFilters();
|
||||
void useOrigTimingClicked();
|
||||
void getStatusUpdate(int frameNum);
|
||||
void EndOfFrameCache();
|
||||
|
||||
private:
|
||||
Ui::FramePlaybackWindow *ui;
|
||||
QList<int> foundID;
|
||||
QList<CANFrame> frameCache;
|
||||
QList<CANFrame> sendingBuffer;
|
||||
const QVector<CANFrame> *modelFrames;
|
||||
int currentPosition;
|
||||
QTimer *playbackTimer;
|
||||
QElapsedTimer playbackElapsed;
|
||||
quint64 playbackLastTimeStamp;
|
||||
bool playbackActive;
|
||||
bool playbackForward;
|
||||
int whichBusSend;
|
||||
QList<SequenceItem> seqItems;
|
||||
SequenceItem *currentSeqItem;
|
||||
int currentSeqNum;
|
||||
FramePlaybackObject playbackObject;
|
||||
bool forward;
|
||||
int currentPosition;
|
||||
|
||||
void refreshIDList();
|
||||
void updateFrameLabel();
|
||||
quint64 updatePosition(bool forward);
|
||||
quint64 peekPosition(bool forward);
|
||||
void fillIDHash(SequenceItem &item);
|
||||
void showEvent(QShowEvent *);
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
void calculateWhichBus();
|
||||
};
|
||||
|
||||
#endif // FRAMEPLAYBACKWINDOW_H
|
||||
|
||||
Reference in New Issue
Block a user