Skip to content
Snippets Groups Projects
Commit 7acf3a69 authored by GUIEU Sylvain's avatar GUIEU Sylvain
Browse files

Update to new template

parent a94b39ca
Branches main repath
No related tags found
No related merge requests found
{{~
Compose = true
ComposeMembers = {motor1: {
PyDevsimClass: 'motor.MotorDevsim',
PyClientClass: 'motor.MotorUaClient',
PyDevsimEngineClass:'motor.MotorDevsimEngine',
PyClientEngineClass:'motor.MotorClientEngine',
PyConfigClass:'motor.MotorDevsimConfig',
PyImport: 'from '+PyRootImport+'.'+'motor import motor',
SkipNamespace: true ,
ConfKey: 'cfg_motor1'
},
motor2: {
PyDevsimClass: 'motor.MotorDevsim',
PyClientClass: 'motor.MotorUaClient',
PyDevsimEngineClass:'motor.MotorDevsimEngine',
PyClientEngineClass:'motor.MotorClientEngine',
PyConfigClass:'motor.MotorDevsimConfig',
PyImport: '',
SkipNamespace: true,
ConfKey: 'cfg_motor2'
}
}
ComposeMembers = {
motor1: motor_member('cfg_motor1'),
motor2: motor_member('cfg_motor2')
}
include 'ma.sbn'
include 'motor_errors.sbn'
......
{{~
Compose = true
ComposeMembers = {motor: {
PyDevsimEngineClass:'motor.MotorEngine',
PyConfigClass:'motor.MotorDevsimConfig',
PyDevsimClass: 'motor.MotorDevsim',
PyClientClass: 'motor.MotorUaClient',
PyImport: 'from '+PyRootImport+'.'+'motor import motor',
SkipNamespace: true,
ConfKey: 'cfg_motor'
}
}
ComposeMembers = {motor: motor_member('cfg_motor')}
include 'motor_errors.sbn'
include 'ma.sbn'
......
......@@ -4,8 +4,9 @@ import os
import sys
PRG_PATH = "tmc2fcs_generator" # should be included in path
TPL_ROOT = "./tmc2fcs_templates/templates/per_component"
INC_ROOT = "./tmc2fcs_templates/includes"
TPL_SIM_ROOT = "../tmc2fcs_templates/templates/per_component"
TPL_CL_ROOT = "../tmc2fcs_templates/templates/clientwrapper/per_component/"
INC_ROOT = "../tmc2fcs_templates/includes"
cmd_args = {
"piezo": "-d Piezo -s ./piezo/piezo.scxml.xml -t ./piezo/Piezo.tmc -I ./piezo",
......@@ -20,13 +21,22 @@ cmd_args = {
}
if __name__ == "__main__":
output = sys.argv[1]
for device in sys.argv[2:]:
directive = sys.argv[1]
if directive == "sim":
TPL_ROOT = TPL_SIM_ROOT
elif directive == "client":
TPL_ROOT = TPL_CL_ROOT
else:
print(f"Error , unknown directive {directive}. Must be 'sim' or 'client'")
print("Usage: ./export.py DIRECTIVE OUTPUDIR DEVICE")
raise ValueError("Wrong directive")
output = sys.argv[2]
for device in sys.argv[3:]:
dev_args = cmd_args[device]
cmd = f"""{PRG_PATH} -o {output} -n fcfe --ProjName=framework --ProjPrefix=ifw --tpl={TPL_ROOT} -I {INC_ROOT} {dev_args} """
cmd = f"""{PRG_PATH} -o {output} -n fcfsim --ProjName=framework --ProjPrefix=ifw --tpl={TPL_ROOT} -I {INC_ROOT} {dev_args} """
print(cmd)
os.system(cmd)
{{~
DevsimConfig = [
SimConfig = [
]
......
{{~
DevsimConfig = [
SimConfig = [
{"Name":"initial_state", "CiiType":"boolean", "PyType":"bool", "Required":true},
{"Name":"warm_up", "CiiType":"double", "PyType":"float", "Required":true},
{"Name":"cool_down", "CiiType":"double", "PyType":"float", "Required":true},
......
{{~
DevsimConfig = [
SimConfig = [
{"Name": "velocity_error", "CiiType":"double","PyType":"float", "Required":true,
"Description": "Velocity Error in % (random in interval [-err; +err])"
},
......
{{~
DevsimConfig = [
SimConfig = [
{"Name":"initial_state", "CiiType":"boolean", "PyType":"bool", "Required":true}
]
EnumTexts['E_PIEZO_ERROR'] = {
......
{{~
DevsimConfig = [
SimConfig = [
{"Name":"initial_state", "CiiType":"boolean", "PyType":"bool", "Required":false}
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment