Home

  Development and Testing

Very often during the early stages of an embedded development effort, it is difficult or impossible to do software testing and debugging on the intended target platform. For this reason KwikPeg provides a set of hardware and OS interfaces which allow your KwikPeg graphical user interface (GUI) to be exercised as a standard 32-bit Windows application.

Using the KwikPeg GUI Testing facility, you can create, test and debug your entire user interface using mature Microsoft Visual C++ software development tools. If your video driver is (or has been derived from) one of those provided with KwikPeg, you can actually use that driver for testing under Windows so that what you see when testing your GUI will look exactly as it will on your target display. Once your target platform is available, you simply change your KwikPeg configuration to identify your target processor, rebuild your KwikPeg Library using your embedded software development tools and link your recompiled KwikPeg GUI with your embedded application.


  Screen Drivers for PC Development

It is often useful to use KwikPeg to prototype your GUI on a conventional desktop PC before your final target hardware becomes available, thereby allowing software and hardware development to proceed in parallel, shortening the time to market for a new design. KwikPeg includes the following screen driver classes to facilitate this type of concurrent development:

Generic VGA for any PC operating in real or protected mode
VESA SuperVGA for any PC operating in real mode
Win32 for any PC running Microsoft Windows

  Configuration Error Detection

The KwikPeg Configuration Module verifies that it is compatible with the KwikPeg device driver which you have selected. A compiler error is generated to exactly describe each inconsistency. For example, if you choose a custom driver and request support for 256 colors, a compilation error report will occur if the header file for your custom video device driver indicates that the device only supports 16 colors. This error detection can be most helpful if you use multiple KwikPeg Libraries configured for use with different device drivers.


  Program Examples

  Basic "Hello World" Example

This example and the code fragment which generates it illustrate the simplicity of programming with KwikPeg. The black background is the default screen color used by the KwikPeg GUI Testing facility.

#include "kp_lib.h"
void PegAppInitialize(PegPresentationManager *pPresent) { PegMessageWindow *pWin = new PegMessageWindow("Hello World", "My First Window!", FF_RAISED|MW_OK); pPresent->Center(pWin); pPresent->Add(pWin); }


  Simple Timing and Messaging Example

This example illustrates the use of a KwikPeg timer which periodically changes the window's background color. The black background is the default screen color used by the KwikPeg GUI Testing facility. The illustration has been animated to let you see the KwikPeg example as it appears once it begins to execute. The source code follows the illustration.

#include "kp_lib.h"

// Define the derived class MyWindow.
class MyWindow : public PegDecoratedWindow
{
    public:
        MyWindow(const PegRect &Rect);
        SIGNED Message(const PegMessage &Mesg);
    private:
        COLORVAL mColor;
};

// Create the initial window and display it
// on the screen.
// Called by the KwikPeg Task at startup.

void PegAppInitialize(PegPresentationManager
                      *pPresent)
{
    PegRect WinRect;
    WinRect.Set(0, 0, 200, 200);

    MyWindow *pWin = new MyWindow(WinRect);
    pPresent->Center(pWin);
    pPresent->Add(pWin);
}


// This is the derived window class constructor:

MyWindow::MyWindow(const PegRect &Rect) :
          PegDecoratedWindow(Rect, FF_THICK)
{
    Add(new PegTitle("A colorful Window!"));
    RemoveStatus(PSF_SIZEABLE);
    mColor = CYAN;
    SetColor(PCI_NORMAL, mColor);
}

// This is the overridden message handling function:

SIGNED MyWindow::Message(const PegMessage &Mesg)
{
    switch(Mesg.wType)
    {
    case PM_SHOW:
        PegDecoratedWindow::Message(Mesg);
        SetTimer(1, KP_ONE_SEC * 2, KP_ONE_SEC / 2);
        break;

    case PM_TIMER:
        if (mColor == RED)
             mColor = GREEN;
        else if (mColor == GREEN)
             mColor = BLUE;
        else mColor = RED;
        SetColor(PCI_NORMAL, mColor);
        Invalidate();
        Draw();
        break;

    case PM_HIDE:
        KillTimer(1);
        PegDecoratedWindow::Message(Mesg);
        break;

    default:
        // Pass all other messages to the
        // base class for service.
        return PegDecoratedWindow::Message(Mesg);
	}

    return 0;
}

Copyright © 1996-2007

















































RTOS
TCP/IP
Graphics
File System
License
Showcase
Targets
Toolsets
Manuals
Demos
Support
What's New
Press
Newsletters
White Papers
Tools
Alliances
Dealers
Contractors
Site Map
Company
Support
Home
FAQ
Get Info