ZSWatch icon indicating copy to clipboard operation
ZSWatch copied to clipboard

Generic history for different sensors

Open Kampi opened this issue 1 year ago • 1 comments

First idea and not tested.

Kampi avatar Apr 22 '24 13:04 Kampi

Looks awesome!

But doesn´t work yet :D

Kampi avatar May 03 '24 20:05 Kampi

I think we should include num_stored_samples in the zsw_history_t to allow the user to know how many of the samples are actually valid. Since the num param today is always the max number of samples. Or can num be changed to actually reflect the number of valid samples?

jakkra avatar May 22 '24 08:05 jakkra

I think we should include num_stored_samples in the zsw_history_t to allow the user to know how many of the samples are actually valid. Since the num param today is always the max number of samples. Or can num be changed to actually reflect the number of valid samples?

Because in the battery app now it plots all samples, which are all 0 so it's hard to see anything.

jakkra avatar May 22 '24 08:05 jakkra

I think we should include num_stored_samples in the zsw_history_t to allow the user to know how many of the samples are actually valid. Since the num param today is always the max number of samples. Or can num be changed to actually reflect the number of valid samples?

Because in the battery app now it plots all samples, which are all 0 so it's hard to see anything.

I think we should keep num (but rename it to length) to have an indicator about the maximum length. Then we add a sample counter. Or we can use write_index for it?

Kampi avatar May 22 '24 10:05 Kampi

I think we should include num_stored_samples in the zsw_history_t to allow the user to know how many of the samples are actually valid. Since the num param today is always the max number of samples. Or can num be changed to actually reflect the number of valid samples?

Because in the battery app now it plots all samples, which are all 0 so it's hard to see anything.

I think we should keep num (but rename it to length) to have an indicator about the maximum length. Then we add a sample counter. Or we can use write_index for it?

Sounds good, or even max_samples or sample_buffer_size so it's clear it's a different length

jakkra avatar May 22 '24 10:05 jakkra

Not working yet

jakkra avatar May 24 '24 17:05 jakkra

What's the issue?

Kampi avatar May 24 '24 18:05 Kampi

What's the issue?

I thunk the get sample function I did not get correct. IMG20240524204938

jakkra avatar May 24 '24 18:05 jakkra

Ok, it's my voltage compressions int mV => byte which is bad, nothing wrong with history code I think. And a bug in get sampel i.

Now fixed

jakkra avatar May 26 '24 06:05 jakkra