30 : QWidget(parent), m_Controls(nullptr)
32 this->m_UpdateTimer =
new QTimer(
this );
35 this->
m_Controls->m_StopNavigationBtn->setEnabled(
false );
46 m_UpdateTimer->stop();
47 m_UpdateTimer =
nullptr;
57 m_Controls =
new Ui::QmitkUpdateTimerWidgetControls;
73 return this->m_UpdateTimer->interval();
79 this->SetFrameRateLabel();
84 this->m_UpdateTimer->setInterval( msec );
85 this->
m_Controls->m_UpdateRateSB->setValue( msec );
90 if(!m_UpdateTimer->isActive())
92 this->m_UpdateTimer->start();
93 this->
m_Controls->m_StartNavigationBtn->setEnabled(
false );
94 this->
m_Controls->m_StopNavigationBtn->setEnabled(
true );
95 this->
m_Controls->m_NavigationStateLbl->setStyleSheet(
"QLabel{background-color: #96e066 }" );
96 this->
m_Controls->m_NavigationStateLbl->setText(
"Started ... " );
104 if(m_UpdateTimer->isActive())
106 m_UpdateTimer->stop();
107 this->
m_Controls->m_StopNavigationBtn->setEnabled(
false );
108 this->
m_Controls->m_StartNavigationBtn->setEnabled(
true );
109 this->
m_Controls->m_NavigationStateLbl->setStyleSheet(
"QLabel{background-color: #ffcccc }" );
110 this->
m_Controls->m_NavigationStateLbl->setText(
"Stopped ... " );
118 return this->m_UpdateTimer;
134 m_Controls->m_StartNavigationBtn->setText(
" Start " + text );
135 m_Controls->m_StopNavigationBtn->setText(
" Stop " + text );
139 void QmitkUpdateTimerWidget::SetupUpdateRateSB(
int min,
int max,
int step )
141 this->
m_Controls->m_UpdateRateSB->setRange( min , max );
142 this->
m_Controls->m_UpdateRateSB->setSingleStep( step );
146 void QmitkUpdateTimerWidget::SetFrameRateLabel()
149 QString frameRateString = QString::number( frameRate,
'g', 4 );
150 this->
m_Controls->m_FrameRateLbl->setText(
"msec (" + frameRateString +
" Hz)");
155 this->
m_Controls->m_UpdatesInMsecLbl->setVisible( !hidden );
156 this->
m_Controls->m_UpdateRateSB->setVisible ( !hidden );
157 this->
m_Controls->m_FrameRateLbl->setVisible ( !hidden );
163 this->setEnabled(
true );
169 this->setEnabled(
false );
179 m_Controls->m_StartNavigationBtn->setIcon(icon);