Skip to content

Commit

Permalink
Update properties of coils in circuit for set/get
Browse files Browse the repository at this point in the history
  • Loading branch information
tbody-cfs committed Nov 13, 2023
1 parent 6c7c253 commit 4d8f070
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions freegs/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,32 +98,6 @@ def __getitem__(self, name):
if label == name:
return coil
raise KeyError("Circuit does not contain coil with label '{0}'".format(name))

@property
def current(self) -> float:
return self._current

@current.setter
def current(self, value: float):
"""
When updating the circuit current, also update the current in the coils in the circuit (with multipliers)
"""
self._current = value
for _, coil, multiplier in self.coils:
coil.current = multiplier * value

@property
def control(self) -> bool:
return self._control

@control.setter
def control(self, value: bool):
"""
When updating the circuit control switch, also update the control switch in the coils in the circuit
"""
self._control = value
for _, coil, _ in self.coils:
coil.control = value

def psi(self, R, Z):
"""
Expand Down

0 comments on commit 4d8f070

Please sign in to comment.