DebuggerPerlDBGP::DebuggerPerlDBGP(LanguageSettings* langs)
    : AbstractDebugger(langs), m_name("perldbgp"), m_isRunning(false), m_isJITActive(false),
      m_listenPort(-1), m_currentExecutionPoint(0), m_globalExecutionPoint(0), 
      m_pdbgSettings(0), m_net(0)
{
  m_pdbgSettings = new PerlDBGPSettings(Protoeditor::self()->settings()->configFile(),
      name(), label(), langSettings());

  langSettings()->registerDebuggerSettings(name(), m_pdbgSettings);

  m_currentExecutionPoint = new DebuggerExecutionPoint();
  m_globalExecutionPoint  = new DebuggerExecutionPoint();


  connect(Protoeditor::self()->settings(), SIGNAL(sigSettingsChanged()),
          this, SLOT(slotSettingsChanged()));

  m_net = new PerlDBGPNet(this);
  connect(m_net, SIGNAL(sigStarted()), this, SLOT(slotStarted()));
  connect(m_net, SIGNAL(sigClosed()), this, SLOT(slotStopped()));
  connect(m_net, SIGNAL(sigError(const QString&)), this, SIGNAL(sigInternalError(const QString&)));
  connect(m_net, SIGNAL(sigStepDone()), this, SLOT(slotStepDone()));
  connect(m_net, SIGNAL(sigNewConnection()), this, SLOT(slotNewConnection()));
  //connect(m_net, SIGNAL(sigBreakpoint()), this, SLOT(slotBreakpoint()));  
}
Exemple #2
0
void Moto::asynchReadSpeed()
{
    if ( m_board->isOpen() )
    {
    	m_state.mutex.lock();
    	int throttle   = m_state.throttle;
    	int speed      = m_state.speed;
    	bool direction = m_state.direction;
    	m_state.mutex.unlock();

        bool res = m_board->throttle( throttle );
        if ( !res )
            goto LBL_SPEED_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->speed( speed );
        if ( !res )
            goto LBL_SPEED_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->direction( direction );
        if ( !res )
            goto LBL_SPEED_CLOSED;
        Sleep::msleep( SLEEP );

        emit sigSpeed();
    }

    return;
LBL_SPEED_CLOSED:
    emit sigClosed();
}
Exemple #3
0
RankPool::RankPool(SQLiteDB *db, HashPool *hp, QObject *parent) :
    QObject(parent),
    db_(db),hp_(hp)
{
    connect( db_, SIGNAL(sigOpened()), this, SLOT(loadRankFromDB()));
    connect( db_, SIGNAL(sigClosed()), this, SLOT(clearCache()));
}
Exemple #4
0
void Moto::initGui()
{
	ui.statusbar->showMessage( "Press F1 for help" );

    ui.speed_msr->setLabel( "x100" );
    ui.software->setEnabled( false );
    slotClosed();
    lockConfig();

    loadSettings();

    connect( this, SIGNAL(sigSpeed()),  this, SLOT(slotSpeed()) );
    connect( this, SIGNAL(sigStatus()), this, SLOT(slotStatus()) );
    connect( this, SIGNAL(sigConfig()), this, SLOT(slotConfig()) );
    connect( this, SIGNAL(sigOpened()), this, SLOT(slotOpened()) );
    connect( this, SIGNAL(sigClosed()), this, SLOT(slotClosed()) );

    // Binding GUI controls.
    connect( ui.throttle,  SIGNAL(valueChanged(int)),        this, SLOT(slotThrottleChanged(int)) );
    connect( ui.speed,     SIGNAL(valueChanged(int)),        this, SLOT(slotSpeedChanged(int)) );
    connect( ui.direction, SIGNAL(currentIndexChanged(int)), this, SLOT(slotDirectionChanged(int)) );
    connect( ui.unlock,    SIGNAL(clicked()),                this, SLOT(slotUnlock()) );
    connect( ui.apply,     SIGNAL(clicked()),                this, SLOT(slotApply()) );
    connect( ui.help,      SIGNAL(triggered()),              this, SLOT(slotHelp()) );

    m_speedTimer  = new QTimer();
    m_statusTimer = new QTimer();
    connect( m_speedTimer,  SIGNAL(timeout()), this, SLOT(slotSpeedTimeout()) );
    connect( m_statusTimer, SIGNAL(timeout()), this, SLOT(slotStatusTimeout()) );
    m_speedTimer->setInterval( 100 );
    m_statusTimer->setInterval( 1000 );
    m_speedTimer->start();
    m_statusTimer->start();
}
void DBGConnection::clearSocket()
{
  if(m_currentSocket) {
    delete m_currentSocket;
    m_currentSocket = NULL;
    emit sigClosed();
  }
}
Exemple #6
0
void MainForm::initConnections()
{
	connect(btnResetView, SIGNAL(clicked()), this, SLOT(sPressedReset()));
    connect(btnLoadModel, SIGNAL(clicked()), this, SLOT(sPressedLoadModel()));
	connect(sliWindow, SIGNAL(valueChanged(int)), this, SLOT(sChangedWindowValue(int)));
	connect(sliLevel, SIGNAL(valueChanged(int)), this, SLOT(sChangedLevelValue(int)));

    connect(sliSlicerNumSlices, SIGNAL(valueChanged(int)), this, SLOT(sChangedNumSlices(int)));
    connect(cmbSlicerMode, SIGNAL(currentIndexChanged(QString)), this, SLOT(sChangedSlicerMode(QString)));
    connect(cmbExaminerMode, SIGNAL(currentIndexChanged(QString)), this, SLOT(sChangedExaminerMode(QString)));
    connect(btnColorTop, SIGNAL(changedColor()), this, SLOT(sChangedColorTop()));
    connect(btnColorMiddle, SIGNAL(changedColor()), this, SLOT(sChangedColorMiddle()));
    connect(btnColorBottom, SIGNAL(changedColor()), this, SLOT(sChangedColorBottom()));

    connect(sliRampWidth, SIGNAL(valueChanged(int)), this, SLOT(sChangedRampWidth(int)));
    connect(sliRampCenter, SIGNAL(valueChanged(int)), this, SLOT(sChangedRampCenter(int)));
    connect(txtRampWidth, SIGNAL(returnPressed()), this, SLOT(sConfirmedRampWidth()));
    connect(txtRampCenter, SIGNAL(returnPressed()), this, SLOT(sConfirmedRampCenter()));

    connect(btnMaxTopLeft, SIGNAL(clicked()), this, SLOT(sClickedMaxTopLeft()));
    connect(btnMaxTopRight, SIGNAL(clicked()), this, SLOT(sClickedMaxTopRight()));
    connect(btnMaxBottomLeft, SIGNAL(clicked()), this, SLOT(sClickedMaxBottomLeft()));
    connect(btnMaxBottomRight, SIGNAL(clicked()), this, SLOT(sClickedMaxBottomRight()));
    connect(btnViewAll, SIGNAL(clicked()), this, SLOT(sClickedViewAll()));

    connect(txtWindow, SIGNAL(returnPressed()), this, SLOT(sConfirmedWindowValue()));
    connect(txtLevel, SIGNAL(returnPressed()), this, SLOT(sConfirmedLevelValue()));

    connect(actOpen, SIGNAL(triggered()), this, SLOT(sPressedLoadModel()));
    connect(actExit, SIGNAL(triggered()), this, SLOT(sClickedExit()));

    connect(glWidget, SIGNAL(mouseRightButtonPressed()), this, SLOT(sPressedRightButton()));

    connect(btnToggleCrossfader, SIGNAL(toggled(bool)), this, SLOT(sTogglePresetMixerForm(bool)));
    connect(btnToggleDicom, SIGNAL(toggled(bool)), this, SLOT(sToggleDicomForm(bool)));
    connect(ViewerCore::get()->getPresetMixerForm(), SIGNAL(sigClosed()), this, SLOT(sPresetMixerFormClosed()));
    connect(ViewerCore::get()->getDicomForm(), SIGNAL(sigClosed()), this, SLOT(sDicomFormClosed()));
}
Exemple #7
0
bool DBGNet::startListener(int port)
{
  QHostAddress addr;
  addr.setAddress("localhost");

  if(m_con) delete m_con;

  m_con = new DBGConnection(addr, port);

  connect(m_con, SIGNAL(sigAccepted(QSocket*)), this, SLOT(slotIncomingConnection(QSocket*)));
  connect(m_con, SIGNAL(sigClosed()), this, SLOT(slotDBGClosed()));
  connect(m_con, SIGNAL(sigError(const QString&)), this, SLOT(slotError(const QString&)));

  return m_con->listening();
}
Exemple #8
0
void Moto::asynchReadStatus()
{
    if ( !m_board->isOpen() )
    {
        bool res = m_board->open();
        if ( res )
        {
        	// Dmitry said, do not read configuration.
        	// Just load it from INI file.
            //asynchReadConfig();
            emit sigOpened();
        }
    }
    else
    {
        bool res = m_board->voltage( m_state.voltage );
        if ( !res )
            goto LBL_STATUS_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->enKeySeat_1( m_state.keySeat_1 );
        if ( !res )
            goto LBL_STATUS_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->enKeySeat_2( m_state.keySeat_2 );
        if ( !res )
            goto LBL_STATUS_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->controllerT( m_state.controllerT );
        if ( !res )
            goto LBL_STATUS_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->motorT( m_state.motorT );
        if ( !res )
            goto LBL_STATUS_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->extInp_1( m_state.extInp_1 );
        if ( !res )
            goto LBL_STATUS_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->extInp_2( m_state.extInp_2 );
        if ( !res )
            goto LBL_STATUS_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->errorCode( m_state.errorCode );
        if ( !res )
            goto LBL_STATUS_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->hours( m_state.hours );
        if ( !res )
            goto LBL_STATUS_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->cycles( m_state.cycles );
        if ( !res )
            goto LBL_STATUS_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->modelRev( m_state.modelRev );
        if ( !res )
            goto LBL_STATUS_CLOSED;
        Sleep::msleep( SLEEP );

        emit sigStatus();
    }

    return;
LBL_STATUS_CLOSED:
    emit sigClosed();
}
Exemple #9
0
void Moto::asynchWriteConfig()
{
    if ( m_board->isOpen() )
    {
        bool res;

        if ( m_state.throttleTypeEn )
        {
        	res = m_board->setThrottleType( m_state.throttleType );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.throttleModeEn )
        {
        	res = m_board->setThrottleMode( m_state.throttleMode );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.maxThrottleCwEn )
        {
        	res = m_board->setMaxThrottleCw( m_state.maxThrottleCw );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.maxThrottleCcwEn )
        {
        	res = m_board->setMaxThrottleCcw( m_state.maxThrottleCcw );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.maxSpeedCcwEn )
        {
        	res = m_board->setMaxSpeedCw( m_state.maxSpeedCw );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.maxSpeedCcwEn )
        {
        	res = m_board->setMaxSpeedCcw( m_state.maxSpeedCcw );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.throttleRampUpCwEn )
        {
        	res = m_board->setThrottleRampUpCw( m_state.throttleRampUpCw );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.throttleRampUpCcwEn )
        {
        	res = m_board->setThrottleRampUpCcw( m_state.throttleRampUpCcw );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.throttleRampDownCwEn )
        {
        	res = m_board->setThrottleRampDownCw( m_state.throttleRampDownCw );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.throttleRampDownCcwEn )
        {
        	res = m_board->setThrottleRampDownCcw( m_state.throttleRampDownCcw );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.commutationModeEn )
        {
        	res = m_board->setCommutationMode( m_state.commutationMode );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.throttleLockoutEn )
        {
        	res = m_board->setThrottleLockout( m_state.throttleLockout );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.stallThresholdEn )
        {
        	res = m_board->setStallThreshold( m_state.stallThreshold );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.currentLimitEn )
        {
        	res = m_board->setCurrentLimit( m_state.currentLimit );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.undervoltageCtrlEn )
        {
        	res = m_board->setUndervoltageCtrl( m_state.undervoltageCtrl );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.motorOvertempEn )
        {
        	res = m_board->setMotorOvertemp( m_state.motorOvertemp );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.controllerOvertempEn )
        {
        	res = m_board->setControllerOvertemp( m_state.controllerOvertemp );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        if ( m_state.passwordEn )
        {
        	res = m_board->setPassword( m_state.password );
        	if ( !res )
        		goto LBL_WRITE_CONFIG_CLOSED;
        	Sleep::msleep( SLEEP );
        }

        // To update GUI call as config was just loaded.
        emit sigConfig();
    }
    return;

LBL_WRITE_CONFIG_CLOSED:
    emit sigClosed();
}
Exemple #10
0
void Moto::asynchReadConfig()
{
    if ( m_board->isOpen() )
    {
        bool res = m_board->throttleType( m_state.throttleType );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->throttleMode( m_state.throttleMode );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->maxThrottleCw( m_state.maxThrottleCw );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->maxThrottleCcw( m_state.maxThrottleCcw );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->maxSpeedCw( m_state.maxSpeedCw );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->maxSpeedCcw( m_state.maxSpeedCcw );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->throttleRampUpCw( m_state.throttleRampUpCw );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->throttleRampUpCcw( m_state.throttleRampUpCcw );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->throttleRampDownCw( m_state.throttleRampDownCw );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->throttleRampDownCcw( m_state.throttleRampDownCcw );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->commutationMode( m_state.commutationMode );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->throttleLockout( m_state.throttleLockout );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->stallThreshold( m_state.stallThreshold );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->currentLimit( m_state.currentLimit );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->undervoltageCtrl( m_state.undervoltageCtrl );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->motorOvertemp( m_state.motorOvertemp );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->controllerOvertemp( m_state.controllerOvertemp );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        res = m_board->password( m_state.password );
        if ( !res )
            goto LBL_READ_CONFIG_CLOSED;
        Sleep::msleep( SLEEP );

        emit sigConfig();
    }
    // If not opened don't emit sigClosed().
    return;

LBL_READ_CONFIG_CLOSED:
    emit sigClosed();
}