示例#1
0
void Bilet::nrSelectC()
{
    //short int nrstopC = setStop(codC).n;
    varbilet.clear();
    if(CampC->selectedItems().count() > setStop(codC).n)
        for(int i = setStop(codC).n;  i <= CampC->selectedItems().count();i++)
            CampC->selectedItems().at(i)->setSelected(false);
    nrC = CampC->selectedItems();
    emit SelectionChanged();
}
示例#2
0
void Bilet::nrSelectA()
{
    //selectare nr Camp A
    //************************************
    //short int nrstopA = setStop(codA).n;
    varbilet.clear();
    if(CampA->selectedItems().count() > setStop(codA).n)
        for(int i = setStop(codA).n;  i <= CampA->selectedItems().count();i++)
            CampA->selectedItems().at(i)->setSelected(false);
    nrA = CampA->selectedItems();
    emit SelectionChanged();
    //qSort(nrA.begin(), nrA.end());
    //end camp A ************
}
示例#3
0
void PrimeSieve::sieve(uint64_t start, uint64_t stop, int flags)
{
  setStart(start);
  setStop(stop);
  setFlags(flags);
  sieve();
}
示例#4
0
文件: Programme.cpp 项目: juriad/tvp
void Programme::setAttribute( QDomAttr &attr) {
  if(attr.localName().compare("VpsStart", Qt::CaseInsensitive)==0) {
    setVpsStart(attr.value());
    return;
  }
  if(attr.localName().compare("Channel", Qt::CaseInsensitive)==0) {
    setChannel(attr.value());
    return;
  }
  if(attr.localName().compare("Showview", Qt::CaseInsensitive)==0) {
    setShowview(attr.value());
    return;
  }
  if(attr.localName().compare("Start", Qt::CaseInsensitive)==0) {
    setStart(attr.value());
    return;
  }
  if(attr.localName().compare("Stop", Qt::CaseInsensitive)==0) {
    setStop(attr.value());
    return;
  }
  if(attr.localName().compare("Clumpidx", Qt::CaseInsensitive)==0) {
    setClumpidx(attr.value());
    return;
  }
  if(attr.localName().compare("PdcStart", Qt::CaseInsensitive)==0) {
    setPdcStart(attr.value());
    return;
  }
  if(attr.localName().compare("Videoplus", Qt::CaseInsensitive)==0) {
    setVideoplus(attr.value());
    return;
  }
}
示例#5
0
void StreamRender::setUrl(const QString url){

    StreamPlay *streamplay= new StreamPlay;
    connect(this, SIGNAL(next()),streamplay, SLOT(setNext()));
    connect(this, SIGNAL(stop()),streamplay, SLOT(setStop()));

    connect(streamplay, SIGNAL(Finish()),this, SLOT(StreamFree()));



    streamplay->isFaderSolapar(FundirSolapar);
    streamplay->isFaderStop(FundirParar);
    streamplay->setFaderSec(Fundir);
    streamplay->setDevice(Device);
    streamplay->setUrl(url);

    stream = streamplay->stream;


     StreamMath *streammath = new StreamMath(stream);
     segundos = streammath->Duracion();
     Slider->setMaximum(segundos);
     delete streammath;
     Timer->start(Render);




}
示例#6
0
SinglePlotThread::SinglePlotThread(const QString &pvname, SinglePlot *plot, const int periodic):m_pvname(pvname), m_plot(plot), mperiodic(periodic)
{
    //ca_context_create(ca_enable_preemptive_callback);
    //ca_context_create(ca_disable_preemptive_callback);
    ca_add_exception_event(exceptionCallback,NULL);
	setStop(false);
	//start();
}
示例#7
0
void ScaleTo::_update()
{
	if (m_remainTimer <= 0)
		setStop(true);
	Vec2 scaleVector = m_dstScale - m_preScale;
	scaleVector *= (float)getDelta() / (float) m_remainTimer;
	m_preScale = getNode()->getScale() + scaleVector;
	getNode()->setScale(m_preScale);
	m_remainTimer -= getDelta();
	if (m_remainTimer <= 0)
		getNode()->setScale(m_dstScale);
}
void ActionSequence::_update()
{
	Action* action = m_actionList.at(m_index);
	action->update();
	if(action->getStop())
	{
		if(++m_index >= m_actionList.size())
			setStop(true);
		else
			m_actionList.at(m_index)->init(action->getNode());
	}
}
示例#9
0
 virtual void next() {
     if ( !c_->ok() ) {
         setComplete();
         return;
     }
     if ( matcher()->matches( c_->currKey(), c_->currLoc() ) ) {
         one_ = c_->current();
         setStop();
     } else {
         c_->advance();
     }
 }
示例#10
0
void RotateTo::_update()
{
	if (m_remainTimer <= 0)
		setStop(true);
	Vec3 scaleVector = m_dstRotate - m_preRotate;
	scaleVector *= (float)getDelta() / (float) m_remainTimer;
	m_preRotate = getNode()->getRotate() + scaleVector;

	getNode()->setRotate(m_preRotate);
	m_remainTimer -= getDelta();
	if (m_remainTimer <= 0)
		getNode()->setRotate(m_dstRotate);
}
示例#11
0
void Animate::_update()
{
	if (index >= m_frameList.size())
	{
		if(!m_replay)
		{
			setStop(true);
			if(m_reset)
				reset();
			return;
		}
		reset();
	}
	Sprite* sprite = dynamic_cast<Sprite*>(getNode());
	sprite->m_frame = m_frameList.at(index++);
}
示例#12
0
 virtual void next() {
     mayAdvance();
     
     if ( _matchCount >= 101 ) {
         // This is equivalent to the default condition for switching from
         // a query to a getMore.
         setStop();
         return;
     }
     if ( !_c || !_c->ok() ) {
         setComplete();
         return;
     }
     
     if ( matcher( _c )->matchesCurrent( _c.get() ) && !_c->getsetdup( _c->currLoc() ) ) {
         ++_matchCount;
     }
     _mustAdvance = true;
 }
示例#13
0
文件: interval.cpp 项目: jtb/RIVALS
 void Interval::setInterval(Domain start, Domain stop, int str){
   assert(inRange(start, stop));
   setStart(start);
   setStop(stop);
   setStrand(str);
 }
示例#14
0
void PrimeSieve::sieve(uint64_t start, uint64_t stop)
{
  setStart(start);
  setStop(stop);
  sieve();
}
示例#15
0
			void cancel()
			{
				setStop(1);
				tryJoin();
			}
示例#16
0
QVector<short int*>Bilet::GenVarBilet()
{
    QVector<short int*> tmpvar(0);
    short int *tmp = 0;
    QString charnr;
    Variante varA = Variante(nrA,setStop(codA));
    Variante varB = Variante(nrB,setStop(codB));
    Variante varC = Variante(nrC,setStop(codC));

    if((nrA.count() < setStop(codA).k) && nrA.count() > 0){
        msgBox = new QMessageBox;
        msgBox->setText("Pleas select more number on fild A");
        msgBox->exec();
        delete msgBox;
        return tmpvar;
    }
    if(setStop(codA).cod != "complet" && nrA.count() < setStop(codA).n){
        msgBox = new QMessageBox;
        charnr.sprintf("%d",setStop(codA).n);
        msgBox->setText("Fild A mast have "+charnr+" numbers");
        msgBox->exec();
        delete msgBox;
        return tmpvar;
    }

    if(nrB.count() < setStop(codB).k && nrB.count() > 0){
        msgBox = new QMessageBox;
        msgBox->setText("Pleas select more number on fild B");
        msgBox->exec();
        delete msgBox;
        return tmpvar;
    }
    if(setStop(codB).cod != "complet" && nrB.count() < setStop(codB).n){
        msgBox = new QMessageBox;
        charnr.sprintf("%d",setStop(codB).n);
        msgBox->setText("Fild B mast have "+charnr+" numbers");
        msgBox->exec();
        delete msgBox;
        return tmpvar;
    }


    if(nrC.count() < setStop(codC).k && nrC.count() > 0)
    {
        msgBox = new QMessageBox;
        msgBox->setText("Pleas select more number on fild C");
        msgBox->exec();
        delete msgBox;
        return tmpvar;
    }
    if(setStop(codC).cod != "complet" && nrC.count() < setStop(codC).n){
        msgBox = new QMessageBox;
        charnr.sprintf("%d",setStop(codC).n);
        msgBox->setText("Fild C mast have "+charnr+" numbers");
        msgBox->exec();
        delete msgBox;
        return tmpvar;
    }

    //if(nrA.count() < )

    if(setStop(codA).k == 6){
        tmpvar<<varA.variante;
        if(setStop(codB).k == 6){
            tmpvar<<varB.variante;
        if(setStop(codC).k == 6)
            tmpvar<<varC.variante;
        else {
            msgBox = new QMessageBox;
            msgBox->setText("Campul C este completat gresit");
            msgBox->exec();
            delete msgBox;
            return tmpvar;
            }
        }
        //schema compusa C+B
        else if((setStop(codC).k + setStop(codB).k) == 6)
            if(Diff(nrC, nrB)){
             for(int vb = 0; vb < varB.variante.count(); vb++ )
                for(int vc = 0; vc < varC.variante.count(); vc++ ){
                    tmp = new short int[6];
                    for(int i = 0; i < setStop(codB).k; i++ )
                        tmp[i] = varB.variante.at(vb)[i];
                    for(int j = 0; j < setStop(codC).k; j++ )
                        tmp[setStop(codB).k + j] = varC.variante.at(vc)[j];
                    tmpvar<<tmp;
                    }
                }
             else{
                msgBox = new QMessageBox;
                msgBox->setText("Numerele din campurile B si C trebui sa fie diferite");
                msgBox->exec();
                delete msgBox;
                return tmpvar;
                }

            else {// prelucrare bilet camp B
                msgBox = new QMessageBox;
                msgBox->setText("Campul B este completat gresit");
                msgBox->exec();
                delete msgBox;
                return tmpvar;
                }

    }
    else if((setStop(codA).k + setStop(codB).k) == 6){ //A+B = 6
        if(Diff(nrA, nrB))
        for(int va = 0; va < varA.variante.count(); va++ )
            for(int vb = 0; vb < varB.variante.count(); vb++ ){
                tmp = new short int[6];
                for(int i = 0; i < setStop(codA).k; i++ )
                    tmp[i] = varA.variante.at(va)[i];
                for(int j = 0; j < setStop(codB).k; j++ )
                    tmp[setStop(codA).k + j] = varB.variante.at(vb)[j];
                tmpvar<<tmp;
            }
        else{
            msgBox = new QMessageBox;
            msgBox->setText("Numerele din campurile A si B trebui sa fie diferite");
            msgBox->exec();
            delete msgBox;
            return tmpvar;
        }

        if(setStop(codC).k == 6) tmpvar<<varC.variante;
        else{
            msgBox = new QMessageBox;
            msgBox->setText("Campul C este completat gresit");
            msgBox->exec();
            delete msgBox;
            return tmpvar;
        }
    }
        else if((setStop(codA).k + setStop(codB).k) + setStop(codC).k == 6)
            if(Diff(nrA, nrB, nrC))
            for(int va = 0; va < varA.variante.count(); va++ )
                for(int vb = 0; vb < varB.variante.count(); vb++ )
                    for(int vc = 0; vc < varC.variante.count(); vc++ ){
                        tmp = new short int[6];
                        for(int i = 0; i < setStop(codA).k; i++ )
                            tmp[i] = varA.variante.at(va)[i];
                        for(int j = 0; j < setStop(codB).k; j++ )
                            tmp[setStop(codA).k + j] = varB.variante.at(vb)[j];
                        for(int k = 0; k < setStop(codC).k; k++ )
                            tmp[setStop(codA).k + setStop(codB).k + k] = varC.variante.at(vc)[k];
                        tmpvar<<tmp;
                    }
            else { // prelucrare bilet camp A
                 msgBox = new QMessageBox;
                 msgBox->setText("Numerele din campurile A, B si C trebui sa fie diferite");
                 msgBox->exec();
                 delete msgBox;
                 return tmpvar;
                 }

            else { // prelucrare bilet camp A
                msgBox = new QMessageBox;
                msgBox->setText("Campul A este completat gresit");
                msgBox->exec();
                delete msgBox;
                return tmpvar;
                }
    biletOK = true;
    return tmpvar;
}
示例#17
0
			~SizeMonitorThread()
			{
				setStop(1);
				tryJoin();
			}
示例#18
0
void TimeBase::setSegment(const TimeValue startTime, const TimeValue stopTime, const TimeScale scale) {
	setStart(startTime, scale);
	setStop(stopTime, scale);
}
示例#19
0
/*
 * I2CONSET
 * 0x04 AA
 * 0x08 SI
 * 0x10 STOP
 * 0x20 START
 * 0x40 ENABLE
 *
 * I2CONCLR
 * 0x04 AA
 * 0x08 SI
 * 0x20 START
 * 0x40 ENABLE
 */
I2C_Base::mI2CStateMachineStatusType I2C_Base::i2cStateMachine()
{
    enum I2CStatus{ busError=0, start=0x08, repeatStart=0x10, arbitrationLost=0x38,
            // Master Transmitter States:
            slaveAddressAcked=0x18, slaveAddressNacked=0x20, dataAckedBySlave=0x28, dataNackedBySlave=0x30,
            // Master Receiver States:
            readAckedBySlave=0x40, readModeNackedBySlave=0x48, dataAvailableAckSent=0x50, dataAvailableNackSent=0x58
    };

    mI2CStateMachineStatusType state = busy;

    /*
     ***********************************************************************************************************
     * Write-mode state transition :
     * start --> slaveAddressAcked --> dataAckedBySlave --> ... (dataAckedBySlave) --> (stop)
     *
     * Read-mode state transition :
     * start --> slaveAddressAcked --> dataAcked --> repeatStart --> readAckedBySlave
     *  For 2+ bytes:  dataAvailableAckSent --> ... (dataAvailableAckSent) --> dataAvailableNackSent --> (stop)
     *  For 1  byte :  dataAvailableNackSent --> (stop)
     ***********************************************************************************************************
     */

    #define clearSIFlag()       mpI2CRegs->I2CONCLR = (1<<3)
    #define setSTARTFlag()      mpI2CRegs->I2CONSET = (1<<5)
    #define clearSTARTFlag()    mpI2CRegs->I2CONCLR = (1<<5)

    // busInUse is only set to 0 for write operation since read operation should set to 0 itself
    #define setStop()           clearSTARTFlag();                       \
                                mpI2CRegs->I2CONSET = (1<<4);           \
                                clearSIFlag();                          \
                                while((mpI2CRegs->I2CONSET&(1<<4)));    \
                                if(i2cRead == mI2CIOFrame.mode)         \
                                    state = readComplete;               \
                                else                                    \
                                    state = writeComplete;

    switch (mpI2CRegs->I2STAT)
    {
        case start:
            mpI2CRegs->I2DAT = mI2CIOFrame.slaveAddress;
            clearSIFlag();
            break;
        case repeatStart:
            mpI2CRegs->I2DAT = mI2CIOFrame.slaveAddress | 0x01;
            clearSIFlag();
            break;

        case slaveAddressAcked:
            clearSTARTFlag();
            if(0 == mI2CIOFrame.bytesToTransfer) {
                setStop();
            }
            else {
                mpI2CRegs->I2DAT = mI2CIOFrame.firstRegister;
                clearSIFlag();
            }
            break;
        case slaveAddressNacked:
            mI2CIOFrame.error = mpI2CRegs->I2STAT;
            setStop();
            break;

        case dataAckedBySlave:
            if (i2cRead == mI2CIOFrame.mode) {
                setSTARTFlag();         // Send Repeat-start for read-mode
                clearSIFlag();
            }
            else {
                if(mI2CIOFrame.bytePointer >= mI2CIOFrame.bytesToTransfer) {
                    setStop();
                }
                else {
                    mpI2CRegs->I2DAT = mI2CIOFrame.rwBuffer[mI2CIOFrame.bytePointer++];
                    clearSIFlag();
                }
            }
            break;
        case dataNackedBySlave:
            mI2CIOFrame.error = mpI2CRegs->I2STAT;
            setStop();
            break;


        case readAckedBySlave:
            clearSTARTFlag();
            if(mI2CIOFrame.bytesToTransfer > 1)
                mpI2CRegs->I2CONSET = 0x04;  // Send ACK to receive a byte and transition to dataAvailableAckSent
            else
                mpI2CRegs->I2CONCLR = 0x04;  // NACK next byte to go to dataAvailableNackSent for 1-byte read.
            clearSIFlag();
            break;
        case readModeNackedBySlave:
            mI2CIOFrame.error = mpI2CRegs->I2STAT;
            setStop();
            break;
        case dataAvailableAckSent:
            mI2CIOFrame.rwBuffer[mI2CIOFrame.bytePointer++] = mpI2CRegs->I2DAT;
            if(mI2CIOFrame.bytePointer >= (mI2CIOFrame.bytesToTransfer-1)) {    // Only 1 more byte remaining
                mpI2CRegs->I2CONCLR = 0x04; // NACK next byte --> Next state: dataAvailableNackSent
            }
            else {
                mpI2CRegs->I2CONSET = 0x04; // ACK next byte --> Next state: dataAvailableAckSent(back to this state)
            }
            clearSIFlag();
            break;
        case dataAvailableNackSent: // Read last-byte from Slave
            mI2CIOFrame.rwBuffer[mI2CIOFrame.bytePointer++] = mpI2CRegs->I2DAT;
            setStop();
            break;


        case busError:
            mI2CIOFrame.error = mpI2CRegs->I2STAT;
            setStop();
            break;
        case arbitrationLost:
            // We should not issue stop() in this condition, but we still need to end our
            // i2c transaction.
            state = mI2CIOFrame.mode == i2cRead ? readComplete : writeComplete;
            mI2CIOFrame.error = mpI2CRegs->I2STAT;
            break;
        default:
            mI2CIOFrame.error = mpI2CRegs->I2STAT;
            setStop();
            break;
    }

    return state;
}
示例#20
0
/*
 * I2CONSET bits
 * 0x04 AA
 * 0x08 SI
 * 0x10 STOP
 * 0x20 START
 * 0x40 ENABLE
 *
 * I2CONCLR bits
 * 0x04 AA
 * 0x08 SI
 * 0x20 START
 * 0x40 ENABLE
 */
I2C_Base::mStateMachineStatus_t I2C_Base::i2cStateMachine()
{
    enum {
        // General states :
        busError        = 0x00,
        start           = 0x08,
        repeatStart     = 0x10,
        arbitrationLost = 0x38,

        // Master Transmitter States:
        slaveAddressAcked  = 0x18,
        slaveAddressNacked = 0x20,
        dataAckedBySlave   = 0x28,
        dataNackedBySlave  = 0x30,

        // Master Receiver States:
        readAckedBySlave      = 0x40,
        readModeNackedBySlave = 0x48,
        dataAvailableAckSent  = 0x50,
        dataAvailableNackSent = 0x58,
    };

    mStateMachineStatus_t state = busy;

    /*
     ***********************************************************************************************************
     * Write-mode state transition :
     * start --> slaveAddressAcked --> dataAckedBySlave --> ... (dataAckedBySlave) --> (stop)
     *
     * Read-mode state transition :
     * start --> slaveAddressAcked --> dataAcked --> repeatStart --> readAckedBySlave
     *  For 2+ bytes:  dataAvailableAckSent --> ... (dataAvailableAckSent) --> dataAvailableNackSent --> (stop)
     *  For 1  byte :  dataAvailableNackSent --> (stop)
     ***********************************************************************************************************
     */

    /* Me being lazy and using #defines instead of inline functions :( */
    #define clearSIFlag()       mpI2CRegs->I2CONCLR = (1<<3)
    #define setSTARTFlag()      mpI2CRegs->I2CONSET = (1<<5)
    #define clearSTARTFlag()    mpI2CRegs->I2CONCLR = (1<<5)
    #define setAckFlag()        mpI2CRegs->I2CONSET = (1<<2)
    #define setNackFlag()       mpI2CRegs->I2CONCLR = (1<<2)

    /* yep ... lazy again */
    #define setStop()           clearSTARTFlag();                           \
                                mpI2CRegs->I2CONSET = (1<<4);               \
                                clearSIFlag();                              \
                                while((mpI2CRegs->I2CONSET&(1<<4)));        \
                                if(I2C_READ_MODE(mTransaction.slaveAddr))   \
                                    state = readComplete;                   \
                                else                                        \
                                    state = writeComplete;

    switch (mpI2CRegs->I2STAT)
    {
        case start:
            mpI2CRegs->I2DAT = I2C_WRITE_ADDR(mTransaction.slaveAddr);
            clearSIFlag();
            break;
        case repeatStart:
            mpI2CRegs->I2DAT = I2C_READ_ADDR(mTransaction.slaveAddr);
            clearSIFlag();
            break;

        case slaveAddressAcked:
            clearSTARTFlag();
            // No data to transfer, this is used just to test if the slave responds
            if(0 == mTransaction.trxSize) {
                setStop();
            }
            else {
                mpI2CRegs->I2DAT = mTransaction.firstReg;
                clearSIFlag();
            }
            break;

        case dataAckedBySlave:
            if (I2C_READ_MODE(mTransaction.slaveAddr)) {
                setSTARTFlag(); // Send Repeat-start for read-mode
                clearSIFlag();
            }
            else {
                if(0 == mTransaction.trxSize) {
                    setStop();
                }
                else {
                    mpI2CRegs->I2DAT = *(mTransaction.pMasterData);
                    ++mTransaction.pMasterData;
                    --mTransaction.trxSize;
                    clearSIFlag();
                }
            }
            break;

        /* In this state, we are about to initiate the transfer of data from slave to us
         * so we are just setting the ACK or NACK that we'll do AFTER the byte is received.
         */
        case readAckedBySlave:
            clearSTARTFlag();
            if(mTransaction.trxSize > 1) {
                setAckFlag();  // 1+ bytes: Send ACK to receive a byte and transition to dataAvailableAckSent
            }
            else {
                setNackFlag();  //  1 byte : NACK next byte to go to dataAvailableNackSent for 1-byte read.
            }
            clearSIFlag();
            break;
        case dataAvailableAckSent:
            *mTransaction.pMasterData = mpI2CRegs->I2DAT;
            ++mTransaction.pMasterData;
            --mTransaction.trxSize;

            if(1 == mTransaction.trxSize) { // Only 1 more byte remaining
                setNackFlag();// NACK next byte --> Next state: dataAvailableNackSent
            }
            else {
                setAckFlag(); // ACK next byte --> Next state: dataAvailableAckSent(back to this state)
            }

            clearSIFlag();
            break;
        case dataAvailableNackSent: // Read last-byte from Slave
            *mTransaction.pMasterData = mpI2CRegs->I2DAT;
            setStop();
            break;

        case arbitrationLost:
            // We should not issue stop() in this condition, but we still need to end our  transaction.
            state = I2C_READ_MODE(mTransaction.slaveAddr) ? readComplete : writeComplete;
            mTransaction.error = mpI2CRegs->I2STAT;
            break;

        case slaveAddressNacked:    // no break
        case dataNackedBySlave:     // no break
        case readModeNackedBySlave: // no break
        case busError:              // no break
        default:
            mTransaction.error = mpI2CRegs->I2STAT;
            setStop();
            break;
    }

    return state;
}
示例#21
0
void TimeDelay::_update()
{
	if((m_delay -= getDelta()) <= 0)
		setStop(true);
}
示例#22
0
void Camera::setStopByIndex(const Parameter & p, int i)
{
    setStop(p, getStopOption(p, i));
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void D3DProcessor::stopProcess()
{
  setStop(true);
}