-
February 26th, 2014, 06:55 AM
#1
Need guidance ...
Hi ,
I need to edit ,update and display a group of 40 parameters on screen .( 10 parameters per page and use of Arrow Key pad or touch screen clicks to modify value)
For that I will need .. Parameter No . , String Name , Point Screen Cord , double value , next element no. etc
I have my old code with structure and array of structure written in C. I have translated it on C++/MFC . But I am not happy.
But pl suggest me some good method for c++ / MFC platform.
How can I implement Class property of c++ ?
pl Guide
-
February 26th, 2014, 08:04 AM
#2
Re: Need guidance ...
Your question si kind of vague as we don't know what you've done and what you need. Sounds like a typical MFC CDialog based app, or perhaps CPropertyPage and CPropertySheets to give you multiple pages.
No idea what you mean by the Class property of C++
-
February 27th, 2014, 12:38 AM
#3
Re: Need guidance ...
Sir , I need to display / edit / update a list of parameters. I have divided the screen into signal display area and parameter area. There is a dialog box to edit all system parameters . But Major Parameters can be edited by mouse click ( or touch screen). So I have listed them on Right Side of the display.
I am using a structure
Code:
typedef struct {
CString Name ;
CString UnitName;
CPoint DispCord;
CString ValueInString;
double Value;
int Index ;
int NextParamIndex;
int PrevParamIndex;
} ImpParam;
I am considering Key Events and Mouse Events.
All this works well.
But I feel , I am using C and not C++.
So pl guide me .. How all this can be in C++.? How can I define a class for all this ? Are there any better features to implement all this.?
pl guide ..
-
February 27th, 2014, 07:20 AM
#4
Re: Need guidance ...
Originally Posted by new_2012
All this works well.
But I feel , I am using C and not C++.
You feel wrong. As long as you use CString and CPoint, you use C++. Besides, there's nothing wrong in using structures in C++. You'd better feel you have no idea what is using pure C.
Best regards,
Igor
-
February 27th, 2014, 08:48 AM
#5
Re: Need guidance ...
Thank you sir .. Now I am feeling happy. I felt that I should design a class . But then there are 40 parameters ..so 40 objects ???
I was confused. With structures the code was simple to write . Thank you again.
-
February 27th, 2014, 09:01 AM
#6
Re: Need guidance ...
Originally Posted by new_2012
Thank you sir .. Now I am feeling happy. I felt that I should design a class . But then there are 40 parameters ..so 40 objects ???
I was confused. With structures the code was simple to write . Thank you again.
In C++, a struct and a class are for all intents and purposes, the same thing. If you want to use a class, it would likely have 40 members, some of which may be objects.
-
February 27th, 2014, 02:35 PM
#7
Re: Need guidance ...
What do you have in mind in terms of layout of the screen? I ask because if you display with some reusability in mind, it might alter how you store the data on the backend.
-
February 28th, 2014, 03:22 AM
#8
Re: Need guidance ...
Sir , I have divided my screen into 2 parts .. 3/4 th for the display .. where all graphics and signals are shown . In 1/4th area , I am drawing rectangular shaded bitmaps , with parameter name ( for e.g. Frequency ,Phase ,Volume gain etc) and its values and units. I can edit them with Arrow Key Pad or Mouse Clicks. I am also scrolling the parameters . After editing the parameter I need to run a function to send the value to system. I am using Function Array for this.
This I had implemented in DOS DPMI mode and now I am using the same structures and arrays. I will need to convert the same project on C# platform after 6 months . I think with Form , I can use bit-mapped Edit Boxes , Split Screen etc
So thinking on some good new algorithm.
-
March 1st, 2014, 12:13 AM
#9
Re: Need guidance ...
GCDEF sir I was thinking on your suggestion yesterday
Yes I will write down algorithms on paper ..
1. Class with 40 members .. Protected varibles and common
display and execute function.
and
2. Class with virtual functions and 40 objects .. so each will display/modify/execute self.
Then I will study which seems to be better ..
I think I can use common Execute Parameter Function for dialog box and touch screen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|