source: project/release/4/nemo/trunk/templates/NEST-accessors_modifiers.tmpl @ 31587

Last change on this file since 31587 was 31587, checked in by Ivan Raikov, 6 years ago

nemo: bug fixes in NEST templates

File size: 1.7 KB
Line 
1
2void {{modelName}}::Parameters_::get (DictionaryDatum &d) const
3{
4
5{% for parameterDef in parameters.parameterDefs %}
6   def<double_t>(d, "{{parameterDef.name}}", {{parameterDef.name}});
7{% endfor %}   
8
9{% for defaultDef in parameters.defaultDefs %}
10   def<double_t>(d, "{{defaultDef.name}}", {{defaultDef.name}});
11{% endfor %}   
12   
13}
14
15void {{modelName}}::Parameters_::set (const DictionaryDatum &d)
16{
17
18{% for parameterDef in parameters.parameterDefs %}
19   updateValue<double_t>(d, "{{parameterDef.name}}", {{parameterDef.name}});
20
21{% if parameterDef.scale %}
22   {{parameterDef.name}} = {{parameterDef.scale}} * {{parameterDef.name}};
23
24{% endif %}   
25{% endfor %}   
26
27
28{% for defaultDef in parameters.defaultDefs %}
29   updateValue<double_t>(d, "{{defaultDef.name}}", {{defaultDef.name}});
30
31{% if defaultDef.scale %}
32   {{defaultDef.name}} = {{defaultDef.scale}} * {{defaultDef.name}};
33
34{% endif %}   
35{% endfor %}   
36
37
38{% for eq in defaultEqDefs %}
39   {{eq}}
40
41{% endfor %}   
42
43}
44
45
46void {{modelName}}::State_::get (DictionaryDatum &d) const
47{
48
49{% for stateDef in stateDefs %}
50   def<double_t>(d, "{{stateDef.name}}", y_[{{attr(stateIndexMap,stateDef.name)}}]);
51
52{% endfor %}   
53   
54{% if hasattr(stateIndexMap,"v") %}
55   def<double_t>(d, names::V_m, y_[{{attr(stateIndexMap,"v")}}]);
56
57{% endif %}   
58   
59}
60   
61void {{modelName}}::State_::set (const DictionaryDatum &d, const Parameters_&)
62{
63
64{% for stateDef in stateDefs %}
65   updateValue<double_t>(d, "{{stateDef.name}}", y_[{{attr(stateIndexMap,stateDef.name)}}]);
66
67{% if stateDef.scale %}
68   {{stateDef.name}} = {{stateDef.scale}} * {{stateDef.name}};
69
70{% endif %}   
71{% endfor %}   
72
73{% if hasattr(stateIndexMap,"v") %}
74   updateValue<double_t>(d, names::V_m, y_[{{attr(stateIndexMap,name)}}]);
75
76{% endif %}   
77   
78}
Note: See TracBrowser for help on using the repository browser.