Hello folks, I've got one that seems a little tricky to me. What I want to do is to calculate my cumulative BTU measurements. I'm already storing various information in the database where I can calculate the BTU/Hr production. The formula to calculate Cumulative BTUs is as follows (per minute):
I calculate the BTU/Hr production using this formula:
Now, what I want to do is to calculate these BTU/Hr production measurements on the fly. I will have different devices sending data in at different time slices. To help clarify, my table structure is shown below:
The common field between those two tables is slice_id. Any assistance with this would be greatly appreciated.
Code:
(BTU1+BTU2) / 2 * .0167
Code:
(t2-t1) * flow rate * brine factor * system status (38.72 - 36.77) * 14.5 * 485 * 1 = 13713.375 BTU/Hr.
Code:
slices
|
> slice_id
> device_id
> timestamp
slice_msmsnt
|
> msmnt_id
> slice_id
> msmnt_type_id
> msmsnt_value
Comment