I have a GUI which is monitoring a real-time device. I have several timed
actions, such as periodic polling of the device, and indicators which flash
for a fixed period.
My first implementation of this was to replicate the way I have seen this
done before - have one central timed method, which is on a timer tick, and
use time variables to keep track of when events are due.
I have now realized that I can avoid the timer method, and time variables,
by having one timer for each timed action.
Using one timer for each timed action seems to be a simpler, and more
robust, solution, but I am reluctant to do this, for a couple of reasons -
one, the ticked method is a central point for all timed actions (which may or
may not be a good thing), and, two, this is what I'm used too.
Any opinions?
TIA,
Javaman 2 1609
Why can't you use threads to monitor each device? AFAIK it will be simpler,
a information obtained from the device will be uptodate...
--
Vadym Stetsyak aka Vadmyst
"Javaman59" <Ja*******@discussions.microsoft.com> wrote in message
news:DD**********************************@microsof t.com... I have a GUI which is monitoring a real-time device. I have several timed actions, such as periodic polling of the device, and indicators which
flash for a fixed period.
My first implementation of this was to replicate the way I have seen this done before - have one central timed method, which is on a timer tick, and use time variables to keep track of when events are due.
I have now realized that I can avoid the timer method, and time variables, by having one timer for each timed action.
Using one timer for each timed action seems to be a simpler, and more robust, solution, but I am reluctant to do this, for a couple of reasons - one, the ticked method is a central point for all timed actions (which may
or may not be a good thing), and, two, this is what I'm used too.
Any opinions?
TIA,
Javaman
Hi Vadym,
I have to disagree. I think that, in general, a timer is a simpler solution
than a thread, but they are not as flexible. The problem with timers is that
they are not good for reading from a connection, and for actions which
require fine timing. However, the timer solution can become more complex than
a thread if we try to do to much with it.
Thanks,
Stephen
"Vadym Stetsyak" wrote: Why can't you use threads to monitor each device? AFAIK it will be simpler, a information obtained from the device will be uptodate...
-- Vadym Stetsyak aka Vadmyst
"Javaman59" <Ja*******@discussions.microsoft.com> wrote in message news:DD**********************************@microsof t.com... I have a GUI which is monitoring a real-time device. I have several timed actions, such as periodic polling of the device, and indicators which flash for a fixed period.
My first implementation of this was to replicate the way I have seen this done before - have one central timed method, which is on a timer tick, and use time variables to keep track of when events are due.
I have now realized that I can avoid the timer method, and time variables, by having one timer for each timed action.
Using one timer for each timed action seems to be a simpler, and more robust, solution, but I am reluctant to do this, for a couple of reasons - one, the ticked method is a central point for all timed actions (which may or may not be a good thing), and, two, this is what I'm used too.
Any opinions?
TIA,
Javaman This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tamim |
last post by:
Hi
I've build a library dll using VS.NET C#, i needed to do an internal timed operation when my dll is referenced in other applications so i've used server components System.Timers.Timer, i've...
|
by: Benjamin |
last post by:
Hi,
I am having a problem enabling a timer in my class. I have attached some
sample pseudo code (see "Sample code illustrating issue") so you can see
what I am talking about.
Whats the issue?...
|
by: HL |
last post by:
I am using VS 2005 Beta - C#
Problem: The Timer fires a few milliseconds before the actual Due-Time
Let's say a timer is created in the following manner:
System.Threading.Timer m_timer = null;...
|
by: Ryan |
last post by:
Hello everyone,
I have made a service that starts timers when it starts. I have
another windows form application that stops and starts the service. Do
I need to deal with any started timers when...
|
by: sophistiKate |
last post by:
I am working with an Access 2003 database. Since adding a timer event to check for idle time to a form, a custom toolbar button that creates a snapshot has stopped working properly. Until the first...
|
by: Joe C. |
last post by:
hello, thanks for reading.
this topic was probably covered in the past; if so, i apologize for
the repost, and would you kindly redirect me to the topic?
i have small app that monitors the...
|
by: eljainc |
last post by:
Hello,
I'm having a problem with a simple application that I've written. I
have a form that loads another form. The second form has a timer
control on it. The timer will not fire for some...
|
by: ssecorp |
last post by:
I am not clear about the results here.
from timeit import Timer
import Decorators
def fib(n):
a, b = 1, 0
while n:
a, b, n = b, a+b, n-1
|
by: Prof. William Battersea |
last post by:
I'd like a class method to fire every n seconds.
I tried this:
class Timed:
def.__init__(self):
self.t = Timer(3, self.dothing)
def.start(self):
self.t.start()
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
| | |