Cardiac arrest drawing a gantt chart with voluminous data

Greetings and pardons for the subject line (I'm on the verge of collapse
here).

I have been entrusted with creating an application to draw timelines.
A piece of hardware running an RTOS is spewing out tonnes of information
regarding events that take place on multiple processors.

The info is a 64-bit time value indicating when the event occurred and on
which processor.

I need to draw a scrollable (scrollable along the x-axis) gantt chart
consisting of n rows, each row representing one processor, and a rectangle
representing the event on this processor (drawn from the instant the event
occurred till the instant it ended).

I have very basic experience with wxwindows and need help coming up with a
design for this app.

As I see it, I can divide up the app into the following:
1. A set of routines for reading the hardware data and storing it in
dictionaries or some such data structure
2. A wxScrolledwindow derived class for the "canvas"

Beyond this, I am at a total loss as to how to ask the draw routines to draw
rectangles whose co-ords are 64-bit.
Shall I scale ?
Shall I double-buffer ? How ?

Would the wxpython gurus please provide their insight into this problem ?
Many many heartfelt thanks :smiley: !

Cheers,
Robin

wxScrolledWindow is a good bet. I have used it with great success for
similar things. How exactly you do the double-buffering is up to you. I
found that with wxScrolledWindow, double-buffering often is often
optional. Anyway, you can start without double buffering now, then add
it later. The only thing that will change is that when double-buffering
you will first draw to a bitmap (i.e. memory DC) rather than directly to
the screen.

It's clear that even if you could give 64-bit coordinates to the drawing
functions this wouldn't help because people would have to scroll like
kilometers until they get to the next data point :slight_smile:

The easiest way is probably to have a (floating-point) scaling factor
which all coordinates are multiplied with. This factor could be
adjustable by the user to allow a "zoom in"-functionality. Thus, you get
coordinates in a sensible range for drawing.

If you have really lots of data points (say in the millions) you will
want to use some advanced data structure where the data points are
ordered, so you don't have to access all of them at every drawing
operation (when only a small subset of them is visible). You may also
want to do some precalculation on the data points to speed up drawing.
But these are general problems that are not in any way
wxPython-specific.

Hope that helps you get started.

Markus

···

Am Mit, den 21.01.2004 schrieb Jagbir Singh Randhawa um 13:08:

Beyond this, I am at a total loss as to how to ask the draw routines to draw
rectangles whose co-ords are 64-bit.
Shall I scale ?
Shall I double-buffer ? How ?

I was just on the http://www.wxWindows.org website trying to figure out how
to submit a bug report and I saw they have an article listed dealing
specifically with plotting in wxWindows and some new(er) module called
wxPlot (apparently just a wrapper on something called PlPlot). Maybe there
are some ideas in that article for you.

···

-----Original Message-----
From: Jagbir Singh Randhawa [mailto:jagbir.randhawa@codito.com]
Sent: Wednesday, January 21, 2004 4:08 AM
To: wxPython-users@lists.wxwindows.org
Subject: [wxPython-users] Cardiac arrest drawing a gantt chart with
voluminous data

Greetings and pardons for the subject line (I'm on the verge
of collapse
here).

I have been entrusted with creating an application to draw timelines.
A piece of hardware running an RTOS is spewing out tonnes of
information
regarding events that take place on multiple processors.

The info is a 64-bit time value indicating when the event
occurred and on
which processor.

I need to draw a scrollable (scrollable along the x-axis) gantt chart
consisting of n rows, each row representing one processor,
and a rectangle
representing the event on this processor (drawn from the
instant the event
occurred till the instant it ended).

I have very basic experience with wxwindows and need help
coming up with a
design for this app.

As I see it, I can divide up the app into the following:
1. A set of routines for reading the hardware data and storing it in
dictionaries or some such data structure
2. A wxScrolledwindow derived class for the "canvas"

Beyond this, I am at a total loss as to how to ask the draw
routines to draw
rectangles whose co-ords are 64-bit.
Shall I scale ?
Shall I double-buffer ? How ?

Would the wxpython gurus please provide their insight into
this problem ?
Many many heartfelt thanks :smiley: !

Cheers,
Robin

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org

Greetings.

Thanks Markus and Rick for your invaluable suggestions.

Markus, how does this sound to you:
1. I draw the huge chart on a memory DC
2. I blit regions of this memory DC onto the the primary (visible) DC. The
region selection would be based on the scrollbar positions in my subclassed
wxScrolledWindow.

Is it possible to maintain a much larger image in the memory DC and __only__
blit selected portions of this image onto the primary DC ?

What sort of scrollbar magic would be needed ?

Is there some reference code / literature I can reference for this ?

Many thanks for your prompt response.

Cheers,
Robin

Greetings.

Thanks Markus and Rick for your invaluable suggestions.

You're welcome.

Markus, how does this sound to you:
1. I draw the huge chart on a memory DC
2. I blit regions of this memory DC onto the the primary (visible) DC. The
region selection would be based on the scrollbar positions in my subclassed
wxScrolledWindow.

Is it possible to maintain a much larger image in the memory DC and __only__
blit selected portions of this image onto the primary DC ?

It is possible, but don't do that. Think about the memory requirements.
The memory bitmaps are uncompressed, 24-bit-per-pixel! Modern computers
are fast enough to calculate the display "on the fly" (think
3D-first-person-shooters).

If you are double-buffering, I'd only buffer the area visible on the
screen.

What sort of scrollbar magic would be needed ?

Is there some reference code / literature I can reference for this ?

I think the demos included in the wxPython distribution should show a
lot of the concepts.

Markus

···

Am Don, den 22.01.2004 schrieb Jagbir Singh Randhawa um 09:25:

Many thanks for your prompt response.

Cheers,
Robin

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org