--- a/svghmi/gen_index_xhtml.xslt Wed Jan 15 09:35:29 2020 +0100
+++ b/svghmi/gen_index_xhtml.xslt Wed Jan 15 11:13:39 2020 +0100
@@ -614,7 +614,7 @@
<xsl:text> dispatch: function(value) {
- <xsl:text> console.log("Heartbeat" + value);
+ <xsl:text> // console.log("Heartbeat" + value); <xsl:text> change_hmi_value(this.indexes[0], "+1");
--- a/svghmi/svghmi.c Wed Jan 15 09:35:29 2020 +0100
+++ b/svghmi/svghmi.c Wed Jan 15 11:13:39 2020 +0100
@@ -300,6 +300,7 @@
void *visible_value_p = UnpackVar(dsc, &real_value_p, &flags);
void *dst_p = &rbuf[dsc->buf_index];
uint32_t sz = __get_type_enum_size(dsc->type);
+#warning TODO: size of string in recv --- a/svghmi/svghmi.py Wed Jan 15 09:35:29 2020 +0100
+++ b/svghmi/svghmi.py Wed Jan 15 11:13:39 2020 +0100
@@ -211,20 +211,15 @@
- # find heartbeat in hmi tree
- # it is supposed to come first, but some HMI_* intances
- # in config's globals might shift them
hearbeat_IEC_path = ['CONFIG', 'HEARTBEAT']
for node in hmi_tree_root.traverse():
- if node.path == hearbeat_IEC_path:
+ if not found_heartbeat and node.path == hearbeat_IEC_path: hmi_tree_hearbeat_index = item_count
extern_variables_declarations += [
"#define heartbeat_index "+str(hmi_tree_hearbeat_index)
- for node in hmi_tree_root.traverse():
if hasattr(node, "iectype") and node.nodetype != "HMI_NODE":
sz = DebugTypesSize.get(node.iectype, 0)
@@ -243,12 +238,12 @@
"extern __IEC_" + node.iectype + "_" +
"t" if node.vartype is "VAR" else "p"
# TODO : filter only requiered external declarations
- if v["C_path"].find('.') < 0 : # and v["vartype"] == "FB" :
+ if v["C_path"].find('.') < 0: extern_variables_declarations += [
"extern %(type)s %(C_path)s;" % v]
@@ -504,34 +499,34 @@
res += ((target_fname, open(target_path, "rb")),)
for thing in ["Start", "Stop", "Watchdog"]:
given_command = self.GetParamsAttributes("SVGHMI.On"+thing)["value"]
- repr(shlex.split(given_command.format(port="8008", name=view_name))) +
+ repr(shlex.split(given_command.format(port="8008", name=view_name))) + ")") if given_command else "# no command given"
runtimefile_path = os.path.join(buildpath, "runtime_svghmi1_%s.py" % location_str)
runtimefile = open(runtimefile_path, 'w')
+ {svghmi_cmds[Watchdog]} def _runtime_svghmi1_{location}_start():
svghmi_root.putChild('{view_name}',File('{xhtml}', defaultType='application/xhtml+xml'))
def _runtime_svghmi1_{location}_stop():
svghmi_root.delEntity('{view_name}')
""".format(location=location_str,
- svghmi_cmds=type("dicobj",(object,),svghmi_cmds)))
+ svghmi_cmds=svghmi_cmds))