473,395 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Program structure problems

I am doing research on a vision based real-time motion control
system.
The software aspect I will develop was based on windows XP and visual
studio6.

The project has three parts.
The main windows frame as a GUI window. image processing and motor
controling.

Image capture:
I have designed a thread with high priority to let the image data
transfer from the camera. The image capture thread is a static
function of the CMainFrame( the class maintain the GUI). I designed a
class named CimagePorcess to track some objects on the images captured
continuesly.

Then I create a class named CmotorControl to communicate the motor
driver for control the movement.

My question is how these two class communicate with each other. eg.
when I finished the image processing procedure. How can I acesss the
instant of CmotorControl. Should I use "friend".
Should the two instant be the member of the CMainFrame member
varilables or be global.

I'm puzzled...
I'd be appreciate with your advice.

Jun 18 '07 #1
6 1261
Asm23 wrote:
I am doing research on a vision based real-time motion control
system.
The software aspect I will develop was based on windows XP and visual
studio6.

The project has three parts.
The main windows frame as a GUI window. image processing and motor
controling.

Image capture:
I have designed a thread with high priority to let the image data
transfer from the camera. The image capture thread is a static
function of the CMainFrame( the class maintain the GUI). I designed a
class named CimagePorcess to track some objects on the images captured
continuesly.

Then I create a class named CmotorControl to communicate the motor
driver for control the movement.

My question is how these two class communicate with each other. eg.
when I finished the image processing procedure. How can I acesss the
instant of CmotorControl. Should I use "friend".
Should the two instant be the member of the CMainFrame member
varilables or be global.
<sarcasm>
Have you heard of question marks? (You know, the symbol '?', like
after the previous sentence) They designate questions in English,
you know. So that others understand that you're actually asking
about something.
</sarcasm>
I'm puzzled...
I'd be appreciate with your advice.
I believe you're starting from the wrong end. Do you have an Entity
Relationship Diagram of your system? Do you have a Data Flow Diagram?
Do you have any design whatsoever?

Don't start by writing low-level code (although for some people it's
the most fun-filled portion). Start by understanding the interaction
between parts. Like, who creates all those objects (Window, Motor
control, Image Processor, and so on). Perhaps the same entity should
organize their interaction (without the need for them to know about
each other)...

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 18 '07 #2
"Asm23" writes:
>I am doing research on a vision based real-time motion control
system.
The software aspect I will develop was based on windows XP and visual
studio6.

The project has three parts.
The main windows frame as a GUI window. image processing and motor
controling.

Image capture:
I have designed a thread with high priority to let the image data
transfer from the camera. The image capture thread is a static
function of the CMainFrame( the class maintain the GUI). I designed a
class named CimagePorcess to track some objects on the images captured
continuesly.

Then I create a class named CmotorControl to communicate the motor
driver for control the movement.

My question is how these two class communicate with each other. eg.
when I finished the image processing procedure. How can I acesss the
instant of CmotorControl. Should I use "friend".
Should the two instant be the member of the CMainFrame member
varilables or be global.
I warn you there is a lot of what you said that I didn't bother to try to
understand. By all means use friend classes to communicate between the two
instances. Conventional wisdom is "never use global variables". But you
can probably avoid a certain amount of clutter in the code by doing so, and
the thought police are unlikely to know about you and your project..
Jun 18 '07 #3
On 6 18 , 9 19 , "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Asm23 wrote:
I am doing research on a vision based real-time motion control
system.
The software aspect I will develop was based on windows XP and visual
studio6.
The project has three parts.
The main windows frame as a GUI window. image processing and motor
controling.
Image capture:
I have designed a thread with high priority to let the image data
transfer from the camera. The image capture thread is a static
function of the CMainFrame( the class maintain the GUI). I designed a
class named CimagePorcess to track some objects on the images captured
continuesly.
Then I create a class named CmotorControl to communicate the motor
driver for control the movement.
My question is how these two class communicate with each other. eg.
when I finished the image processing procedure. How can I acesss the
instant of CmotorControl. Should I use "friend".
Should the two instant be the member of the CMainFrame member
varilables or be global.

<sarcasm>
Have you heard of question marks? (You know, the symbol '?', like
after the previous sentence) They designate questions in English,
you know. So that others understand that you're actually asking
about something.
</sarcasm>
I'm puzzled...
I'd be appreciate with your advice.

I believe you're starting from the wrong end. Do you have an Entity
Relationship Diagram of your system? Do you have a Data Flow Diagram?
Do you have any design whatsoever?

Don't start by writing low-level code (although for some people it's
the most fun-filled portion). Start by understanding the interaction
between parts. Like, who creates all those objects (Window, Motor
control, Image Processor, and so on). Perhaps the same entity should
organize their interaction (without the need for them to know about
each other)...

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask- -

- -
Thanks for your advice. Really I'm not a native english speaker, and
This is my first post on the news groups. I'm sorry to foget some "?"
in my post. I'll try to increase my writing ability.

Jun 19 '07 #4
On Jun 18, 8:07 pm, Asm23 <Asmwarr...@gmail.comwrote:
I am doing research on a vision based real-time motion control
system.
The software aspect I will develop was based on windows XP and visual
studio6.
Don't use MSVC 6 unless you absolutely have no choice. MFC is not very
nice to work with either. Either of the two newer releases (.NET 2003
and .NET 2005) are much better compilers and you'll have far less
problems - they have native code C++ compilers so you're not forced to
use .NET.
>
The project has three parts.
The main windows frame as a GUI window. image processing and motor
controling.

Image capture:
I have designed a thread with high priority to let the image data
transfer from the camera. The image capture thread is a static
function of the CMainFrame( the class maintain the GUI). I designed a
class named CimagePorcess to track some objects on the images captured
continuesly.
Shared state threading is hard to do and get right. If you can design
it around message passing it will make this much easier to get right.
Think about it as if you had two separate programs sharing as little
as possible.
>
Then I create a class named CmotorControl to communicate the motor
driver for control the movement.

My question is how these two class communicate with each other. eg.
when I finished the image processing procedure. How can I acesss the
instant of CmotorControl. Should I use "friend".
Should the two instant be the member of the CMainFrame member
varilables or be global.
These are very low level questions to be thinking about right now. The
right answer should become more obvious when you try to block out the
overall solution.
K

Jun 19 '07 #5
On 6 19 , 1 12 , Kirit Sælensminde <kirit.saelensmi...@gmail.com>
wrote:
On Jun 18, 8:07 pm, Asm23 <Asmwarr...@gmail.comwrote:
I am doing research on a vision based real-time motion control
system.
The software aspect I will develop was based on windows XP and visual
studio6.

Don't use MSVC 6 unless you absolutely have no choice. MFC is not very
nice to work with either. Either of the two newer releases (.NET 2003
and .NET 2005) are much better compilers and you'll have far less
problems - they have native code C++ compilers so you're not forced to
use .NET.
The project has three parts.
The main windows frame as a GUI window. image processing and motor
controling.
Image capture:
I have designed a thread with high priority to let the image data
transfer from the camera. The image capture thread is a static
function of the CMainFrame( the class maintain the GUI). I designed a
class named CimagePorcess to track some objects on the images captured
continuesly.

Shared state threading is hard to do and get right. If you can design
it around message passing it will make this much easier to get right.
Think about it as if you had two separate programs sharing as little
as possible.
Then I create a class named CmotorControl to communicate the motor
driver for control the movement.
My question is how these two class communicate with each other. eg.
when I finished the image processing procedure. How can I acesss the
instant of CmotorControl. Should I use "friend".
Should the two instant be the member of the CMainFrame member
varilables or be global.

These are very low level questions to be thinking about right now. The
right answer should become more obvious when you try to block out the
overall solution.

K
Thanks, my application have so high speed (it's about 100 frames/
second) that I have to use the critical section to seperate the image
capture thread and the image process thread. I wonder the Message is a
good method to use in this case?

Though, I think it is better to publish this post to a news group like
news:microsoft.VC...
Jun 21 '07 #6
On Jun 21, 10:30 am, Asm23 <Asmwarr...@gmail.comwrote:
[snip]
Though, I think it is better to publish this post to
a news group like
news:microsoft.VC...
Ah Grasshopper! You have achieved wisdom.
Socks

Jun 21 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
0
by: Mark Stokes | last post by:
Hi there, I wanted a bit of advice on a program (a prototype) that I am trying to write that uses threads. I will outline what I am attempting to do, and if anyone has any advice on the way I...
7
by: alphatan | last post by:
Is there relative source or document for this purpose? I've searched the index of "Mastering Regular Expression", but cannot get the useful information for C. Thanks in advanced. -- Learning...
1
by: Giulio | last post by:
I'm trying to learn how to create an RPC client/server. I'm having problems in understanding how to make it. in particular I'm studying...
7
by: Randy Yates | last post by:
Hi, I work in an embedded environment in which we often use a mix of C and assembly code. Thus a recurring requirement is to be able to take a C header file with structure definitions as input...
8
by: Charles Law | last post by:
Can anyone suggest how I would marshal a variable length structure back from an API call. Specifically, I am looking at the WaitForDebugEvent function, which returns a DEBUG_EVENT structure. ...
6
by: Ken | last post by:
When running a program in the debugger, what would cause it to crash without any error messages? I get "The program has exited with code 0 (0x0)". The program is a MDI app with threading for...
8
by: SK | last post by:
Hi I am trying to write a simple C program with devc++ as the complier using the concept of arrays. I cannot get the program to compile without mutiple errors. If anyone has the time to help me...
16
by: Martin Joergensen | last post by:
Hi, I wanted to try something which I think is a very good exercise... I read in data from the keyboard and store them in a structure. There's a pointer called "data_pointer" which I use to...
3
by: John Dann | last post by:
Trying to learn Python here, but getting tangled up with variable scope across functions, modules etc and associated problems. Can anyone advise please? Learning project is a GUI-based...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.