Exemplo n.º 1
0
void ezQtPropertyContainerWidget::SetSelection(const ezHybridArray<ezPropertySelection, 8>& items)
{
  ezQtPropertyWidget::SetSelection(items);

  UpdateElements();

  if (m_pAddButton)
  {
    m_pAddButton->SetSelection(m_Items);
  }
}
Exemplo n.º 2
0
void GUIWIDGETLIST::Update(SCENENODE & scene, float dt)
{
	if (!m_values.empty())
	{
		UpdateElements(scene);
		m_values.clear();
	}

	for (size_t i = 0; i < m_elements.size(); ++i)
	{
		m_elements[i]->Update(scene, dt);
	}
}
Exemplo n.º 3
0
void GuiWidgetList::Update(SceneNode & scene, float dt)
{
	if (!m_values.empty())
	{
		UpdateElements(scene);
		m_values.clear();
	}

	for (size_t i = 0; i < m_elements.size(); ++i)
	{
		m_elements[i]->Update(scene, dt);
	}
}
Exemplo n.º 4
0
void sTabBorderBase::OnPaint(int layer)
{
    auto sty = Style();
    auto pnt = Painter();

    if(BoxesDirty)
        UpdateElements();

    sRect r(Outer);
    r.y1 = r.y0 + ReqSizeY;

    sty->Rect(layer,this,sSK_ToolBorder_Top,r);

    sDragDropIcon icon;
    int mx,my;
    int drophere = -1;
    if(Gui->GetDragDropInfo(this,icon,mx,my))
        drophere = FindDragDrop(icon,mx,my);

    if(drophere==0)
    {
        pnt->SetLayer(layer+1);
        pnt->Rect(sty->Colors[sGC_HoverFeedback],sRect(Client.x0,Client.y0,Client.x0+2,Client.y1));
    }

    int n = 0;
    for(sTabDummyElement *e : *Array)
    {
        sTabElementInfo &info = e->*Info;
        int mod = 0;
        if(Pressed && e==Selected)
            mod |= sSM_Pressed;
        if(e==*WindowSelect)
            mod |= sSM_WindowSel;
        if(e==*GlobalSelect)
            mod |= sSM_GlobalSel;
        if(info.HoverDelete && (Flags & sWF_Hover))
            mod |= sSM_HoverIcon;

        sty->Rect(layer,this,sSK_TabItem,info.Client,mod,info.Name);

        n++;
        if(n==drophere)
        {
            int x = info.Client.x1 + 4;
            pnt->SetLayer(layer+1);
            pnt->Rect(sty->Colors[sGC_HoverFeedback],sRect(x-1,Client.y0,x+1,Client.y1));
        }
    }
}
Exemplo n.º 5
0
void ScreenArcadeDiagnostics::Update( float fDeltaTime )
{
	// update the theme elements (uptime, etc.)
	PlayCommand( "Refresh" );

	// only update the USB list once per UPDATE_TIME period.
	// this allows us to keep the screen running smoothly while
	// maintaining a low detection granularity.
	if( m_bFirstUpdate || m_UpdateTimer.Ago() > USB_UPDATE_TIME )
	{
		m_UpdateTimer.Touch();
		UpdateElements();
	}

	Screen::Update( fDeltaTime );
}
Exemplo n.º 6
0
int main(void) {
    const int N = 10;
    float a[N];
 
    // Initialize array
    int i;
    for ( i = 0; i < N; ++i ) a[i] = rand() / (float)RAND_MAX;


    for ( i = 0; i < N; ++i ) printf("a[%d]=%f\n",i,a[i]); 
    // Double elements
    UpdateElements( a, N, DoubleValue );
    printf("\nAfter statement: UpdateElements( a, N, DoubleValue );\n");
    for ( i = 0; i < N; ++i ) printf("a[%d]=%f\n",i,a[i]); 
 


    return 0;
}
Exemplo n.º 7
0
void ezQtPropertyTypeContainerWidget::CommandHistoryEventHandler(const ezCommandHistoryEvent& e)
{
  if (IsUndead())
    return;

  switch (e.m_Type)
  {
    case ezCommandHistoryEvent::Type::UndoEnded:
    case ezCommandHistoryEvent::Type::RedoEnded:
    case ezCommandHistoryEvent::Type::TransactionEnded:
    case ezCommandHistoryEvent::Type::TransactionCanceled:
    {
      if (m_bNeedsUpdate)
      {
        m_bNeedsUpdate = false;
        UpdateElements();
      }
    }
    break;

    default:
      break;
  }
}
Exemplo n.º 8
0
//------------------------------------------------------------------------------
void ExtendedKalmanInv::Estimate()
{
   #ifdef DEBUG_ESTIMATION
      MessageInterface::ShowMessage("\n\n---------------------\n");
      MessageInterface::ShowMessage("Current covariance:\n");
      for (UnsignedInt i = 0; i < stateSize; ++i)
      {
         for (UnsignedInt j = 0; j < stateSize; ++j)
            MessageInterface::ShowMessage("   %.12lf", (*covariance)(i,j));
         MessageInterface::ShowMessage("\n");
      }
      MessageInterface::ShowMessage("\n");

      MessageInterface::ShowMessage("Current stm:\n");
      for (UnsignedInt i = 0; i < stateSize; ++i)
      {
         for (UnsignedInt j = 0; j < stateSize; ++j)
            MessageInterface::ShowMessage("   %.12lf", (*stm)(i,j));
         MessageInterface::ShowMessage("\n");
      }
      MessageInterface::ShowMessage("\n");

      MessageInterface::ShowMessage("Current State: [ ");
      for (UnsignedInt i = 0; i < stateSize; ++i)
         MessageInterface::ShowMessage(" %.12lf ", (*estimationState)[i]);
      MessageInterface::ShowMessage("\n");
   #endif

   // Perform the time update of the covariances, phi P phi^T, and the state
   TimeUpdate();

   #ifdef DEBUG_ESTIMATION
      MessageInterface::ShowMessage("Time updated matrix \\bar P:\n");
      for (UnsignedInt i = 0; i < stateSize; ++i)
      {
         for (UnsignedInt j = 0; j < stateSize; ++j)
            MessageInterface::ShowMessage("   %.12lf", pBar(i,j));
         MessageInterface::ShowMessage("\n");
      }
      MessageInterface::ShowMessage("\n");
   #endif

   // Construct the O-C data and H tilde
   ComputeObs();

   #ifdef DEBUG_ESTIMATION
      MessageInterface::ShowMessage("hTilde:\n");
      for (UnsignedInt i = 0; i < measSize; ++i)
      {
         for (UnsignedInt j = 0; j < stateSize; ++j)
            MessageInterface::ShowMessage("   %.12lf", hTilde[i][j]);
         MessageInterface::ShowMessage("\n");
      }
      MessageInterface::ShowMessage("\n");
   #endif

   // Then the Kalman gain
   ComputeGain();

   #ifdef DEBUG_ESTIMATION
      MessageInterface::ShowMessage("The Kalman gain is: \n");
      for (UnsignedInt i = 0; i < stateSize; ++i)
      {
         for (UnsignedInt j = 0; j < measSize; ++j)
            MessageInterface::ShowMessage("   %.12lf", kalman(i,j));
         MessageInterface::ShowMessage("\n");
      }
      MessageInterface::ShowMessage("\n");
   #endif

   // Finally, update everything
   UpdateElements();

   // Plot residuals if set
   if (showAllResiduals)
      PlotResiduals();


   #ifdef DEBUG_ESTIMATION
      MessageInterface::ShowMessage("Updated covariance:\n");
      for (UnsignedInt i = 0; i < stateSize; ++i)
      {
         for (UnsignedInt j = 0; j < stateSize; ++j)
            MessageInterface::ShowMessage("   %.12lf", (*covariance)(i,j));
         MessageInterface::ShowMessage("\n");
      }
      MessageInterface::ShowMessage("\n");

      MessageInterface::ShowMessage("Updated State: [ ");
      for (UnsignedInt i = 0; i < stateSize; ++i)
         MessageInterface::ShowMessage(" %.12lf ", (*estimationState)[i]);
      MessageInterface::ShowMessage("\n\n---------------------\n");
   #endif

   // ReportProgress();

   // Advance MeasMan to the next measurement and get its epoch
   measManager.AdvanceObservation();
   nextMeasurementEpoch = measManager.GetEpoch();
   FindTimeStep();

   #ifdef DEBUG_ESTIMATION
      MessageInterface::ShowMessage("CurrentEpoch = %.12lf, next "
            "epoch = %.12lf, timeStep = %.12lf\n", currentEpoch,
            nextMeasurementEpoch, timeStep);
   #endif

   if (currentEpoch < nextMeasurementEpoch)
   {
      // Reset the STM
      for (UnsignedInt i = 0; i < stateSize; ++i)
         for (UnsignedInt j = 0; j < stateSize; ++j)
            if (i == j)
               (*stm)(i,j) = 1.0;
            else
               (*stm)(i,j) = 0.0;
      esm.MapSTMToObjects();
      esm.MapVectorToObjects();
      PropagationStateManager *psm = propagator->GetPropStateManager();
      psm->MapObjectsToVector();

      // Flag that a new current state has been loaded in the objects
      resetState = true;

      currentState = PROPAGATING;
   }
   else
      currentState = CHECKINGRUN;  // Should this just go to FINISHED?
}
Exemplo n.º 9
0
void GamePanel::Update(){
	if(isPanelOpen){
		UpdateElements();
	}
};
Exemplo n.º 10
0
void sTabBorderBase::OnLayoutChilds()
{
    Inner.y0 += ReqSizeY;
    Client.y1 = Inner.y0;
    UpdateElements();
}