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. 3 2162
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
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.
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 that I can
decide what's best for the user and what's best for screen flow.
Here's the structure: I have what's called "an Event". Each Event can
have multiple "Trials". Each "Trial" can multiple "Classes".
(This is the structure for a dog...
|
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 small steps. Right now, I'm just trying to attach a ComboBox to a dataset
that's in my class module. In the class, I call a Stored Procedure. I know
how to set up the connection, command, adapter, and dataset, what I'm having
a problem with is,...
|
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 processing steps that need to
be performed. Many of the steps rely on the results of other steps for
their processing.
I have each step coded as a separate instance. The way I'd like to
execute all the steps is to spawn a thread for each of...
|
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 classes. These classes use the ms sqlhelper class as a data access layer.
I've now created a web form that uses the site and sitescollection classes to build a collection of site objects from the database and display them in a datagrid. I have also...
|
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 responsible for instantiating the orders class? Would it be
the ui layer or the master class in the business layer?
thanks,
| |
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 and Ethernet PLCs, OPC servers,
etc. The application will need to display graphic gauges and charts, in
addition to the actual values retrieved from the various data sources. The
application will need to continually update itself in a real-time...
|
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 end of this message, but I
will start with an overview of the problem.
I've made a content management solution for my work with a decently
structured relational database system. The CMS stores articles. The CMS also
stores related items --...
|
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>.
|
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 foreign Key
relationship or does this always indicate some sort of underlying
design flaw. Something that requires a re evaluation of the problem
domain?
The reason I ask is because in our application, the user can perform x
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |