ComputerPlayer::ComputerPlayer() : isActive_(false) { interface_ = new ComputerPlayerInterface(); connect(interface_->browseButton, SIGNAL(released()), this, SLOT(selectProgram())); interface_->hide(); setAllowedTime(3000); }
task main() { initializeRobot(); //////////////////////////////////////////////////////////////////////////// while(true) { selectProgram(); switch(system) { case 0: break; //Drivetrain Test////////////////////////////////////////////////////////// case 1: motor[leftDrive] = 50; wait10Msec(200); motor[leftDrive] = 0; //----------------------- motor[leftDrive] = -50; wait10Msec(200); motor[leftDrive] = 0; //----------------------- motor[rightDrive] = 50; wait10Msec(200); motor[rightDrive] = 0; //----------------------- motor[rightDrive] = -50; wait10Msec(200); motor[rightDrive] = 0; //----------------------- motor[leftDrive] = 50; motor[rightDrive] = 50; wait10Msec(200); motor[leftDrive] = 0; motor[rightDrive] = 0; //----------------------- motor[leftDrive] = 50; motor[rightDrive] = 50; wait10Msec(200); motor[leftDrive] = 0; motor[rightDrive] = 0; //----------------------- break; //Gripper Test////////////////////////////////////////////////////////// case 2: nMotorEncoderTarget[finger] = 90; ClearTimer(T1); while ((nMotorEncoder[finger] < 90) && (time1[T1] < 500)) { motor[finger] = 30; } wait10Msec(100); //------------------------------------------------------- nMotorEncoderTarget[finger] = 0; ClearTimer(T1); while ((nMotorEncoder[finger] > 0) && (time1[T1] < 500)) { motor[finger] = -30; } motor[finger] = 0; break; //Arm Test//////////////////////////////////////////////////////////////// case 3: //----------------------------- motor[arm] = 20; wait10Msec(300); //----------------------------- motor[arm] = -20; wait10Msec(300); //----------------------------- break; //BAM///////////////////////////////////////////////////////////////////// case 4: servoTarget[bamLeft] = 255; servoTarget[bamRight] = 0; wait10Msec(200); //------------------------------ servoTarget[bamLeft] = 0; servoTarget[bamRight] = 255; wait10Msec(200); //------------------------------ servoTarget[bamLeft] = 127; servoTarget[bamRight] = 127; wait10Msec(200); break; //Mechanical Stop///////////////////////////////////////////////////////// case 5: servoTarget[stopLeft] = 255; servoTarget[stopRight] = 0; wait10Msec(200); //------------------------------ servoTarget[stopLeft] = 0; servoTarget[stopRight] = 255; wait10Msec(200); //------------------------------ servoTarget[stopLeft] = 127; servoTarget[stopRight] = 127; wait10Msec(200); break; //Gyro///////////////////////////////////////////////////////////////////// case 6: turngyro_right(90, 30); wait10Msec(200); //---------------------------- turngyro_right(-90, 30); wait10Msec(200); //---------------------------- turngyro_right(45, 30); wait10Msec(200); //---------------------------- turngyro_right(-45, 30); wait10Msec(200); break; } } }