1 #include "Subscriber.h"
6 Subscriber::Subscriber( QWidget *parent, const char *name )
7 : QWidget( parent, name )
11 void Subscriber::Create(QString name, char shape, char color)
15 m_mainFrm = new MainForm;
16 Text = new QLabel( m_mainFrm, "Text" );
17 Text->setGeometry( QRect(10 , 0, 110, 15 ) );
18 Text->setText( trUtf8( "Minimum Separation : " ) );
19 MinSep = new QSlider(m_mainFrm, "str" );
20 MinSep->setGeometry( QRect( 120, 0, 130, 15 ) );
21 MinSep->setMaxValue( 10 );
22 MinSep->setOrientation( QSlider::Horizontal );
23 connect( MinSep, SIGNAL( valueChanged(int) ), this, SLOT(changeMinSep() ) );
25 m_mainFrm->SetProperties(shape,color);
31 strTitle="Subscriber : "+name+" (Topic=";
37 strTitle+="RECTANGLE, Type=";
41 strTitle+="ELLIPSE, Type=";
45 strTitle+="TRIANGLE, Type=";
69 strTitle+=" Min.Sep.=0 )";
70 m_mainFrm->setCaption(strTitle);
74 void Subscriber::Destroy()
76 m_mainFrm->WantClose();
81 void Subscriber::changeMinSep()
83 ORTESubsProp sub_prop;
84 ORTEAppSubsPropGet(app,1,&sub_prop);
85 NtpTimeAssembFromMs(sub_prop.minimumSeparation,MinSep->value(),0);
86 ORTEAppSubsPropSet(app,1,&sub_prop);
87 QString name=QString::number(MinSep->value());
88 if((MinSep->value())<10) name+=" ";
89 (this->strTitle).replace((this->strTitle).length()-3,2,name);
90 (this->m_mainFrm)->setCaption(this->strTitle);