blob: 852f4c05853ae9c0cea90eccb5067aa7823c25e3 [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 <%
23 # If the PID type is a fan, set-point field is unused,
24 # so just use a default of 0. If the PID is not a type
25 # of fan, require the set-point field.
26 if 'fan' == details['type']:
27 setpoint = 0
28 else:
29 setpoint = details['set-point']
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},
39 {${details['pid']['sampleperiod']},
40 ${details['pid']['p_coefficient']},
41 ${details['pid']['i_coefficient']},
42 ${details['pid']['ff_off_coefficient']},
43 ${details['pid']['ff_gain_coefficient']},
44 {${details['pid']['i_limit']['min']}, ${details['pid']['i_limit']['max']}},
45 {${details['pid']['out_limit']['min']}, ${details['pid']['out_limit']['max']}},
46 ${details['pid']['slew_neg']},
James Feist572c43d2019-01-31 15:52:22 -080047 ${details['pid']['slew_pos']},
48 ${neg_hysteresis},
49 ${pos_hysteresis}},
Patrick Venturee6206562018-03-08 15:36:53 -080050 },
51 },
52 % endfor
53 },
54 },
55 % endif
56% endfor
57};