KyleBenson / scale_client

The Python-based SCALE Client software for acquiring data from various sensors (i.e. via Raspberry Pi platform), processing it, and sharing it through multiple networks and data exchange protocols.
http://scale.ics.uci.edu/
Other
4 stars 8 forks source link

SensedEvents should obscure the dict/json representation of event data underneath #21

Open KyleBenson opened 9 years ago

KyleBenson commented 9 years ago

I already added a get_raw_data() function, but I think we need more abstractions for this fairly complex object. It's become fairly clunky and has its logic spread out over a lot of different places that are now requiring checks to validate it's correct state. In particular, I'm looking at how the "condition" part has to be duplicated in the VirtualSensors (once for the logic itself, another time to record how the logic was done). Wouldn't it be great to abstract this into one text representation, configurable via the config files, that is parsed into an actual logical rule and then executed in the VS?

I modified VSs for the whole read_raw_data() vs read() thing to start addressing some of this wonkiness where sometimes we want to work in raw sensor readings and other times in the whole object.

I've also run into issues of the whole TOPIC concept and whether it belongs inside of a SensedEvent or outside as a separate concept (maybe ONLY pertinent to MQTT?). This will also ease omitting unchanged details between sensor readings, compression, etc.

It may be time to bring in some more advanced Python modules that add nice syntax and translations for these operations, such as for database support.