Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic history for different sensors #263

Merged
merged 2 commits into from
May 27, 2024
Merged

Conversation

Kampi
Copy link
Collaborator

@Kampi Kampi commented Apr 22, 2024

First idea and not tested.

@Kampi Kampi added the enhancement New feature or request label Apr 22, 2024
@Kampi Kampi requested a review from jakkra April 22, 2024 13:26
Copy link
Owner

@jakkra jakkra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome!

app/src/history/zsw_history.c Outdated Show resolved Hide resolved
@Kampi
Copy link
Collaborator Author

Kampi commented May 3, 2024

Looks awesome!

But doesn´t work yet :D

@Kampi Kampi force-pushed the Add-Generic-History branch 3 times, most recently from 91dafb9 to 4c58bc2 Compare May 7, 2024 11:30
app/src/history/zsw_history.c Outdated Show resolved Hide resolved
app/src/history/zsw_history.c Show resolved Hide resolved
app/src/history/zsw_history.c Outdated Show resolved Hide resolved
app/src/history/zsw_history.c Show resolved Hide resolved
app/src/history/zsw_history.c Show resolved Hide resolved
@jakkra
Copy link
Owner

jakkra commented May 22, 2024

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
Copy link
Owner

jakkra commented May 22, 2024

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.

@Kampi
Copy link
Collaborator Author

Kampi commented May 22, 2024

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?

@jakkra
Copy link
Owner

jakkra commented May 22, 2024

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

@Kampi Kampi force-pushed the Add-Generic-History branch 5 times, most recently from f0e3563 to 2b2756e Compare May 22, 2024 19:44
@jakkra jakkra marked this pull request as ready for review May 23, 2024 05:52
app/src/history/zsw_history.c Outdated Show resolved Hide resolved
app/src/history/zsw_history.c Outdated Show resolved Hide resolved
@jakkra jakkra force-pushed the Add-Generic-History branch 3 times, most recently from 3e7e3ee to d8fe966 Compare May 23, 2024 18:10
@Kampi Kampi requested a review from jakkra May 24, 2024 17:31
@jakkra
Copy link
Owner

jakkra commented May 24, 2024

Not working yet

@Kampi
Copy link
Collaborator Author

Kampi commented May 24, 2024

What's the issue?

@jakkra
Copy link
Owner

jakkra commented May 24, 2024

What's the issue?

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

@jakkra
Copy link
Owner

jakkra commented May 26, 2024

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

Kampi and others added 2 commits May 27, 2024 22:25
- Adds a component that simpifies storage of sensor reading to flash.
- Handles automaticallt removing old data etc.
- Easy way to read out.
Copy link
Owner

@jakkra jakkra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and I think it works.

@jakkra jakkra merged commit edf2f8b into jakkra:main May 27, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants