frappy/frappy_psi/manual_valves.py
Markus Zolliker 52f90fe5be frappy_psi.manual_valves: make persistent and clean up
Change-Id: Ifbdc886f556064745a7aaffbfdc1bad2ad74632e
2025-06-05 10:22:36 +02:00

33 lines
1.3 KiB
Python

# *****************************************************************************
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Module authors:
# Andrea Plank <andrea.plank@psi.ch>
#
# *****************************************************************************
from frappy.core import Parameter, BoolType, Writable
from frappy.persistent import PersistentMixin, PersistentParam
class ManualValve(PersistentMixin, Writable):
target = PersistentParam('Valve target', datatype=BoolType(), persistent='auto')
value = Parameter('Valve state', datatype=BoolType())
def write_target(self, target):
self.value = target
return self.value