Issue #782 fixed

This commit is contained in:
bsongis
2014-03-20 17:11:14 +01:00
parent dd7298a35b
commit b973c5db1d
6 changed files with 115 additions and 228 deletions
+46 -47
View File
@@ -14,6 +14,7 @@
#ifndef FLASHINTERFACE_H
#define FLASHINTERFACE_H
#include <QDialog>
#include <QtGui>
#include <inttypes.h>
@@ -32,12 +33,12 @@
#define ERSKY9X_SPS "SPS"
#define ERSKY9X_SPE "SPE"
#define ERSKY9X_OFFSET (7)
#define VERS_MARK "VERS:"
#define SVN_MARK "SVN:"
#define DATE_MARK "DATE:"
#define TIME_MARK "TIME:"
#define BLD_MARK "BLD:"
#define VAR_MARK "EEPR:"
#define VERS_MARK "VERS"
#define SVN_MARK "SVN"
#define DATE_MARK "DATE"
#define TIME_MARK "TIME"
#define BLD_MARK "BLD"
#define EEPR_MARK "EEPR"
#define FILE_TYPE_BIN 1
#define FILE_TYPE_HEX 2
@@ -49,48 +50,46 @@ int getFileType(const QString &fullFileName);
class FlashInterface
{
public:
FlashInterface(QString filename);
QString getDate();
QString getTime();
QString getSvn();
int getSize();
QString getBuild();
QImage getSplash();
bool setSplash(const QImage & newsplash);
bool hasSplash();
int getSplashWidth();
uint getSplashHeight();
uint getSplashColors();
QImage::Format getSplashFormat();
uint saveFlash(QString fileName);
bool isValid();
public:
FlashInterface(QString filename);
inline QString getDate() { return date; }
inline QString getTime() { return time; }
inline QString getSvn() { return svn; }
int getSize() { return flash_size; }
inline QString getVersion() { return version; }
inline QString getEEprom() { return eeprom; }
QImage getSplash();
bool setSplash(const QImage & newsplash);
bool hasSplash();
int getSplashWidth();
uint getSplashHeight();
uint getSplashColors();
QImage::Format getSplashFormat();
uint saveFlash(QString fileName);
bool isValid();
private:
QByteArray flash;
void SeekVer();
void SeekSvn();
void SeekDate();
void SeekTime();
void SeekBuild();
void SeekSplash();
QString filename;
QString date;
QString time;
QString svn;
QString build;
QByteArray splash;
uint splash_offset;
uint splash_type;
uint splash_size;
uint splash_width;
uint splash_height;
uint splash_colors;
QImage::Format splash_format;
uint flash_size;
protected:
bool isValidFlag;
private:
QByteArray flash;
QString seekString(const QString & string);
QString seekLabel(const QString & label);
void SeekSplash();
QString filename;
QString date;
QString time;
QString svn;
QString version;
QString eeprom;
QByteArray splash;
uint splash_offset;
uint splash_type;
uint splash_size;
uint splash_width;
uint splash_height;
uint splash_colors;
QImage::Format splash_format;
uint flash_size;
bool isValidFlag;
};
#endif /* FLASHINTERFACE_H */