Giter Club home page Giter Club logo

mp's People

Contributors

makman2 avatar

Watchers

 avatar  avatar  avatar

mp's Issues

Implememt BloodPressureDataFrame with time parametrization

The current class allows not related values, but the remote module gives us data frames with equal time differences. Subclass from DataFrame and implement constructor with these parameters. Then also a file writer is possible with more efficient storage handling.

Use AsyncTask instead of worker threads

AsyncTask is the special designed class for this purpose. Especially the asynchrone WifiConnector functions can be replaced with it.
Big advance: AsyncTasks are cancellable! This is needed from the UI.

MPDF file management abstraction

Create an abstraction layer class that handles complete MPDF management. The user can only create and open files via this interface.

Using checksums in file format?

Checksums add a layer of security, but to handle them correctly is quite complicated. The data format is quite simple so it is maybe not really worth it.
So in short:

Pro:

  • Check if data was corrupted
  • Minimal extra file size (in concrete: 8 bytes extra, that's nothing)

Contra:

  • Difficult to implement
  • Writing data costs more time since checksum calculation takes place
  • The format is so simple, no extra security needed.

Copy constructors or clone()?

Nearly all classes lack the capability of copying. There are two options:

  1. Use copy constructors.
    • Advantage: Type-safe, no castings needed
  2. clone():
    • Advantages: Java conform, works together with other components. Especially every Object has a clone-function.
    • (big) Disadvantage: Annoying implementation, involves many casts and a try-catch. Not really efficient.

Make settings keys directly related to settings.xml

The code file Settings.java contains the key names of the settings used in the PreferenceFragment.
The keys should be defined in a new strings XML file and also their defaults. Settings.java loads the resources at static constructor (or if possible in the same line as the constants get defined) and the PreferenceFragment just addresses the resources.

GUI

Implement the GUI.

Some things that are needed:

  • The actual plot
  • Some buttons/options to adjust viewed data
  • Credits

MPDF buffer overflow protection

The current format allows to place entries with a length of 4GB!!! That is definetly too much and needs to be reduced. Otherwise this would be a possible exploit.
Limitting to a short (64KB) is enough.

Data backend

Implement DataFrame organizing classes and classes that handle data output suited for MPAndroidChart.

Remote module interface

Implement classes to receive remote module data.
Which protocol is used and how exactly needs to be determined.

Remote module communication thread

We need a thread that handles all data request to the module, my plan:

  1. The application requests a data bunch via putting its request on a queue. The element on the queue contains the actual request and a callback.
  2. The queue is worked through until all requests are done. If all done, let the thread remain in idle state.
  3. If the thread needs to process a request, it sends the request to the remote module interface (#3) and waits for response (maybe also asynchronous).
  4. When respond arrives, it calls the callback in the registered request with the request result. BUT: The callbacks now are organized in a threading-pool to not blast the system with too many threads. If the module reacts fast and the thread needs to process many requests, it could possibly open too many threads (especially if the callbacks are time-consuming). I would limit the thread count to 2-4.

The good aspect behind this system is that one thread hosts the connection to the remote module. Multiple threads are difficult to realize (but would simplify the callback process).

Handle multiple WiFi access points with same SSID

Many routers send more than one possible WiFi connection (i.e. different frequencies because of different WLAN standards, WLAN repeaters).
Need to catch the broadcast and select the connection with the best signal strength.
If connection is not possible fall back to the least good signal.

Make DataFrame abstract again?

The basic idea behind this is to allow automatically generate data from parameters.

For our specific blood pressure example:
Because we receive data-bunches where each data-piece has equal time difference, we don't need to manually save x-data. That would allow also to write a custom file writer that takes advantage of this fact.

Let the refresh button spin

The WiFi refresh menu action button shall spin until the refreshed view is shown.

This is a bit complicated since the SDK has problems with AppCompat and uses a dumb system regarding drawable rotations. Just complicated and not helpful at all.

So best way:

  • Write our own RotateDrawable, where you can just set the angle (and not some awkward "level" that ranges from 0 - 10000)
  • If possible embed it in XML
  • Use the new drawable as icon
  • Use an animator with linear interpolation that sets the angle
    • Maybe make a completely own Animator class that just needs the new RotateDrawable target. But some properties should be left open, like interpolation etc.

Plot range x-labels have ugly values

If we render for example 1000 data points (starting from zero), we get something like:

It would be better to display the x-label "1000" itself at the right edge, but if we adjust code to get 1001 labels (so from 0 until 1000), the plot calculates even more ugly values (and there's still no 1000 at the right edge):

We should try to display the range 0 until 1000 (or any other range, but it shouldn't be cut off like this).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.