Patrick Venture | e620656 | 2018-03-08 15:36:53 -0800 | [diff] [blame] | 1 | ## 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 Venture | c54fbd8 | 2018-10-30 19:40:05 -0700 | [diff] [blame] | 9 | std::map<int64_t, PIDConf> zoneConfig = { |
Patrick Venture | e620656 | 2018-03-08 15:36:53 -0800 | [diff] [blame] | 10 | % 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 Feist | 572c43d | 2019-01-31 15:52:22 -0800 | [diff] [blame] | 30 | |
| 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 Venture | e620656 | 2018-03-08 15:36:53 -0800 | [diff] [blame] | 37 | %> |
| 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 Feist | 572c43d | 2019-01-31 15:52:22 -0800 | [diff] [blame] | 47 | ${details['pid']['slew_pos']}, |
| 48 | ${neg_hysteresis}, |
| 49 | ${pos_hysteresis}}, |
Patrick Venture | e620656 | 2018-03-08 15:36:53 -0800 | [diff] [blame] | 50 | }, |
| 51 | }, |
| 52 | % endfor |
| 53 | }, |
| 54 | }, |
| 55 | % endif |
| 56 | % endfor |
| 57 | }; |