Пример #1
0
QList<Model::Node*> LoopStatement::findSymbols(const QRegExp& symbolExp,Model::Node* source, FindSymbolMode mode,
		bool exhaustAllScopes)
{
	QList<Model::Node*> symbols;

	if (condition()) symbols << condition()->findSymbols(symbolExp, source, SEARCH_DOWN, false);
	if (initStep()) symbols << initStep()->findSymbols(symbolExp, source, SEARCH_DOWN, false);
	if (updateStep()) symbols << updateStep()->findSymbols(symbolExp, source, SEARCH_DOWN, false);

	if (exhaustAllScopes || symbols.isEmpty())
		symbols << Node::findSymbols(symbolExp, source, mode, exhaustAllScopes);

	return symbols;
}
Пример #2
0
CustomProxy::CustomProxy(QGraphicsItem *parent, Qt::WindowFlags wFlags)
    : QGraphicsProxyWidget(parent, wFlags), popupShown(false), currentPopup(0)
{
    timeLine = new QTimeLine(250, this);
    connect(timeLine, SIGNAL(valueChanged(qreal)),
            this, SLOT(updateStep(qreal)));
    connect(timeLine, SIGNAL(stateChanged(QTimeLine::State)),
            this, SLOT(stateChanged(QTimeLine::State)));
}
Пример #3
0
//-----------------------------------------------------------------------------
// Purpose: Think function to move the ghost
//-----------------------------------------------------------------------------
void GhostEntity::Think( void )
{
	CBaseAnimating::Think();

		if (Q_strlen(m_gName) != 0) {
			if (!IsEffectActive(EF_NODRAW)) EntityText(0, m_gName, 0);
			updateStep();
			HandleGhost();
		} else {
			EndRun();
		}
	SetNextThink( gpGlobals->curtime + 0.01f );
}
Пример #4
0
void BatteryMeter::update() {
	voltage=((double)analogRead(voltagePin)/100);
	if(voltage < min) {
		numLightsOn = 0;
	} else if(voltage > max){
		numLightsOn = numLeds;
	} else {
		numLightsOn = (short)numLeds*((double)(voltage-min) /max);
	}
	if(stepTimer->check() == true) {
		updateStep();
	}
	light(currentStep);
}
Пример #5
0
void
CQRealSpin::
init(double value)
{
  setObjectName("realSpin");

  setRange(-1E6, 1E6);

  setValue(value);

  connect(this, SIGNAL(valueChanged(double)), this, SLOT(updateStep()));

  connect(lineEdit(), SIGNAL(cursorPositionChanged(int,int)), this, SLOT(updateStep()));

  updateStep();
}
Пример #6
0
LS_SEQ_UPDATE_RESULT_T 
LEDSequence::startSequence( struct timeval *curTime, LEDDriver *leds, CRLEDCommandPacket *cmdPkt )
{
    std::cout << "LEDSequence::startSequence" << std::endl;

    // Back to the beginning
    activeStep = 0;

    // Initialize all of the steps
    for( std::vector< LEDSequenceStep* >::iterator it = stepList.begin(); it != stepList.end(); it++ )
    {
        (*it)->init( cmdPkt );
    }

    // Run an update step in case we are behind
    return updateStep( curTime, leds );
}
	/**
	 * Updates the tween or timeline state. <b>You may want to use a
	 * TweenManager to update objects for you.</b>
	 *
	 * Slow motion, fast motion and backward play can be easily achieved by
	 * tweaking this delta time. Multiply it by -1 to play the animation
	 * backward, or by 0.5 to play it twice slower than its normal speed.
	 *
	 * @param delta A delta time between now and the last call.
	 */
	void BaseTween::update(float delta)
    {
		if (!isStartedFlag || isPausedFlag || isKilledFlag) return;
        
		deltaTime = delta;
        
		if (!isInitializedFlag) initialize();
        
		if (isInitializedFlag)
        {
			testRelaunch();
			updateStep();
			testCompletion();
		}
        
		currentTime += deltaTime;
		deltaTime = 0;
	}
Пример #8
0
void
CQRealSpin::
stepBy(int n)
{
  lineEdit()->deselect();

  //---

  double v = value();
  double s = step();

  int pos    = cursorPosition();
  int dotPos = this->dotPos();

  bool negative = isNegative();

  if (! negative) {
    if (pos < 1)
      pos = 1;
  }
  else {
    if (pos < 2)
      pos = 2;
  }

  setValue(v + n*s);

  int dotPos1 = this->dotPos();

  int pos1 = dotPos1 - dotPos + pos;

  if (pos1 != pos)
    setCursorPosition(pos1);

  updateStep();
}
Пример #9
0
void updateStepActions(Menu &menu, const QString &text, int step) {
	for (auto a : menu.g(_L(EnumInfo<ChangeValue>::typeKey()))->actions()) {
		auto action = static_cast<StepAction*>(a);
		action->updateStep(text, step);
	}
}