finnjames / verdant-shores

ERIRA telescope code rewrite
GNU General Public License v3.0
0 stars 0 forks source link

Clock is Trash #2

Closed finnjames closed 5 years ago

finnjames commented 5 years ago

The current tick() system is absolute garbage. I feel okay saying that because I wrote it, but it needs to be standardized. Perhaps some on-a-whiteboard type planning is in order so that we can keep the main logic well abstracted. One way or another, though, this needs to be fixed.

finnjames commented 5 years ago

One idea:

tick() is the main method called by the clock every 10 ms, and within it it calls the handler methods for all of the other logic, including:

Adding a lot more delegation could really help as well—each individual thing should likely be handled by an encapsulated object and not Threepio

finnjames commented 5 years ago

On the same topic, it is important that there is a disconnect between the refresh clock and the actual observation time—with each tick() there also needs to be a system time check. With that in mind, setting the duration of the observation needs to be implemented.

finnjames commented 5 years ago

Clock now based on system time, not the refresh rate (hallelujah)