Does anyone know of any data on how fast a typical person performs a double-click?
- doubleclick interval is an adjustable OS user setting.
Our user might not have configured his machine typically.
I don't know what's the issue with GetDoubleClickTime() / 3
. Even if there was some research proving that an average person doubleclicks 2.56768 time faster than the required minimum speed - 2.56768 is still a magic number of sorts...
You may want to look at an example from Programming in Scala, as they have a simulator that does what you are trying to do in Java:
http://www.cs.helsinki.fi/u/wikla/OTS/Sisalto/examples/html/ch30.html#sec6
By looking at their approach you may find how to change your program to get the behavior you want.
You mentioned that you can't add it easily, so why not explain what your approach is, and what the difficulty that you encounter is, so people can give you some suggestions you may not have considered.
As mentioned, design patterns are ways to talk about what your code is doing, as a shorthand, but the idea of trying to force design patterns in just seems like a bad idea.
Basically a propagation delay shouldn't be hard.
You can have a base class that is Gate
, and in her put in a delay.
All gates extend from this, and set the actual delay.
Now, when you are following a signal, when in a gate, that thread may sleep for the simulated delay, but this also means you need to map the real-time to your simulated time, as your simulator will be slower than a real system would be.
If you find that you have too many threads, then just put into a sorted list, by next one on top, and when you pause, just put the time the delay is done and on each loop the simulator will pick those that are now ready, do the next action, and then the next delay happens.
This would be similar to a game loop.
Best Answer
An 'ATM terminal' is often a magnetic stripe reader (MSR).
There are several different approaches for this:
As some of these just act as keyboards themselves, yes, you can simulate it by typing the data in from a keyboard. Otherwise, if you want to support things such as cherry keyboards and VeriFone 870 you will probably need to get one. Especially consider that these devices are often dedicated computers of their own, with their own programming languages and operating systems (in the case of the 870 I linked, its an embedded linux system).
There are libraries that try to abstract away the 'card reader' (and then you can go about making something that works with JavaPOS or the like, but from experience, these can be very frustrating to work with as they often target the lowest common denominator of devices (and that can be very low).