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