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
9fa1f9bb
Commit
9fa1f9bb
authored
Mar 09, 2010
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Syntax and PostCreate methods for sevhist objects
parent
1252ff3e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
196 additions
and
6 deletions
+196
-6
src/wbl/pwrb/src/pwrb_c_sevhistobject.wb_load
src/wbl/pwrb/src/pwrb_c_sevhistobject.wb_load
+1
-6
wb/lib/wb/src/wb_c_sevhist.cpp
wb/lib/wb/src/wb_c_sevhist.cpp
+17
-0
wb/lib/wb/src/wb_c_sevhistobject.cpp
wb/lib/wb/src/wb_c_sevhistobject.cpp
+101
-0
wb/lib/wb/src/wb_c_sevhistthread.cpp
wb/lib/wb/src/wb_c_sevhistthread.cpp
+71
-0
wb/lib/wb/src/wb_i_base_methods.cpp
wb/lib/wb/src/wb_i_base_methods.cpp
+4
-0
wb/lib/wb/src/wb_wb.meth
wb/lib/wb/src/wb_wb.meth
+2
-0
No files found.
src/wbl/pwrb/src/pwrb_c_sevhistobject.wb_load
View file @
9fa1f9bb
...
...
@@ -117,12 +117,7 @@ SObject pwrb:Class
EndObject
Object PostCreate $DbCallBack
Body SysBody
Attr MethodName = "SevHist-PostCreate"
EndBody
EndObject
Object PostMove $DbCallBack
Body SysBody
Attr MethodName = "SevHist-PostMove"
Attr MethodName = "SevHistObject-PostCreate"
EndBody
EndObject
Object ConfiguratorPoson $Menu
...
...
wb/lib/wb/src/wb_c_sevhist.cpp
View file @
9fa1f9bb
...
...
@@ -43,6 +43,10 @@ static pwr_tStatus PostCreate (
int
size
;
pwr_tAName
Name
;
pwr_sAttrRef
Attribute
;
pwr_tOid
oid
;
pwr_tOid
toid
;
int
cnt
=
0
;
/*
If father of SevHist has an "ActualValue" attribute, then make this SevHist
...
...
@@ -64,6 +68,19 @@ static pwr_tStatus PostCreate (
sizeof
(
Attribute
));
if
(
EVEN
(
sts
))
return
PWRB__SUCCESS
;
// Insert a thread object
sts
=
ldh_GetClassList
(
Session
,
pwr_cClass_SevHistThread
,
&
oid
);
while
(
ODD
(
sts
))
{
cnt
++
;
toid
=
oid
;
sts
=
ldh_GetNextObject
(
Session
,
oid
,
&
oid
);
}
if
(
cnt
>
0
)
{
sts
=
ldh_SetObjectPar
(
Session
,
Object
,
"RtBody"
,
"ThreadObject"
,
(
char
*
)
&
toid
,
sizeof
(
toid
));
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
...
...
wb/lib/wb/src/wb_c_sevhistobject.cpp
0 → 100644
View file @
9fa1f9bb
/*
* Proview $Id$
* 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_sevhistobject.cpp -- work bench methods of the SevHistObject class. */
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
PostCreate
(
ldh_tSesContext
Session
,
pwr_tObjid
Object
,
pwr_tObjid
Father
,
pwr_tClassId
Class
)
{
pwr_tStatus
sts
;
pwr_tOid
oid
;
pwr_tOid
toid
;
int
cnt
=
0
;
// Insert a thread object
sts
=
ldh_GetClassList
(
Session
,
pwr_cClass_SevHistThread
,
&
oid
);
while
(
ODD
(
sts
))
{
cnt
++
;
toid
=
oid
;
sts
=
ldh_GetNextObject
(
Session
,
oid
,
&
oid
);
}
if
(
cnt
>
0
)
{
sts
=
ldh_SetObjectPar
(
Session
,
Object
,
"RtBody"
,
"ThreadObject"
,
(
char
*
)
&
toid
,
sizeof
(
toid
));
if
(
EVEN
(
sts
))
return
sts
;
}
return
PWRB__SUCCESS
;
}
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
pwr_tOid
thread_oid
;
wb_session
*
sp
=
(
wb_session
*
)
Session
;
wb_attribute
a
=
sp
->
attribute
(
&
Object
);
if
(
!
a
)
return
a
.
sts
();
// Check ThreadObject
wb_attribute
thread_a
(
a
,
0
,
"ThreadObject"
);
if
(
!
thread_a
)
return
thread_a
.
sts
();
thread_a
.
value
(
&
thread_oid
);
if
(
!
thread_a
)
return
thread_a
.
sts
();
wb_object
othread
=
sp
->
object
(
thread_oid
);
if
(
!
othread
)
wsx_error_msg_str
(
Session
,
"Bad thread object"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
else
if
(
othread
.
cid
()
!=
pwr_cClass_SevHistThread
)
wsx_error_msg_str
(
Session
,
"Bad thread object class"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
// Every method to be exported to the workbench should be registred here.
pwr_dExport
pwr_BindMethods
(
SevHistObject
)
=
{
pwr_BindMethod
(
PostCreate
),
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_c_sevhistthread.cpp
0 → 100644
View file @
9fa1f9bb
/*
* Proview $Id: wb_c_sevhist.cpp,v 1.1 2008-09-18 15:01:13 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_sevhistthread.cpp -- work bench methods of the SevHistThread class. */
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tString40
server_name
;
wb_attribute
a
=
sp
->
attribute
(
&
Object
);
if
(
!
a
)
return
a
.
sts
();
// Check ServerNode
wb_attribute
thread_a
(
a
,
0
,
"ServerNode"
);
if
(
!
thread_a
)
return
thread_a
.
sts
();
thread_a
.
value
(
&
server_name
);
if
(
!
thread_a
)
return
thread_a
.
sts
();
if
(
strcmp
(
server_name
,
""
)
==
0
)
wsx_error_msg_str
(
Session
,
"Server name is missing"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
// Every method to be exported to the workbench should be registred here.
pwr_dExport
pwr_BindMethods
(
SevHistThread
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_i_base_methods.cpp
View file @
9fa1f9bb
...
...
@@ -58,6 +58,8 @@ pwr_dImport pwr_BindMethods(NodeConfig);
pwr_dImport
pwr_BindMethods
(
SevNodeConfig
);
pwr_dImport
pwr_BindMethods
(
Application
);
pwr_dImport
pwr_BindMethods
(
FriendNodeConfig
);
pwr_dImport
pwr_BindMethods
(
SevHistThread
);
pwr_dImport
pwr_BindMethods
(
SevHistObject
);
pwr_dExport
pwr_BindClasses
(
Base
)
=
{
pwr_BindClass
(
ASup
),
...
...
@@ -97,6 +99,8 @@ pwr_dExport pwr_BindClasses(Base) = {
pwr_BindClass
(
SevNodeConfig
),
pwr_BindClass
(
Application
),
pwr_BindClass
(
FriendNodeConfig
),
pwr_BindClass
(
SevHistThread
),
pwr_BindClass
(
SevHistObject
),
pwr_NullClass
};
...
...
wb/lib/wb/src/wb_wb.meth
View file @
9fa1f9bb
...
...
@@ -35,3 +35,5 @@ NodeConfig
SevNodeConfig
Application
FriendNodeConfig
SevHistThread
SevHistObject
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