New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface refactor #16

Merged
merged 12 commits into from Aug 18, 2016

Conversation

Projects
None yet
1 participant
@ReeceStevens
Owner

ReeceStevens commented Aug 10, 2016

Develop a better system of managing UI and interactive elements on the screen. This became a higher priority after I realized that UI became my bottleneck in developing the NIBP system (PR #15).

Goals of this refactor:

  • Create a clearly organized and well-documented way to construct a screen layout, update it, and interact with it
  • Reduce the amount of code clogging up the main.cpp file
  • Shoot for making the NIBP UI a close-to-trivial task to develop

ReeceStevens added some commits Aug 9, 2016

Begin refactoring interface, begin writing docs
Starting to develop a new scheme where there is a master `Screen` object
which contains a `Vector` of `ScreenElement` objects (see
docs/interface.md for more details).
Move signalTrace functionality out of ECG
Moving signal traces to a generic SignalTrace class.
Move signals into separate file, begin ts work
Moved the signal based interface elements into their own file.

Also, beginning work on how to manage touch events using the new screen
-> screen element system. This is a work in progress, see TODO note in
inc/screen.h.
Use callback function for buttons, general cleanup
Add callback functions to Button objects that are called when the
Screen they are associated with checks for touch events. Also, perform
general code base maintenance, renaming, and organization of variables.

Also, update docs to reflect that I ditched the proposed Action system
in favor of the callback function because it was easier and clearer in
pretty much every conceivable way.
Change screen lifecycle to include `propogateTouch`
Update docs to describe the lifecycle hooks that occur during every
screen update. Changed `main.cpp` to more clearly reflect when these
lifecycle hooks are called.

In keeping with this, `listenForTouch` was renamed to `propogateTouch`
and the full touch screen cycle was moved inside this function. The
call sequence for a screen lifecycle iteration is now:

```
screen.update(some_delay);
screen.propogateTouch();
```

where `some_delay` is a delay period to allow the display chip to
finish rendering all updated elements.
@ReeceStevens

This comment has been minimized.

Show comment
Hide comment
@ReeceStevens

ReeceStevens Aug 18, 2016

Owner

Looks like all aforementioned goals have been accomplished and everything is working smoothly, so I'm going to merge this into master!

Owner

ReeceStevens commented Aug 18, 2016

Looks like all aforementioned goals have been accomplished and everything is working smoothly, so I'm going to merge this into master!

@ReeceStevens ReeceStevens merged commit c277611 into master Aug 18, 2016

@ReeceStevens ReeceStevens deleted the interface-refactor branch Aug 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment