blob: 2e6738dc01e74426967538e44b76aca4ac6a4e6d [file] [log] [blame]
Patrick Venturee6206562018-03-08 15:36:53 -08001## This file is a template. The comment below is emitted
2## into the rendered file; feel free to edit this file.
3
4// !!! WARNING: This is GENERATED Code... Please do NOT edit !!!
5
6#include <map>
7#include "conf.hpp"
8
Patrick Venturec54fbd82018-10-30 19:40:05 -07009std::map<int64_t, PIDConf> zoneConfig = {
Patrick Venturee6206562018-03-08 15:36:53 -080010% for zone in PIDDict.iterkeys():
11 % if zone:
12 {${zone},
13 {
14 % for key, details in PIDDict[zone].iteritems():
15 {"${key}",
16 {"${details['type']}",
17 {
18 % for item in details['inputs'].split():
19 "${item}",
20 % endfor
21 },
22 <%
Patrick Venture7280e272019-02-11 10:45:32 -080023 # If the PID type is a fan, setpoint field is unused,
Patrick Venturee6206562018-03-08 15:36:53 -080024 # so just use a default of 0. If the PID is not a type
Patrick Venture7280e272019-02-11 10:45:32 -080025 # of fan, require the setpoint field.
Patrick Venturee6206562018-03-08 15:36:53 -080026 if 'fan' == details['type']:
27 setpoint = 0
28 else:
Patrick Venture7280e272019-02-11 10:45:32 -080029 setpoint = details['setpoint']
James Feist572c43d2019-01-31 15:52:22 -080030
31 neg_hysteresis = 0
32 pos_hysteresis = 0
33 if 'neg_hysteresis' in details['pid']:
34 neg_hysteresis = details['pid']['neg_hysteresis']
35 if 'pos_hysteresis' in details['pid']:
36 pos_hysteresis = details['pid']['pos_hysteresis']
Patrick Venturee6206562018-03-08 15:36:53 -080037 %>
38 ${setpoint},
Patrick Venture7442c372019-02-11 10:21:05 -080039 {${details['pid']['samplePeriod']},
40 ${details['pid']['proportionalCoeff']},
41 ${details['pid']['integralCoeff']},
42 ${details['pid']['feedFwdOffOffsetCoeff']},
43 ${details['pid']['feedFwdGainCoeff']},
44 {${details['pid']['integralLimit']['min']}, ${details['pid']['integralLimit']['max']}},
45 {${details['pid']['outLimit']['min']}, ${details['pid']['outLimit']['max']}},
46 ${details['pid']['slewNeg']},
47 ${details['pid']['slewPos']},
James Feist572c43d2019-01-31 15:52:22 -080048 ${neg_hysteresis},
49 ${pos_hysteresis}},
Patrick Venturee6206562018-03-08 15:36:53 -080050 },
51 },
52 % endfor
53 },
54 },
55 % endif
56% endfor
57};