Wrox Programmer Forums
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2006, 10:24 AM
Registered User
 
Join Date: Oct 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default drawing a square wave

i'm really a beginner here, so hopefully somebody can help me. i'm currently doing a dialog application for a IC tester(hardware). In this application, it will send some vector(series of '1' and '0' ) to the IC tester(hardware) and then after the testing it will return back a result vector(series of '1' and '0' ) to the computer. Therefore, in the dialog, it will hv a button to start the testing. Once the button is pressed, the testing will begin and later in the dialog, it should display the input vector and also the output vector( which looks like a square wave to represent 1 or 0). The data for the vector can be taken from a file saved in text format.
The problem now are:
1)how do i display the vector in my dialog box? Should i create and list box or picture to display the graph in certain area in the dialog?
2) is there anybody who knows how to draw a square wave by getting the data from a file( the file contains a series of 1 and 0, and if 1, the wave amplitude is high and if 0 it will show low). Which function do you recommend me to use?
3) i also need to be able to zoom in/out to view the vector.
Thanks.


Thanks in advance.


 
Old December 31st, 2006, 09:16 AM
Authorized User
 
Join Date: Aug 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

a bit tricky graphics program.

read each bit and draw each piece of graph and advance the x co-ordinate to move and draw in the next bit position. Assume a virtual/invisible line which will be the ground line of the graph and use this co-ordinate to draw the graph.

For the case of zooming in simply redraw the graph with amplitude (y axis) and length (x axis) greater than the provious one - in proportion to the zoom setting . and for case of zoom out redraw the graph with reduced length and height of the line for each bit .


To draw it u may use GDI functions available / MFC functions available etc.



It's upto u how u will design the program.(it was just a hint)

0 1 0 1 0 1 0
  |~~ |~~ |~~
-- --- -- ---

hope u got the idea

ABhattacharyya





Similar Threads
Thread Thread Starter Forum Replies Last Post
Square Brackets in Form Names dylan_b JSP Basics 1 July 11th, 2006 02:29 PM
play wave files kanoorani Javascript How-To 1 September 23rd, 2005 06:34 AM
Square root Ashleek007 C++ Programming 3 December 12th, 2004 04:21 PM
Text to wave file conversion harishksh Visual C++ 1 December 24th, 2003 09:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.