Skip to content

Commit 0fee27b

Browse files
Update to new version : 4.5.0.0
1 parent 89fb953 commit 0fee27b

12 files changed

+243
-13
lines changed
2 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.4.0.0
1+
4.5.0.0

underautomation/fanuc/snpx/assignment/numeric_registers_batch_assignment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from UnderAutomation.Fanuc.Snpx.Assignment import NumericRegistersBatchAssignment as numeric_registers_batch_assignment
44

55
class NumericRegistersBatchAssignment(BatchAssignment2[float, int]):
6-
'''Batch assignment for reading multiple numeric registers at once.'''
6+
'''Batch assignment for reading multiple numeric registers at once as float'''
77
def __init__(self, _internal = 0):
88
'''Initializes a new instance of the NumericRegistersBatchAssignment class.'''
99
if(_internal == 0):
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import typing
2+
from underautomation.fanuc.snpx.internal.batch_assignment_2 import BatchAssignment2
3+
from UnderAutomation.Fanuc.Snpx.Assignment import NumericRegistersInt16BatchAssignment as numeric_registers_int16_batch_assignment
4+
5+
class NumericRegistersInt16BatchAssignment(BatchAssignment2[int, int]):
6+
'''Batch assignment for reading multiple numeric registers at once as 16-bit integers.'''
7+
def __init__(self, _internal = 0):
8+
'''Initializes a new instance of the NumericRegistersInt16BatchAssignment class.'''
9+
if(_internal == 0):
10+
self._instance = numeric_registers_int16_batch_assignment()
11+
else:
12+
self._instance = _internal
13+
14+
def read(self) -> typing.List[int]:
15+
'''Read all numeric registers assigned in this batch assignment.
16+
17+
:returns: Returns an array of Int16 values representing the numeric registers
18+
'''
19+
return self._instance.Read()
20+
21+
def __str__(self):
22+
return self._instance.ToString() if self._instance is not None else ""
23+
24+
def __repr__(self):
25+
return self.__str__()
26+
27+
def __eq__(self, other) -> bool:
28+
if not isinstance(other, NumericRegistersInt16BatchAssignment):
29+
NotImplemented
30+
return self._instance.Equals(other._instance)
31+
32+
def __hash__(self) -> int:
33+
return self._instance.GetHashCode() if self._instance is not None else 0
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import typing
2+
from underautomation.fanuc.snpx.internal.batch_assignment_2 import BatchAssignment2
3+
from UnderAutomation.Fanuc.Snpx.Assignment import NumericRegistersInt32BatchAssignment as numeric_registers_int32_batch_assignment
4+
5+
class NumericRegistersInt32BatchAssignment(BatchAssignment2[int, int]):
6+
'''Batch assignment for reading multiple numeric registers at once as 32-bit integers.'''
7+
def __init__(self, _internal = 0):
8+
'''Initializes a new instance of the NumericRegistersInt32BatchAssignment class.'''
9+
if(_internal == 0):
10+
self._instance = numeric_registers_int32_batch_assignment()
11+
else:
12+
self._instance = _internal
13+
14+
def read(self) -> typing.List[int]:
15+
'''Read all numeric registers assigned in this batch assignment.
16+
17+
:returns: Returns an array of Int32 values representing the numeric registers
18+
'''
19+
return self._instance.Read()
20+
21+
def __str__(self):
22+
return self._instance.ToString() if self._instance is not None else ""
23+
24+
def __repr__(self):
25+
return self.__str__()
26+
27+
def __eq__(self, other) -> bool:
28+
if not isinstance(other, NumericRegistersInt32BatchAssignment):
29+
NotImplemented
30+
return self._instance.Equals(other._instance)
31+
32+
def __hash__(self) -> int:
33+
return self._instance.GetHashCode() if self._instance is not None else 0

underautomation/fanuc/snpx/internal/current_position_request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def get_hash_code(self) -> int:
1717

1818
@property
1919
def group(self) -> int:
20-
'''Gets or sets the motion group number.'''
20+
'''Gets or sets the motion group number. Starts from 1.'''
2121
return self._instance.Group
2222

2323
@group.setter
@@ -26,7 +26,7 @@ def group(self, value: int):
2626

2727
@property
2828
def user_frame(self) -> int:
29-
'''Gets or sets the user frame number.'''
29+
'''Gets or sets the user frame number. Use 0 for World Frame'''
3030
return self._instance.UserFrame
3131

3232
@user_frame.setter

underautomation/fanuc/snpx/internal/numeric_registers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import typing
22
from underautomation.fanuc.snpx.assignment.numeric_registers_batch_assignment import NumericRegistersBatchAssignment
3-
from underautomation.fanuc.snpx.internal.snpx_writable_assignable_indexable_elements_2 import SnpxWritableAssignableIndexableElements2
3+
from underautomation.fanuc.snpx.internal.numeric_registers_base_2 import NumericRegistersBase2
44
from UnderAutomation.Fanuc.Snpx.Internal import NumericRegisters as numeric_registers
55

6-
class NumericRegisters(SnpxWritableAssignableIndexableElements2[float, NumericRegistersBatchAssignment]):
7-
'''Provides access to numeric registers (R[]) on the robot via SNPX.'''
6+
class NumericRegisters(NumericRegistersBase2[float, NumericRegistersBatchAssignment]):
7+
'''Provides access to numeric registers as float (R[]) on the robot via SNPX.'''
88
def __init__(self, _internal = 0):
99
if(_internal == 0):
1010
self._instance = numeric_registers()
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import typing
2+
from underautomation.fanuc.snpx.internal.snpx_writable_assignable_indexable_elements_2 import SnpxWritableAssignableIndexableElements2
3+
from UnderAutomation.Fanuc.Snpx.Internal import NumericRegistersBase as numeric_registers_base_2
4+
5+
TValue = typing.TypeVar('TValue')
6+
TAssignment = typing.TypeVar('TAssignment')
7+
class NumericRegistersBase2(SnpxWritableAssignableIndexableElements2[TValue, TAssignment], typing.Generic[TValue, TAssignment]):
8+
'''Provides access to numeric registers (R[]) on the robot via SNPX.'''
9+
def __init__(self, _internal = 0):
10+
if(_internal == 0):
11+
self._instance = numeric_registers_base_2()
12+
else:
13+
self._instance = _internal
14+
15+
def __str__(self):
16+
return self._instance.ToString() if self._instance is not None else ""
17+
18+
def __repr__(self):
19+
return self.__str__()
20+
21+
def __eq__(self, other) -> bool:
22+
if not isinstance(other, NumericRegistersBase2):
23+
NotImplemented
24+
return self._instance.Equals(other._instance)
25+
26+
def __hash__(self) -> int:
27+
return self._instance.GetHashCode() if self._instance is not None else 0
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import typing
2+
from underautomation.fanuc.snpx.assignment.numeric_registers_int16_batch_assignment import NumericRegistersInt16BatchAssignment
3+
from underautomation.fanuc.snpx.internal.numeric_registers_base_2 import NumericRegistersBase2
4+
from UnderAutomation.Fanuc.Snpx.Internal import NumericRegistersInt16 as numeric_registers_int16
5+
6+
class NumericRegistersInt16(NumericRegistersBase2[int, NumericRegistersInt16BatchAssignment]):
7+
'''Provides access to numeric registers as 16 bits integer (R[]) on the robot via SNPX.'''
8+
def __init__(self, _internal = 0):
9+
if(_internal == 0):
10+
self._instance = numeric_registers_int16()
11+
else:
12+
self._instance = _internal
13+
14+
def create_batch_assignment(self, startIndex: int, count: int) -> NumericRegistersInt16BatchAssignment:
15+
'''Creates a batch assignment for reading multiple numeric registers.
16+
17+
:param startIndex: The starting register index.
18+
:param count: The number of consecutive registers.
19+
:returns: A batch assignment for the specified range.
20+
'''
21+
return NumericRegistersInt16BatchAssignment(self._instance.CreateBatchAssignment(startIndex, count))
22+
23+
def __str__(self):
24+
return self._instance.ToString() if self._instance is not None else ""
25+
26+
def __repr__(self):
27+
return self.__str__()
28+
29+
def __eq__(self, other) -> bool:
30+
if not isinstance(other, NumericRegistersInt16):
31+
NotImplemented
32+
return self._instance.Equals(other._instance)
33+
34+
def __hash__(self) -> int:
35+
return self._instance.GetHashCode() if self._instance is not None else 0
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import typing
2+
from underautomation.fanuc.snpx.assignment.numeric_registers_int32_batch_assignment import NumericRegistersInt32BatchAssignment
3+
from underautomation.fanuc.snpx.internal.numeric_registers_base_2 import NumericRegistersBase2
4+
from UnderAutomation.Fanuc.Snpx.Internal import NumericRegistersInt32 as numeric_registers_int32
5+
6+
class NumericRegistersInt32(NumericRegistersBase2[int, NumericRegistersInt32BatchAssignment]):
7+
'''Provides access to numeric registers as 32 bits integer (R[]) on the robot via SNPX.'''
8+
def __init__(self, _internal = 0):
9+
if(_internal == 0):
10+
self._instance = numeric_registers_int32()
11+
else:
12+
self._instance = _internal
13+
14+
def create_batch_assignment(self, startIndex: int, count: int) -> NumericRegistersInt32BatchAssignment:
15+
'''Creates a batch assignment for reading multiple numeric registers.
16+
17+
:param startIndex: The starting register index.
18+
:param count: The number of consecutive registers.
19+
:returns: A batch assignment for the specified range.
20+
'''
21+
return NumericRegistersInt32BatchAssignment(self._instance.CreateBatchAssignment(startIndex, count))
22+
23+
def __str__(self):
24+
return self._instance.ToString() if self._instance is not None else ""
25+
26+
def __repr__(self):
27+
return self.__str__()
28+
29+
def __eq__(self, other) -> bool:
30+
if not isinstance(other, NumericRegistersInt32):
31+
NotImplemented
32+
return self._instance.Equals(other._instance)
33+
34+
def __hash__(self) -> int:
35+
return self._instance.GetHashCode() if self._instance is not None else 0

0 commit comments

Comments
 (0)