Commit 3efd3a05 authored by Claes Sjofors's avatar Claes Sjofors

WebSocketServer added

parent e027861c
......@@ -51,6 +51,7 @@ JNIEXPORT jint JNICALL Java_jpwr_rt_Errh_init
name = (*env)->GetStringUTFChars( env, jname, 0);
cstr = (char *)name;
printf( "Init errh %s %d", cstr, anix);
sts = errh_Init( cstr, anix);
(*env)->ReleaseStringUTFChars( env, jname, cstr);
......
......@@ -493,7 +493,7 @@ JNIEXPORT jobjectArray JNICALL Java_jpwr_rt_Gdh_getObjectRefInfoStringArray
JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_refObjectInfo
(JNIEnv *env, jclass obj, jstring name)
{
int sts;
int sts = GDH__SUCCESS;
const char *str;
char *cstr;
void *attr_p;
......@@ -557,12 +557,12 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_refObjectInfo
}
else
{
typeid = pwr_eType_Boolean;
size = sizeof(pwr_tBoolean);
elements = 1;
sts = gdh_GetAttributeCharacteristics( cstr, &typeid, (pwr_tUInt32 *)&size, 0,
(pwr_tUInt32 *)&elements);
}
sts = gdh_RefObjectInfo( cstr, &attr_p, &subid, size);
if ( ODD(sts))
sts = gdh_RefObjectInfo( cstr, &attr_p, &subid, size);
if ( ODD(sts))
{
......
......@@ -80,7 +80,10 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_RtSecurity_checkUser
aref = cdh_ObjidToAref( oid);
sts = gdh_GetObjectInfoAttrref( &aref, &sec, sizeof(sec));
if ( ODD(sts)){
sts = user_CheckUser( sec.WebSystemGroup, cuser, cpassword, &priv);
if ( strcmp( cuser, "") == 0)
priv = sec.DefaultWebPriv;
else
sts = user_CheckUser( sec.WebSystemGroup, cuser, cpassword, &priv);
}
}
(*env)->ReleaseStringUTFChars( env, jsystemgroup, csystemgroup);
......
......@@ -69,16 +69,16 @@ public class GlowConPoint extends GlowArrayElem {
case Glow.eSave_ConPoint:
break;
case Glow.eSave_ConPoint_number:
number =Integer.valueOf(token.nextToken());
number = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_ConPoint_direction:
number =Integer.valueOf(token.nextToken());
direction = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_ConPoint_p:
p.open(reader);
break;
case Glow.eSave_ConPoint_trace_attr_type:
trace_attr_type =Integer.valueOf(token.nextToken());
trace_attr_type = Integer.valueOf(token.nextToken());
break;
case Glow.eSave_ConPoint_trace_attribute:
if ( token.hasMoreTokens())
......
......@@ -56,6 +56,7 @@ public class CdhrObjAttr implements Serializable
public GdhrRefObjectInfo refObj;
public String name;
public String fullName = null;
public String className = null;
public int type;
public int size;
public int flags;
......
......@@ -42,6 +42,7 @@ package jpwr.rt;
public class Errh {
public static final int eAnix_webmon = 14;
public static final int eAnix_webmonmh = 15;
public static final int eAnix_websocketserver = 28;
public static final int PWR__SRVSTARTUP = 134512720;
public static final int PWR__SRUN = 134512731;
......
......@@ -200,8 +200,7 @@ public class Gdh {
}
//public Vector getAllClassAttributes( int classid, PwrtObjid objid_obj )
public Vector<CdhrObjAttr> getAllClassAttributes( int classid, PwrtObjid objid_obj )
{
public Vector<CdhrObjAttr> getAllClassAttributes( int classid, PwrtObjid objid_obj) {
//System.out.println("getAllClassAttributes" + classid + " " + objid_obj.oix + " " + objid_obj.vid);
String name = this.objidToName(objid_obj, Cdh.mName_pathStrict).str;
......@@ -212,36 +211,38 @@ public class Gdh {
Vector<CdhrObjAttr> v = new Vector<CdhrObjAttr>();
//Vector v = new Vector();
for(int i = 0;i<gdhrsAttrDefArr.length;i++)
{
if(gdhrsAttrDefArr[i] == null)
break;
//System.out.println("getAllClassAttributesFor:" + i + gdhrsAttrDefArr[i].attrName);
while(gdhrsAttrDefArr[i].attrName.startsWith("Super."))
gdhrsAttrDefArr[i].attrName = gdhrsAttrDefArr[i].attrName.substring(6);
CdhrObjAttr oa;
if((gdhrsAttrDefArr[i].info.Flags & Pwr.mAdef_class) > 0)
{
oa = new CdhrObjAttr(this.nameToObjid(name + "." + gdhrsAttrDefArr[i].attrName).objid,
gdhrsAttrDefArr[i].attrName,
gdhrsAttrDefArr[i].typeRef,
gdhrsAttrDefArr[i].info.Size,
gdhrsAttrDefArr[i].info.Flags,
gdhrsAttrDefArr[i].info.Elements);
}
else
{
//System.out.println("getAllClassAttr:" + name + "." + gdhrsAttrDefArr[i].attrName);
oa = new CdhrObjAttr(this.nameToObjid(name + "." + gdhrsAttrDefArr[i].attrName).objid,
gdhrsAttrDefArr[i].attrName,
gdhrsAttrDefArr[i].info.Type,
gdhrsAttrDefArr[i].info.Size,
gdhrsAttrDefArr[i].info.Flags,
gdhrsAttrDefArr[i].info.Elements);
}
v.add(oa);
for( int i = 0;i<gdhrsAttrDefArr.length;i++) {
if ( gdhrsAttrDefArr[i] == null)
break;
//System.out.println("getAllClassAttributesFor:" + i + gdhrsAttrDefArr[i].attrName);
while ( gdhrsAttrDefArr[i].attrName.startsWith("Super."))
gdhrsAttrDefArr[i].attrName = gdhrsAttrDefArr[i].attrName.substring(6);
CdhrObjAttr oa;
if ( (gdhrsAttrDefArr[i].info.Flags & Pwr.mAdef_class) > 0) {
oa = new CdhrObjAttr(this.nameToObjid(name + "." + gdhrsAttrDefArr[i].attrName).objid,
gdhrsAttrDefArr[i].attrName,
gdhrsAttrDefArr[i].typeRef,
gdhrsAttrDefArr[i].info.Size,
gdhrsAttrDefArr[i].info.Flags,
gdhrsAttrDefArr[i].info.Elements);
CdhrObjid classObj = this.classIdToObjid( gdhrsAttrDefArr[i].info.Type);
if ( classObj.oddSts())
oa.className = this.objidToName(classObj.objid, Cdh.mName_object).str;
}
else {
//System.out.println("getAllClassAttr:" + name + "." + gdhrsAttrDefArr[i].attrName);
oa = new CdhrObjAttr(this.nameToObjid(name + "." + gdhrsAttrDefArr[i].attrName).objid,
gdhrsAttrDefArr[i].attrName,
gdhrsAttrDefArr[i].info.Type,
gdhrsAttrDefArr[i].info.Size,
gdhrsAttrDefArr[i].info.Flags,
gdhrsAttrDefArr[i].info.Elements);
}
v.add(oa);
}
return v;
}
......
This diff is collapsed.
......@@ -336,6 +336,7 @@ public class Pwrb {
public static final int cClass_waith = 133072;
public static final int cClass_WebBrowserConfig = 133488;
public static final int cClass_WebHandler = 133440;
public static final int cClass_WebSocketServer = 136704;
public static final int cClass_OpPlaceWeb = 136528;
public static final int cClass_OpPlaceApp = 136536;
public static final int cClass_WebGraph = 133472;
......
......@@ -42,6 +42,7 @@ local_java_sources = \
SubElement.java \
GdhServer.java \
GdhServerMonitor.java \
GdhWebSocketServer.java \
HistQuery.java \
MhrsEventId.java \
MhrEvent.java \
......
......@@ -36,6 +36,7 @@
#include <ctype.h>
#include "pwr_baseclasses.h"
#include "pwr_remoteclasses.h"
#include "pwr_nmpsclasses.h"
#include "pwr_basecomponentclasses.h"
......@@ -68,6 +69,7 @@
#define cPrio_webmon (cPrio_base + 15)
#define cPrio_webmonmh (cPrio_base + 15)
#define cPrio_webmonelog (cPrio_base + 15)
#define cPrio_websocketserver (cPrio_base + 15)
#define cPrio_elog (cPrio_base + 15)
#define cPrio_sysmon (cPrio_base + 16)
#define cPrio_opc_server (cPrio_base + 15)
......@@ -172,6 +174,10 @@ void ini_ProcTable(pwr_tStatus* status, ini_sContext* cp)
"rt_webmonelog.sh", cPrio_webmonelog, 0, pwr_cClass_WebHandler, "", 0);
pp->proc.flags.b.system = 1;
pp = ini_ProcInsert(sts, cp, "pwr_websocketserver", "pwr_websocketserver_%d", 0, 1,
"rt_websocketserver.sh", cPrio_websocketserver, 0, pwr_cClass_WebSocketServer, "", 0);
pp->proc.flags.b.system = 1;
pp = ini_ProcInsert(sts, cp, "pwr_opc_server", "pwr_opc_server_%d", 0, 1,
"opc_server", cPrio_opc_server, 0, pwr_cClass_Opc_ServerConfig, "", 0);
pp->proc.flags.b.system = 1;
......
#!/bin/bash
#
# ProviewR Open Source Process Control.
# Copyright (C) 2005-2018 SSAB EMEA AB.
#
# This file is part of ProviewR.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ProviewR. If not, see <http://www.gnu.org/licenses/>
#
# Linking ProviewR statically or dynamically with other modules is
# making a combined work based on ProviewR. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# ProviewR give you permission to, from the build function in the
# ProviewR Configurator, combine ProviewR with modules generated by the
# ProviewR PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of ProviewR (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
#
export LD_LIBRARY_PATH=$pwr_exe
export CLASSPATH=$pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar
$jdk_home/java -Djava.library.path=$jdk/lib/i386/client:$jdk/lib/i386:$jdk/../lib/i386:$pwr_exe jpwr.rt.GdhWebSocketServer
......@@ -120,6 +120,7 @@ typedef enum {
errh_eAnix_powerlink = 25,
errh_eAnix_videomgm = 26,
errh_eAnix_redcom = 27,
errh_eAnix_websocketserver = 28,
errh_eAnix_plc1 = 41,
errh_eAnix_plc2 = 42,
errh_eAnix_plc3 = 43,
......
0! DefaultWidth 990
0! DefaultHeight 515
0! DefaultHeight 535
199
!/**
! TempSwitch
......@@ -29,22 +29,22 @@
100 20
135 20
101 20
102 -204
103 72
104 3.09562
136 3.09562
102 -38
103 -2
104 3.57009
136 3.57009
105 100
106 -31
106 -7
107 0
108 51.5
109 -2
110 26.0048
110 26.4272
111 0.01322
116 0
117 11
118 117
119 105
120 0
117 0
118 68
119 108
120 1
121 Claes context
122 0
126 0.5
......@@ -63,7 +63,7 @@
134
22
2200 0
2201 548
2201 558
2202 pwr_c_node_servers
2203 310
2205 0
......@@ -74,7 +74,7 @@
2209 0
2210 0
2211 49.5
2212 25.75
2212 26.75
2213 4
2214
pwrp_pop:
......@@ -17479,13 +17479,13 @@ pwr_exe:
0
0
1006 7.25453
1007 1.0158
1008 14.641
1009 13.7277
1007 1.01579
1008 14.6409
1009 13.7276
1013 7.25453
1014 1.0158
1015 14.641
1016 13.7277
1014 1.01579
1015 14.6409
1016 13.7276
1003
0
0
......@@ -21518,5 +21518,854 @@ pwr_exe:
99
99
99
27
2703 370
2704 410
2731 10000
2722 10000
2705 410
2723 10000
2706 370
2732 10000
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2725 0
2726 0
2702 0
2701
2700
10
1000 pwr_indsquare
1002 O552
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 8.32213
1007 7.5915
1008 26.3477
1009 25.5562
1013 8.32213
1014 7.5915
1015 26.3477
1016 25.5562
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 5.95
701 8.95
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 1.21772
2801 0
2802 7.40884
2803 0
2804 1.21772
2805 25.4344
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2727 0
2728 303
2729 4
2730 0
2721
1
100 33554432
105 0
101 0
106 0
102 65532
103 0
31
3100 $object.ProcStatus[27]##status
3101 374
3102 1
99
99
99
27
2703 310
2704 310
2731 10000
2722 326
2705 310
2723 326
2706 310
2732 10000
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2725 0
2726 0
2702 0
2701
2700
10
1000 pwr_valuelong
1002 O553
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 25.8189
1007 8.56567
1008 26.3477
1009 25.4953
1013 25.8189
1014 8.56567
1015 26.3477
1016 25.4953
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 6.75
701 5.6
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 0.648618
2801 0
2802 8.56567
2803 0
2804 1.21772
2805 25.4953
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2727 0
2728 303
2729 4
2730 0
2721
1
100 1
105 0
101 1
106 0
102 65532
103 0
12
1200 $object.ProcStatus[27]##status
1201 %1m
1202 1
1203 1
1204 0
1205
1206 0
99
99
99
27
2703 370
2704 410
2731 10000
2722 10000
2705 410
2723 10000
2706 370
2732 10000
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2725 0
2726 0
2702 0
2701
2700
10
1000 pwr_indsquare
1002 O554
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 27.4404
1007 26.7098
1008 26.3477
1009 25.5562
1013 27.4404
1014 26.7098
1015 26.3477
1016 25.5562
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 5.95
701 8.95
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 1.21772
2801 0
2802 26.5271
2803 0
2804 1.21772
2805 25.4344
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2727 0
2728 303
2729 4
2730 0
2721
1
100 33554432
105 0
101 0
106 0
102 65532
103 0
31
3100 $object.ProcMsgSeverity[27]##status
3101 374
3102 1
99
99
99
27
2703 310
2704 310
2731 10000
2722 326
2705 310
2723 326
2706 310
2732 10000
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2725 0
2726 0
2702 0
2701
2700
10
1000 pwr_valuelong
1002 O555
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 48.6406
1007 27.623
1008 26.3477
1009 25.4953
1013 48.6406
1014 27.623
1015 26.3477
1016 25.4953
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 6.75
701 5.6
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 0.790134
2801 0
2802 27.623
2803 0
2804 1.21772
2805 25.4953
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2727 0
2728 303
2729 4
2730 0
2721
1
100 1
105 0
101 1
106 0
102 65532
103 0
12
1200 $object.ProcMessage[27]##string80
1201 %s
1202 1
1203 1
1204 0
1205
1206 0
99
99
99
20
2004 O556
2000 49.5
2001 0
2002 26.4272
2003 26.4272
2009 322
2010 0
2005
6
600 322
601 1
602
7
700 49.5
701 13
99
603
7
700 0
701 13
99
99
2008
28
2800 1
2801 0
2802 0
2803 0
2804 1
2805 13.4272
2806 0
99
99
35
3500
27
2703 454
2704 450
2731 10000
2722 458
2705 450
2723 458
2706 454
2732 10000
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2725 0
2726 0
2702 0
2701
2700
10
1000 Grp557_
1002 Grp557_
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 7.25453
1007 1.01579
1008 26.4085
1009 25.4952
1013 7.25453
1014 1.01579
1015 26.4085
1016 25.4952
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 0
701 0
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 35454972
1028 0
1029
99
2707
28
2800 1
2801 0
2802 0
2803 0
2804 1
2805 1
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2727 0
2728 303
2729 9999
2730 0
2721
1
100 0
105 0
101 66
106 0
102 65535
103 0
50
5000 &$object.ProcObject[27]
99
55
5500 open graph/classgraph/instance=&$object.ProcObject[27]
99
99
99
3501
36
3600
3
300 Grp557_
301
2
19
1904 O387
1900 7.25453
1901 1.01579
1902 25.4085
1903 24.4952
1908 0
1909 30
1910 30
1911 1
1915 1
1913 16
1916 2
1914 0
1918 0
1919 0
1920 0
1917 0
1921 0
1922 4
1923 0
1924 0
1925 10000
1926 0
1907 0
1906
1905
5
500 0
501 1
504 1
505 1
502
7
700 0.95
701 10.6
99
503
7
700 4.5
701 11.35
99
99
1912
28
2800 1.75739
2801 0
2802 -0.653727
2803 0
2804 1.21772
2805 11.5874
2806 0
99
99
30
3004 O388
3000 6.68088
3001 1.63088
3002 25.3887
3003 24.5887
3008 103
3010 4
3011 2
3007 0
3006
3005
9
900 2
901 303
904 0
902 rt_websockets
903
7
700 1.1
701 2.5
99
99
3009
28
2800 1.75739
2801 0
2802 -0.302248
2803 0
2804 1.21772
2805 22.1944
2806 0
99
99
99
302 0
304 0
303
305 0
306
307
308 0
330 0
321 0
331 0
309 0
313 0
322 0
323 0
324 0
325 0
326 0
327 0
310 0
311 0
312
314
315 1
316 1
317 0
318 0
319 0
320 0
328 0
332 0
99
99
99
99
99
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