gijzelaerr / python-snap7

A Python wrapper for the snap7 PLC communication library
http://python-snap7.readthedocs.org/
MIT License
644 stars 245 forks source link

Types and lib location feature #255

Closed lautarodapin closed 3 years ago

lautarodapin commented 3 years ago

Three main changes

  1. Added optional parameter in the init client class, to specify the dll file location for those who can't installed properly.
  2. Utils DB, added area parameter for handling marks, inputs and outputs. TODO: tests
  3. Types: added Enum class for the areas, this way we can handle the typing.
lautarodapin commented 3 years ago

@gijzelaerr I don't really know how to handle this errors.

snap7/common.py:44: error: Cannot determine type of 'cdll'
snap7/util.py:657: error: Argument 4 to "set_bool" has incompatible type "Union[bool, str, int, float]"; expected "bool"
snap7/util.py:667: error: Argument 3 to "set_string" has incompatible type "Union[bool, str, int, float]"; expected "str"
snap7/util.py:673: error: Argument 3 to "set_dword" has incompatible type "Union[bool, str, int, float]"; expected "int"
snap7/util.py:676: error: Argument 3 to "set_dint" has incompatible type "Union[bool, str, int, float]"; expected "int"
snap7/util.py:679: error: Argument 3 to "set_int" has incompatible type "Union[bool, str, int, float]"; expected "int"
snap7/util.py:682: error: Argument 3 to "set_word" has incompatible type "Union[bool, str, int, float]"; expected "int"
snap7/util.py:685: error: Argument 3 to "set_usint" has incompatible type "Union[bool, str, int, float]"; expected "int"
snap7/util.py:691: error: Argument 3 to "set_usint" has incompatible type "Union[bool, str, int, float]"; expected "int"
lautarodapin commented 3 years ago

@gijzelaerr I think is ready.

lautarodapin commented 3 years ago

@gijzelaerr ready i think