Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
f4585c02
Commit
f4585c02
authored
Sep 17, 2009
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User object removed, and integrated with WebHandler object
parent
cc6b8836
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
108 deletions
+10
-108
java/jpwr/rt/src/MhServer.java
java/jpwr/rt/src/MhServer.java
+10
-20
wb/lib/wb/src/wb_c_rttconfig.cpp
wb/lib/wb/src/wb_c_rttconfig.cpp
+0
-88
No files found.
java/jpwr/rt/src/MhServer.java
View file @
f4585c02
...
@@ -129,39 +129,29 @@ public class MhServer
...
@@ -129,39 +129,29 @@ public class MhServer
maxConnections
=
50
;
maxConnections
=
50
;
return
1
;
return
1
;
}
}
CdhrObjid
cdhrObjid
;
CdhrString
cdhrString
;
CdhrString
cdhrString
;
CdhrString
cdhrStringUser
;
CdhrInt
cdhrMaxCon
;
CdhrInt
cdhrMaxCon
;
CdhrInt
cdhrMaxAlarms
;
CdhrInt
cdhrMaxAlarms
;
CdhrInt
cdhrMaxEvents
;
CdhrInt
cdhrMaxEvents
;
cdhr
Objid
=
gdh
.
getClassList
(
Pwrb
.
cClass_WebHandler
);
cdhr
WebHandlerObj
=
gdh
.
getClassList
(
Pwrb
.
cClass_WebHandler
);
if
(
cdhr
Objid
.
evenSts
())
if
(
cdhr
WebHandlerObj
.
evenSts
())
{
{
errh
.
info
(
"No WebHandler is configured,
Gd
hServer terminating"
);
errh
.
info
(
"No WebHandler is configured,
M
hServer terminating"
);
return
cdhr
Objid
.
getSts
();
return
cdhr
WebHandlerObj
.
getSts
();
}
}
cdhrString
=
gdh
.
objidToName
(
cdhr
Objid
.
objid
,
Cdh
.
mName_volumeStrict
);
cdhrString
=
gdh
.
objidToName
(
cdhr
WebHandlerObj
.
objid
,
Cdh
.
mName_volumeStrict
);
if
(
cdhrString
.
evenSts
())
if
(
cdhrString
.
evenSts
())
{
{
return
cdhrString
.
getSts
();
return
cdhrString
.
getSts
();
}
}
String
userObjectString
=
cdhrString
.
str
+
".UserObject"
;
String
maxAlarmsAttr
=
cdhrString
.
str
+
".MaxNoOfAlarms"
;
cdhrStringUser
=
gdh
.
getObjectInfoString
(
userObjectString
);
String
maxEventsAttr
=
cdhrString
.
str
+
".MaxNoOfEvents"
;
cdhrUserObj
=
gdh
.
nameToObjid
(
cdhrStringUser
.
str
);
if
(
cdhrUserObj
.
evenSts
())
{
return
cdhrUserObj
.
getSts
();
}
String
maxAlarmsAttr
=
cdhrStringUser
.
str
+
".MaxNoOfAlarms"
;
String
maxEventsAttr
=
cdhrStringUser
.
str
+
".MaxNoOfEvents"
;
String
maxConAttr
=
cdhrString
.
str
+
".MaxConnections"
;
String
maxConAttr
=
cdhrString
.
str
+
".MaxConnections"
;
cdhrMaxAlarms
=
gdh
.
getObjectInfoInt
(
maxAlarmsAttr
);
cdhrMaxAlarms
=
gdh
.
getObjectInfoInt
(
maxAlarmsAttr
);
cdhrMaxEvents
=
gdh
.
getObjectInfoInt
(
maxEventsAttr
);
cdhrMaxEvents
=
gdh
.
getObjectInfoInt
(
maxEventsAttr
);
cdhrMaxCon
=
gdh
.
getObjectInfoInt
(
maxConAttr
);
cdhrMaxCon
=
gdh
.
getObjectInfoInt
(
maxConAttr
);
System
.
out
.
println
(
"MaxNoOfAlarms: "
+
cdhrString
User
.
str
+
" "
+
cdhrMaxAlarms
.
value
+
" "
+
cdhrMaxAlarms
.
evenSts
());
System
.
out
.
println
(
"MaxNoOfAlarms: "
+
cdhrString
.
str
+
" "
+
cdhrMaxAlarms
.
value
+
" "
+
cdhrMaxAlarms
.
evenSts
());
if
(
cdhrMaxCon
.
evenSts
())
if
(
cdhrMaxCon
.
evenSts
())
{
{
return
cdhrMaxCon
.
getSts
();
return
cdhrMaxCon
.
getSts
();
...
@@ -204,7 +194,7 @@ public class MhServer
...
@@ -204,7 +194,7 @@ public class MhServer
}
}
}
}
CdhrObjid
cdhr
Us
erObj
;
CdhrObjid
cdhr
WebHandl
erObj
;
/**
/**
...
@@ -244,7 +234,7 @@ public class MhServer
...
@@ -244,7 +234,7 @@ public class MhServer
mhThread
=
new
MhThread
[
maxConnections
];
mhThread
=
new
MhThread
[
maxConnections
];
mhData
=
new
MhData
(
maxAlarms
,
maxEvents
);
mhData
=
new
MhData
(
maxAlarms
,
maxEvents
);
PwrtStatus
stsM
=
mh
.
outunitConnect
(
cdhr
Us
erObj
.
objid
);
PwrtStatus
stsM
=
mh
.
outunitConnect
(
cdhr
WebHandl
erObj
.
objid
);
if
(
stsM
.
evenSts
())
if
(
stsM
.
evenSts
())
{
{
System
.
out
.
println
(
"Fel vid outunitConnect"
);
System
.
out
.
println
(
"Fel vid outunitConnect"
);
...
...
wb/lib/wb/src/wb_c_rttconfig.cpp
deleted
100644 → 0
View file @
cc6b8836
/*
* Proview $Id: wb_c_rttconfig.cpp,v 1.1 2007-01-04 07:29:03 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* wb_c_rttconfig.c -- work bench methods of the RttConfig class. */
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
pwr_tOid
Object
,
pwr_tOid
Father
,
pwr_tCid
Class
)
{
pwr_tOid
oid
;
pwr_tCid
cid
;
pwr_tStatus
sts
;
pwr_tInt32
*
number
;
pwr_tInt32
max_number
=
0
;
int
size
;
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"OpPlace"
);
if
(
EVEN
(
sts
))
return
sts
;
// Get next OpNumber
sts
=
ldh_GetClassList
(
Session
,
cid
,
&
oid
);
while
(
ODD
(
sts
))
{
sts
=
ldh_GetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
**
)
&
number
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
number
>
max_number
)
max_number
=
*
number
;
free
(
(
char
*
)
number
);
sts
=
ldh_GetNextObject
(
Session
,
oid
,
&
oid
);
}
sts
=
ldh_ClassNameToId
(
Session
,
&
cid
,
"User"
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_GetClassList
(
Session
,
cid
,
&
oid
);
while
(
ODD
(
sts
))
{
sts
=
ldh_GetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
**
)
&
number
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
*
number
>
max_number
)
max_number
=
*
number
;
free
(
(
char
*
)
number
);
sts
=
ldh_GetNextObject
(
Session
,
oid
,
&
oid
);
}
max_number
++
;
sts
=
ldh_CreateObject
(
Session
,
&
oid
,
"User"
,
cid
,
Object
,
ldh_eDest_IntoLast
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_SetObjectPar
(
Session
,
oid
,
"RtBody"
,
"OpNumber"
,
(
char
*
)
&
max_number
,
sizeof
(
max_number
));
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_SetObjectPar
(
Session
,
Object
,
"RtBody"
,
"UserObject"
,
(
char
*
)
&
oid
,
sizeof
(
oid
));
if
(
EVEN
(
sts
))
return
sts
;
return
PWRS__SUCCESS
;
}
pwr_dExport
pwr_BindMethods
(
RttConfig
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_NullMethod
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment