forked from GTRONICK/QPickit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogrammer.h
26 lines (22 loc) · 941 Bytes
/
programmer.h
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
#ifndef PROGRAMMER_H
#define PROGRAMMER_H
#include <QMap>
#include <QString>
#include <QStringList>
class Programmer {
public:
Programmer();
~Programmer() {}
void init();
void setProgrammer( const QString &programmer ) { activeProgrammer = programmer; }
const QStringList &getCmd( const QString &action ) { return Programmer::commands[ activeProgrammer ][ action ]; }
bool isSupported( const QString &thisProgrammer ) { return Programmer::commands.contains( thisProgrammer ); }
bool supportsCmd( const QString &thisAction ) { return Programmer::commands[ activeProgrammer ].contains( thisAction ); }
QList< QString > allDevices() { return commands.keys(); }
QList< QString > curCapas() { return Programmer::commands[ activeProgrammer ].keys(); }
bool verbose = false;
private:
QMap< QString, QMap< QString, QStringList > > commands;
QString activeProgrammer;
};
#endif // PROGRAMMER_H