task main()
{
	forward(2*12/WHEEL_CIRCUM);
	doNothing(1000);
	turnLeft(0.8);
	doNothing(1000);
	forward(2.5*12/WHEEL_CIRCUM);
	doNothing(1000);
	turnRight(0.9);
	doNothing(1000);
	forward(1.5*12/WHEEL_CIRCUM);
	doNothing(1000);
	turnRight(0.8);
	doNothing(1000);
	openClaw();
	doNothing(1000);
	forward(12/WHEEL_CIRCUM);
	doNothing(1000);
	closeClaw();
	doNothing(1000);
	moveArmUp(900);
	doNothing(1000);
	turnLeft(1.6);
	forward(12/WHEEL_CIRCUM);
	turnLeft(0.8);
	forward(1.5*12/WHEEL_CIRCUM);
	turnLeft(0.8);
	forward(2.5*12/WHEEL_CIRCUM);
	turnLeft(0.8);
	forward(2*12/WHEEL_CIRCUM);
	moveArmDown(900);
	openClaw();
	backward(4*12/WHEEL_CIRCUM);
}
Пример #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    int lPisarzy = 2;
    int lCzytelnikow = 5;
    int lKsiazek = 3;
    listaCzytelnikow = new QList<Czytelnik*>();
    listaPisarzy = new QList<Pisarz*>();

    biblioteka = new Biblioteka(lKsiazek);
    QObject::connect(biblioteka, SIGNAL(showCzytelnicy()), this, SLOT(slot_showCzytelicy()), Qt::DirectConnection);
    QObject::connect(biblioteka, SIGNAL(showPisarze()), this, SLOT(slot_showPisarze()), Qt::DirectConnection);

    for (int i = 0 ; i < lPisarzy ; i++ ){
        Pisarz *pisarz = new Pisarz(i+1);
        listaPisarzy->append(pisarz);

        QObject::connect(pisarz, SIGNAL(stoppedDoNothing()), pisarz, SLOT(slot_stoppedDoNothing()), Qt::DirectConnection);
        QObject::connect(pisarz, SIGNAL(stoppedWriting()), pisarz, SLOT(slot_stoppedWriting()), Qt::DirectConnection);
        QObject::connect(pisarz, SIGNAL(boredToDeath()), pisarz, SLOT(slot_boredToDeath()), Qt::DirectConnection);
        QObject::connect(pisarz, SIGNAL(startDoNothingAgain()), pisarz, SLOT(doNothing()), Qt::DirectConnection);

        QObject::connect(pisarz, SIGNAL(freeSlot()), biblioteka, SLOT(slot_freeSlotPisarz()), Qt::DirectConnection);
        QObject::connect(pisarz, SIGNAL(meWantsWrite(Pisarz*)), biblioteka, SLOT(slot_requestedSlotByPisarz(Pisarz*)), Qt::DirectConnection);
    }

    for (int i = 0 ; i < lCzytelnikow ; i++ ){
        Czytelnik *czytelnik = new Czytelnik(i+1);
        listaCzytelnikow->append(czytelnik);

        QObject::connect(czytelnik, SIGNAL(stoppedDoNothing()), czytelnik, SLOT(slot_stoppedDoNothing()), Qt::DirectConnection);
        QObject::connect(czytelnik, SIGNAL(stoppedReading()), czytelnik, SLOT(slot_stoppedReading()), Qt::DirectConnection);
        QObject::connect(czytelnik, SIGNAL(boredToDeath()), czytelnik, SLOT(slot_boredToDeath()), Qt::DirectConnection);
        QObject::connect(czytelnik, SIGNAL(startDoNothingAgain()), czytelnik, SLOT(doNothing()), Qt::DirectConnection);

        QObject::connect(czytelnik, SIGNAL(freeSlot()), biblioteka, SLOT(slot_freeSlotCzytelnik()), Qt::DirectConnection);
        QObject::connect(czytelnik, SIGNAL(meWantsRead(Czytelnik*)), biblioteka, SLOT(slot_requestedSlotByCzytelnik(Czytelnik*)), Qt::DirectConnection);
    }


    for ( int i = 0 ; i < listaCzytelnikow->size() ; i++ ){
        (*listaCzytelnikow)[i]->startThread();
    }

    for ( int i = 0 ; i < listaPisarzy->size() ; i++ ){
        (*listaPisarzy)[i]->startThread();
    }

    ui->setupUi(this);
}
Пример #3
0
void DAC_Init(void){
	SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOF;
	doNothing();
	GPIO_PORTF_DIR_R |= 0x0F;
	GPIO_PORTF_AFSEL_R |= 0x00;
	GPIO_PORTF_DEN_R |= 0x0F;
}
Пример #4
0
int main ()
{
    int result = doNothing();

    int i = addSomething(result);

    return 0;
}
Пример #5
0
void VeritazzExtra::begin()
{
	boot();

	if (buttonsState() & UP_BUTTON)
		doNothing();

	bootLogo();
}
Пример #6
0
void Game::doAction(const Actions action) {
	switch (action)
	{
	case GO: doGo(); break;
	case QUIT: doQuit(); break;
	case PICK: doPick(); break;
	case DROP: doDrop(); break;
	case READ: doRead(); break;
	case BREAK: doBreak(); break;
	case SEE: doSee(); break;
	case OPEN: doOpen(); break;
	case FILL: doFill(); break;
	case USE: doUse(); break;
	case PUT: doPut(); break;
	case NOACTION: doNothing(); break;
	default: doNothing();
	}
}
Пример #7
0
/** 
 * \fn int rcpt_to(char *c)
 * \brief handler for rcpt to command
 */
int
rcpt_to (char *c)
{
  if (!say_ehlo || strlen (data_email->from_email) < 3)
    {
      return smtp_proto_violation ();
    }
  char prefix[255];
  int i = 0;
  int j = 0;
  int t = 0;
  char parameters[512];
  while (c[i] != ':' && c[i] != '\n' && c[i] != '\0' && i < 255)
    {
      prefix[i] = tolower (c[i]);
      i++;
    }
  prefix[i] = '\0';
  if (strcmp (prefix, "rcpt to") != 0)
    {
      return doNothing (c);
    }
  i++;
  while (c[i + j] != '\n' && c[i + j] != '\0' && j < 512)
    {
      if (c[i + j] != '<' && c[i + j] != '>')
	{
	  parameters[t] = c[i + j];
	  t++;
	}
      j++;
    }
  parameters[t] = '\0';
  short int v = verify (parameters);
  if (v == EMAIL_OK)
    {
      strcpy (data_email->rcpt_email, parameters);
    }
  else if (v == EMAIL_DOMAIN_UNKNOW)
    {
      sendTxt ("553 relay denied\r\n");
      return 553;
    }
  else if (v == EMAIL_MAILBOX_UNKNOW)
    {
      sendTxt ("550 unknow mailbox\r\n");
      return 550;
    }
  else
    {
      internal_error ();
      return 450;
    }
  sendTxt ("250 OK msg to : %s\r\n", parameters);
  return 250;
}
Пример #8
0
void VeritazzExtra::begin()
{
	WDTCSR |= _BV(WDIE);

	boot();

	if (buttonsState() & UP_BUTTON)
		doNothing();

	bootLogo();
}
Пример #9
0
WebView::WebView(QWidget *parent) :
    QWebView(parent)
    , m_page(new WebPage(this))
{
    setPage(m_page);
    page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
    connect( m_page->mainFrame() , SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(attachObject()) );

    connect(this,SIGNAL(loadFinished(bool)),this,SLOT(loadFinished(bool)));
    connect(this,SIGNAL(selectionChanged()),this,SLOT(doNothing()));
    connect(this,SIGNAL(urlChanged(QUrl)),this,SLOT(urlChanged(QUrl)));
    enableSettings();
    attachObject();
    //setContextMenuPolicy(Qt::PreventContextMenu);
}
Пример #10
0
int
main()
{
    for (int i = 0; i < 5; i--) {
        doNothing();
    }

    for (int i = 0; i < 5; --i) {
        doNothing();
    }

    for (int i = 0; i < 5; i++) {
        doNothing();
    }

    for (int i = 0; i < 5; ++i) {
        doNothing();
    }

    std::vector<int> v;
    typedef std::vector<int> IntVector;

    for (IntVector::const_iterator cit = v.begin(); cit != v.end(); cit++) {
        doNothing();
    }

    for (IntVector::const_iterator cit = v.begin(); cit != v.end(); ++cit) {
        doNothing();
    }

    for (IntVector::const_iterator cit = v.begin(); cit != v.end(); cit--) {
        doNothing();
    }

    for (IntVector::const_iterator cit = v.begin(); cit != v.end(); --cit) {
        doNothing();
    }

    return EXIT_SUCCESS;
}
Пример #11
0
/** 
 * \fn int mail_from(char *c)
 * \brief handler for mail from command
 */
int
mail_from (char *c)
{
  if (!say_ehlo)
    {
      return smtp_proto_violation ();
    }
  if (strlen (data_email->from_email) > 0)
    {
      clearData ();
    }
  char prefix[255] = "";
  int i = 0;
  int j = 0;
  int t = 0;
  char parameters[512] = "";
  while (c[i] != ':' && c[i] != '\n' && c[i] != '\0' && i < 255)
    {
      prefix[i] = tolower (c[i]);
      i++;
    }
  prefix[i] = '\0';
  if (strcmp (prefix, "mail from") != 0)
    {
      return doNothing (c);
    }
  i++;
  while (c[i + j] != '\n' && c[i + j] != '\0' && j < 512)
    {
      if (c[i + j] != '<' && c[i + j] != '>')
	{
	  parameters[t] = c[i + j];
	  t++;
	}
      j++;
    }
  parameters[t] = '\0';
  strcpy (data_email->from_email, parameters);
  sendTxt ("250 OK new mail from : %s\r\n", parameters);
  return 250;
}
Пример #12
0
static void entityWait()
{
	doNothing();

	if (self->target != NULL)
	{
		if (self->thinkTime <= 0)
		{
			self->target->inUse = FALSE;

			self->target = NULL;
		}

		else
		{
			if (self->target->dirX < 0)
			{
				self->target->x = self->x + self->w / 2;

				self->target->startX = self->target->x;
			}
		}
	}
}
Пример #13
0
void doSomething() {
    doNothing(); // √
    doSomethingElse();
}
Пример #14
0
QAction *MainWindow::createAction(const QString icon, const QString toolTip, const QString statusTip, bool scripted)
{
    QAction *ACTION = new QAction(QIcon("icons/" + getSettingsGeneralIconTheme() + "/" + icon + ".png"), toolTip, this); //TODO: Qt4.7 wont load icons without an extension...
    ACTION->setStatusTip(statusTip);
    ACTION->setObjectName(icon);
    // TODO: Set What's This Context Help to statusTip for now so there is some infos there.
    // Make custom whats this context help popup with more descriptive help than just
    // the status bar/tip one liner(short but not real long) with a hyperlink in the custom popup
    // at the bottom to open full help file description. Ex: like wxPython AGW's SuperToolTip.
    ACTION->setWhatsThis(statusTip);
    // TODO: Finish All Commands ... <.<

    if     (icon == "donothing")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(doNothing()));
    else if(icon == "new")                      { ACTION->setShortcut(QKeySequence::New);      connect(ACTION, SIGNAL(triggered()), this, SLOT(newFile()));         }
    else if(icon == "open")                     { ACTION->setShortcut(QKeySequence::Open);     connect(ACTION, SIGNAL(triggered()), this, SLOT(openFile()));        }
    else if(icon == "save")                     { ACTION->setShortcut(QKeySequence::Save);     connect(ACTION, SIGNAL(triggered()), this, SLOT(savefile()));        }
    else if(icon == "saveas")                   { ACTION->setShortcut(QKeySequence::SaveAs);   connect(ACTION, SIGNAL(triggered()), this, SLOT(saveasfile()));      }
    else if(icon == "print")                    { ACTION->setShortcut(QKeySequence::Print);    connect(ACTION, SIGNAL(triggered()), this, SLOT(print()));           }
    else if(icon == "designdetails")            { ACTION->setShortcut(QKeySequence("Ctrl+D")); connect(ACTION, SIGNAL(triggered()), this, SLOT(designDetails()));   }
    else if(icon == "exit")                     { ACTION->setShortcut(QKeySequence("Ctrl+Q")); connect(ACTION, SIGNAL(triggered()), this, SLOT(exit()));            }

    else if(icon == "cut")                      { ACTION->setShortcut(QKeySequence::Cut);   connect(ACTION, SIGNAL(triggered()), this, SLOT(cut()));   }
    else if(icon == "copy")                     { ACTION->setShortcut(QKeySequence::Copy);  connect(ACTION, SIGNAL(triggered()), this, SLOT(copy()));  }
    else if(icon == "paste")                    { ACTION->setShortcut(QKeySequence::Paste); connect(ACTION, SIGNAL(triggered()), this, SLOT(paste())); }

    else if(icon == "windowcascade")              connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(cascade()));
    else if(icon == "windowtile")                 connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(tile()));
    else if(icon == "windowclose")              { ACTION->setShortcut(QKeySequence::Close);    connect(ACTION, SIGNAL(triggered()), this, SLOT(onCloseWindow()));   }
    else if(icon == "windowcloseall")             connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows()));
    else if(icon == "windownext")               { ACTION->setShortcut(QKeySequence::NextChild);     connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow()));     }
    else if(icon == "windowprevious")           { ACTION->setShortcut(QKeySequence::PreviousChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); }

    else if(icon == "help")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(help()));
    else if(icon == "changelog")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(changelog()));
    else if(icon == "tipoftheday")                connect(ACTION, SIGNAL(triggered()), this, SLOT(tipOfTheDay()));
    else if(icon == "about")                      connect(ACTION, SIGNAL(triggered()), this, SLOT(about()));
    else if(icon == "whatsthis")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(whatsThisContextHelp()));

    else if(icon == "icon16")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon16()));
    else if(icon == "icon24")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon24()));
    else if(icon == "icon32")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon32()));
    else if(icon == "icon48")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon48()));
    else if(icon == "icon64")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon64()));
    else if(icon == "icon128")                    connect(ACTION, SIGNAL(triggered()), this, SLOT(icon128()));

    else if(icon == "settingsdialog")             connect(ACTION, SIGNAL(triggered()), this, SLOT(settingsDialog()));

    else if(icon == "undo")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(undo()));
    else if(icon == "redo")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(redo()));

    else if(icon == "makelayercurrent")           connect(ACTION, SIGNAL(triggered()), this, SLOT(makeLayerActive()));
    else if(icon == "layers")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(layerManager()));
    else if(icon == "layerprevious")              connect(ACTION, SIGNAL(triggered()), this, SLOT(layerPrevious()));

    else if(icon == "textbold")                 { ACTION->setCheckable(true); connect(ACTION, SIGNAL(toggled(bool)), this, SLOT(setTextBold(bool)));   }
void AutoModeController::handle(CowRobot* bot)
{
	bool result = false;
	
	// Run the command
	switch(m_CurrentCommand.m_Command)
	{
		case CMD_NULL:
		{
			doNothing(bot);
			
			result = true;
			break;
		}
		case CMD_WAIT:
		{
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			bot->DriveWithHeading(m_CurrentCommand.m_Heading, 0);
			doNothing(bot);
			break;
		}
		case CMD_DESPRING:
		{
			doNothing(bot);
			bot->WinchDespring();
			break;
		}
		case CMD_DETECT_HOT:
		{
			doNothing(bot);
			if(bot->KinectLeftRight() < -0.5)
			{
				m_CommandList = *(m_CurrentCommand.m_HotGoalLeftCommandList);
				printf("Detected kinect left!\n");
				result = true;
			}
			else if(bot->KinectLeftRight() > 0.5)
			{
				m_CommandList = *(m_CurrentCommand.m_HotGoalRightCommandList);
				printf("Detected kinect right!\n");
				result = true;
			}
			break;
		}
		case CMD_CHANGE_SETPOINT:
		{
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			bot->DriveWithHeading(m_CurrentCommand.m_Heading, 0);
			if(!m_ChangedSetpoint)
			{
				bot->ChangeWinchSetpoint(m_CurrentCommand.m_WinchSetpoint);
				m_ChangedSetpoint = true;
			}
			else
			{
				if(bot->ReadyToFire())
				{
					m_ChangedSetpoint = false;
					result = true;
				}
			}
			break;
		}
		case CMD_FORCE_FIRE:
		{
			bot->DriveWithHeading(m_CurrentCommand.m_Heading, 0);
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			if(!m_Fired)
			{
				bot->ForceFire();
				m_Fired = true;
			}
			else if(bot->ReadyToFire())
			{
				result = true;
				m_Fired = false;
			}
			break;
		}
		case CMD_FIRE:
		{
			bot->DriveDistanceWithHeading(m_CurrentCommand.m_Heading, m_CurrentCommand.m_EncoderCount);
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			if(!m_Fired)
			{
				if(bot->ReadyToFire())
				{
					bot->AskForFire();
					m_Fired = true;
				}
			}
			else
			{
				// if we have fired
				if(!m_ChangedSetpoint)
				{
					m_ChangedSetpoint = bot->ChangeWinchSetpoint(m_CurrentCommand.m_WinchSetpoint);
				}
				if(bot->Reloading())
				{
					result = true;
					m_Fired = false;
				}
			}
			break;
		}
		case CMD_FIRE_HEADING_ONLY:
		{
			bot->DriveWithHeading(m_CurrentCommand.m_Heading, 0);
			//bot->DriveDistanceWithHeading(m_CurrentCommand.m_Heading, m_CurrentCommand.m_EncoderCount);
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			if(!m_Fired)
			{
				if(bot->ReadyToFire())
				{
					bot->AskForFire();
					m_Fired = true;
				}
			}
			else
			{
				// if we have fired
				if(!m_ChangedSetpoint)
				{
					m_ChangedSetpoint = bot->ChangeWinchSetpoint(m_CurrentCommand.m_WinchSetpoint);
				}
				if(bot->Reloading())
				{
					result = true;
					m_Fired = false;
				}
			}
			break;
		}
		case CMD_FIRE_INSTANT:
		{
			bot->DriveWithHeading(m_CurrentCommand.m_Heading, 0);
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			if(bot->ReadyToFire())
			{
				bot->AskForFire();
				result = true;
			}
			break;
		}
		case CMD_FIRE_INTAKE:
		{
			bot->DriveWithHeading(m_CurrentCommand.m_Heading, 0);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			if(bot->ReadyToFire())
			{
				bot->FrontIntake(0, m_CurrentCommand.m_FrontIntakeState);
				if(!m_Fired)
				{
					bot->AskForFire();
					m_Fired = true;
				}
				else
				{
					result = true;
					m_Fired = false;
				}
			}
			else if(m_Fired)
			{
				bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			}
			else
			{
				bot->FrontIntake(0, m_CurrentCommand.m_FrontIntakeState);
			}
			break;
		}
		case CMD_DRIVE_FIRE_SKIP:
		{
			bot->DriveDistanceWithHeading(m_CurrentCommand.m_Heading, m_CurrentCommand.m_EncoderCount);
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			if(bot->GetDriveDistance() > m_CurrentCommand.m_FirePoint)
			{
				if(!m_Fired)
				{
					if(bot->ReadyToFire())
					{
						bot->AskForFire();
						m_Fired = true;
					}
				}
				else
				{
					// if we have fired
					if(!m_ChangedSetpoint)
					{
						m_ChangedSetpoint = bot->ChangeWinchSetpoint(m_CurrentCommand.m_WinchSetpoint);
					}
					if(bot->Reloading())
					{
						result = true;
						m_Fired = false;
					}
				}
			}
			break;
		}
		case CMD_DRIVE_FIRE:
		{
			bool drive = bot->DriveDistanceWithHeading(m_CurrentCommand.m_Heading, m_CurrentCommand.m_EncoderCount);
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			if(bot->ReadyToFire() && bot->GetDriveDistance() > m_CurrentCommand.m_FirePoint)
			{
				if(!m_Fired)
				{
					bot->AskForFire();
					m_Fired = true;
				}
				else
				{
					// if we have fired
					if(!m_ChangedSetpoint)
					{
						m_ChangedSetpoint = bot->ChangeWinchSetpoint(m_CurrentCommand.m_WinchSetpoint);
					}
					if(drive)
					{
						result = true;
						m_Fired = false;
					}
				}
			}
			break;
		}
		case CMD_INTAKES:
		{
			bot->DriveWithHeading(m_CurrentCommand.m_Heading, 0);
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			break;
		}
		case CMD_INTAKES_FRONT:
		{
			//Figure out if we actually sucked in the ball
			if(bot->GetRearIR() > 1)
			{
				result = true;
			}
			bot->DriveWithHeading(m_CurrentCommand.m_Heading, 0);
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			break;
		}
		case CMD_TURN:
		{
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			result = bot->DriveWithHeading(m_CurrentCommand.m_Heading, 0);
			break;
		}
		case CMD_DRIVE_DISTANCE:
		{
			bot->FrontIntake(m_CurrentCommand.m_FrontIntakeSpeed, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(m_CurrentCommand.m_RearIntakeSpeed, m_CurrentCommand.m_RearIntakeState);
			result = bot->DriveDistanceWithHeading(m_CurrentCommand.m_Heading, m_CurrentCommand.m_EncoderCount);
			break;
		}
		case CMD_SETTLE_BALL:
		{
			bot->FrontIntake(0, m_CurrentCommand.m_FrontIntakeState);
			bot->RearIntake(0, m_CurrentCommand.m_RearIntakeState);
//			bot->SetFrontIntakeState(m_CurrentCommand.m_FrontIntakeState);
//			bot->SetRearIntakeState(m_CurrentCommand.m_RearIntakeState);
			bot->AutoSettle();
			result = (bot->GetSettledState() == CowRobot::SETTLE_FINISHED);
			break;
		}
		default:
		{
			doNothing(bot);
			result = true;
			break;
		}
	}
	
	// Check if this command is done
	if(result == true || m_CurrentCommand.m_Command == CMD_NULL || m_Timer->Get() > m_CurrentCommand.m_Timeout)
	{
		if(m_CurrentCommand.m_Command == CMD_DETECT_HOT && m_Timer->Get() > m_CurrentCommand.m_Timeout)
		{
			m_CommandList = *(m_CurrentCommand.m_HotGoalLeftCommandList);
		}
		// This command is done, go get the next one
		if(m_CommandList.size() > 0 )
		{			
			m_CurrentCommand = m_CommandList.front();
			m_CommandList.pop_front();
			
			if(!m_CurrentCommand.m_Command == CMD_NULL)
				printf("Time elapsed: %f\n", m_Timer->Get());
			
			m_Timer->Reset();
			
			m_Fired = false;
			m_SmartLoaded = false;
			m_ChangedSetpoint = false;
		}
		else
		{
			//we're done clean up
			m_CurrentCommand = RobotCommand();
		}
	}
}
QAction *MainWindow::createAction(const QString icon, const QString toolTip, const QString statusTip, bool scripted)
{
    QAction *ACTION = new QAction(QIcon("icons/" + getSettingsGeneralIconTheme() + "/" + icon + ".png"), toolTip, this); //TODO: Qt4.7 wont load icons without an extension...
    ACTION->setStatusTip(statusTip);
    ACTION->setObjectName(icon);
    // TODO: Finish All Commands ... <.<

    if     (icon == "donothing")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(doNothing()));
    else if(icon == "new")                      { ACTION->setShortcut(QKeySequence::New);      connect(ACTION, SIGNAL(triggered()), this, SLOT(newfile()));         }
    else if(icon == "open")                     { ACTION->setShortcut(QKeySequence::Open);     connect(ACTION, SIGNAL(triggered()), this, SLOT(openfile()));        }
    else if(icon == "save")                     { ACTION->setShortcut(QKeySequence::Save);     connect(ACTION, SIGNAL(triggered()), this, SLOT(savefile()));        }
    else if(icon == "saveas")                   { ACTION->setShortcut(QKeySequence::SaveAs);   connect(ACTION, SIGNAL(triggered()), this, SLOT(saveasfile()));      }
    else if(icon == "print")                    { ACTION->setShortcut(QKeySequence::Print);    connect(ACTION, SIGNAL(triggered()), this, SLOT(print()));           }
    else if(icon == "close")                    { ACTION->setShortcut(QKeySequence::Close);    connect(ACTION, SIGNAL(triggered()), this, SLOT(onCloseWindow()));   }
    else if(icon == "designdetails")            { ACTION->setShortcut(QKeySequence("Ctrl+D")); connect(ACTION, SIGNAL(triggered()), this, SLOT(designDetails()));   }
    else if(icon == "exit")                     { ACTION->setShortcut(QKeySequence("Ctrl+Q")); connect(ACTION, SIGNAL(triggered()), this, SLOT(exit()));            }

    else if(icon == "cut")                      { ACTION->setShortcut(QKeySequence::Cut);   connect(ACTION, SIGNAL(triggered()), this, SLOT(cut()));   }
    else if(icon == "copy")                     { ACTION->setShortcut(QKeySequence::Copy);  connect(ACTION, SIGNAL(triggered()), this, SLOT(copy()));  }
    else if(icon == "paste")                    { ACTION->setShortcut(QKeySequence::Paste); connect(ACTION, SIGNAL(triggered()), this, SLOT(paste())); }

    else if(icon == "windowcascade")              connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(cascade()));
    else if(icon == "windowtile")                 connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(tile()));
    else if(icon == "windowcloseall")             connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows()));
    else if(icon == "windownext")               { ACTION->setShortcut(QKeySequence::NextChild);     connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow()));     }
    else if(icon == "windowprevious")           { ACTION->setShortcut(QKeySequence::PreviousChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); }

    else if(icon == "help")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(help()));
    else if(icon == "changelog")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(changelog()));
    else if(icon == "tipoftheday")                connect(ACTION, SIGNAL(triggered()), this, SLOT(tipOfTheDay()));
    else if(icon == "about")                      connect(ACTION, SIGNAL(triggered()), this, SLOT(about()));
    else if(icon == "aboutQt")                    connect(ACTION, SIGNAL(triggered()), qApp, SLOT(aboutQt()));

    else if(icon == "icon16")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon16()));
    else if(icon == "icon24")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon24()));
    else if(icon == "icon32")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon32()));
    else if(icon == "icon48")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon48()));
    else if(icon == "icon64")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon64()));
    else if(icon == "icon128")                    connect(ACTION, SIGNAL(triggered()), this, SLOT(icon128()));

    else if(icon == "settingsdialog")             connect(ACTION, SIGNAL(triggered()), this, SLOT(settingsDialog()));

    else if(icon == "undo")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(undo()));
    else if(icon == "redo")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(redo()));

    else if(icon == "makelayercurrent")           connect(ACTION, SIGNAL(triggered()), this, SLOT(makeLayerActive()));
    else if(icon == "layers")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(layerManager()));
    else if(icon == "layerprevious")              connect(ACTION, SIGNAL(triggered()), this, SLOT(layerPrevious()));

    else if(icon == "textbold")                 { ACTION->setCheckable(true); connect(ACTION, SIGNAL(toggled(bool)), this, SLOT(setTextBold(bool)));   }
task main()
{
	//ALWAYS START CHALLENGE WITH CLAW CLOSED!!!
	forward((2 * 12 - 0.5) / WHEEL_CIRCUM);
	doNothing(1000);
	turnLeft(0.8);
	doNothing(1000);
	forward((2.4 * 12 + 1) / WHEEL_CIRCUM);
	doNothing(1000);
	turnLeft(0.75);
	doNothing(1000);
	openClaw();
	doNothing(1000);
	forward(13.25 / WHEEL_CIRCUM);
	doNothing(1000);
	closeClaw();
	doNothing(1000);
	moveArmUp(900);
	doNothing(1000);
	turnLeft(1.5);
	doNothing(1000);
	forward((2.7 * 12 + 3) / WHEEL_CIRCUM);
	doNothing(1000);
	turnRight(0.7);
	doNothing(1000);
	moveArmUp(200);
	doNothing(1000);
	forward(2.5 / WHEEL_CIRCUM);
	doNothing(1000);
	openClaw();
	doNothing(1000);
	moveArmUp(300);
	doNothing(1000);
	backward(2 / WHEEL_CIRCUM);
	doNothing(1000);
	moveArmDown(600);
	doNothing(1000);
	forward(2.5 / WHEEL_CIRCUM);
	doNothing(1000);
	closeClaw();
	doNothing(1000);
	moveArmUp(900);
	doNothing(1000);
	turnRight(0.7);
	doNothing(1000);
	forward(1.5 * 12 / WHEEL_CIRCUM);
	doNothing(1000);
	turnLeft(0.7);
	doNothing(1000);
	forward(2 * 12 / WHEEL_CIRCUM);
	doNothing(1000);
	turnLeft(0.7);
	doNothing(1000);
	forward(12 / WHEEL_CIRCUM);
	doNothing(1000);
	moveArmDown(900);
	doNothing(1000);
	openClaw();
}