44#include < QHBoxLayout>
55#include " qimageselectionwidget.h"
66#include < QColorDialog>
7+ #include < QLabel>
78
89gNodeComponentWidget ::gNodeComponentWidget (sJarvisNodeComponent * comp,QWidget *parent) :
910 QGroupBox (parent), m_component(comp),
@@ -19,7 +20,8 @@ gNodeComponentWidget::gNodeComponentWidget(sJarvisNodeComponent* comp,QWidget *p
1920 jarvisActions action = actions[i];
2021 // qDebug() << QString::number(int(action));
2122 QToolButton* b = new QToolButton (ui->actionsBox );
22- ui->actionsBox ->layout ()->addWidget (b);
23+ QGridLayout* l = (QGridLayout*)ui->actionsBox ->layout ();
24+ l->addWidget (b,l->count ()/2 ,l->count ()%2 );
2325 b->setText (QString::number (action,' f' ,0 ));
2426
2527 if (action == A_ENABLE){
@@ -78,48 +80,66 @@ gNodeComponentWidget::gNodeComponentWidget(sJarvisNodeComponent* comp,QWidget *p
7880 for (int i = 0 ; i < events.count () ; i++)
7981 {
8082 gBlinkWidget * w = new gBlinkWidget (ui->eventsBox );
81- ui->eventsBox ->layout ()->addWidget (w);
83+ QLabel* label = new QLabel (ui->eventsBox );
84+ QGridLayout* l = (QGridLayout*)ui->eventsBox ->layout ();
85+ l->addWidget (label,i,0 );
86+ l->addWidget (w,i,1 );
87+ w->setMaximumHeight (50 );
8288 if (events[i] == E_ACTIVATED)
8389 {
8490 connect (m_component,SIGNAL (activated ()),w,SLOT (blink ()));
91+ label->setText (" Activated" );
8592
8693 }else if (events[i] == E_DEACTIVATED)
8794 {
8895 connect (m_component,SIGNAL (deactivated ()),w,SLOT (blink ()));
96+ label->setText (" Deactivated" );
8997
9098 }else if (events[i] == E_ENABLED)
9199 {
92100 connect (m_component,SIGNAL (enabled ()),w,SLOT (blink ()));
101+ label->setText (" Enabled" );
93102
94103 }else if (events[i] == E_DISABLED)
95104 {
96105 connect (m_component,SIGNAL (disabled ()),w,SLOT (blink ()));
106+ label->setText (" Disabled" );
97107
98108 }else if (events[i] == E_RAW_READ)
99109 {
100110 connect (m_component,SIGNAL (rawRead ()),w,SLOT (blink ()));
101111 connect (m_component,SIGNAL (rawRead (QStringList)),w,SLOT (displayRead (QStringList)));
112+ label->setText (" Raw" );
102113
103114 }else if (events[i] == E_DATA_READ)
104115 {
105116 connect (m_component,SIGNAL (dataRead ()),w,SLOT (blink ()));
106117 connect (m_component,SIGNAL (dataRead (QStringList)),w,SLOT (displayRead (QStringList)));
118+ label->setText (" Data" );
107119
108120 }else if (events[i] == E_GLOBAL_POWERON)
109121 {
110122 connect (m_component,SIGNAL (globalPowerOn ()),w,SLOT (blink ()));
123+ label->setText (" PowerOn" );
111124
112125 }else if (events[i] == E_GLOBAL_SHUTDOWN)
113126 {
114127 connect (m_component,SIGNAL (globalShutDown ()),w,SLOT (blink ()));
128+ label->setText (" PowerOff" );
115129
116130 }else if (events[i] == E_COFFEE_MAKING)
117131 {
118132 connect (m_component,SIGNAL (coffeeMaking ()),w,SLOT (blink ()));
133+ label->setText (" Coffee Making" );
119134
120135 }else if (events[i] == E_COFFEE_MADE)
121136 {
122137 connect (m_component,SIGNAL (coffeeMade ()),w,SLOT (blink ()));
138+ label->setText (" Cofee Made" );
139+ }
140+ else
141+ {
142+ label->setText (" Unknown" );
123143 }
124144 // w->setMinimumSize(32,32);
125145 // w->setMaximumSize(32,32);
0 commit comments