Skip to content

Commit

Permalink
feat(plc4py): remove start_pos variable as it never gets used.
Browse files Browse the repository at this point in the history
  • Loading branch information
hutcheb committed May 21, 2023
1 parent 67272f7 commit 7c2d17c
Show file tree
Hide file tree
Showing 52 changed files with 0 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ class ${type.name}<#if type.isDiscriminatedParentTypeDefinition()></#if>(<#if ty
<#if helper.hasFieldOfType("unknown")>
raise SerializationException("Unknown field not serializable")
<#else>
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("${type.name}")
<#assign reservedFieldIndex=0>
<#list type.fields as field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def serialize_modbus_adu_child(self, write_buffer: WriteBuffer) -> None:
pass

def serialize(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusADU")

# Switch field (Serialize the sub-type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def __post_init__(self):
super().__init__(self.response)

def serialize_modbus_adu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusAsciiADU")

# Simple Field (address)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def __post_init__(self):
super().__init__()

def serialize(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusConstants")

# Const Field (modbusTcpDefaultPort)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def __post_init__(self):
super().__init__()

def serialize(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusDeviceInformationObject")

# Simple Field (objectId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer) -> None:
pass

def serialize(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDU")

# Discriminator Field (errorFlag) (Used as input to a switch field)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUDiagnosticRequest")

# Simple Field (subFunction)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUDiagnosticResponse")

# Simple Field (subFunction)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUError")

# Simple Field (exceptionCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUGetComEventCounterRequest")

write_buffer.pop_context("ModbusPDUGetComEventCounterRequest")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUGetComEventCounterResponse")

# Simple Field (status)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUGetComEventLogRequest")

write_buffer.pop_context("ModbusPDUGetComEventLogRequest")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUGetComEventLogResponse")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUMaskWriteHoldingRegisterRequest")

# Simple Field (referenceAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUMaskWriteHoldingRegisterResponse")

# Simple Field (referenceAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadCoilsRequest")

# Simple Field (startingAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadCoilsResponse")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadDeviceIdentificationRequest")

# Const Field (meiType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadDeviceIdentificationResponse")

# Const Field (meiType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadDiscreteInputsRequest")

# Simple Field (startingAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadDiscreteInputsResponse")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadExceptionStatusRequest")

write_buffer.pop_context("ModbusPDUReadExceptionStatusRequest")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadExceptionStatusResponse")

# Simple Field (value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadFifoQueueRequest")

# Simple Field (fifoPointerAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadFifoQueueResponse")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadFileRecordRequest")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def __post_init__(self):
super().__init__()

def serialize(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadFileRecordRequestItem")

# Simple Field (referenceType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadFileRecordResponse")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def __post_init__(self):
super().__init__()

def serialize(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadFileRecordResponseItem")

# Implicit Field (data_length) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadHoldingRegistersRequest")

# Simple Field (startingAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadHoldingRegistersResponse")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadInputRegistersRequest")

# Simple Field (startingAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadInputRegistersResponse")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadWriteMultipleHoldingRegistersRequest")

# Simple Field (readStartingAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReadWriteMultipleHoldingRegistersResponse")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReportServerIdRequest")

write_buffer.pop_context("ModbusPDUReportServerIdRequest")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUReportServerIdResponse")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteFileRecordRequest")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __post_init__(self):
super().__init__()

def serialize(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteFileRecordRequestItem")

# Simple Field (referenceType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteFileRecordResponse")

# Implicit Field (byte_count) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def __post_init__(self):
super().__init__()

def serialize(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteFileRecordResponseItem")

# Simple Field (referenceType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteMultipleCoilsRequest")

# Simple Field (startingAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteMultipleCoilsResponse")

# Simple Field (startingAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteMultipleHoldingRegistersRequest")

# Simple Field (startingAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteMultipleHoldingRegistersResponse")

# Simple Field (startingAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteSingleCoilRequest")

# Simple Field (address)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteSingleCoilResponse")

# Simple Field (address)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteSingleRegisterRequest")

# Simple Field (address)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __post_init__(self):
super().__init__()

def serialize_modbus_pdu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusPDUWriteSingleRegisterResponse")

# Simple Field (address)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def __post_init__(self):
super().__init__(self.response)

def serialize_modbus_adu_child(self, write_buffer: WriteBuffer):
start_pos: int = write_buffer.get_pos()
write_buffer.push_context("ModbusRtuADU")

# Simple Field (address)
Expand Down
Loading

0 comments on commit 7c2d17c

Please sign in to comment.