void MotionPlanningFrame::connectTeleopSlots()
 {
     connect( ui_->plan_button,    SIGNAL( clicked() ), this, SLOT( planButtonClicked() ));
     connect( ui_->execute_button, SIGNAL( clicked() ), this, SLOT( executeButtonClicked() ));
     connect( ui_->preview_button, SIGNAL( clicked() ), this, SLOT( previewButtonClicked() ));
     connect( ui_->stop_button,    SIGNAL( clicked() ), this, SLOT( stopButtonClicked() ));
 }
Ejemplo n.º 2
0
void CallTab::SendFailedHandler()
{
#ifdef REN_DEBUG
	qWarning("CallTab::SendFailedHandler()");
#endif
	qWarning("Hello World!!");
	if (error_handled++ > error_threshold)
	{
		// renyang-modify - 設定目前這一個primary為不能使用
		setAddressEvent(hostEdit->currentText(),QString("SCTP_SEND_FAILED_THRESHOLD"));
		qWarning("want to find a available address");
		for (unsigned int i=0;i<hostList->count();i++)
		{
			if (hostList->item(i)->isSelectable())
			{
				// renyang-modify - 設定目前這一個為primary address
				// renyang-modify - 之前send fail ip可能要設定為其它顏色的球
				// renyang-modify - 設定這一個ip為primary address
				qWarning(QString("%1 is available").arg(hostList->text(i)));
				emit setPrimaddrSignal(callId,hostList->text(i));
				error_handled = 0;
				return;
			}
		}
		// renyang-modify - 若跑到這裡的話, 則表示每一個address都是un-selectable啦, 可能要掛斷電話啦
		qWarning("There is no ip address for available");
		stopButtonClicked();
	}
}
Ejemplo n.º 3
0
MainWindow::MainWindow(QWidget *parent)
	: QDialog(parent),
	handle(-1),
	keyboard(false),
	joystick(false),
	mouseon(false),
	lastprogsw(false)
{
	g_main_window = this; // HACK

	setupUi(this);

	connect(start_button, SIGNAL(clicked(bool)), this, SLOT(startButtonClicked(bool)));
	connect(stop_button, SIGNAL(clicked()), this, SLOT(stopButtonClicked()));
	connect(quit_button, SIGNAL(clicked()), this, SLOT(quitButtonClicked()));
	connect(clear_button, SIGNAL(clicked()), this, SLOT(clearClicked()));

	// LED controls
	connect(green_check, SIGNAL(clicked(bool)), this, SLOT(greenCheckClicked(bool)));
	connect(red_check, SIGNAL(clicked(bool)), this, SLOT(redCheckClicked(bool)));
	connect(flash_green_check, SIGNAL(clicked(bool)), this, SLOT(flashGreenCheckClicked(bool)));
	connect(flash_red_check, SIGNAL(clicked(bool)), this, SLOT(flashRedCheckClicked(bool)));
	connect(flash_freq, SIGNAL(textChanged(const QString &)), this, SLOT(flashFrequencyChanged(const QString &)));

	// Backlight
	connect(backlight_on_off, SIGNAL(clicked(bool)), this, SLOT(backlightOnOffClicked(bool)));
	connect(backlight_flash, SIGNAL(clicked(bool)), this, SLOT(backlightFlashClicked(bool)));
	connect(backlight_bank1_all, SIGNAL(clicked(bool)), this, SLOT(backlightBank1AllClicked(bool)));
	connect(backlight_bank2_all, SIGNAL(clicked(bool)), this, SLOT(backlightBank2AllClicked(bool)));
	connect(backlight_scroll_lock, SIGNAL(clicked(bool)), this, SLOT(backlightScrollLockClicked(bool)));
	connect(backlight_toggle, SIGNAL(clicked()), this, SLOT(backlightToggle()));
	connect(backlight_set_intensity, SIGNAL(clicked()), this, SLOT(backlightSetIntensity()));
	connect(backlight_save, SIGNAL(clicked()), this, SLOT(backlightSave()));

	// PID controls
	connect(convert_pid1, SIGNAL(clicked()), this, SLOT(convertPID1Clicked()));
	connect(convert_pid2, SIGNAL(clicked()), this, SLOT(convertPID2Clicked()));
	connect(show_descriptor, SIGNAL(clicked()), this, SLOT(showDescriptorClicked()));
	connect(generate_report, SIGNAL(clicked()), this, SLOT(generateReportClicked()));
	
	// Timestamp
	connect(timestamp_on, SIGNAL(clicked()), this, SLOT(timestampOnClicked()));
	connect(timestamp_off, SIGNAL(clicked()), this, SLOT(tiemstampOffClicked()));

	// Reflector Controls
	connect(keyboard_reflector, SIGNAL(clicked()), this, SLOT(keyboardReflectorClicked()));
	connect(joystick_reflector, SIGNAL(clicked()), this, SLOT(joystickReflectorClicked()));
	connect(mouse_reflector, SIGNAL(clicked()), this, SLOT(mouseReflectorClicked()));

	// Connect our append() signal to the output box's append() slot.
	// This is so we can append to the output box from the callback
	// thread.
	connect(this, SIGNAL(append(const QString &)), output_box, SLOT(append(const QString &)));

	connect(this, SIGNAL(messageBox(const QString &, const QString &)),
	        this, SLOT(showMessageBox(const QString &, const QString&)));

}
Ejemplo n.º 4
0
void WorldView::stopButtonClicked()
{
    mutex.lock();
    commThread.stop();
    startButton->setText(QString("Start World Viewer"));
    disconnect(startButton, SIGNAL(clicked()), this, SLOT(stopButtonClicked()));
    connect(startButton, SIGNAL(clicked()), this, SLOT(startButtonClicked()));
    mutex.unlock();
}
Ejemplo n.º 5
0
void StreamOutputWidget::enabledButtonClicked(bool enabled)
{
	m_enabled = m_ui.m_enabledCheckbox->isChecked();

	if (!m_enabled)
        {
		stopButtonClicked();
		clearButtonClicked();
	}
}
Ejemplo n.º 6
0
int tcpServer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: { QString _r = currentTime();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; }  break;
        case 1: changeString((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 2: stopButtonClicked(); break;
        case 3: continueButtonClicked(); break;
        }
        _id -= 4;
    }
    return _id;
}
EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) :
    AbstractWizardPage(wizard, parent),
    ui(new Ui::EscCalibrationPage), m_isCalibrating(false)
{
    ui->setupUi(this);

    ui->outputHigh->setEnabled(false);
    ui->outputLow->setEnabled(true);
    ui->outputLevel->setEnabled(true);
    ui->outputLevel->setText(QString(tr("%1 µs")).arg(OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS));

    connect(ui->startButton, SIGNAL(clicked()), this, SLOT(startButtonClicked()));
    connect(ui->stopButton, SIGNAL(clicked()), this, SLOT(stopButtonClicked()));

    connect(ui->securityCheckBox1, SIGNAL(toggled(bool)), this, SLOT(securityCheckBoxesToggled()));
    connect(ui->securityCheckBox2, SIGNAL(toggled(bool)), this, SLOT(securityCheckBoxesToggled()));
    connect(ui->securityCheckBox3, SIGNAL(toggled(bool)), this, SLOT(securityCheckBoxesToggled()));
}
Ejemplo n.º 8
0
StreamOutputWidget::StreamOutputWidget(QWidget *parent)
    : QWidget(parent), m_mutex(QMutex::Recursive), m_audioOutput(NULL), m_IODevice(NULL), m_enabled(false)

{
    //Create GUI components
    m_ui.setupUi(this);

    m_timer =new QTimer(this);

    //Connect signals
    connect(m_ui.m_startButton,SIGNAL(clicked()),this,SLOT(startButtonClicked()));
    connect(m_ui.m_stopButton,SIGNAL(clicked()),this,SLOT(stopButtonClicked()));
    connect(m_ui.m_clearButton,SIGNAL(clicked()),this,SLOT(clearButtonClicked()));
    connect(m_timer,SIGNAL(timeout()),this,SLOT(refreshTimeout()));
    connect(m_ui.m_enabledCheckbox,SIGNAL(toggled(bool)),this,SLOT(enabledButtonClicked(bool)));

    //Scan audio output devices
    scanOutputDevice();

    m_timer->start(100); //100ms timer
}
Ejemplo n.º 9
0
HITLWidget::HITLWidget(QWidget *parent)
    : QWidget(parent),
    simulator(0)
{
    widget = new Ui_HITLWidget();
    widget->setupUi(this);
    widget->startButton->setEnabled(true);
    widget->stopButton->setEnabled(false);

    greenColor      = "rgb(35, 221, 35)"; // Change the green color in order to make it a bit more vibrant
    strStyleEnable  = QString("QFrame{background-color: %1; color: white}").arg(greenColor);
    strStyleDisable = "QFrame{background-color: red; color: white}";

    strAutopilotDisconnected = " Autopilot OFF ";
    strSimulatorDisconnected = " Simulator OFF ";
    strAutopilotConnected    = " Autopilot ON ";

    widget->apLabel->setText(strAutopilotDisconnected);
    widget->simLabel->setText(strSimulatorDisconnected);

    connect(widget->startButton, SIGNAL(clicked()), this, SLOT(startButtonClicked()));
    connect(widget->stopButton, SIGNAL(clicked()), this, SLOT(stopButtonClicked()));
    connect(widget->buttonClearLog, SIGNAL(clicked()), this, SLOT(buttonClearLogClicked()));
}
Ejemplo n.º 10
0
HITLWidget::HITLWidget(QWidget *parent)
	: QWidget(parent),
	simulator(0)
{
	widget = new Ui_HITLWidget();
	widget->setupUi(this);
	widget->startButton->setEnabled(true);
	widget->stopButton->setEnabled(false);

	greenColor = "rgb(35, 221, 35)";

	strAutopilotDisconnected = " Autopilot OFF ";
	strSimulatorDisconnected = " Simulator OFF ";
	strAutopilotConnected = " Autopilot ON ";
	strSimulatorConnected = " Simulator ON ";

	widget->apLabel->setText(strAutopilotDisconnected);
	widget->simLabel->setText(strSimulatorDisconnected);

	connect(widget->startButton, SIGNAL(clicked()), this, SLOT(startButtonClicked()));
	connect(widget->stopButton, SIGNAL(clicked()), this, SLOT(stopButtonClicked()));
	connect(widget->buttonClearLog, SIGNAL(clicked()), this, SLOT(buttonClearLogClicked()));

}
Ejemplo n.º 11
0
void
MainWindow::quitButtonClicked()
{
	stopButtonClicked();
	qApp->quit();
}
/*
 *  Initialize dialog window.
 */
void
MultiShot::initialize()
{
    /*
     *  Pages.
     */
    exposureBracketingPage = getExposureBracketingPage();
    focusBracketingPage = getFocusBracketingPage();
    intervalsPage = getIntervalsPage();
    stitchPage = getStitchPage();

    tabWidget = new QTabWidget();
    tabWidget->addTab( exposureBracketingPage, tr("Exposure bracketing") );
    tabWidget->addTab( focusBracketingPage, tr("Focus bracketing") );
    tabWidget->addTab( intervalsPage, tr("Intervals") );
    tabWidget->addTab( stitchPage, tr("Panorama") );
    tabWidget->setCurrentIndex( 0 );
    QObject::connect(
	tabWidget, SIGNAL(currentChanged(int)),
	this, SLOT(updateChecklist()) );

    /*
     *  Buttons.
     */
    QPushButton *checklistButton = new QPushButton( tr("Checklist") );
    checklistButton->setIcon(
	QIcon(":/Resources/Misc/checklist.png") );
    QObject::connect(
	checklistButton, SIGNAL(clicked()),
	this, SLOT(checklistButtonClicked()) );

    runButton = new QPushButton( tr("Run") );
    QObject::connect(
	runButton, SIGNAL(clicked()),
	this, SLOT(runButtonClicked()) );

    stopButton = new QPushButton( tr("Stop") );
    stopButton->setEnabled( false );
    QObject::connect(
	stopButton, SIGNAL(clicked()),
	this, SLOT(stopButtonClicked()) );

    QPushButton *closeButton = new QPushButton( tr("Close") );
    closeButton->setDefault( true );
    QObject::connect(
	closeButton, SIGNAL(clicked()),
	this, SLOT(close()) );

    /*
     *  Final layout.
     */
    QHBoxLayout *buttonLayout = new QHBoxLayout();
    buttonLayout->addWidget( checklistButton );
    buttonLayout->addStretch();
    buttonLayout->addWidget( runButton );
    buttonLayout->addWidget( stopButton );
    buttonLayout->addWidget( closeButton );

    QVBoxLayout *layout = new QVBoxLayout( this );
    layout->addWidget( tabWidget );
    layout->addLayout( buttonLayout );
    setLayout( layout );
}
Ejemplo n.º 13
0
CallTab::CallTab( int id, QString hosts[], int maxhost, QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
	// renyang - 設定這一個widget的佈局
	setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, sizePolicy().hasHeightForWidth() ) );

	// renyang - 設定這一個CallTab對方打電話過來的名字
	callName = QString(name);

	QBoxLayout *mainLayout = new QVBoxLayout( this, 0, 10,"mainLayout");

	mainFrame = new QFrame( this, "ledFrame" );
	mainLayout->addWidget(mainFrame);
	
	QBoxLayout *mLayout = new QVBoxLayout( mainFrame, 0, 10,"mLayout");

	mLayout->addSpacing(10);

	QBoxLayout *mhLayout = new QHBoxLayout(mLayout);
	
	hostname = new QLabel( mainFrame, "hostname" );
	QFont hostname_font(  hostname->font() );
	hostname_font.setPointSize( 12 );
	hostname_font.setBold( TRUE );
	hostname->setFont( hostname_font );
	
	mhLayout->addStretch();
	mhLayout->addWidget(hostname);
	mhLayout->addStretch();
	
	mLayout->addStretch();

// renyang - 增加一個hostlist可以顯示所有的peer address-----------------------
	QBoxLayout *mhLayout0 = new QHBoxLayout(mLayout);

	mhLayout0->addSpacing(5);

	QBoxLayout *mvLayout = new QVBoxLayout(mhLayout0);

	hostEdit = new QComboBox( TRUE, mainFrame, "hostEdit" );
	hostEdit->setMinimumSize( QSize(100, 30) );
	// renyang - 設定自動補齊
	hostEdit->setAutoCompletion(TRUE);
	hostEdit->setDuplicatesEnabled(FALSE);
	// renyang - the string will not be inserted into the combobox
	hostEdit->setInsertionPolicy(QComboBox::NoInsertion);
	hostEdit->clear();

	hostList = new QListBox(mainFrame,"hostList");
	hostList->setMinimumSize(QSize(100,100));

	video_label = new QLabel(mainFrame,"video label");
	video_label->setMinimumSize(QSize(160,120));
	video_label->setMaximumSize(QSize(160,120));
	video_label->setPalette(QPalette( QColor( 250, 250, 200) ));

	video_check = new QCheckBox(mainFrame,"video_check");
	video_check->setEnabled(false);

	primButton = new QPushButton(mainFrame,"primButton");
	primButton->setMinimumSize(QSize(130,35));

	mvLayout->addSpacing(5);
	mvLayout->addWidget(hostEdit);
	mvLayout->addSpacing(5);

	QBoxLayout *mhLayout3 = new QHBoxLayout(mvLayout);

	mhLayout3->addWidget(hostList);
	mhLayout3->addSpacing(5);

	mhLayout3->addWidget(video_label);
	mhLayout3->addSpacing(5);

	mhLayout3->addWidget(video_check);
	mhLayout3->addSpacing(5);

	mvLayout->addSpacing(5);
	mvLayout->addWidget(primButton);
	mvLayout->addSpacing(5);

	mhLayout0->addSpacing(5);
// renyang --------------------------------------------------------------------
	
	mLayout->addStretch();
	
	QBoxLayout *mhLayout1 = new QHBoxLayout(mLayout, 25);
	
	mhLayout1->addSpacing(5);

	callButton = new QPushButton( mainFrame, "callButton" );
	callButton->setMinimumSize( QSize(130, 35) );
	callButton->setIconSet( QIconSet( QPixmap::fromMimeSource( "call.png" ) ) );
	mhLayout1->addWidget(callButton, 2);
	
	ringButton = new QToolButton( mainFrame, "ringButton" );
	ringButton->setFixedSize( QSize(40, 35) );
	// renyang - 設定為可以on/off的按扭
	ringButton->setToggleButton(TRUE);
	ringButton->setIconSet( QIconSet( QPixmap::fromMimeSource( "bell.png" ) ) );
	ringButton->setEnabled(FALSE);
	mhLayout1->addWidget(ringButton, 1);
	
	stopButton = new QPushButton( mainFrame, "stopButton" );
	stopButton->setMinimumSize( QSize(130, 35) );
	stopButton->setEnabled( FALSE );
	stopButton->setIconSet( QIconSet( QPixmap::fromMimeSource( "hangup.png" ) ) );
	mhLayout1->addWidget(stopButton, 2);
	
	mhLayout1->addSpacing(5);

	mLayout->addStretch();
	
	QBoxLayout *mhLayout2 = new QHBoxLayout(mLayout);
	
	mhLayout2->addSpacing(30);
	
	muteMicButton = new QToolButton( mainFrame, "muteMicButton" );
	muteMicButton->setMinimumSize( QSize(30, 30) );
	muteMicButton->setToggleButton(TRUE);
	muteMicButton->setIconSet( QIconSet( QPixmap::fromMimeSource( "mic.png" ) ) );
	mhLayout2->addWidget(muteMicButton);

	mhLayout2->addStretch();

	ledFrame = new QFrame( mainFrame, "ledFrame" );
	ledFrame->setFrameStyle( QFrame::Panel | QFrame::Sunken );

	QBoxLayout *ledLayout = new QHBoxLayout(ledFrame, 3, 10);

	ledLayout->addSpacing(10);

	tx = new QLabel( ledFrame, "tx" );
	tx->setEnabled(FALSE);
	ledLayout->addWidget(tx);
	
	txPixmap = new QLabel( ledFrame, "txPixmap" );
	txPixmap->setPixmap( QPixmap::fromMimeSource( "red.png" ) );
	txPixmap->setEnabled(FALSE);
	ledLayout->addWidget(txPixmap);
	
	ledLayout->addSpacing(5);
	ledLayout->addStretch();

	lockPixmap = new QLabel( ledFrame, "lockPixmap" );
	lockPixmap->setPixmap( QPixmap::fromMimeSource( "lock.png" ) );
	lockPixmap->setEnabled( FALSE );
	ledLayout->addWidget(lockPixmap);

	ledLayout->addStretch();
	ledLayout->addSpacing(5);

	rxPixmap = new QLabel( ledFrame, "rxPixmap" );
	rxPixmap->setPixmap( QPixmap::fromMimeSource( "green.png" ) );
	rxPixmap->setEnabled(FALSE);
	ledLayout->addWidget(rxPixmap);

	rx = new QLabel( ledFrame, "rx" );
	rx->setEnabled(FALSE);
	ledLayout->addWidget(rx);
	
	ledLayout->addSpacing(10);

	mhLayout2->addWidget(ledFrame);

	mhLayout2->addStretch();

	muteSpkButton = new QToolButton( mainFrame, "muteSpkButton" );
	muteSpkButton->setMinimumSize( QSize(30, 30) );
	muteSpkButton->setToggleButton(TRUE);
	muteSpkButton->setIconSet( QIconSet( QPixmap::fromMimeSource( "speaker.png" ) ) );
	mhLayout2->addWidget(muteSpkButton);

	mhLayout2->addSpacing(30);

	// renyang - The QStatusBar class provides a horizontal bar suitable for presenting status information
	statusbar = new QStatusBar(this, "statusbar");
	// renyang - 讓QStatusBar的右下角不會出現可以調整大小的三角型
	statusbar->setSizeGripEnabled(FALSE);

	QWidget *trafficWidget = new QWidget( this, "trafficWidget");
	QBoxLayout *tLayout = new QHBoxLayout(trafficWidget);
	trafficLabel = new QLabel( trafficWidget, "trafficLabel" );
	trafficLabel->setEnabled(FALSE);
	tLayout->addWidget(trafficLabel);
	statusbar->addWidget( trafficWidget, 0, true);
	
	mainLayout->addWidget(statusbar);

	connect( ringButton, SIGNAL( clicked() ), this, SLOT( ringButtonClicked() ) );
	connect( callButton, SIGNAL( clicked() ), this, SLOT( callButtonClicked() ) );
	connect( stopButton, SIGNAL( clicked() ), this, SLOT( stopButtonClicked() ) );
	connect( hostEdit->lineEdit(), SIGNAL( returnPressed() ), this, SLOT( callButtonClicked() ) );
	connect( muteMicButton, SIGNAL( clicked() ), this, SLOT( muteMicButtonClicked() ) );
	connect( muteSpkButton, SIGNAL( clicked() ), this, SLOT( muteSpkButtonClicked() ) );
	// renyang-modify - 新增當按下primButton時, 會做什麼事
	connect( primButton,SIGNAL(clicked()),this,SLOT(primButtonClicked()));
	// renyang-modify - 當按下video_check扭時, 要求對方傳送image過來
	connect( video_check,SIGNAL(clicked()),this,SLOT(videoCheckChanged()));

	languageChange();

	callId = id;
	received = false;
	talking = false;
	seconds = 0;
	skipStat = 0;
	// renyang-modify - 初始化error_handled
	error_handled = 0;
	// renyang-modify - 初始化waiting, 當要向對方要求影像, 但是, 像還沒有整個上傳到CallTab時, waiting是true
	waiting = false;
	// renyang-modify - 初始化video_timer
	video_timer = new QTimer(this,"video_timer");
	// renyang-modify - 當時間到時要要求下一個frame
	connect(video_timer,SIGNAL(timeout()),this,SLOT(video_timeout()));
	// renyang-modify - 記錄對方的video是否Fail
	peervideofail = false;

	// renyang-modify - 暫時預設error_threshold為5
	error_threshold = 5;

	for (int i=0; i<maxhost; i++)
	{
		if (!hosts[i].isEmpty())
			hostEdit->insertItem(hosts[i]);
	}
}