File: firmwareuploaderwindow.h

package info (click to toggle)
savvycan 220-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,456 kB
  • sloc: cpp: 61,803; sh: 293; javascript: 91; python: 44; makefile: 8
file content (50 lines) | stat: -rw-r--r-- 1,082 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef FIRMWAREUPLOADERWINDOW_H
#define FIRMWAREUPLOADERWINDOW_H

#include <QDialog>
#include <QTimer>
#include "can_structs.h"
#include "connections/canconmanager.h"
#include "utility.h"

namespace Ui {
class FirmwareUploaderWindow;
}

class FirmwareUploaderWindow : public QDialog
{
    Q_OBJECT

public:
    explicit FirmwareUploaderWindow(const QVector<CANFrame> *frames, QWidget *parent = 0);
    ~FirmwareUploaderWindow();

public slots:
    void gotTargettedFrame(CANFrame frame);

private slots:
    void handleLoadFile();
    void handleStartStopTransfer();
    void updatedFrames(int);
    void timerElapsed();

private:
    void updateProgress();
    void loadBinaryFile(QString);
    void sendFirmwareChunk();
    void sendFirmwareEnding();

    Ui::FirmwareUploaderWindow *ui;
    bool transferInProgress;
    bool startedProcess;
    int firmwareSize;
    int currentSendingPosition;
    int baseAddress;
    int bus;
    uint32_t token;
    QByteArray firmwareData;
    const QVector<CANFrame> *modelFrames;
    QTimer *timer;
};

#endif // FIRMWAREUPLOADERWINDOW_H