@@ -1,4 +1,4 | |||
|
1 | 1 | 1cb664ab4bb3c531d706b1948a378ed9810c0dda src/SocExplorerEngine/PeripheralWidget |
|
2 |
|
|
|
2 | eee9d5c97f55f377210426c1688224e9adc3dd8d src/common/genericBinaryFiles | |
|
3 | 3 | 2b353bf8243cbfb3db44e196f33bd164c11c9949 src/common/lppserial |
|
4 | 4 | 923afde9cc96bb419cf898560d080ec96991aeca src/common/qhexedit |
@@ -1,58 +1,58 | |||
|
1 | 1 | #include "regsexplorer.h" |
|
2 | 2 | #include "ui_regsexplorernew.h" |
|
3 | 3 | #include "socmodel.h" |
|
4 | 4 | |
|
5 | 5 | RegsExplorer::RegsExplorer(QWidget *parent) : |
|
6 | 6 | QDockWidget(parent), |
|
7 | 7 | ui(new Ui::RegsExplorerNew) |
|
8 | 8 | { |
|
9 | 9 | ui->setupUi(this); |
|
10 | 10 | connect(SocExplorerEngine::self(),SIGNAL(enumDeviceAdded(socExplorerEnumDevice*)),this,SLOT(addDev(socExplorerEnumDevice*))); |
|
11 | 11 | delegate.device=NULL; |
|
12 | 12 | } |
|
13 | 13 | |
|
14 | 14 | RegsExplorer::~RegsExplorer() |
|
15 | 15 | { |
|
16 | 16 | delete ui; |
|
17 | 17 | } |
|
18 | 18 | |
|
19 | 19 | void RegsExplorer::addDev(socExplorerEnumDevice *device) |
|
20 | 20 | { |
|
21 |
if((delegate.device->sameSoc(device)) |
|
|
21 | if((delegate.device==NULL)||(delegate.device->sameSoc(device))) | |
|
22 | 22 | { |
|
23 | 23 | delegate.device = device; |
|
24 | 24 | peripheralWidget* peripheral=new peripheralWidget(device->name(),device->baseAddress(),&delegate,this); |
|
25 | 25 | this->ui->regsViewer->addPeripheral(peripheral); |
|
26 | 26 | peripheralModel periphM=SocExplorerEngine::xmlModel()->getPeripheral(device->name()); |
|
27 | 27 | int startIndex,stopIndex; |
|
28 | 28 | QString desc; |
|
29 | 29 | QString name; |
|
30 | 30 | bool rw; |
|
31 | 31 | this->ui->regsViewer->setSocName(device->socName()); |
|
32 | 32 | for(int i=0;i<periphM.registers.count();i++) |
|
33 | 33 | { |
|
34 | 34 | peripheral->addRegister(periphM.registers.at(i).name,device->baseAddress() + periphM.registers.at(i).offset); |
|
35 | 35 | for(int j=0;j<periphM.registers.at(i).bitfields.count();j++) |
|
36 | 36 | { |
|
37 | 37 | startIndex = periphM.registers.at(i).bitfields.at(j).offset; |
|
38 | 38 | stopIndex = periphM.registers.at(i).bitfields.at(j).offset+periphM.registers.at(i).bitfields.at(j).size-1; |
|
39 | 39 | desc = periphM.registers.at(i).bitfields.at(j).description; |
|
40 | 40 | rw = periphM.registers.at(i).bitfields.at(j).rw; |
|
41 | 41 | name = periphM.registers.at(i).bitfields.at(j).name; |
|
42 | 42 | peripheral->registerAt(i)->setBitFieldAttribute(startIndex,stopIndex,name,desc,rw); |
|
43 | 43 | } |
|
44 | 44 | } |
|
45 | 45 | } |
|
46 | 46 | } |
|
47 | 47 | |
|
48 | 48 | void RegsExplorer::changeEvent(QEvent *e) |
|
49 | 49 | { |
|
50 | 50 | QDockWidget::changeEvent(e); |
|
51 | 51 | switch (e->type()) { |
|
52 | 52 | case QEvent::LanguageChange: |
|
53 | 53 | ui->retranslateUi(this); |
|
54 | 54 | break; |
|
55 | 55 | default: |
|
56 | 56 | break; |
|
57 | 57 | } |
|
58 | 58 | } |
General Comments 0
You need to be logged in to leave comments.
Login now