示例#1
0
void LorrisProgrammer::connectedStatus(bool connected)
{
    if(connected)
    {
        m_vcc = -1;
        this->updateProgrammer();
        Q_ASSERT(m_programmer.data());
        m_state &= ~(STATE_DISCONNECTED);
        updateStartStopUi(m_programmer->isInFlashMode());

        if (!m_programmer->supportsVdd())
            setEnableButtons(true);
    }
    else
    {
        this->updateProgrammer();

        m_state |= STATE_DISCONNECTED;
        updateStartStopUi(false);
        m_timeout_timer.stop();

        setEnableButtons(false);
        m_blink_led->setEnabled(false);
    }
    ui->connectedStatus(connected);
}
示例#2
0
void
MainWindow::setDefaultIndex(int index) 
{
	if (index == 0)
	{
		setEnableButtons(pushButton[0]);
		setIndex(0);
	}
}
示例#3
0
void
MainWindow::setDefaultIndex(int index) 
{
	if (index == 0)
	{
		setEnableButtons(pushButton[0]);
		setIndex(0);
		//stackedWidget->setCurrentIndex(0);
	}
	else if (index == 1)
	{
		setEnableButtons(pushButton[3]);
		setIndex(DISPLAYTYPE3);
		//setIndex(1);
		//stackedWidget->setCurrentIndex(1);
	}
	else if (index == 2)
	{
		
#if 0
		setEnableButtons(pushButton[14]);
		setIndex(14);
#endif
		//stackedWidget->setCurrentIndex(14);
#if 0
		QString passwd = passWord.at(15);
		Password pword(passwd, new QWidget());
		if(passwd.compare("") != 0)
		{
			//qDebug("Password: %s", passwd.toStdString().c_str());
			if(pword.getStatus()== true)
			{
				setEnableButtons(pushButton[15]);
				setIndex(15);
			}
			else {
				qDebug("Password is not match.");
			}
		}
#endif
	}

}
示例#4
0
bool MainWindow::displayDockWidget(const int index, QPushButton *pobj)
{
	if ( index >= DISPLAYTOT || index < DISPLAYTYPE ) return false;

	QString displayname = QString("/usr/local/opi/ui/")+displayDocklist.at(index)+".ui";
    dockWidget->setWindowTitle(displayDocklist.at(index));
	setEnableButtons(pobj);

	// for stackwidget
	if(stackedWidget->widget(index) != 0)
	{
		setIndex(index);
	}; 
	return true;
}
示例#5
0
void LorrisProgrammer::vccValueChanged(quint8 id, double value)
{
    m_timeout_timer.start();
    if(m_timeout_warn)
        delete m_timeout_warn;

    if(id == 0 && !m_vdd_setup.empty() && m_vcc != value)
    {
        if((value < 0 ? -value : value) < 0.03)
            value = 0;

        setEnableButtons(value != 0);
        ui->vccValChanged(value);

        m_vcc = value;
        checkOvervoltage();
    }
}
示例#6
0
bool MainWindow::displayDockWidget(const int index, QPushButton *pobj)
{
	if ( index >= DISPLAYTOT || index < DISPLAYTYPE ) return false;

	QString displayname = QString("/usr/local/opi/ui/")+displayDocklist.at(index)+".ui";
    dockWidget->setWindowTitle(displayDocklist.at(index));
	setEnableButtons(pobj);

#if 1
	// for stackwidget
	if(stackedWidget->widget(index) != 0)
	{
		setIndex(index);
	}; 
#else
	//for DockWidget
	AttachChannelAccess *pattach = new AttachChannelAccess(displayname.toStdString().c_str());
	qDebug("DisplayUI:%s",displayname.toStdString().c_str());
	if (!pattach->GetWidget())	return false;
	dockWidget->setWidget(pattach->GetWidget());
#endif
	return true;
}