Example #1
0
void
avtTraceHistoryFilter::Execute(void)
{
    //
    // Write out the connectivity.  "-1" is the hint to do that.
    //
    OutputTime(GetTypedInput(), -1);

    //
    // Pull out just the points.
    //
    avtDataset_p ds = InitializeDataset();

    //
    // Put the fields from the current time step on the points and then
    // output those fields.
    //
    PerformIteration(0, ds, false);
    OutputTime(ds, 0);

    //
    // Now iterate through the time slices, displacing and evaluating.
    //
    for (int i = 0 ; i < atts.GetNumiter() ; i++)
    {
        ds->SetSource(GetInput()->GetSource());
        PerformIteration(i, ds, true);
        OutputTime(ds, i+1);
    }

    // The operator just passes the data through.
    GetDataTree() = GetInputDataTree();
}
Example #2
0
void
UpdateTimeLeftClockDisplay(bool doprint)
{
    if (nextflare) {
        long timeleft = TimeUntilNextFlare();
        if (timeleft < 0) {
            if (-timeleft % 2) {
                timeleft = 0;
            } else {
                timeleft = -1;
            }
        }
        OutputTime(doprint, timeleft);
    } else {
        OutputTime(doprint, -1);
    }
}
Example #3
0
LRESULT 
TaskBarControlProc(
	HWND hWnd, 
	int iMsg, 
	WPARAM wParam, 
	LPARAM lParam
)
{
	POINT point;
	PWindowsTree pWin;
	RECT rc;
	HDC hDC;
	unsigned long iRetMsg;
	
	PAINTSTRUCT ps;
	int iWidth,iHeight;
	HPEN hPen;	
	HBRUSH hBrush;
	COLORREF crColor;
	PWNDCLASSEX pWndClass;
	LRESULT res;
	char* pString;
	int iLen;
	PTaskBarItem pTaskBarItem;
	PTaskBar pTaskBar;

	pWin=(PWindowsTree)hWnd;

	
	switch(iMsg)
	{
		case LMSG_CREATE:
			_lGUI_pTaskBarWindow = (PWindowsTree)hWnd;
			InitFixTaskBarData(hWnd);
		//	SetTimer(hWnd,ID_TIMER,6000); 修改了
			break;
		case LMSG_TIMER:
		{
			PTaskBar pTaskBar;
			PTaskBarItem pItem;
			pTaskBar = (PTaskBar)(pWin->dwAddData);
			pItem = pTaskBar->pItemHead;
			while(1){
				if(pItem->id == TASKBAR_OBJID_CLOCK)
					break;
				pItem = pItem->pNext;
			}
			if(!pItem)
				return false;
			InvalidateRect(hWnd,&(pItem->rect),true);
			break;
		}
	
		case LMSG_COMMAND:
			break;
		case LMSG_PENDOWN:
		{
			int x, y;
			CaptureMouse(hWnd,BYCLIENT);	
			x = (int)wParam;
			y = (int)lParam;
			ProcessTaskbarPenDown(hWnd, x, y);
			break;
		}		
		case LMSG_PENMOVE:
			break;

		case LMSG_PENUP:
			DisCaptureMouse();
			break;
		case LMSG_ERASEBKGND:			
			pWndClass=GetRegClass(pWin->lpszClassName);
			if(!pWndClass)
				return (LRESULT)NULL;
			hBrush=pWndClass->hbrBackground;
			crColor=((BRUSH*)hBrush)->crBrushColor;

			((BRUSH*)hBrush)->crBrushColor=RGB_SYSTEMHIBRIGHT;

			res=DefWindowProc(hWnd, iMsg, wParam, lParam);
			((BRUSH*)hBrush)->crBrushColor=crColor;
			return res;
			
		case LMSG_PAINT:
		{
			int iHeight,iWidth;
			HPEN hPenWhite;
			PBITMAP pBitmap;
			PTaskBarItem pItem;
			ps.bPaintDirect=false;
			hDC=BeginPaint(hWnd, &ps);
			if(!hDC){
				return true;
			}
			
			GetClientRect(hWnd,&rc);
			SetRect(&rc,0,0,rc.right-rc.left,rc.bottom-rc.top);
			iWidth	=rc.right - rc.left + 1;
			iHeight	=rc.bottom - rc.top + 1;
			

			hPenWhite 	=CreatePen(PS_SOLID,1,RGB_SYSTEMWHITE);
			
			SelectObject(hDC,hPenWhite);
			MoveToEx(hDC,rc.left,rc.top,&point);
			LineTo(hDC,rc.right,rc.top);


			DeleteObject(hPenWhite);
			//output those bitmaps
			pBitmap = malloc(sizeof(BITMAP));
			if(!pBitmap)
				return;
			memset(pBitmap,0,sizeof(BITMAP));
			pTaskBar = (PTaskBar)(pWin->dwAddData);
			pItem = pTaskBar->pItemHead;
			iWidth = pWin->rect.right - pWin->rect.left + 1;
			iHeight = pWin->rect.bottom - pWin->rect.top + 1;
			
			while(pItem){
				if(pItem->bShow){
					pBitmap->bmHeight = pItem->rect.bottom - pItem->rect.top + 1;
					pBitmap->bmWidth = pItem->rect.right - pItem->rect.left + 1;
					pBitmap->bmBits = GetBmpBufAddress(pItem->id,pItem->pData,pItem->iCurValue);
					OutputBmpObj(hDC,pItem->rect.left,pItem->rect.top,
						iWidth,iHeight,(HBITMAP)pBitmap);
				}
				pItem = pItem->pNext;
			}
			OutputTime(hWnd,hDC);
			free(pBitmap);

			EndPaint(hWnd, &ps);
			break;
		}
		case LMSG_DESTROY:
			ClearTaskBarData(hWnd);
			KillTimer(hWnd,ID_TIMER);
			break;
		default:
			return DefWindowProc(hWnd, iMsg, wParam, lParam);
	}
	return true;
}