def make_controller(profile): if profile['type'] == 'linear': controller = TTable(profile['data']) return controller if profile['type'] == 'pid': controller = PID(profile['setpoint'], profile['kp'], profile['ki'], profile['kd'], profile['negative_hysteresis'], profile['positive_hysteresis']) return controller err = "Don't understand profile type '%s'" % (profile['type']) error(err)
def make_controller(pTable): if pTable["type"] == "linear": controller = TTable( pTable["data"], pTable.get("negative_hysteresis", 0), pTable.get("positive_hysteresis", 0), ) return controller if pTable["type"] == "pid": controller = PID( pTable["setpoint"], pTable["kp"], pTable["ki"], pTable["kd"], pTable["negative_hysteresis"], pTable["positive_hysteresis"], ) return controller err = "Don't understand profile type '%s'" % (pTable["type"]) Logger.error(err)
def make_controller(pTable): if pTable["type"] == "linear": controller = TTable( pTable["data"], pTable.get("negative_hysteresis", 0), pTable.get("positive_hysteresis", 0), ) return controller if pTable["type"] == "pid": controller = PID( pTable["setpoint"], pTable["kp"], pTable["ki"], pTable["kd"], pTable["negative_hysteresis"], pTable["positive_hysteresis"], ) return controller if pTable["type"] == "linear_4curve": controller = TTable4Curve( pTable["data_normal_up"], pTable["data_normal_down"], pTable["data_onefail_up"], pTable["data_onefail_down"], ) return controller if pTable["type"] == "incrementpid": controller = IncrementPID( pTable["setpoint"], pTable["kp"], pTable["ki"], pTable["kd"], pTable["negative_hysteresis"], pTable["positive_hysteresis"], ) return controller err = "Don't understand profile type '%s'" % (pTable["type"]) Logger.error(err)