| 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 | <% | 
| Patrick Venture | 7280e27 | 2019-02-11 10:45:32 -0800 | [diff] [blame] | 23 | # If the PID type is a fan, setpoint field is unused, | 
| Patrick Venture | e620656 | 2018-03-08 15:36:53 -0800 | [diff] [blame] | 24 | # so just use a default of 0.  If the PID is not a type | 
| Patrick Venture | 7280e27 | 2019-02-11 10:45:32 -0800 | [diff] [blame] | 25 | # of fan, require the setpoint field. | 
| Patrick Venture | e620656 | 2018-03-08 15:36:53 -0800 | [diff] [blame] | 26 | if 'fan' == details['type']: | 
|  | 27 | setpoint = 0 | 
|  | 28 | else: | 
| Patrick Venture | 7280e27 | 2019-02-11 10:45:32 -0800 | [diff] [blame] | 29 | setpoint = details['setpoint'] | 
| 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}, | 
| Patrick Venture | 7442c37 | 2019-02-11 10:21:05 -0800 | [diff] [blame] | 39 | {${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 Feist | 572c43d | 2019-01-31 15:52:22 -0800 | [diff] [blame] | 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 | }; |