Ejemplo n.º 1
0
void
InfoBoxManager::DisplayInfoBox()
{
  if (InfoBoxesHidden)
    return;

  int DisplayType[MAXINFOWINDOWS];
  static bool first = true;
  static int DisplayTypeLast[MAXINFOWINDOWS];

  // JMW note: this is updated every GPS time step

  for (unsigned i = 0; i < InfoBoxLayout::numInfoWindows; i++) {
    // All calculations are made in a separate thread. Slow calculations
    // should apply to the function DoCalculationsSlow()
    // Do not put calculations here!

    DisplayType[i] = GetCurrentType(i);

    bool needupdate = ((DisplayType[i] != DisplayTypeLast[i]) || first);

    if (needupdate) {
      InfoBoxes[i]->SetTitle(gettext(InfoBoxFactory::GetCaption(DisplayType[i])));
      InfoBoxes[i]->SetContentProvider(InfoBoxFactory::Create(DisplayType[i]));
    }

    InfoBoxes[i]->UpdateContent();

    DisplayTypeLast[i] = DisplayType[i];
  }

  Paint();

  first = false;
}
void
InfoBoxManager::DisplayInfoBox()
{
  int DisplayType[InfoBoxPanelConfig::MAX_INFOBOXES];
  static int DisplayTypeLast[InfoBoxPanelConfig::MAX_INFOBOXES];

  // JMW note: this is updated every GPS time step

  for (unsigned i = 0; i < layout.count; i++) {
    // All calculations are made in a separate thread. Slow calculations
    // should apply to the function DoCalculationsSlow()
    // Do not put calculations here!

    DisplayType[i] = GetCurrentType(i);

    bool needupdate = ((DisplayType[i] != DisplayTypeLast[i]) || first);

    if (needupdate) {
      InfoBoxes[i]->SetTitle(gettext(InfoBoxFactory::GetCaption(DisplayType[i])));
      InfoBoxes[i]->SetContentProvider(InfoBoxFactory::Create(DisplayType[i]));
      InfoBoxes[i]->SetID(i);
    }

    InfoBoxes[i]->UpdateContent();

    DisplayTypeLast[i] = DisplayType[i];
  }

  Paint();

  first = false;
}
Ejemplo n.º 3
0
BOOL CStockContainer::ReRetrieveFromStatic( CStrategy * pStrategy, BOOL bUpToDate )
{
	CSPMutex::Scoped	l(m_mutex);

	int	type;
	CSPString	strDomain;
	DWORD	dwDate;
	GetCurrentType( &type, &strDomain, &dwDate );
	if( bUpToDate )
		dwDate	=	-1;
	return RetrieveFromStatic( type, strDomain, pStrategy, dwDate );
}
Ejemplo n.º 4
0
void
InfoBoxManager::Event_Change(int i)
{
  int j = 0, k;

  int InfoFocus = GetFocused();
  if (InfoFocus < 0)
    return;

  k = GetCurrentType(InfoFocus);
  if (i > 0)
    j = InfoBoxFactory::GetNext(k);
  else if (i < 0)
    j = InfoBoxFactory::GetPrevious(k);

  // TODO code: if i==0, go to default or reset

  SetCurrentType(InfoFocus, j);

  InfoBoxes[InfoFocus]->UpdateContent();
  Paint();
}
Ejemplo n.º 5
0
int IoOldOoglLexer::ExpectNum(int count, float *array, IoOldOoglToken::NumberType type)
{
        int n = 0, m = 0;  // To keep track of the number of numbers read.
        int *iarray;
        short *sarray;

// This is a bit of a hack to get the incrementing to work in VC++.  I'm 
// not sure why, but VC++ doesn't seem to interpret (int *)array as an 
// l-value and therefore cannot increment it.  There may be something else
// wierd here that is causing this error, but I don't see it at the moment.
// jcm - 10/16/97

        if (count <= 0) return n;

  // First check for lookahead.
        if (mpNext != NULL)
        {
                SwapForward();

                if (GetCurrentType() != IoOldOoglToken::NUMBER) return 0;

                if (type == IoOldOoglToken::INTEGER)
                {
                        int num = (int) GetCurrentNumber();
                        *((int *)array) = num;
                        iarray = (int *)array;
                        iarray++;
                        array = (float *)iarray;
                }
                else if (type == IoOldOoglToken::SHORT)
                {
                        short num = (short) GetCurrentNumber();
                        *((short *)array) = num;
                        sarray = (short *)array;
                        sarray++;
                        array = (float *)iarray;
                }
                else
                {
                        *array = GetCurrentNumber();
                        array++;
                }

                count--; n++;
                if (count <= 0) return n;
        }

        if (type == IoOldOoglToken::INTEGER)
                m = mpStream->fgetni(count, (int   *)array, mDataType);
        else if (type == IoOldOoglToken::SHORT)
                m = mpStream->fgetns(count, (short *)array, mDataType);
        else
                m = mpStream->fgetnf(count, (float *)array, mDataType);

        if (m == 1)
                SwapForward();
        if (m >= 1)
        {
                mpCurrent->mType = IoOldOoglToken::NUMBER;
                mpCurrent->mFValue = array[m-1];
                // mpCurrent->mpCValue = NULL;      <----- What about strings?
                if (m >= 2)
                {
                        mpPrev->mType = IoOldOoglToken::NUMBER;
                        mpPrev->mFValue = array[m-2];
                        // mpPrev->mpCValue = NULL;      <----- What about strings?
                }
        }
        return n+m;
}