/*----- CarTBN --------------------------------------------------------------*/ CarTBN::CarTBN( qreal spd ) : Car( eTBN, eTBN, spd ) { // Init distination dist = (enum EPlace) ((( qrand() % 5 ) + (int)genPlace +1) % 6); setStartPos(); setRotation( 0 ); }
/*----- CarRHE --------------------------------------------------------------*/ CarRHE::CarRHE( qreal spd ) : Car( eRHE, eRHE, spd ) { // Init distination dist = (enum EPlace) ((( qrand() % 5 ) + (int)genPlace +1) % 6); setStartPos(); setRotation( 90 ); }
/*----- CarBSS --------------------------------------------------------------*/ CarBSS::CarBSS( qreal spd ) : Car( eBSS, eBSS, spd ) { // Init distination dist = (enum EPlace) ((( qrand() % 5 ) + (int)genPlace +1) % 6); setStartPos(); setRotation( 180 ); }
/*----- CarRHW --------------------------------------------------------------*/ CarRHW::CarRHW( qreal spd ) : Car( eRHW, eRHW, spd ) { // Init distination //dist = (enum EPlace) ((( qrand() % 5 ) + (int)genPlace) % 5); dist = (enum EPlace) ((( qrand() % 5 ) + (int)genPlace +1) % 6); setStartPos(); setRotation( -90 ); }
/*----- CarTBS --------------------------------------------------------------*/ CarTBS::CarTBS( qreal spd ) : Car( eTBS, eTBS, spd ) { // Init distination //dist = (enum EPlace) ((( qrand() % 5 ) + (int)genPlace) % 5); dist = (enum EPlace) ((( qrand() % 5 ) + (int)genPlace +1) % 6); setStartPos(); setRotation( 180 ); }
void DetView::setCenterPos(qint64 pos) { if (!isWrapMode()) { GSequenceLineView::setCenterPos(pos); return; } DetViewRenderArea* detArea = getDetViewRenderArea(); qint64 line = pos / detArea->getSymbolsPerLine(); qint64 newPos = (line - detArea->getLinesCount()/ 2) * detArea->getSymbolsPerLine(); currentShiftsCounter = 0; setStartPos(newPos); }
/** *@brief ホームポジションに移動 */ void RobotArm::goHomePosition() { //homePosition = calcKinematics(theta); //targetPoint = homePosition; //addTargetJointPos(homeTheta, -1); setStartPos(homeTheta[0], homeTheta[1], homeTheta[2], homeTheta[3]); //startPoint = homePosition; }
// --------------------------------------------------------------------------- // Match: private helpers methods // --------------------------------------------------------------------------- void Match::initialize(const Match &toCopy){ //do not copy over value of fPositionSize as it is irrelevant to the //state of the Match fMemoryManager = toCopy.fMemoryManager; int toCopySize = toCopy.getNoGroups(); setNoGroups(toCopySize); for (int i=0; i<toCopySize; i++){ setStartPos(i, toCopy.getStartPos(i)); setEndPos(i, toCopy.getEndPos(i)); } }
void AbstractGraphicsItem::resize( qint64 newSize, qint64 newMovingBoundary, qint64 currentStillBoundary, From from ) { if ( newSize < 1 ) { // if ( from == END ) // setStartPos( currentStillBoundary - 1 ); // setWidth( 1 ); return ; } qint64 maxSize = maxEnd() - maxBegin(); //The "from" actually stands for the clip bound that stays still. if ( from == BEGINNING ) { if ( hasResizeBoundaries() == true ) { qint64 beginOffset = begin() - maxBegin(); qint64 absoluteStartPos = currentStillBoundary - beginOffset; if ( absoluteStartPos + maxSize < newMovingBoundary ) { setWidth( maxSize - beginOffset ); return ; } } setWidth( newSize ); } else { if ( newMovingBoundary < 0 ) return ; if ( hasResizeBoundaries() == true ) { qint64 endOffset = maxEnd() - end(); qint64 absoluteEnd = currentStillBoundary + endOffset; if ( newMovingBoundary < absoluteEnd - maxSize ) { // qint64 size = end() - begin(); // setWidth( size ); // setStartPos( currentStillBoundary - size ); return ; } } setWidth( newSize ); setStartPos( newMovingBoundary ); } }
Car::Car( EPlace gen, EPlace dis, qreal fast ) : genPlace(gen), dist(dis), speed(fast) { setStartPos(); }
/*---------------------------------------------------------------------------*/ Car::Car() : speed(0.1), genPlace(eBSN), dist(eBSS) { setRotation( 0 ); setStartPos(); }
void CSettingDlg7::Save() { // TODO: Add extra validation here UpdateData(TRUE); CMainFrame* pMain =(CMainFrame*)AfxGetMainWnd(); CTaskControlDoc* pDoc = (CTaskControlDoc*)pMain->GetActiveDocument(); //若选择反馈 if (m_bPracCheck) { pDoc->m_Setting7[m_DlgIdx].m_PracMode = 1; pDoc->m_Setting7[m_DlgIdx].m_ExperMode = 0; } else { pDoc->m_Setting7[m_DlgIdx].m_PracMode = 0; pDoc->m_Setting7[m_DlgIdx].m_ExperMode = 1; } pDoc->m_Setting7[m_DlgIdx].m_iBallColorR = m_iSmallBallClrR; pDoc->m_Setting7[m_DlgIdx].m_iBallColorG = m_iSmallBallClrG; pDoc->m_Setting7[m_DlgIdx].m_iBallColorB = m_iSmallBallClrB; pDoc->m_Setting7[m_DlgIdx].m_iBckGrndColorR= m_iBkgndClrR; pDoc->m_Setting7[m_DlgIdx].m_iBckGrndColorG = m_iBkgndClrG; pDoc->m_Setting7[m_DlgIdx].m_iBckGrndColorB = m_iBkgndClrB; pDoc->m_Setting7[m_DlgIdx].m_iObstacleColorR = m_iObstacleColorR; pDoc->m_Setting7[m_DlgIdx].m_iObstacleColorG = m_iObstacleColorG; pDoc->m_Setting7[m_DlgIdx].m_iObstacleColorB = m_iObstacleColorB; pDoc->m_Setting7[m_DlgIdx].m_iSpeedMode = m_iSpeedMode; pDoc->m_Setting7[m_DlgIdx].m_iBallSpeed1 = m_iSpeed1; pDoc->m_Setting7[m_DlgIdx].m_iBallSpeed2 = m_iSpeed2; pDoc->m_Setting7[m_DlgIdx].m_iBallSpeed3 = m_iSpeed3; //pDoc->m_Setting7[m_DlgIdx].m_iBallSpeedAcc = m_iSmallBallAcc; //pDoc->m_Setting7[m_DlgIdx].m_iBallStartPos = m_iStartPos; pDoc->m_Setting7[m_DlgIdx].m_iObstacleRadius = m_iObstacleRadius; pDoc->m_Setting7[m_DlgIdx].m_iBallRadius = m_iSmallBallRadius; pDoc->m_Setting7[m_DlgIdx].m_iBallCenterDis = m_iBallCenterDis; pDoc->m_Setting7[m_DlgIdx].m_iIntervalTime = m_iInterval; printf(m_iBallCenterDis+""); if (m_bStartPosTop == TRUE) { pDoc->m_Setting7[m_DlgIdx].m_iTop = 1; } else { pDoc->m_Setting7[m_DlgIdx].m_iTop = 0; } if (m_bStartPosBottom == TRUE) { pDoc->m_Setting7[m_DlgIdx].m_iBottom = 1; } else { pDoc->m_Setting7[m_DlgIdx].m_iBottom = 0; } if (m_bStartPosLeft == TRUE) { pDoc->m_Setting7[m_DlgIdx].m_iLeft = 1; } else { pDoc->m_Setting7[m_DlgIdx].m_iLeft = 0; } if (m_bStartPosRight == TRUE) { pDoc->m_Setting7[m_DlgIdx].m_iRight = 1; } else { pDoc->m_Setting7[m_DlgIdx].m_iRight = 0; } pDoc->m_Setting7[m_DlgIdx].m_iPracTimes = m_iPracTimes; pDoc->m_Setting7[m_DlgIdx].m_iExpTimes = m_iPracTimes; // 初始位置 setStartPos(); }