Esempio n. 1
0
void dropSeQ(unsigned char side)
{
	elevate(0, side);//lower
	open(side);
	elevate(45, side);//mid
	close(side);
}
Esempio n. 2
0
void pickupSeQ(unsigned char side)
{
	elevate(0, side);//lower
	open(side);
	close(side);
	elevate(45, side);//mid
}
Esempio n. 3
0
void pick(int side)	//TODO delay
{
	elevate(0, side);//lower
	open(side);
	close(side);
	elevate(45, side);//mid
	armCount--;
}
Esempio n. 4
0
void Camera::processKeyboardEvents()
{
  if (activeKeys[0]) move(speed);
  if (activeKeys[1]) move(-speed);
  if (activeKeys[2]) strafeMove(-speed);
  if (activeKeys[3]) strafeMove(speed);
  if (activeKeys[4]) elevate(speed);
  if (activeKeys[5]) elevate(-speed);
}
Esempio n. 5
0
void drop(int side)	//TODO delay
{
	lcd("drop");
	elevate(0, side);//lower
	open(side);
	elevate(45, side);//mid
	close(side);
	armCount++;
}
Esempio n. 6
0
void drop(int side)	//TODO delay
{
	if(side==0)
	lcd("dropRight");
	else
	lcd("dropLeft");
	elevate(0, side);//lower
	open(side);
	elevate(45, side);//mid
	close(side);
	armCount++;
}
Esempio n. 7
0
void pick(int side)	//TODO delay
{
	if(side==0)
		lcd("pickRight");
	else
		lcd("pickLeft");
	elevate(0, side);//lower
	open(side);
	close(side);
	elevate(45, side);//mid
	armCount--;
}
Esempio n. 8
0
void Lift::addHuman(Human* human) {
    //    qDebug() << "Passengers in lift (count): " << passengers.size();
    if (passengers.size() < capacity()) {
        passengers.push_back(human);
    }
    else {
        busy(true);
        elevate();
    }
}
Esempio n. 9
0
void drop(int side)
{
	//	armCount++;
	lower(side);//lower
	_delay_ms(1000);
	open(side);
	_delay_ms(3000);
	elevate();//mid
	_delay_ms(1000);
}
void drop(int side)
{
	lower(side);//lower
	open(side);
	elevate();//mid
	
	armCount++;
	if(side==0)
	lcd("dropRight");
	else
	lcd("dropLeft");
}
Esempio n. 11
0
void pick(int side)
{
	lower(side);//lower
	//_delay_ms(1000);
	//open(side);
	_delay_ms(1000);
	//while(1);
	close(side);
	_delay_ms(3000);
//	while(1);
	elevate();//mid
	_delay_ms(1000);
}
void pick(int side)
{
	
	
	lower(side);//lower
	open(side);
	close(side);
	elevate();//mid
	armCount--;
	if (side == 0)
		lcd("pickRight");
	else
		lcd("pickLeft");
}
Esempio n. 13
0
int btree_cmp_iters(const btree_iterator iter_a, const btree_iterator iter_b)
{
	btree_iterator a = {*iter_a}, b = {*iter_b};
	int ad, bd;

	ad = btree_deref(a);
	bd = btree_deref(b);

	/* Check cases where one or both iterators are at the end. */
	if (!ad)
		return bd ? 1 : 0;
	if (!bd)
		return ad ? -1 : 0;

	/* Bring iterators to the same depth. */
	if (a->node->depth < b->node->depth) {
		if (elevate(a, b))
			return -1;
	} else if (a->node->depth > b->node->depth) {
		if (elevate(b, a))
			return 1;
	}

	/* Bring iterators to the same node. */
	while (a->node != b->node) {
		ascend(a);
		ascend(b);
	}

	/* Now we can compare by k directly. */
	if (a->k < b->k)
		return -1;
	if (a->k > b->k)
		return 1;

	return 0;
}
Esempio n. 14
0
File: nssm.cpp Progetto: myhhx/nssm
int _tmain(int argc, TCHAR **argv) {
  check_console();

#ifdef UNICODE
  /*
    Ensure we write in UTF-16 mode, so that non-ASCII characters don't get
    mangled.  If we were compiled in ANSI mode it won't work.
   */
  _setmode(_fileno(stdout), _O_U16TEXT);
  _setmode(_fileno(stderr), _O_U16TEXT);
#endif

  /* Remember if we are admin */
  check_admin();

  /* Set up function pointers. */
  if (get_imports()) exit(111);

  /* Remember our path for later. */
  GetModuleFileName(0, unquoted_imagepath, _countof(unquoted_imagepath));
  GetModuleFileName(0, imagepath, _countof(imagepath));
  PathQuoteSpaces(imagepath);

  /* Elevate */
  if (argc > 1) {
    /*
      Valid commands are:
      start, stop, pause, continue, install, edit, get, set, reset, unset, remove
    */
    if (str_equiv(argv[1], _T("start"))) exit(control_service(NSSM_SERVICE_CONTROL_START, argc - 2, argv + 2));
    if (str_equiv(argv[1], _T("stop"))) exit(control_service(SERVICE_CONTROL_STOP, argc - 2, argv + 2));
    if (str_equiv(argv[1], _T("restart"))) {
      int ret = control_service(SERVICE_CONTROL_STOP, argc - 2, argv + 2);
      if (ret) exit(ret);
      exit(control_service(NSSM_SERVICE_CONTROL_START, argc - 2, argv + 2));
    }
    if (str_equiv(argv[1], _T("pause"))) exit(control_service(SERVICE_CONTROL_PAUSE, argc - 2, argv + 2));
    if (str_equiv(argv[1], _T("continue"))) exit(control_service(SERVICE_CONTROL_CONTINUE, argc - 2, argv + 2));
    if (str_equiv(argv[1], _T("status"))) exit(control_service(SERVICE_CONTROL_INTERROGATE, argc - 2, argv + 2));
    if (str_equiv(argv[1], _T("rotate"))) exit(control_service(NSSM_SERVICE_CONTROL_ROTATE, argc - 2, argv + 2));
    if (str_equiv(argv[1], _T("install"))) {
      if (! is_admin) exit(elevate(argc, argv, NSSM_MESSAGE_NOT_ADMINISTRATOR_CANNOT_INSTALL));
      create_messages();
      exit(pre_install_service(argc - 2, argv + 2));
    }
    if (str_equiv(argv[1], _T("edit")) || str_equiv(argv[1], _T("get")) || str_equiv(argv[1], _T("set")) || str_equiv(argv[1], _T("reset")) || str_equiv(argv[1], _T("unset"))) {
      int ret = pre_edit_service(argc - 1, argv + 1);
      if (ret == 3 && ! is_admin && argc == 3) exit(elevate(argc, argv, NSSM_MESSAGE_NOT_ADMINISTRATOR_CANNOT_EDIT));
      /* There might be a password here. */
      for (int i = 0; i < argc; i++) SecureZeroMemory(argv[i], _tcslen(argv[i]) * sizeof(TCHAR));
      exit(ret);
    }
    if (str_equiv(argv[1], _T("list"))) exit(list_nssm_services());
    if (str_equiv(argv[1], _T("remove"))) {
      if (! is_admin) exit(elevate(argc, argv, NSSM_MESSAGE_NOT_ADMINISTRATOR_CANNOT_REMOVE));
      exit(pre_remove_service(argc - 2, argv + 2));
    }
  }

  /* Thread local storage for error message buffer */
  tls_index = TlsAlloc();

  /* Register messages */
  if (is_admin) create_messages();

  /*
    Optimisation for Windows 2000:
    When we're run from the command line the StartServiceCtrlDispatcher() call
    will time out after a few seconds on Windows 2000.  On newer versions the
    call returns instantly.  Check for stdin first and only try to call the
    function if there's no input stream found.  Although it's possible that
    we're running with input redirected it's much more likely that we're
    actually running as a service.
    This will save time when running with no arguments from a command prompt.
  */
  if (! GetStdHandle(STD_INPUT_HANDLE)) {
    /* Start service magic */
    SERVICE_TABLE_ENTRY table[] = { { NSSM, service_main }, { 0, 0 } };
    if (! StartServiceCtrlDispatcher(table)) {
      unsigned long error = GetLastError();
      /* User probably ran nssm with no argument */
      if (error == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) exit(usage(1));
      log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_DISPATCHER_FAILED, error_string(error), 0);
      free_imports();
      exit(100);
    }
  }
  else exit(usage(1));

  /* And nothing more to do */
  exit(0);
}
void Tourelle::elevate(long frame, int anglePct)
{
	elevate(frame,frame+1,anglePct,anglePct);
}
Esempio n. 16
0
 //! Go up to the surface
 inline void
 goUp(void)
 {
     elevate(0.0, IMC::Z_DEPTH);
 }
Esempio n. 17
0
 //! Go down to the maneuver's z reference
 inline void
 goDown(void)
 {
     elevate(m_maneuver.z, m_maneuver.z_units);
 }
void Tourelle::animate(long startFrame, long stopFrame, int *startState, int *stopState)
{
	rotate(startFrame,stopFrame,startState[0],stopState[0]);
	elevate(startFrame,stopFrame,startState[1],stopState[1]);
	lightup(startFrame,stopFrame,startState[2],stopState[2]);
}