Skip to content
Snippets Groups Projects
Commit 05d8e178 authored by Sander Snoo's avatar Sander Snoo
Browse files

Fixed setting voltage offset with +=

parent 38d4f7e7
No related branches found
No related tags found
No related merge requests found
......@@ -111,9 +111,26 @@ class segment_base():
return new_segment
def __iadd__(self, other):
'''
define addition operator for segment_single
'''
if isinstance(other, segment_base):
self.data = self.data + other.data
elif type(other) == int or type(other) == float:
self.data += other
else:
raise TypeError("Please add up segment_single type or a number ")
return self
def __sub__(self, other):
return self.__add__(other*-1)
def __isub__(self, other):
return self.__iadd__(other*-1)
def __mul__(self, other):
'''
muliplication operator for segment_single
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment