diff --git a/projects/jfcontrols/src/jfcontrols/app/Main.java b/projects/jfcontrols/src/jfcontrols/app/Main.java index b7300bf70..ab6e92bca 100755 --- a/projects/jfcontrols/src/jfcontrols/app/Main.java +++ b/projects/jfcontrols/src/jfcontrols/app/Main.java @@ -87,6 +87,10 @@ public static void addMessage(String msg) { msgs += "\r\n"; } + public static void trace() { + try { throw new Exception(); } catch (Exception e) { JFLog.log(e); } + } + public static void serviceStart(String args[]) { main(args); } diff --git a/projects/jfcontrols/src/jfcontrols/logic/TIMER_OFF_DELAY.java b/projects/jfcontrols/src/jfcontrols/logic/TIMER_OFF_DELAY.java index 387ce4730..acb05efa9 100755 --- a/projects/jfcontrols/src/jfcontrols/logic/TIMER_OFF_DELAY.java +++ b/projects/jfcontrols/src/jfcontrols/logic/TIMER_OFF_DELAY.java @@ -19,7 +19,7 @@ public String getDesc() { } public String getCode(int[] types, boolean[] array, boolean[] unsigned) { - return "enabled = timer_off_delay(enabled, tags);"; + return "enabled = timer_off_delay(enabled, tags);\r\n"; } public int getTagsCount() { diff --git a/projects/jfcontrols/src/jfcontrols/logic/TIMER_ON_DELAY.java b/projects/jfcontrols/src/jfcontrols/logic/TIMER_ON_DELAY.java index 1de690b10..be51e99a1 100755 --- a/projects/jfcontrols/src/jfcontrols/logic/TIMER_ON_DELAY.java +++ b/projects/jfcontrols/src/jfcontrols/logic/TIMER_ON_DELAY.java @@ -19,7 +19,7 @@ public String getDesc() { } public String getCode(int[] types, boolean[] array, boolean[] unsigned) { - return "enabled = timer_on_delay(enabled, tags);"; + return "enabled = timer_on_delay(enabled, tags);\r\n"; } public int getTagsCount() { diff --git a/projects/jfcontrols/src/jfcontrols/panels/NodeRoot.java b/projects/jfcontrols/src/jfcontrols/panels/NodeRoot.java index e4ec46d26..f5d95218b 100755 --- a/projects/jfcontrols/src/jfcontrols/panels/NodeRoot.java +++ b/projects/jfcontrols/src/jfcontrols/panels/NodeRoot.java @@ -39,7 +39,7 @@ public String saveLogic(SQL sql) { sb.append('|'); break; case '#': - sql.execute("insert into blocks (fid,rid,bid,name,tags) values (" + fid + "," + rid + "," + bid + ",'" + node.blk.getName() + "'," + SQL.quote(node.getTags()) + ")"); + sql.execute("insert into jfc_blocks (fid,rid,bid,name,tags) values (" + fid + "," + rid + "," + bid + ",'" + node.blk.getName() + "'," + SQL.quote(node.getTags()) + ")"); sb.append(Integer.toString(bid)); bid++; sb.append('|'); diff --git a/projects/jfcontrols/src/jfcontrols/tags/LocalTag.java b/projects/jfcontrols/src/jfcontrols/tags/LocalTag.java index b8b5b6fa4..08de8c8c6 100755 --- a/projects/jfcontrols/src/jfcontrols/tags/LocalTag.java +++ b/projects/jfcontrols/src/jfcontrols/tags/LocalTag.java @@ -9,6 +9,8 @@ import javaforce.*; +import jfcontrols.app.*; + public class LocalTag extends MonitoredTag { private int tid; private Object arrayLock = new Object(); @@ -18,9 +20,12 @@ public class LocalTag extends MonitoredTag { private HashMap mids; private String memberComments[]; private String comment; + private String name; + private String udtname; public LocalTag(String name, int type, boolean unsigned, boolean array, SQL sql) { super(type, unsigned, array); + this.name = name; tid = Integer.valueOf(sql.select1value("select id from jfc_tags where cid=0 and name=" + SQL.quote(name))); comment = sql.select1value("select comment from jfc_tags where cid=0 and id=" + tid); if (udt) { @@ -31,6 +36,7 @@ public LocalTag(String name, int type, boolean unsigned, boolean array, SQL sql) mids.put(data[a][0], Integer.valueOf(data[a][1])); memberComments[a] = data[a][2]; } + udtname = sql.select1value("select name from jfc_udts where uid=" + type); } if (array || udt) { values = new HashMap<>(); @@ -78,9 +84,11 @@ private void readValue(TagValue tv) { } public String getValue() { - if (array || udt) { - JFLog.log("Error:LocalTag array:must call getIndex() or getMember()"); - return null; + if (array) { + return name + "[]"; + } + if (udt) { + return udtname; } return getValue(0, 0, 0); }