svghmi/svghmi.py
branchsvghmi
changeset 2767 302347f48193
parent 2765 887aba5ef178
child 2768 31785529a657
equal deleted inserted replaced
2766:3f3b1b8ccba4 2767:302347f48193
    19 from docutil import open_svg, get_inkscape_path
    19 from docutil import open_svg, get_inkscape_path
    20 from lxml import etree
    20 from lxml import etree
    21 
    21 
    22 from util.ProcessLogger import ProcessLogger
    22 from util.ProcessLogger import ProcessLogger
    23 from runtime.typemapping import DebugTypesSize
    23 from runtime.typemapping import DebugTypesSize
       
    24 import targets
    24 
    25 
    25 HMI_TYPES_DESC = {
    26 HMI_TYPES_DESC = {
    26     "HMI_CLASS":{},
    27     "HMI_CLASS":{},
    27     "HMI_LABEL":{},
    28     "HMI_LABEL":{},
    28     "HMI_STRING":{},
    29     "HMI_STRING":{},
   204         svghmi_c_code = svghmi_c_file.read()
   205         svghmi_c_code = svghmi_c_file.read()
   205         svghmi_c_file.close()
   206         svghmi_c_file.close()
   206         svghmi_c_code = svghmi_c_code % { 
   207         svghmi_c_code = svghmi_c_code % { 
   207             "variable_decl_array": ",\n".join(variable_decl_array),
   208             "variable_decl_array": ",\n".join(variable_decl_array),
   208             "extern_variables_declarations": "\n".join(extern_variables_declarations),
   209             "extern_variables_declarations": "\n".join(extern_variables_declarations),
   209             "buffer_size": buf_index
   210             "buffer_size": buf_index,
       
   211             "var_access_code": targets.GetCode("var_access.c")
   210             }
   212             }
   211 
   213 
   212         gen_svghmi_c_path = os.path.join(buildpath, "svghmi.c")
   214         gen_svghmi_c_path = os.path.join(buildpath, "svghmi.c")
   213         gen_svghmi_c = open(gen_svghmi_c_path, 'w')
   215         gen_svghmi_c = open(gen_svghmi_c_path, 'w')
   214         gen_svghmi_c.write(svghmi_c_code)
   216         gen_svghmi_c.write(svghmi_c_code)