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 {
class PlowCtx {
gdh: Gdh = null;
debug = false;
nodraw = 0;
zoom_factor = 20.0;
base_zoom_factor = 20.0;
......
......@@ -95,7 +95,7 @@ class Ev {
console.log("toolitem2", o.userdata.e.supObject.vid,
o.userdata.e.supObject.oix);
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");
});
// Trace sup object
......@@ -106,18 +106,16 @@ class Ev {
if (o === null) {
return;
}
let newwindow = window.open("", "_blank");
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
document.getElementById("toolitem4")
.addEventListener("click", function (event) {
let o = this.ctx.get_select();
if (o.userdata instanceof EvItemAlarm) {
let newwindow = window.open("", "_blank");
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
......@@ -125,9 +123,8 @@ class Ev {
.addEventListener("click", function (event) {
let o = this.ctx.get_select();
if (o.userdata instanceof EvItemAlarm) {
let newwindow = window.open("", "_blank");
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
......@@ -147,9 +144,8 @@ class Ev {
if (o === null) {
return;
}
let newwindow = window.open("", "_blank");
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");
});
// History event name
......@@ -175,7 +171,7 @@ class Ev {
if (o === null) {
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");
});
// Help event name
......@@ -192,12 +188,10 @@ class Ev {
return;
}
if (o.userdata instanceof EvItemAlarm) {
let newwindow = window.open("", "_blank");
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) {
......@@ -206,25 +200,26 @@ class Ev {
gdh_init_cb() {
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.trace_cyclic();
}
login_cb(id, data, sts, result) {
console.log("Login:", sts, result);
this.priv = (sts & 1) ? result : 0;
login_cb(res) {
console.log("Login:", res.sts, res.value);
this.priv = (res.sts & 1) ? res.value : 0;
}
sync_cb(id, data, sts, result) {
if (!(sts & 1)) {
sync_cb(res) {
if (!(res.sts & 1)) {
return;
}
let result = res.value;
if (result.length === 0) {
return;
}
......@@ -326,7 +321,7 @@ class Ev {
let item = node.get_userdata();
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) {
item.e.eventStatus &= ~EventStatus.NotAck;
......@@ -338,24 +333,28 @@ class Ev {
this.ctx.draw();
}
ack_cb(id, data, sts) {
console.log("ack sts", sts);
ack_cb(res) {
console.log("ack sts", res.sts);
}
open_objectgraph_cb(id, data, sts, result) {
if ((sts & 1) === 0) {
data.document.write("Error status " + sts);
open_objectgraph_cb(res) {
let w = window.open("", "_blank");
if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else {
data.location.href =
let result = res.value;
w.location.href =
"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) {
if ((sts & 1) === 0) {
data.document.write("Error status " + sts);
open_graph_cb(res) {
let w = window.open("", "_blank");
if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else {
let result = res.value;
let idx = result.param1.indexOf('.');
if (idx !== -1) {
result.param1 = result.param1.substring(0, idx);
......@@ -366,62 +365,61 @@ class Ev {
instancestr = "&instance=" + result.fullname;
}
data.location.href = "ge.html?graph=" + result.param1 + instancestr;
data.document.title = result.param1;
w.location.href = "ge.html?graph=" + result.param1 + instancestr;
w.document.title = result.param1;
}
}
open_plc_cb(id, data, sts, result) {
if ((sts & 1) === 0) {
data.document.write("Error status " + sts);
open_plc_cb(res) {
let w = window.open("", "_blank");
if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else {
let param1;
if (result.param1 === "") {
param1 = "";
} else {
param1 = "&obj=" + result.param1;
}
let result = res.value;
let param1 = result.param1 ? ("&obj=" + result.param1) : "";
console.log("flow.html?vid=" + result.objid.vid + "&oix=" +
result.objid.oix + param1);
data.location.href =
w.location.href =
"flow.html?vid=" + result.objid.vid + "&oix=" + result.objid.oix +
param1;
data.document.title = "Trace " + result.fullname;
w.document.title = "Trace " + result.fullname;
}
}
open_navigator_cb(id, data, sts, result) {
console.log("Open navigator", sts);
if ((sts & 1) === 0) {
console.log("Error status " + sts);
open_navigator_cb(res) {
console.log("Open navigator", res.sts);
if ((res.sts & 1) === 0) {
console.log("Error status " + res.sts);
} else {
localStorage.setItem("XttMethodNavigator", result.fullname);
localStorage.setItem("XttMethodNavigator", res.value.fullname);
console.log("storage", localStorage.getItem("XttMethodNavigator"));
}
}
open_objectgraph_cb(id, data, sts, result) {
if ((sts & 1) === 0) {
data.document.write("Error status " + sts);
open_objectgraph_cb(res) {
let w = window.open("", "_blank");
if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else {
let classname = result.classname.toLowerCase();
let classname = res.value.classname.toLowerCase();
if (classname.substring(0, 1) === "$") {
classname = classname.substring(1);
}
let graphname = "pwr_c_" + classname;
data.location.href =
"ge.html?graph=" + graphname + "&instance=" + result.fullname;
data.document.title = graphname + " " + result.fullname;
w.location.href =
"ge.html?graph=" + graphname + "&instance=" + res.value.fullname;
w.document.title = graphname + " " + res.value.fullname;
}
}
open_helpclass_cb(id, data, sts, result) {
if ((sts & 1) === 0) {
data.document.write("Error status " + sts);
open_helpclass_cb(res) {
let w = window.open("", "_blank");
if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else {
console.log("open_helpclass", result.param1);
data.location.href =
location.protocol + "//" + location.host + result.param1;
console.log("open_helpclass", res.value.param1);
w.location.href =
location.protocol + "//" + location.host + res.value.param1;
}
}
......@@ -442,12 +440,12 @@ class Ev {
}
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);
}
trace_scan(id, sts) {
trace_scan(res) {
this.scan_update = false;
if (this.scan_update) {
this.ctx.draw();
......@@ -581,17 +579,13 @@ class Ev {
case Event.Key_CtrlL:
let o = this.ctx.get_select();
if (o.userdata instanceof EvItemAlarm) {
let newwindow = window.open("", "_blank");
this.ctx.gdh.getObject(o.userdata.objid, GdhOp.GET_OP_METHOD_PLC,
this.open_plc_cb, newwindow);
this.ctx.gdh.getObject(o.userdata.objid, GdhOp.GET_OP_METHOD_PLC).then(this.open_plc_cb);
}
break;
case Event.Key_CtrlG:
let o = this.ctx.get_select();
if (o.userdata instanceof EvItemAlarm) {
let newwindow = window.open("", "_blank");
this.ctx.gdh.getObject(o.userdata.objid, GdhOp.GET_OP_METHOD_PLC,
this.open_objectgraph_cb, newwindow);
this.ctx.gdh.getObject(o.userdata.objid, GdhOp.GET_OP_METHOD_PLC).then(this.open_objectgraph_cb);
}
break;
default:
......
......@@ -1551,7 +1551,6 @@ class FlowCtx extends Rect {
gdraw: GDraw;
display_level = DisplayLevel.One;
gdh: Gdh = null;
debug = false;
zoom_factor = 20.0;
base_zoom_factor = 20.0;
offset_x = 0;
......@@ -1776,10 +1775,8 @@ class FlowFrame {
}
flow_open() {
console.log("flow_open");
console.log("ctx.gdh", this.ctx.gdh);
this.ctx.connect();
this.ctx.gdh.refObjectInfoList(this.ctx.gdh.refObjectInfoListReply);
this.ctx.gdh.refObjectInfoList();
this.timer = setTimeout(this.flow_cyclic, 1000);
}
......@@ -1794,7 +1791,6 @@ class FlowFrame {
}
flow_close() {
console.log("Close function", this.timer);
clearTimeout(this.timer);
for (let i in this.ctx.gdh.pending) {
delete this.ctx.gdh.pending[i];
......
......@@ -20,6 +20,7 @@
<script type="text/babel" src="glow_annot.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_arrow.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_conclass.ts"></script>
......
......@@ -74,10 +74,8 @@ class Appl {
}
if (classGraph) {
console.log("Cmd classGraph");
let newwindow = window.open("", "_blank");
this.graph.gdh.getObjectFromName(instanceValue,
GdhOp.GET_OP_METHOD_OBJECTGRAPH, this.open_objectgraph_cb,
newwindow);
GdhOp.GET_OP_METHOD_OBJECTGRAPH).then(this.open_objectgraph_cb);
} else {
let graphName = cli.getQualValue("cli_arg2").toLowerCase();
if (!graphName) {
......@@ -86,7 +84,7 @@ class Appl {
}
graphName = graphName.toLowerCase();
if (graphName.charAt(".pwg") === -1) {
if (!graphName.endsWith(".pwg")) {
graphName += ".pwg";
}
......@@ -266,14 +264,16 @@ class Appl {
}
}
open_objectgraph_cb(id, data, sts, result) {
if ((sts & 1) === 0) {
data.document.write("Error status " + sts);
open_objectgraph_cb(res) {
let w = window.open("", "_blank");
if ((res.sts & 1) === 0) {
w.document.write("Error status " + res.sts);
} else {
let result = res.value;
console.log("param1", result.param1);
data.location.href =
w.location.href =
"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 {
let typeId = this.getTypeId(attributeName);
let name = this.getName(attributeName);
if (typeId === 0) {
return i;
return 0;
}
let id = this.nameToId(owner, name);
......@@ -212,7 +212,7 @@ class Graph {
constructor(appl) {
this.appl = appl;
if (typeof InstallTrigger !== 'undefined') {
if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
// Firefox is not os fast...
this.scan_time = 1;
this.fast_scan_time = 1;
......@@ -249,31 +249,27 @@ class Graph {
gdh_init_cb() {
if (this.priv === null) {
this.gdh.login("", "", this.login_cb, this);
this.gdh.login("", "").then(this.login_cb);
}
this.ctx.traceConnect();
this.gdh.refObjectInfoList(this.trace_connected);
this.gdh.refObjectInfoList().then(e => this.trace_cyclic());
}
login_cb(id, data, sts, result) {
console.log("Login:", sts, result);
this.priv = (sts & 1) ? result : 0;
}
trace_connected(id, sts) {
this.trace_cyclic();
login_cb(res) {
console.log("Login:", res.sts, res.value);
this.priv = (res.sts & 1) ? res.value : 0;
}
trace_cyclic() {
if (this.frame.nogdh) {
this.trace_scan(0, 0);
this.trace_scan();
} else {
this.gdh.getRefObjectInfoAll(this.trace_scan);
}
}
trace_scan(id, sts) {
trace_scan() {
this.scan_time = this.ctx.scantime;
this.fast_scan_time = this.ctx.fast_scantime;
this.animation_scan_time = this.ctx.animation_scantime;
......@@ -306,9 +302,6 @@ class Graph {
return ret;
}
let dyn = new Dyn(this);
if (type !== UserdataCbType.NodeClass) {
dyn.userdata = this;
}
ret.userdata = dyn;
ret.row = dyn.open(lines, row);
}
......@@ -354,7 +347,6 @@ class Graph {
case Event.MB1Down:
case Event.MB1DoubleClick:
case Event.MB3Press:
case Event.ValueChanged:
case Event.SliderMoveStart:
case Event.SliderMoveEnd:
case Event.SliderMoved:
......@@ -712,6 +704,18 @@ class Graph {
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) {
if (this.appl) {
return this.appl.command(cmd);
......@@ -754,4 +758,9 @@ class Graph {
loadCtx(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 {
}
enum Event {
Null,
MB1Click,
MB1Up = 2,
MB1Down,
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,
ValueChanged,
MenuCreate,
MenuActivated,
MenuDelete,
Exposure,
Enter,
Leave,
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,
SliderMoved,
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
}
......
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 {
}
class GlowCustomColors {
debug = false;
colors_size = DrawType.CustomColor__ - DrawType.CustomColor1;
colors = new Array(this.colors_size);
colortheme_lightness = 0;
......@@ -380,10 +379,6 @@ class GlowCustomColors {
this.colors[j][0] = parseFloat(tokens[0]);
this.colors[j][1] = parseFloat(tokens[1]);
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;
case GlowSave.End:
......
......@@ -13,7 +13,6 @@ class GrowCtxWindow {
class GrowCtx extends Rect {
appl = null;
debug = false;
antiAliasing = 0;
name = null;
version = 0;
......@@ -110,10 +109,6 @@ class GrowCtx extends Rect {
let tokens = lines[i].split(' ');
let key = parseInt(tokens[0], 10);
if (this.debug) {
console.log("ctx : " + lines[i]);
}
switch (key) {
case GlowSave.Ctx:
break;
......
......@@ -470,10 +470,6 @@ class GrowTrend extends GrowRect {
return null;
}
getClassUserData() {
return this.nc.userdata;
}
getUserData() {
return this.userdata;
}
......
......@@ -32,8 +32,8 @@ class OpWindMenu {
gdh_init_cb() {
let oid = new PwrtObjid(0, 0);
this.user = "Default";
this.gdh.login("", "", this.login_cb, this);
this.gdh.getOpwindMenu(this.get_opplace(), this.get_menu_cb, 999);
this.gdh.login("", "").then(this.login_cb);
this.gdh.getOpwindMenu(this.get_opplace()).then(this.get_menu_cb);
}
add_menu_button(context, text) {
......@@ -49,9 +49,9 @@ class OpWindMenu {
return button;
}
get_menu_cb(id, data, sts, result) {
get_menu_cb(res) {
let result = res.value;
this.info = result;
console.log("Menu received", sts, data, result.buttons.length);
let context = document.getElementById("opwindmenu");
document.getElementById("opwind_title").innerHTML = result.title;
......@@ -89,7 +89,7 @@ class OpWindMenu {
passwd = c.crypt("aa", passwd);
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")
.addEventListener("click", function (event) {
......@@ -102,7 +102,7 @@ class OpWindMenu {
document.getElementById("login_frame").style.height = '0px';
this.priv = 0;
this.user = "Default";
this.gdh.login("", "", this.login_cb, this);
this.gdh.login("", "").then(this.login_cb);
});
document.getElementById("login_user").innerHTML = "";
......@@ -200,10 +200,9 @@ class OpWindMenu {
}
}
login_cb(id, data, sts, result) {
console.log("Login:", sts, result);
if (sts & 1) {
this.priv = result;
login_cb(res) {
if (res.sts & 1) {
this.priv = res.value;
sessionStorage.setItem("pwr_privilege", String(this.priv));
if (this.user_text !== null) {
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