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

WIP: add -1/--singleshot option #450

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

r00t-
Copy link
Contributor

@r00t- r00t- commented Feb 21, 2021

WIP: fix #389

@r00t- r00t- force-pushed the cleanup_runmodes branch 2 times, most recently from 2510c84 to be75e30 Compare February 21, 2021 23:55
@r00t- r00t- force-pushed the cleanup_runmodes branch 3 times, most recently from fb0205f to f843d13 Compare February 22, 2021 03:25
src/Config_Options.cpp Outdated Show resolved Hide resolved
@r00t-
Copy link
Contributor Author

r00t- commented Mar 9, 2021

@mbehr1:
maybe you can help, it seems you wrote most of the unit-tests:
my changes add a dependency on the options global to MeterS0.cpp,
(so that if if single-shot mode is enabled, MeterS0 can generate a semi-useful "power" reading after two pulses, instead of a useless single "impulse" reading.)
but this breaks the unit-test, because mock_MeterS0 links MeterS0.cpp without also linking Config_Options.cpp.
options should probably be replaced with a mock for that purpose, but it's not so straightforard for me,
can you provide at least a pointer to how you would handle this?

(alternatively one could write code to feed the single-shot flag into MeterS0 when constructing/configuring it,
but adding such meter-specific code to the nice generic meter-interface
doesn't seem better to me than accessing the global from the meter.)

@r00t- r00t- changed the title WIP: cleanup runmodes WIP: add -1/--singleshot option Mar 11, 2021
@r00t- r00t- force-pushed the cleanup_runmodes branch 2 times, most recently from 2ced10a to 69ae1f6 Compare March 14, 2021 07:01
@r00t- r00t- added the Question label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vzlogger should have a --one-time CLI switch
2 participants