fs: improve and fix implementation
+ introduce WrapControlledBy and fix HasControlledBy this in a new module before mercury/triton have been fixed
This commit is contained in:
@@ -63,7 +63,7 @@ import math
|
||||
from frappy.core import Readable, Writable, Parameter, Attached, IDLE, Property
|
||||
from frappy.lib import clamp
|
||||
from frappy.datatypes import LimitsType, EnumType, BoolType, FloatRange
|
||||
from frappy.newmixins import HasOutputModule
|
||||
from frappy.ctrlby import HasOutputModule
|
||||
from frappy_psi.convergence import HasConvergence
|
||||
|
||||
|
||||
@@ -75,12 +75,14 @@ class PImixin(HasOutputModule, Writable):
|
||||
output_min = Parameter('min output', FloatRange(), default=0, readonly=False)
|
||||
output_max = Parameter('max output', FloatRange(), default=0, readonly=False)
|
||||
output_func = Parameter('output function',
|
||||
EnumType(lin=0, square=1), readonly=False, default=0)
|
||||
EnumType(lin=0, square=1), readonly=False, value=0)
|
||||
value = Parameter(unit='K')
|
||||
_lastdiff = None
|
||||
_lasttime = 0
|
||||
_get_range = None # a function get output range from output_module
|
||||
_overflow = 0
|
||||
_cvt2int = None
|
||||
_cvt2ext = None
|
||||
|
||||
def initModule(self):
|
||||
super().initModule()
|
||||
@@ -149,11 +151,10 @@ class PImixin(HasOutputModule, Writable):
|
||||
if not value:
|
||||
self.output_module.write_target(0)
|
||||
|
||||
def write_target(self, _):
|
||||
def set_target(self, value):
|
||||
if not self.control_active:
|
||||
self.activate_control()
|
||||
|
||||
|
||||
# unchecked!
|
||||
|
||||
class PI(HasConvergence, PImixin):
|
||||
@@ -178,4 +179,3 @@ class PI2(PI):
|
||||
if not self.control_active:
|
||||
self.output.write_target(target)
|
||||
super().write_target(target)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user