Commit 3767c365 authored by Claes Sjofors's avatar Claes Sjofors

java OpPlaceWeb name in html-file, aristotle used for projects with several operator stations

parent 71808c75
......@@ -96,6 +96,19 @@ public class JopOpWindowApplet extends JopApplet
setSize(new Dimension(370, 570));
String pwrPlace = this.getParameter("pwrplace");
System.out.println( "pwrPlace " + pwrPlace);
if ( pwrPlace == null) {
System.out.println( "No pwrPlace specified in applet");
return;
}
if ( pwrPlace.startsWith("$node")) {
// Replace with node object
CdhrObjid roid = engine.gdh.getNodeObject(0);
String name = engine.gdh.objidToName( roid.objid, Cdh.mName_pathStrict).str;
pwrPlace = name + pwrPlace.substring(5);
}
localPanel = new JopOpWindow( session, (Object)this, pwrPlace);
contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(borderLayout1);
......
......@@ -112,6 +112,8 @@ int Graph::generate_web( ldh_tSesContext ldhses, pwr_tOid opplaceweb_oid)
char sname[80];
char arlist[400];
pwr_tOName opplaceweb_name;
pwr_tOid nodeobject_oid;
pwr_tAName nodeobject_name;
ge_get_systemname( sname);
......@@ -238,6 +240,21 @@ int Graph::generate_web( ldh_tSesContext ldhses, pwr_tOid opplaceweb_oid)
strcpy( fname, "$pwrp_web/pwr_login.html");
dcli_translate_filename( fname, fname);
// If OpPlaceWeb is positioned under the node object, use $node syntax
sts = ldh_GetClassList( ldhses, pwr_eClass_Node, &nodeobject_oid);
if ( EVEN(sts)) return sts;
sts = ldh_ObjidToName( ldhses, nodeobject_oid, ldh_eName_Hierarchy, nodeobject_name,
sizeof(nodeobject_name), &size);
if ( EVEN(sts)) return sts;
if ( strncmp( nodeobject_name, opplaceweb_name, strlen(nodeobject_name)) == 0) {
pwr_tAName tmp;
strcpy( tmp, &opplaceweb_name[strlen(nodeobject_name)]);
strcpy( opplaceweb_name, "$node");
strcat( opplaceweb_name, tmp);
}
fp_login.open( fname);
fp_login <<
......
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