Projectkk2glider/issue 4086 usb and serial (#4097)
[opentx.git] / companion / src / burnconfigdialog.h
bloba09b8985d770402dd425f1f8c0d104049e5d074b
1 /*
2 * Copyright (C) OpenTX
4 * Based on code named
5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef _BURNCONFIGDIALOG_H_
22 #define _BURNCONFIGDIALOG_H_
24 #include <QtWidgets>
26 #define MEM_TYPE_EEPROM 1
27 #define MEM_TYPE_FLASH 2
29 #define OPR_TYPE_READ 1
30 #define OPR_TYPE_WRITE 2
32 namespace Ui {
33 class burnConfigDialog;
36 class burnConfigDialog : public QDialog {
37 Q_OBJECT
38 public:
39 burnConfigDialog(QWidget *parent = 0);
40 ~burnConfigDialog();
42 QString getAVRDUDE() {return avrLoc;}
43 QString getSAMBA() {return sambaLoc;}
44 QString getDFU() {return dfuLoc;}
45 QStringList getAvrdudeArgs() { QStringList args = avrArgs; if (!avrPort.isEmpty()) args << "-P" << avrPort; return args; }
46 QStringList getDFUArgs() {return dfuArgs;}
47 QString getProgrammer() {return avrProgrammer;}
48 QString getMCU() {return avrMCU;}
49 QString getArmMCU() {return armMCU;}
50 QString getPort() {return avrPort;}
51 QString getSambaPort() {return sambaPort;}
53 void listAvrdudeProgrammers();
55 private:
56 Ui::burnConfigDialog *ui;
58 void populateProgrammers();
60 QString avrLoc;
61 QString sambaLoc;
62 QString dfuLoc;
63 QStringList avrArgs;
64 QString avrProgrammer;
65 QString avrMCU;
66 QString armMCU;
67 QString avrPort;
68 QString sambaPort;
69 QStringList dfuArgs;
71 private slots:
72 void shrink();
73 void on_avrArgs_editingFinished();
74 void on_pushButton_4_clicked();
75 void on_pushButton_3_clicked();
76 void on_pushButton_clicked();
77 void on_avrdude_location_editingFinished();
78 void on_avrdude_programmer_currentIndexChanged(QString );
79 void on_avrdude_mcu_currentIndexChanged(QString );
80 void on_avrdude_port_currentIndexChanged(QString );
81 void on_samba_location_editingFinished();
82 void on_samba_port_editingFinished();
83 void on_arm_mcu_currentIndexChanged(QString );
84 void on_sb_browse_clicked();
85 void on_dfu_browse_clicked();
86 void on_dfu_location_editingFinished();
87 void on_dfuArgs_editingFinished();
88 void on_advCtrChkB_toggled(bool checked);
89 void getSettings();
90 void putSettings();
93 #endif // _BURNCONFIGDIALOG_H_