Commit e5705510 authored by Claes Sjofors's avatar Claes Sjofors

Merge branch 'master'

parents d79e489a 673feb15
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
exe : $(doc_dir)/sv_se/orm/pwr_basecomponentclasses_h.html \
$(doc_dir)/en_us/orm/pwr_basecomponentclasses_h.html \
$(doc_dir)/sv_se/orm/pwr_basecomponentclasses_hpp.html \
$(doc_dir)/en_us/orm/pwr_basecomponentclasses_hpp.html
$(doc_dir)/sv_se/orm/pwr_basecomponentclasses_h.html : $(inc_dir)/pwr_basecomponentclasses.h
@ echo "Generating html files for struct sv_se..."
@ $(co_convert) -c -d $(doc_dir)/sv_se/orm "$(source)"
$(doc_dir)/en_us/orm/pwr_basecomponentclasses_h.html : $(inc_dir)/pwr_basecomponentclasses.h
@ echo "Generating html files for struct en_us..."
@ $(co_convert) -c -d $(doc_dir)/en_us/orm "$(source)"
$(doc_dir)/sv_se/orm/pwr_basecomponentclasses_hpp.html : $(inc_dir)/pwr_basecomponentclasses.hpp
@ echo "Generating html files for struct sv_se..."
@ $(co_convert) -c -d $(doc_dir)/sv_se/orm "$(source)"
$(doc_dir)/en_us/orm/pwr_basecomponentclasses_hpp.html : $(inc_dir)/pwr_basecomponentclasses.hpp
@ echo "Generating html files for struct en_us..."
@ $(co_convert) -c -d $(doc_dir)/en_us/orm "$(source)"
This diff is collapsed.
...@@ -707,7 +707,6 @@ class GDraw { ...@@ -707,7 +707,6 @@ class GDraw {
class PlowCtx { class PlowCtx {
gdh: Gdh = null; gdh: Gdh = null;
debug = false;
nodraw = 0; nodraw = 0;
zoom_factor = 20.0; zoom_factor = 20.0;
base_zoom_factor = 20.0; base_zoom_factor = 20.0;
......
...@@ -95,7 +95,7 @@ class Ev { ...@@ -95,7 +95,7 @@ class Ev {
console.log("toolitem2", o.userdata.e.supObject.vid, console.log("toolitem2", o.userdata.e.supObject.vid,
o.userdata.e.supObject.oix); o.userdata.e.supObject.oix);
this.ctx.gdh.getObjectFromAref(o.userdata.e.supObject, this.ctx.gdh.getObjectFromAref(o.userdata.e.supObject,
GdhOp.GET_OP_SELF, this.open_navigator_cb, null); GdhOp.GET_OP_SELF).then(this.open_navigator_cb);
console.log("toolitem2 event"); console.log("toolitem2 event");
}); });
// Trace sup object // Trace sup object
...@@ -106,18 +106,16 @@ class Ev { ...@@ -106,18 +106,16 @@ class Ev {
if (o === null) { if (o === null) {
return; return;
} }
let newwindow = window.open("", "_blank");
this.ctx.gdh.getObjectFromAref(o.userdata.e.supObject, this.ctx.gdh.getObjectFromAref(o.userdata.e.supObject,
GdhOp.GET_OP_METHOD_PLC, this.open_plc_cb, newwindow); GdhOp.GET_OP_METHOD_PLC).then(this.open_plc_cb);
}); });
// Graph event name // Graph event name
document.getElementById("toolitem4") document.getElementById("toolitem4")
.addEventListener("click", function (event) { .addEventListener("click", function (event) {
let o = this.ctx.get_select(); let o = this.ctx.get_select();
if (o.userdata instanceof EvItemAlarm) { if (o.userdata instanceof EvItemAlarm) {
let newwindow = window.open("", "_blank");
this.ctx.gdh.getObjectFromName(o.userdata.e.eventName, this.ctx.gdh.getObjectFromName(o.userdata.e.eventName,
GdhOp.GET_OP_METHOD_GRAPH, this.open_graph_cb, newwindow); GdhOp.GET_OP_METHOD_GRAPH).then(this.open_graph_cb);
} }
}); });
// Object raph event name // Object raph event name
...@@ -125,9 +123,8 @@ class Ev { ...@@ -125,9 +123,8 @@ class Ev {
.addEventListener("click", function (event) { .addEventListener("click", function (event) {
let o = this.ctx.get_select(); let o = this.ctx.get_select();
if (o.userdata instanceof EvItemAlarm) { if (o.userdata instanceof EvItemAlarm) {
let newwindow = window.open("", "_blank");
this.ctx.gdh.getObjectFromName(o.userdata.e.eventName, this.ctx.gdh.getObjectFromName(o.userdata.e.eventName,
GdhOp.GET_OP_METHOD_OBJECTGRAPH, this.open_graph_cb, newwindow); GdhOp.GET_OP_METHOD_OBJECTGRAPH).then(this.open_graph_cb);
} }
}); });
// Navigator event name // Navigator event name
...@@ -147,9 +144,8 @@ class Ev { ...@@ -147,9 +144,8 @@ class Ev {
if (o === null) { if (o === null) {
return; return;
} }
let newwindow = window.open("", "_blank");
this.ctx.gdh.getObjectFromName(o.userdata.e.eventName, this.ctx.gdh.getObjectFromName(o.userdata.e.eventName,
GdhOp.GET_OP_METHOD_PLC, this.open_plc_cb, newwindow); GdhOp.GET_OP_METHOD_PLC).then(this.open_plc_cb);
console.log("toolitem7 event"); console.log("toolitem7 event");
}); });
// History event name // History event name
...@@ -175,7 +171,7 @@ class Ev { ...@@ -175,7 +171,7 @@ class Ev {
if (o === null) { if (o === null) {
return; return;
} }
this.ctx.gdh.crrSignal(o.userdata.e.eventName, this.open_crr_cb, o); this.ctx.gdh.crrSignal(o.userdata.e.eventName).then(this.open_crr_cb(o));
console.log("toolitem10 event"); console.log("toolitem10 event");
}); });
// Help event name // Help event name
...@@ -192,12 +188,10 @@ class Ev { ...@@ -192,12 +188,10 @@ class Ev {
return; return;
} }
if (o.userdata instanceof EvItemAlarm) { if (o.userdata instanceof EvItemAlarm) {
let newwindow = window.open("", "_blank");
this.ctx.gdh.getObjectFromName(o.userdata.e.eventName, this.ctx.gdh.getObjectFromName(o.userdata.e.eventName,
GdhOp.GET_OP_METHOD_HELPCLASS, this.open_helpclass_cb, newwindow); GdhOp.GET_OP_METHOD_HELPCLASS).then(this.open_helpclass_cb);
} }
}); });
} }
is_authorized(access) { is_authorized(access) {
...@@ -206,25 +200,26 @@ class Ev { ...@@ -206,25 +200,26 @@ class Ev {
gdh_init_cb() { gdh_init_cb() {
if (!this.priv) { if (!this.priv) {
this.ctx.gdh.login("", "", this.login_cb, this); this.ctx.gdh.login("", "").then(this.login_cb);
} }
//this.ctx.gdh.mhSync( this.mhSyncIdx, this.sync_cb, this); //this.ctx.gdh.mhSync(this.mhSyncIdx).then(this.sync_cb);
this.ctx.gdh.listSent = true; this.ctx.gdh.listSent = true;
this.trace_cyclic(); this.trace_cyclic();
} }
login_cb(id, data, sts, result) { login_cb(res) {
console.log("Login:", sts, result); console.log("Login:", res.sts, res.value);
this.priv = (sts & 1) ? result : 0; this.priv = (res.sts & 1) ? res.value : 0;
} }
sync_cb(id, data, sts, result) { sync_cb(res) {
if (!(sts & 1)) { if (!(res.sts & 1)) {
return; return;
} }
let result = res.value;
if (result.length === 0) { if (result.length === 0) {
return; return;
} }
...@@ -326,7 +321,7 @@ class Ev { ...@@ -326,7 +321,7 @@ class Ev {
let item = node.get_userdata(); let item = node.get_userdata();
console.log("Ack", item.e.eventText); console.log("Ack", item.e.eventText);
this.ctx.gdh.mhAcknowledge(item.e.eventId, this.ack_cb, this); this.ctx.gdh.mhAcknowledge(item.e.eventId).then(this.ack_cb);
if (item.e.eventStatus & EventStatus.NotRet) { if (item.e.eventStatus & EventStatus.NotRet) {
item.e.eventStatus &= ~EventStatus.NotAck; item.e.eventStatus &= ~EventStatus.NotAck;
...@@ -338,24 +333,28 @@ class Ev { ...@@ -338,24 +333,28 @@ class Ev {
this.ctx.draw(); this.ctx.draw();
} }
ack_cb(id, data, sts) { ack_cb(res) {
console.log("ack sts", sts); console.log("ack sts", res.sts);
} }
open_objectgraph_cb(id, data, sts, result) { open_objectgraph_cb(res) {
if ((sts & 1) === 0) { let w = window.open("", "_blank");
data.document.write("Error status " + sts); if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else { } else {
data.location.href = let result = res.value;
w.location.href =
"ge.html?graph=" + result.param1 + "&instance=" + result.fullname; "ge.html?graph=" + result.param1 + "&instance=" + result.fullname;
data.document.title = result.fullname; w.document.title = result.fullname;
} }
} }
open_graph_cb(id, data, sts, result) { open_graph_cb(res) {
if ((sts & 1) === 0) { let w = window.open("", "_blank");
data.document.write("Error status " + sts); if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else { } else {
let result = res.value;
let idx = result.param1.indexOf('.'); let idx = result.param1.indexOf('.');
if (idx !== -1) { if (idx !== -1) {
result.param1 = result.param1.substring(0, idx); result.param1 = result.param1.substring(0, idx);
...@@ -366,62 +365,61 @@ class Ev { ...@@ -366,62 +365,61 @@ class Ev {
instancestr = "&instance=" + result.fullname; instancestr = "&instance=" + result.fullname;
} }
data.location.href = "ge.html?graph=" + result.param1 + instancestr; w.location.href = "ge.html?graph=" + result.param1 + instancestr;
data.document.title = result.param1; w.document.title = result.param1;
} }
} }
open_plc_cb(id, data, sts, result) { open_plc_cb(res) {
if ((sts & 1) === 0) { let w = window.open("", "_blank");
data.document.write("Error status " + sts); if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else { } else {
let param1; let result = res.value;
if (result.param1 === "") { let param1 = result.param1 ? ("&obj=" + result.param1) : "";
param1 = "";
} else {
param1 = "&obj=" + result.param1;
}
console.log("flow.html?vid=" + result.objid.vid + "&oix=" + console.log("flow.html?vid=" + result.objid.vid + "&oix=" +
result.objid.oix + param1); result.objid.oix + param1);
data.location.href = w.location.href =
"flow.html?vid=" + result.objid.vid + "&oix=" + result.objid.oix + "flow.html?vid=" + result.objid.vid + "&oix=" + result.objid.oix +
param1; param1;
data.document.title = "Trace " + result.fullname; w.document.title = "Trace " + result.fullname;
} }
} }
open_navigator_cb(id, data, sts, result) { open_navigator_cb(res) {
console.log("Open navigator", sts); console.log("Open navigator", res.sts);
if ((sts & 1) === 0) { if ((res.sts & 1) === 0) {
console.log("Error status " + sts); console.log("Error status " + res.sts);
} else { } else {
localStorage.setItem("XttMethodNavigator", result.fullname); localStorage.setItem("XttMethodNavigator", res.value.fullname);
console.log("storage", localStorage.getItem("XttMethodNavigator")); console.log("storage", localStorage.getItem("XttMethodNavigator"));
} }
} }
open_objectgraph_cb(id, data, sts, result) { open_objectgraph_cb(res) {
if ((sts & 1) === 0) { let w = window.open("", "_blank");
data.document.write("Error status " + sts); if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else { } else {
let classname = result.classname.toLowerCase(); let classname = res.value.classname.toLowerCase();
if (classname.substring(0, 1) === "$") { if (classname.substring(0, 1) === "$") {
classname = classname.substring(1); classname = classname.substring(1);
} }
let graphname = "pwr_c_" + classname; let graphname = "pwr_c_" + classname;
data.location.href = w.location.href =
"ge.html?graph=" + graphname + "&instance=" + result.fullname; "ge.html?graph=" + graphname + "&instance=" + res.value.fullname;
data.document.title = graphname + " " + result.fullname; w.document.title = graphname + " " + res.value.fullname;
} }
} }
open_helpclass_cb(id, data, sts, result) { open_helpclass_cb(res) {
if ((sts & 1) === 0) { let w = window.open("", "_blank");
data.document.write("Error status " + sts); if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else { } else {
console.log("open_helpclass", result.param1); console.log("open_helpclass", res.value.param1);
data.location.href = w.location.href =
location.protocol + "//" + location.host + result.param1; location.protocol + "//" + location.host + res.value.param1;
} }
} }
...@@ -442,12 +440,12 @@ class Ev { ...@@ -442,12 +440,12 @@ class Ev {
} }
trace_cyclic() { trace_cyclic() {
this.ctx.gdh.mhSync(this.mhSyncIdx, this.sync_cb, this); this.ctx.gdh.mhSync(this.mhSyncIdx).then(this.sync_cb);
this.timer = setTimeout(this.trace_cyclic, 1000); this.timer = setTimeout(this.trace_cyclic, 1000);
} }
trace_scan(id, sts) { trace_scan(res) {
this.scan_update = false; this.scan_update = false;
if (this.scan_update) { if (this.scan_update) {
this.ctx.draw(); this.ctx.draw();
...@@ -581,17 +579,13 @@ class Ev { ...@@ -581,17 +579,13 @@ class Ev {
case Event.Key_CtrlL: case Event.Key_CtrlL:
let o = this.ctx.get_select(); let o = this.ctx.get_select();
if (o.userdata instanceof EvItemAlarm) { if (o.userdata instanceof EvItemAlarm) {
let newwindow = window.open("", "_blank"); this.ctx.gdh.getObject(o.userdata.objid, GdhOp.GET_OP_METHOD_PLC).then(this.open_plc_cb);
this.ctx.gdh.getObject(o.userdata.objid, GdhOp.GET_OP_METHOD_PLC,
this.open_plc_cb, newwindow);
} }
break; break;
case Event.Key_CtrlG: case Event.Key_CtrlG:
let o = this.ctx.get_select(); let o = this.ctx.get_select();
if (o.userdata instanceof EvItemAlarm) { if (o.userdata instanceof EvItemAlarm) {
let newwindow = window.open("", "_blank"); this.ctx.gdh.getObject(o.userdata.objid, GdhOp.GET_OP_METHOD_PLC).then(this.open_objectgraph_cb);
this.ctx.gdh.getObject(o.userdata.objid, GdhOp.GET_OP_METHOD_PLC,
this.open_objectgraph_cb, newwindow);
} }
break; break;
default: default:
......
...@@ -1551,7 +1551,6 @@ class FlowCtx extends Rect { ...@@ -1551,7 +1551,6 @@ class FlowCtx extends Rect {
gdraw: GDraw; gdraw: GDraw;
display_level = DisplayLevel.One; display_level = DisplayLevel.One;
gdh: Gdh = null; gdh: Gdh = null;
debug = false;
zoom_factor = 20.0; zoom_factor = 20.0;
base_zoom_factor = 20.0; base_zoom_factor = 20.0;
offset_x = 0; offset_x = 0;
...@@ -1776,10 +1775,8 @@ class FlowFrame { ...@@ -1776,10 +1775,8 @@ class FlowFrame {
} }
flow_open() { flow_open() {
console.log("flow_open");
console.log("ctx.gdh", this.ctx.gdh);
this.ctx.connect(); this.ctx.connect();
this.ctx.gdh.refObjectInfoList(this.ctx.gdh.refObjectInfoListReply); this.ctx.gdh.refObjectInfoList();
this.timer = setTimeout(this.flow_cyclic, 1000); this.timer = setTimeout(this.flow_cyclic, 1000);
} }
...@@ -1794,7 +1791,6 @@ class FlowFrame { ...@@ -1794,7 +1791,6 @@ class FlowFrame {
} }
flow_close() { flow_close() {
console.log("Close function", this.timer);
clearTimeout(this.timer); clearTimeout(this.timer);
for (let i in this.ctx.gdh.pending) { for (let i in this.ctx.gdh.pending) {
delete this.ctx.gdh.pending[i]; delete this.ctx.gdh.pending[i];
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<script type="text/babel" src="glow_annot.ts"></script> <script type="text/babel" src="glow_annot.ts"></script>
<script type="text/babel" src="glow_arc.ts"></script> <script type="text/babel" src="glow_arc.ts"></script>
<script type="text/babel" src="glow_array.ts"></script> <script type="text/babel" src="glow_array.ts"></script>
<script type="text/babel" src="glow_arrow.ts"></script>
<script type="text/babel" src="glow_cformat.ts"></script> <script type="text/babel" src="glow_cformat.ts"></script>
<script type="text/babel" src="glow_con.ts"></script> <script type="text/babel" src="glow_con.ts"></script>
<script type="text/babel" src="glow_conclass.ts"></script> <script type="text/babel" src="glow_conclass.ts"></script>
......
...@@ -74,10 +74,8 @@ class Appl { ...@@ -74,10 +74,8 @@ class Appl {
} }
if (classGraph) { if (classGraph) {
console.log("Cmd classGraph"); console.log("Cmd classGraph");
let newwindow = window.open("", "_blank");
this.graph.gdh.getObjectFromName(instanceValue, this.graph.gdh.getObjectFromName(instanceValue,
GdhOp.GET_OP_METHOD_OBJECTGRAPH, this.open_objectgraph_cb, GdhOp.GET_OP_METHOD_OBJECTGRAPH).then(this.open_objectgraph_cb);
newwindow);
} else { } else {
let graphName = cli.getQualValue("cli_arg2").toLowerCase(); let graphName = cli.getQualValue("cli_arg2").toLowerCase();
if (!graphName) { if (!graphName) {
...@@ -86,7 +84,7 @@ class Appl { ...@@ -86,7 +84,7 @@ class Appl {
} }
graphName = graphName.toLowerCase(); graphName = graphName.toLowerCase();
if (graphName.charAt(".pwg") === -1) { if (!graphName.endsWith(".pwg")) {
graphName += ".pwg"; graphName += ".pwg";
} }
...@@ -266,14 +264,16 @@ class Appl { ...@@ -266,14 +264,16 @@ class Appl {
} }
} }
open_objectgraph_cb(id, data, sts, result) { open_objectgraph_cb(res) {
if ((sts & 1) === 0) { let w = window.open("", "_blank");
data.document.write("Error status " + sts); if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else { } else {
let result = res.value;
console.log("param1", result.param1); console.log("param1", result.param1);
data.location.href = w.location.href =
"ge.html?graph=" + result.param1 + "&instance=" + result.fullname; "ge.html?graph=" + result.param1 + "&instance=" + result.fullname;
data.document.title = result.param1 + " " + result.fullname; w.document.title = result.param1 + " " + result.fullname;
} }
} }
} }
......
This diff is collapsed.
...@@ -75,7 +75,7 @@ class GraphLocalDb { ...@@ -75,7 +75,7 @@ class GraphLocalDb {
let typeId = this.getTypeId(attributeName); let typeId = this.getTypeId(attributeName);
let name = this.getName(attributeName); let name = this.getName(attributeName);
if (typeId === 0) { if (typeId === 0) {
return i; return 0;
} }
let id = this.nameToId(owner, name); let id = this.nameToId(owner, name);
...@@ -212,7 +212,7 @@ class Graph { ...@@ -212,7 +212,7 @@ class Graph {
constructor(appl) { constructor(appl) {
this.appl = appl; this.appl = appl;
if (typeof InstallTrigger !== 'undefined') { if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
// Firefox is not os fast... // Firefox is not os fast...
this.scan_time = 1; this.scan_time = 1;
this.fast_scan_time = 1; this.fast_scan_time = 1;
...@@ -249,31 +249,27 @@ class Graph { ...@@ -249,31 +249,27 @@ class Graph {
gdh_init_cb() { gdh_init_cb() {
if (this.priv === null) { if (this.priv === null) {
this.gdh.login("", "", this.login_cb, this); this.gdh.login("", "").then(this.login_cb);
} }
this.ctx.traceConnect(); this.ctx.traceConnect();
this.gdh.refObjectInfoList(this.trace_connected); this.gdh.refObjectInfoList().then(e => this.trace_cyclic());
} }
login_cb(id, data, sts, result) { login_cb(res) {
console.log("Login:", sts, result); console.log("Login:", res.sts, res.value);
this.priv = (sts & 1) ? result : 0; this.priv = (res.sts & 1) ? res.value : 0;
}
trace_connected(id, sts) {
this.trace_cyclic();
} }
trace_cyclic() { trace_cyclic() {
if (this.frame.nogdh) { if (this.frame.nogdh) {
this.trace_scan(0, 0); this.trace_scan();
} else { } else {
this.gdh.getRefObjectInfoAll(this.trace_scan); this.gdh.getRefObjectInfoAll(this.trace_scan);
} }
} }
trace_scan(id, sts) { trace_scan() {
this.scan_time = this.ctx.scantime; this.scan_time = this.ctx.scantime;
this.fast_scan_time = this.ctx.fast_scantime; this.fast_scan_time = this.ctx.fast_scantime;
this.animation_scan_time = this.ctx.animation_scantime; this.animation_scan_time = this.ctx.animation_scantime;
...@@ -306,9 +302,6 @@ class Graph { ...@@ -306,9 +302,6 @@ class Graph {
return ret; return ret;
} }
let dyn = new Dyn(this); let dyn = new Dyn(this);
if (type !== UserdataCbType.NodeClass) {
dyn.userdata = this;
}
ret.userdata = dyn; ret.userdata = dyn;
ret.row = dyn.open(lines, row); ret.row = dyn.open(lines, row);
} }
...@@ -354,7 +347,6 @@ class Graph { ...@@ -354,7 +347,6 @@ class Graph {
case Event.MB1Down: case Event.MB1Down:
case Event.MB1DoubleClick: case Event.MB1DoubleClick:
case Event.MB3Press: case Event.MB3Press:
case Event.ValueChanged:
case Event.SliderMoveStart: case Event.SliderMoveStart:
case Event.SliderMoveEnd: case Event.SliderMoveEnd:
case Event.SliderMoved: case Event.SliderMoved:
...@@ -712,6 +704,18 @@ class Graph { ...@@ -712,6 +704,18 @@ class Graph {
return Math.min(this.scan_time, this.animation_scan_time); return Math.min(this.scan_time, this.animation_scan_time);
} }
setScanTime(scan_time) {
this.scan_time = scan_time;
}
setFastScanTime(fast_scan_time) {
this.fast_scan_time = fast_scan_time;
}
setAnimationScanTime(animation_scan_time) {
this.animation_scan_time = animation_scan_time;
}
command(cmd) { command(cmd) {
if (this.appl) { if (this.appl) {
return this.appl.command(cmd); return this.appl.command(cmd);
...@@ -754,4 +758,9 @@ class Graph { ...@@ -754,4 +758,9 @@ class Graph {
loadCtx(file, read_cb) { loadCtx(file, read_cb) {
return this.frame.readGrowWindow(file, read_cb); return this.frame.readGrowWindow(file, read_cb);
} }
getReferenceName(name) {
// TODO
return null;
}
} }
\ No newline at end of file
...@@ -1653,20 +1653,93 @@ enum EventType { ...@@ -1653,20 +1653,93 @@ enum EventType {
} }
enum Event { enum Event {
Null,
MB1Click, MB1Click,
MB1Up = 2,
MB1Down,
MB1DoubleClick, MB1DoubleClick,
CursorMotion, MB1Press,
MB2Click,
MB2DoubleClick,
MB2Press,
MB1ClickShift,
MB1DoubleClickShift,
MB1PressShift,
MB2ClickShift,
MB2DoubleClickShift,
MB2PressShift,
MB1ClickCtrl,
MB1DoubleClickCtrl,
MB1PressCtrl,
MB2ClickCtrl,
MB2DoubleClickCtrl,
MB2PressCtrl,
MB1ClickShiftCtrl,
MB1DoubleClickShiftCtrl,
MB1PressShiftCtrl,
MB2ClickShiftCtrl,
MB2DoubleClickShiftCtrl,
MB2PressShiftCtrl,
MB3Click,
MB3Press,
ButtonRelease,
ButtonMotion, ButtonMotion,
ValueChanged, Exposure,
MenuCreate, Enter,
MenuActivated, Leave,
MenuDelete, CursorMotion,
Init,
PasteSequenceStart,
PasteSequenceEnd,
VisibilityUnobscured,
VisibilityObscured,
SelectClear,
ObjectMoved,
ObjectDeleted,
AnnotationInput,
Radiobutton,
Key_Return,
Key_Up,
Key_Down,
Key_Right,
Key_Left,
Key_PageUp,
Key_PageDown,
Key_BackSpace,
Key_PF1,
Key_PF2,
Key_PF3,
Key_PF4,
CreateGrowObject,
GrowDynamics,
SliderMoveStart, SliderMoveStart,
SliderMoved,
SliderMoveEnd, SliderMoveEnd,
MB3Press, SliderMoved,
HotRequest,
MB1Down,
MB1Up,
MB2Down,
MB2Up,
MB3Down,
MB3Up,
Key_Tab,
Map,
Unmap,
Resized,
Translate,
TipText,
Key_Ascii,
InputFocusLost,
InputFocusGained,
InputFocusInit,
Key_CtrlAscii,
Key_ShiftTab,
Key_Escape,
MenuActivated,
MenuCreate,
MenuDelete,
ScrollUp,
ScrollDown,
AnteUndo,
PostUndo,
Signal Signal
} }
......
class GlowArrow {
ctx: GrowCtx;
p_dest: GlowPoint;
p1: GlowPoint;
p2: GlowPoint;
arrow_width: Number;
arrow_length: Number;
draw_type: DrawType;
line_width: Number;
constructor(ctx) {
this.ctx = ctx;
this.p_dest = new GlowPoint();
this.p1 = new GlowPoint();
this.p2 = new GlowPoint();
}
open(lines, row) {
let i;
for (i = row; i < lines.length; i++) {
let tokens = lines[i].split(' ');
let key = parseInt(tokens[0], 10);
switch (key) {
case GlowSave.Arrow:
break;
case GlowSave.Arrow_arrow_width:
this.arrow_width = Number(tokens[1]);
break;
case GlowSave.Arrow_arrow_length:
this.arrow_length = Number(tokens[1]);
break;
case GlowSave.Arrow_draw_type:
this.draw_type = DrawType(tokens[1]);
break;
case GlowSave.Arrow_line_width:
this.line_width = parseInt(tokens[1], 10);
break;
case GlowSave.Arrow_p_dest:
i = this.p_dest.open(lines, i + 1);
break;
case GlowSave.Arrow_p1:
i = this.p1.open(lines, i + 1);
break;
case GlowSave.Arrow_p2:
i = this.p2.open(lines, i + 1);
break;
case GlowSave.End:
return i;
default:
console.log("Syntax error in GlowArrow");
break;
}
}
return i;
}
}
\ No newline at end of file
...@@ -329,7 +329,6 @@ class GlowColor { ...@@ -329,7 +329,6 @@ class GlowColor {
} }
class GlowCustomColors { class GlowCustomColors {
debug = false;
colors_size = DrawType.CustomColor__ - DrawType.CustomColor1; colors_size = DrawType.CustomColor__ - DrawType.CustomColor1;
colors = new Array(this.colors_size); colors = new Array(this.colors_size);
colortheme_lightness = 0; colortheme_lightness = 0;
...@@ -380,10 +379,6 @@ class GlowCustomColors { ...@@ -380,10 +379,6 @@ class GlowCustomColors {
this.colors[j][0] = parseFloat(tokens[0]); this.colors[j][0] = parseFloat(tokens[0]);
this.colors[j][1] = parseFloat(tokens[1]); this.colors[j][1] = parseFloat(tokens[1]);
this.colors[j][2] = parseFloat(tokens[2]); this.colors[j][2] = parseFloat(tokens[2]);
if (this.debug) {
console.log(j, this.colors[j][0], this.colors[j][1],
this.colors[j][2]);
}
} }
break; break;
case GlowSave.End: case GlowSave.End:
......
...@@ -13,7 +13,6 @@ class GrowCtxWindow { ...@@ -13,7 +13,6 @@ class GrowCtxWindow {
class GrowCtx extends Rect { class GrowCtx extends Rect {
appl = null; appl = null;
debug = false;
antiAliasing = 0; antiAliasing = 0;
name = null; name = null;
version = 0; version = 0;
...@@ -110,10 +109,6 @@ class GrowCtx extends Rect { ...@@ -110,10 +109,6 @@ class GrowCtx extends Rect {
let tokens = lines[i].split(' '); let tokens = lines[i].split(' ');
let key = parseInt(tokens[0], 10); let key = parseInt(tokens[0], 10);
if (this.debug) {
console.log("ctx : " + lines[i]);
}
switch (key) { switch (key) {
case GlowSave.Ctx: case GlowSave.Ctx:
break; break;
......
...@@ -470,10 +470,6 @@ class GrowTrend extends GrowRect { ...@@ -470,10 +470,6 @@ class GrowTrend extends GrowRect {
return null; return null;
} }
getClassUserData() {
return this.nc.userdata;
}
getUserData() { getUserData() {
return this.userdata; return this.userdata;
} }
......
...@@ -32,8 +32,8 @@ class OpWindMenu { ...@@ -32,8 +32,8 @@ class OpWindMenu {
gdh_init_cb() { gdh_init_cb() {
let oid = new PwrtObjid(0, 0); let oid = new PwrtObjid(0, 0);
this.user = "Default"; this.user = "Default";
this.gdh.login("", "", this.login_cb, this); this.gdh.login("", "").then(this.login_cb);
this.gdh.getOpwindMenu(this.get_opplace(), this.get_menu_cb, 999); this.gdh.getOpwindMenu(this.get_opplace()).then(this.get_menu_cb);
} }
add_menu_button(context, text) { add_menu_button(context, text) {
...@@ -49,9 +49,9 @@ class OpWindMenu { ...@@ -49,9 +49,9 @@ class OpWindMenu {
return button; return button;
} }
get_menu_cb(id, data, sts, result) { get_menu_cb(res) {
let result = res.value;
this.info = result; this.info = result;
console.log("Menu received", sts, data, result.buttons.length);
let context = document.getElementById("opwindmenu"); let context = document.getElementById("opwindmenu");
document.getElementById("opwind_title").innerHTML = result.title; document.getElementById("opwind_title").innerHTML = result.title;
...@@ -89,7 +89,7 @@ class OpWindMenu { ...@@ -89,7 +89,7 @@ class OpWindMenu {
passwd = c.crypt("aa", passwd); passwd = c.crypt("aa", passwd);
this.user = user; this.user = user;
this.gdh.login(user, passwd, this.login_cb, this); this.gdh.login(user, passwd).then(this.login_cb);
}); });
document.getElementById("cancel_button") document.getElementById("cancel_button")
.addEventListener("click", function (event) { .addEventListener("click", function (event) {
...@@ -102,7 +102,7 @@ class OpWindMenu { ...@@ -102,7 +102,7 @@ class OpWindMenu {
document.getElementById("login_frame").style.height = '0px'; document.getElementById("login_frame").style.height = '0px';
this.priv = 0; this.priv = 0;
this.user = "Default"; this.user = "Default";
this.gdh.login("", "", this.login_cb, this); this.gdh.login("", "").then(this.login_cb);
}); });
document.getElementById("login_user").innerHTML = ""; document.getElementById("login_user").innerHTML = "";
...@@ -200,10 +200,9 @@ class OpWindMenu { ...@@ -200,10 +200,9 @@ class OpWindMenu {
} }
} }
login_cb(id, data, sts, result) { login_cb(res) {
console.log("Login:", sts, result); if (res.sts & 1) {
if (sts & 1) { this.priv = res.value;
this.priv = result;
sessionStorage.setItem("pwr_privilege", String(this.priv)); sessionStorage.setItem("pwr_privilege", String(this.priv));
if (this.user_text !== null) { if (this.user_text !== null) {
this.user_text.textContent = this.user + " on " + this.host; this.user_text.textContent = this.user + " on " + this.host;
......
This diff is collapsed.
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