iCub-main
customtreewidgetitem.h
Go to the documentation of this file.
1 #ifndef CUSTOMTREEWIDGETITEM_H
2 #define CUSTOMTREEWIDGETITEM_H
3 
4 #include <QObject>
5 #include "firmwareupdatercore.h"
6 #include "selectioncheckbox.h"
7 #include <QTreeWidgetItem>
8 
9 #define _MAIN_WINDOW_SHOW_CAN_ADDRESS_IN_ADDRESS_COLUMN
10 
11 #if defined(_MAIN_WINDOW_SHOW_CAN_ADDRESS_IN_ADDRESS_COLUMN)
12  //#define _MAIN_WINDOW_USE_IP_PREFIX_FOR_CAN_ADDRESS
13 #endif
14 
15 #define ETH_TREE_NODE QTreeWidgetItem::UserType + 1
16 #define CAN_TREE_NODE QTreeWidgetItem::UserType + 2
17 
18 #define ETH_TREE_ROOT_NODE QTreeWidgetItem::UserType + 3
19 #define CAN_TREE_ROOT_NODE QTreeWidgetItem::UserType + 4
20 
21 
22 
23 class CustomTreeWidgetItem : public QObject, public QTreeWidgetItem
24 {
25  Q_OBJECT
26 
27 public:
28  CustomTreeWidgetItem(QTreeWidgetItem*parent, QStringList fields, int indexOfBoard, FirmwareUpdaterCore *core,int type);
29 
30  int getIndexOfBoard();
31  void setCheckEnabled(bool enable);
32  bool checkIsEnabled();
33  void setCheckSelected(bool selected);
34  bool isCheckSelected();
35  QTreeWidgetItem *getParentNode();
36  void setCanBoards(QList <sBoard> boards);
37  virtual void refresh();
38  QString getBoardType();
39  QString getBoardProcess();
40  void replaceCanBoard(int , sBoard);
41 
42  bool getDeviceID(QString devicefullstring, QString &idstr, QString &devicestr);
43 
44 
45  QString retrieveCanBoards(bool force = true);
47  QList <sBoard> getCanBoards();
48  sBoard getCanBoard(int index);
49 
50 
51 protected:
52 
56  QTreeWidgetItem *parentNode;
57  QList <sBoard> canBoards;
58 
59 signals:
60  void selectedChanged(bool);
61  void needLoading(bool,bool);
62  void selectionCheckDestroy(QObject*);
63 
64 private slots:
65  void onSelectedChanged(bool);
66 
67 };
68 
70 {
71  Q_OBJECT
72 
73 public:
74  EthTreeWidgetItem(QTreeWidgetItem*parent, FirmwareUpdaterCore *core, int indexOfBoard);
75  void setSelectedBoard(bool, int);
76  void refresh();
77 
78 
79 
80 
81 
82 };
83 
85 {
86  Q_OBJECT
87 
88 public:
89  CanTreeWidgetItem(QTreeWidgetItem*,FirmwareUpdaterCore *core,int indexOfBoard);
90  void erasEeprom(bool);
91  sBoard getBoard();
92  void refresh();
93 
94 };
95 
96 #endif // CUSTOMTREEWIDGETITEM_H
CanTreeWidgetItem(QTreeWidgetItem *, FirmwareUpdaterCore *core, int indexOfBoard)
SelectionCheckBox * check
QList< sBoard > getCanBoards()
QString retrieveCanBoards(bool force=true)
void setCheckSelected(bool selected)
QTreeWidgetItem * parentNode
bool getDeviceID(QString devicefullstring, QString &idstr, QString &devicestr)
QTreeWidgetItem * getParentNode()
void selectionCheckDestroy(QObject *)
FirmwareUpdaterCore * core
void selectedChanged(bool)
void needLoading(bool, bool)
sBoard getCanBoard(int index)
CustomTreeWidgetItem(QTreeWidgetItem *parent, QStringList fields, int indexOfBoard, FirmwareUpdaterCore *core, int type)
void setCanBoards(QList< sBoard > boards)
void replaceCanBoard(int, sBoard)
void setCheckEnabled(bool enable)
EthTreeWidgetItem(QTreeWidgetItem *parent, FirmwareUpdaterCore *core, int indexOfBoard)
void setSelectedBoard(bool, int)