Re-Configured hardware sensor config

I finally had a clear enough mind to really go through and update the raspberry pi sensor software configurations. Before I had multiple functions load the config file from the disk, but this means its reading from the disk multiple times, and the disk is one of the slower parts of a computer, especially for the Pi’s. So, I made it so the configuration py file itself loads and creates the configuration object, and all others just use that object. This way it only loads once (well technically twice because it’s used in 2 programs). This also standardizes things for simplicity, so whenever anything uses the config, it’s done the same everywhere and points to the same object instance. Easier to follow code and saves a bunch of system resources.

I’ll have to remember to do my refactoring when I’m feeling really good, as refactoring takes the most thought and planning… well that and writing the initial code 🙂 But I usually don’t know the best way to do it the first time, especially if I have to “fiddle around” to get it working, so the better work generally comes during refactoring.

During this configuration overhaul, I made a separate python file for trigger variances, since I will be making interval and trigger recording work on all sensors. With the new variance python file in place, I’ll be creating a new configuration file to enable variances per sensor & making it so the interval and trigger recording can be enabled and disabled separately in the main config file.

Motivation is especially low, so little has actually been done in the past 4 or 5 days. Something about the winter…

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>