-
Notifications
You must be signed in to change notification settings - Fork 42
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
reset() => getTotalVolume() #1
Comments
Question: in what scenario would this make sense for you and what's your intended use case? The persistence of the total volume counter across calls of reset() is intentional. The basic idea is that of a meter – in contrast to a simple counter.
Resetting the total value(s) wouldn't make much sense, since they would then never differ from the current value(s) in most scenarios. Ideally, the total volume and flow rate would persist across power cycles (in order to make tampering more difficult). I could add a way to store these values into non-volatile memory if there is demand for that. |
In my special case I'm using it for a beverage machine with a bunch of meters. In this case I use a shift register to switch between those meters and need a variable to keep track of this. So it would be nice, to have a value which counts the poured liquid and is resettable. |
Can you clarify how you intend to use the FlowMeter object in this? I don't think you should count the flow rates of multiple sensors using just one FlowMeter object. |
The problem is, that the count of the flowMeters should be dynamic and I read them during startup of an SDCard via JSON. So I can't initialize it on top of the Application. So I came up with the solution to use just one Instance and cycle them through a shift register. But I haven't seen the Thanks for clarifying! |
Okay, I see. So you'd like to load and store the state(s) of the meter(s). This feature has been requested before, maybe it's worthwhile to integrate (since Arduino offers Flash memory anyway). Until then I think it might be a possibility for you to just modify the library by adding setter methods (and then doing the initialisation that way). You could probably get away with setting void FlowMeter::setTotalDuration(totalDuration) {
this->_totalDuration = totalDuration;
}
void FlowMeter::setTotalVolume(totalVolume) {
this->_totalVolume = totalVolume;
}
Current values would then start from zero every time after startup, but this might be what you want anyway. Depending on what other details you need, you could add further setters, e.g. for |
Thank you! :-) I'll check on that! |
I'd like to reopen this issue in order to find a solution to the problem of wether to reset total values on a call to Since the FlowMeter library would lose a feature – total values strictly being monotonic (i.e. never losing volume that has been accounted for) during runtime – I'm thinking about adding a third set of values to The meaning would be:
I think it would be rather simple to accomplish this, but I can't come up with a good name right now. |
see sekdiy#1 for a possible solution to this feature
see sekdiy#1 for a possible solution to this feature
Hey how can I reset the total volume?I like to the amount of ml it push and after with one button I want to reset it to 0 and I start the measurements again . |
Hey @tasosman, could you achieve your goal by using Current volume – and other Total volume – and other |
Yes I check it when I use current volume is sawing l/s but me use the total so I can see how much ml run ,but I fix that I use what are you take off of your code so I put it back and now I can reset the total volume by using the reset .it is a little only difficult to calibrate my sensor now because I use coffee machine and is passing max 400 ml/minute |
Alright, thanks for the feedback. Yes, modifying the code to also Well, this thread/issue serves as a place for me to discuss this as a feature request. So I consider your case another data point in favour of the feature. :) |
Coffee machines (I'm a LaCimbali Junior user) were one of my initial motivations to create this library, along with garden irrigation. If you'd like to discuss your sensor and its calibration, please open another issue here. |
Come on bro ,xaxaxaxa same passion here of course I have made 3 custom espresso machine and this is one of my last project
Best regards
Anastasios Manolidis
…________________________________
From: Sebastian Kraus ***@***.***>
Sent: Wednesday, December 15, 2021 1:16:54 PM
To: sekdiy/FlowMeter ***@***.***>
Cc: tasosman ***@***.***>; Mention ***@***.***>
Subject: Re: [sekdiy/FlowMeter] reset() => getTotalVolume() (#1)
Coffee machines (I'm a LaCimbali Junior user) were one of my initial motivations to create this library, along with garden irrigation.
If you'd like to discuss your sensor and its calibration, please open another issue here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJRXTPOS4YYBVH2PBPRU6ELURCBLNANCNFSM4EKD7WNA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I will open new one |
I'm closing this issue due to inactivity. |
Wouldn't it make sense to clear getTotalVolume() either during the reset() method?
The text was updated successfully, but these errors were encountered: