Skip to content

Commit

Permalink
feat(plc4py): Add TODO for string serialization of generated classes
Browse files Browse the repository at this point in the history
  • Loading branch information
hutcheb committed Sep 8, 2024
1 parent fe2ccdb commit e0bb452
Show file tree
Hide file tree
Showing 88 changed files with 179 additions and 681 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -869,14 +869,9 @@ class ${type.name}<#if type.isDiscriminatedParentTypeDefinition()></#if>(<#if ty
<@emitImport import="from plc4py.api.exceptions.exceptions import SerializationException" />
<@emitImport import="from plc4py.api.exceptions.exceptions import PlcRuntimeException" />
def __str__(self) -> str:
pass
#write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
#try:
# write_buffer_box_based.writeSerializable(self)
#except SerializationException as e:
# raise PlcRuntimeException(e)
# TODO:- Implement a generic python object to probably json convertor or something.
return ""

#return "\n" + str(write_buffer_box_based.get_box()) + "\n"

<#if type.isDiscriminatedParentTypeDefinition()>
@dataclass
Expand Down
4 changes: 3 additions & 1 deletion plc4py/plc4py/api/value/PlcValue.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def __len__(self):
def __eq__(self, other):
"""Compare PlcValue with another or a native data type"""
if isinstance(other, PlcValue):
return (self.value == other.value) and (self.__class__.__name__ == other.__class__.__name__)
return (self.value == other.value) and (
self.__class__.__name__ == other.__class__.__name__
)
else:
return other == self.value

Expand Down
10 changes: 2 additions & 8 deletions plc4py/plc4py/protocols/modbus/readwrite/ModbusADU.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
10 changes: 2 additions & 8 deletions plc4py/plc4py/protocols/modbus/readwrite/ModbusAsciiADU.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
10 changes: 2 additions & 8 deletions plc4py/plc4py/protocols/modbus/readwrite/ModbusConstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,5 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,5 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""
10 changes: 2 additions & 8 deletions plc4py/plc4py/protocols/modbus/readwrite/ModbusPDU.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,14 +663,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
10 changes: 2 additions & 8 deletions plc4py/plc4py/protocols/modbus/readwrite/ModbusPDUError.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,8 @@ def hash_code(self) -> int:
return hash(self)

def __str__(self) -> str:
pass
# write_buffer_box_based: WriteBufferBoxBased = WriteBufferBoxBased(True, True)
# try:
# write_buffer_box_based.writeSerializable(self)
# except SerializationException as e:
# raise PlcRuntimeException(e)

# return "\n" + str(write_buffer_box_based.get_box()) + "\n"
# TODO:- Implement a generic python object to probably json convertor or something.
return ""


@dataclass
Expand Down
Loading

0 comments on commit e0bb452

Please sign in to comment.