bnjmnp / pysoem

Cython wrapper for the Simple Open EtherCAT Master Library
MIT License
96 stars 37 forks source link

Added function set_manualstatechange #57

Closed askogvold-halodi closed 2 years ago

askogvold-halodi commented 2 years ago

Simply expose the flag manualstatechange to the Master class, so it can be set.

There are situations where one wants to run functions config_init() or config_map() without slave states automatically being updated. This flag will allow full manual control over the slave states.

bnjmnp commented 2 years ago

Hi, thank you. It makes completely sense to expose the manualstatechange flag. I would prefer to implement it as a property like I did this for the CdefMasters state property. What do you think? Apart from that, to harmonize the naming I think we could go with manual_state_change as the properties name..? (it aligns with expected_wkc, dc_time and the names of the functions)

askogvold-halodi commented 2 years ago

Thanks for the feedback!

I agree with both changes. I will update the PR with suggested changes hopefully during this week. If not, definitely next week.

bnjmnp commented 2 years ago

Thank you for your contribution, that helps PySOEM to evolve.

askogvold-halodi commented 2 years ago

@bnjmnp Could you do me a favor and create a new release with this fix?

bnjmnp commented 2 years ago

It is online now. I was developing another feature lately and planned to combine it with you PR in one release. But the feature takes more time than expected so I just create the 1.0.5 release. I also triggert the update of the readthedocs documentation, but note that the property dose not show up there. It's most likely because the docstring for a property is expected to be in the getter function, not in the setter function. I'll fix that later.