Exemplo n.º 1
0
void Collector::doCollector()
{
    switch (state)
    {
    case COLLECTOR_DEPLOY:
        collectorM.Set(Relay::kForward);
        setStar(0);
        starDirection = 1;
        break;
    case COLLECTOR_DEPLOYED:
        if (deployed.Get())
        {
            collectorM.Set(Relay::kOff);
        }
        setStar(1);
        break;
    case COLLECTOR_UNDEPLOY:
        collectorM.Set(Relay::kReverse);
        setStar(0);
        break;
    case COLLECTOR_UNDEPLOYED:
        if (undeployed.Get())
        {
            collectorM.Set(Relay::kOff);
        }
        setStar(0);
        break;
    default:
        collectorM.Set(Relay::kOff);
        setStar(0);
        state = COLLECTOR_UNDEPLOYED;
    }
}
Exemplo n.º 2
0
Arquivo: PolyDDV.cpp Projeto: 8l/rose
void PolyDDV::computeHull(PolyDDV& ddv)
{
  if (ddv.getSize() != _types.size())
    return;
  int i;
  for (i = 0; i < ddv.getSize(); ++i)
    {
      if (ddv.isPlus(i))
	{
	  if (isEq(i) || isScalar(i))
	    setPlus(i);
	  else if (isMinus(i))
	    setStar(i);
	}
      else if (ddv.isMinus(i))
	{
	  if (isEq(i) || isScalar(i))
	    setMinus(i);
	  else if (isPlus(i))
	    setStar(i);
	}
      else if (ddv.isStar(i))
	setStar(i);
      else if (ddv.isScalar(i) && ! isStar(i))
	{
	  int s1 = ddv.getScalar(i);
	  if (isScalar(i) || isEq(i))
	    {
	      int s2 = 0;
	      if (isScalar(i))
		s2 = getScalar(i);
	      if (s1 > 0 && s2 < 0 || s1 < 0 && s2 > 0)
		setStar(i);
	      else if (s1 > 0 && s1 != s2)
		setPlus(i);
	      else if (s1 < 0 && s1 != s2)
		setMinus(i);
	    }
	  else
	    {
	      if (s1 > 0 && isMinus(i) || s1 < 0 && isPlus(i))
		setStar(i);
	    }
	}
    }
}
Exemplo n.º 3
0
QStarItem::QStarItem(qreal x, qreal y, const Star &star, QGraphicsItem *parent)
{
    this->starRadius = 0.025;

    nameItem = new QGraphicsTextItem(star.Name);
//    addToGroup(nameItem);

    ellipseItem = new QGraphicsEllipseItem();
    ellipseItem->setPen(QPen(QBrush(Qt::yellow),0));
    ellipseItem->setBrush(QBrush(Qt::yellow));
    addToGroup(ellipseItem);

    setPos(x, y);
    setStar(star);
}