472,354 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Design Question. Data Acquisition/Display related.

Hi,

I'm building a little application, which the goal is to:

1./ Collect data via Serial line and or via a file (for playback).
2./ Display these data as graph, oscilloscope, ...

How manage this ?

1./ Is each "display" must responsible to acquire/read the data ?
2./ Or an engine collect the data then send them to each "display" ?

Also, how to "anim" this ?

1./ Via a timer ?
2./ Via a simple loop (read/update display/pause/read user key)

The app. will be a GUI (tkInter) app. and the user must be able to stop
the process at any time.

Sure, all this must be maintenable, let's say to acquire data via other
type of channel or to other type of display...

Yes, it's like a "mini" labView...

Any idea or link is welcome.

Thanks.

STepH.
Jul 19 '05 #1
3 2058
StepH wrote:
1./ Is each "display" must responsible to acquire/read the data ?
2./ Or an engine collect the data then send them to each "display" ?
I'd keep it simple:

- DataCollector class
asociated with one or more display instances (implemented as a list of
display subscribers)
it collects data from a source and notifies each subscribed display that
new data is available.
could something like a 'collect' method which performs:

for display in self.subscribed_displays:
display.update( data )
- Display class
just a simple display class with an "update" method
it should be able to receive new data
and display new data
(those 2 actions could be implemented in different methods, you might
not want to display everytime new data is available... maybe you might
want to consolidate data in some way and output it at some high interval)
Also, how to "anim" this ?

1./ Via a timer ?
2./ Via a simple loop (read/update display/pause/read user key)


a simple loop could do it
- handle user events
- collect data
- update displays
- sleep
Jul 19 '05 #2
Alex Verstraeten a écrit :
StepH wrote:
1./ Is each "display" must responsible to acquire/read the data ?
2./ Or an engine collect the data then send them to each "display" ?
I'd keep it simple:

- DataCollector class
asociated with one or more display instances (implemented as a list of
display subscribers)
it collects data from a source and notifies each subscribed display
that new data is available.
could something like a 'collect' method which performs:

for display in self.subscribed_displays:
display.update( data )
- Display class
just a simple display class with an "update" method
it should be able to receive new data
and display new data
(those 2 actions could be implemented in different methods, you might
not want to display everytime new data is available... maybe you might
want to consolidate data in some way and output it at some high interval)


Ok, it was my first idea too...
Also, how to "anim" this ?

1./ Via a timer ?
2./ Via a simple loop (read/update display/pause/read user key)


a simple loop could do it
- handle user events
- collect data
- update displays
- sleep

Here i've a prob. (due to the fact that I start both with Python &
TkInter). In TkInter, you run your app by launching a mainloop()
routine, right ? So, how, in my forever loop (handle user events /
Collect data / Update Display / Sleep) handle the user data ?

Sure, i can (i suppose), log user activity (via the event send by the Tk
underlayer), the "poll" theses event in my for ever loop ? But in this
case, are these event will be correctly generated (by Tk) ? How to
"give the hand" to Tk in such scenario ?

Thanks for your help.

StepH.
Jul 19 '05 #3
StepH wrote:
a simple loop could do it
- handle user events
- collect data
- update displays
- sleep

Here i've a prob. (due to the fact that I start both with Python &
TkInter). In TkInter, you run your app by launching a mainloop()
routine, right ? So, how, in my forever loop (handle user events /
Collect data / Update Display / Sleep) handle the user data ?

Sure, i can (i suppose), log user activity (via the event send by the Tk
underlayer), the "poll" theses event in my for ever loop ? But in this
case, are these event will be correctly generated (by Tk) ? How to
"give the hand" to Tk in such scenario ?

Thanks for your help.

StepH.

oops, sorry, I was thinking of a 'pygame' kind of loop, where you have
control over it.
I dont have experience on Tk, I allways use wxPython or pygame for gui's.

you can forget about the loop I mentioned... it doesn't apply to
event-driven applications where you have no control over the loop.
you'd be using a timer that triggers a tick method at a certain
interval, in that tick method you could tell your data collectors to
collect data... then the data collectors would trigger all its
subscribed displays's "update" function, so they draw the new available
data, just like the "for display in self.subscribed_displays:
display.update(data)".

so it comes to something like this:

tk mainloop is set to call tick() every 100ms through a timer.
tick() will iterate through all data collectors and call their "collect"
method
each data collector will then collect data and iterate through all
asociated displays calling their respective 'update' method on each.

of course there are plenty of ways to design an app, this is just an idea.

hope it helps,
Alex



Jul 19 '05 #4

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

Similar topics

7
by: Susan Bricker | last post by:
Greetings. As a relative newcomer to Access, I am having trouble deciding on how to design the form flow for updating and creating related records. I'm looking for a variety of suggestions so...
2
by: JS | last post by:
I'm trying to create a data layer and having problems returning a DataSet from my code that's in a class module. Please forgive me. I'm new to C# (VB'er). I decided to create my data layer in...
8
by: JS | last post by:
I am monitoring/controlling some realtime activities in a manufacturing process. When a part comes into my station, I have a bunch of processing to do. There are 30-40 data acquisition and data...
7
by: krs | last post by:
Hi, I'm using the MS timetracker app as a basis for an application I am building. I have at present two classes, Site and SitesCollection, similar to the timeentry and timeentrycollection...
6
by: rodchar | last post by:
Hey all, I'm trying to understand Master/Detail concepts in VB.NET. If I do a data adapter fill for both customer and orders from Northwind where should that dataset live? What client is...
7
by: jude | last post by:
Hello, We are starting to discuss a new ASP.NET application that will be a data acquisition display application. The data to be displayed will come from multiple sources--database tables, serial...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
36
by: Ulysses | last post by:
Could someone tell me how to go about getting data from a data acquisition card using C?...<Just general information would also help........I'm just working on an idea at the moment>.
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.