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

Flowmeter #220

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

Flowmeter #220

wants to merge 15 commits into from

Conversation

YannickDieter
Copy link
Contributor

No description provided.

@YannickDieter YannickDieter mentioned this pull request May 7, 2024
@YannickDieter
Copy link
Contributor Author

Can you please comment a bit on the changes? To me it looks like a lot is simplyfied (most of the code is removed), but it still works?

@YannickDieter
Copy link
Contributor Author

YannickDieter commented May 15, 2024

ping @matthias-schuessler

@matthias-schuessler
Copy link
Contributor

I can't really comment on this, because this branch is entirely Antonios and Thomas work. I never worked with this branch and our current module qc environment does not use the changes in it. I can look into this.

@YannickDieter
Copy link
Contributor Author

YannickDieter commented May 15, 2024

Yes, please have a look. In the longterm we want to use the flowmeter for our setup and it would be nice to check if the code changes actually work. Thanks! :)

@cbespin
Copy link
Contributor

cbespin commented Jul 29, 2024

@matthias-schuessler Why do you always force-push? If it does not work with a regular push, your local history is messed up.

@matthias-schuessler
Copy link
Contributor

matthias-schuessler commented Jul 29, 2024

@cbespin I did this, since I just performed a rebase of flowmeter onto the current version of master (basil release 3.3.0). From what I gathered from documentation, a force-push is necessary after a rebase since the idea behind rebase is to change the branch history.

@matthias-schuessler
Copy link
Contributor

Yes, please have a look. In the longterm we want to use the flowmeter for our setup and it would be nice to check if the code changes actually work. Thanks! :)

The flowmeter changes in here are working properly after rebase and can be considered ready for merge.

@cbespin cbespin self-requested a review July 29, 2024 15:07
@cbespin
Copy link
Contributor

cbespin commented Jul 29, 2024

You do not need a force-push after a rebase. This is the idea of a rebase ;) force-push overwrites the remote history. Always try with a normal push and if you encounter errors, deal with them first before considering a force-push.

I added myself as reviewer and will take a look as soon as possible

Copy link
Contributor

@cbespin cbespin left a comment

Choose a reason for hiding this comment

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

Nice PR, nice cleanup and comments. Makes the code much more readable! I have a few questions and suggestions that I am open to discuss.

Also nice to see a new example, thanks!


def set_setpoint(self, value):
cmd = [1, 1, 0x21, (value >> 8) & 0xFF, value & 0xFF]
self.write(cmd)
"""value range from 0 - 32000
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the range exactly 32000 or 32767 aka 2^15? The command seems to allow 2^16 actually? Iirc, there is a large range that does not influence the effective the setting, is it this one? Not sure if we should print a warning or info or ignore it, since the user should not care? @YannickDieter

Copy link
Contributor

Choose a reason for hiding this comment

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

I heard @SilasM2001, you know more about that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I worked with the new version in the flowmeter branch. I can not commend on the previous code. The manual says setpoint has a range of 0 to 32000, with 32000 being 100%. In my experience the range works fine. The module testing setup of Matthias uses a large range (1000-25000 or so, if i recall correctly) and i did not observe a large range that does not influence the effective setting.

def set_control_mode(self, value):
answer_in_hex = ret[11:] # read from the 11th digits to translate what point is set
answer = int(answer_in_hex, 16)
return answer
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this might even be less "confusing" if you do answer = int(ret[11:], 16) # convert reply from hex to integer

cmd = [4, 1, 0x21, 1, 0x20]
self.write(cmd)
answer_in_hex = ret[11:] # read from the 11th digits to translate what mode is on
answer = int(answer_in_hex, 16)
Copy link
Contributor

Choose a reason for hiding this comment

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

See above

logger.debug("ELFLOW.get_valve_output() ret error ret=%s" % str(ret))
return -1
answer_in_hex = ret[11:] # read from the 11th digits to translate what the capacity is
cap_100 = struct.unpack('!f', bytes.fromhex(answer_in_hex))[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

cap_100 is not really conclusive. Is this the maximum capacity in percent? Maybe add a comment or find a more descriptive variable name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants