Commit b5c38ce4 authored by Chris Woodall's avatar Chris Woodall
Browse files

Removed generated time

and fixed eds file dictionary order
parent eb596527
Pipeline #5347 passed with stage
in 52 seconds
......@@ -4,7 +4,6 @@
* {% for description_line in objdict.description.split('\n') %}
* {{ description_line }}{% endfor %}
*
* Generated on {{ date }}
*/
#ifndef {{ objdict.prefix|upper }}{{ objdict.module_name|upper }}_H_
......
......@@ -12,7 +12,7 @@ from objdict_generate.datatypes import *
from objdict_generate.resources import get_resource, get_resource_string
from pykwalify.core import Core
from collections import OrderedDict
import yaml
import arrow
import jinja2
......@@ -30,13 +30,13 @@ def generate_eds_section(objdict):
for entry in objdict['indexes']:
if entry['subindex'] == 0:
section_name = "{:04x}".format(entry['index'])
eds_config[section_name] = {
"ObjectType": "0x07",
"DataType": DataTypes.get_code(entry['datatype']),
"ParameterName": entry['name'],
"AccessType": entry['access'].lower(),
"PDOMapping": 0,
}
eds_config[section_name] = OrderedDict([
("ObjectType", "0x07"),
("DataType", DataTypes.get_code(entry['datatype'])),
("ParameterName", entry['name']),
("AccessType", entry['access'].lower()),
("PDOMapping", 0),
])
if "default" in entry:
eds_config[section_name][
......@@ -51,28 +51,25 @@ def generate_eds_section(objdict):
base_entry].pop("DefaultValue", None)
section_name = "{:04x}sub0".format(entry['index'])
eds_config[section_name] = {
"ObjectType": "0x07",
"DataType": eds_config[base_entry]['DataType'],
"ParameterName": "NumberOfEntries",
"AccessType": eds_config[base_entry]['AccessType'].lower(),
"PDOMapping": 0,
"DefaultValue": default_value
}
eds_config[section_name] = OrderedDict([
("ObjectType", "0x07"),
("DataType", eds_config[base_entry]['DataType']),
("ParameterName", "NumberOfEntries"),
("AccessType", eds_config[base_entry]['AccessType'].lower()),
("PDOMapping", 0),
("DefaultValue", default_value)])
# generate the subN index
section_name = "{0:04x}sub{1:X}".format(
entry['index'], entry['subindex'])
eds_config[section_name] = {
"ObjectType": "0x07",
"DataType": DataTypes.get_code(entry['datatype']),
"ParameterName": entry['name'].split("_")[-1],
"AccessType": entry['access'].lower(),
"PDOMapping": 0,
}
eds_config[section_name] = OrderedDict([
("ObjectType", "0x07"),
("DataType", DataTypes.get_code(entry['datatype'])),
("ParameterName", entry['name'].split("_")[-1]),
("AccessType", entry['access'].lower()),
("PDOMapping", 0)])
if "default" in entry:
eds_config[section_name][
"DefaultValue"] = str(entry["default"])
eds_config[section_name]["DefaultValue"] = str(entry["default"])
return eds_config
......
#!/usr/bin/env python3
__version__ = "0.6.1"
__version__ = "0.7.0"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment