//---------------------------------------------------------------------------- void Plcm::deletePos(int pos,compactType dir) // // Really moves elements laying over this position by one basic cell down. // Also if we have a licing layout it updates slices infomrations { int offset; if(dir == HorizC) offset=thisImage.size[HOR]; else offset=thisImage.size[VER]; if(slicingLayout) { int i,j; SLICE* slvPtr,*slhPtr; for(i=0,slvPtr=layoutToBuild->slice->chld.slice; slvPtr!=NULL && i<slicesInHor;i++,slvPtr=slvPtr->next) for(j=0,slhPtr=slvPtr->chld.slice; slhPtr!=NULL && j<slicesInVer;j++,slhPtr=slhPtr->next) { // we let\'s find out if this one has to // be updated SLICE_INFO* tdPtr=(SLICE_INFO*)slhPtr->flag.p; if (tdPtr->layerTrans != NULL) cerr << "Warning : Compact - you shouldn't do compactions after \n" << " transparency analysis ! " << endl; if(dir == HorizC) { if(tdPtr->cX + tdPtr->width >= pos) for(LAYINSTPTR lPtr=slhPtr->chld.layinst;lPtr != NULL;lPtr=lPtr->next) moveCell(lPtr,dir,pos,offset); if(tdPtr->cX <= pos && tdPtr->cX+tdPtr->width > pos) tdPtr->width--; // only shrink it if(tdPtr->cX > pos) // only shift tdPtr->cX--; } else { if (tdPtr->cY + tdPtr->height >= pos) for(LAYINSTPTR lPtr=slhPtr->chld.layinst;lPtr != NULL;lPtr=lPtr->next) moveCell(lPtr,dir,pos,offset); if(tdPtr->cY <= pos && tdPtr->cY+tdPtr->height > pos) tdPtr->height--; // only shrink it if(tdPtr->cY > pos) // only shift tdPtr->cY--; } } } else for(LAYINST *liPtr=*layInstancesList;liPtr!=NULL;liPtr=liPtr->next) moveCell(liPtr,dir,pos,offset); }// Plcm::deletePos //
void followWallTest() { mainControlInit(); telemetersStart(); motorsSleepDriver(OFF); HAL_Delay(500); // control_params.wall_follow_state = TRUE; wall_follow_control.follow_type = FOLLOW_WALL;//NOFOLLOW // moveUTurn(300, 300, 0); //while(1); move(0, 0, 0, 0); moveStartCell(500, 500); moveCell(5, 500, 300); moveRotateCW90(300, 300); moveCell(3, 500, 300); moveRotateCW90(300, 300); moveCell(2, 500, 300); moveRotateCW90(300, 300); moveCell(2, 500, 300); moveRotateCCW90(300, 300); moveCell(1, 500, 300); moveRotateCW90(300, 0); // moveRotateCW90(50, 10); // moveRotateCCW90(50, 10); // moveRotateCCW90(50, 10); while(1); moveRotateCW90(600, 200); moveRotateCW90(600, 200); moveCell(1, 600, 200); moveRotateCCW90(600, 200); moveRotateCCW90(600, 200); HAL_Delay(1000); moveCell(4, 1000, 200); HAL_Delay(1000); moveRotateCW90(600, 200); moveRotateCCW90(600, 200); moveRotateCW90(600, 200); moveRotateCCW90(600, 200); moveRotateCW90(600, 200); moveRotateCCW90(600, 200); moveRotateCW90(600, 200); moveCell(1, 600, 200); telemetersStop(); mainControlDisplayTest(); mainControlDisplayTest(); }