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
a6966dbf
Commit
a6966dbf
authored
Oct 18, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New type DataRef
parent
b6f78634
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
175 additions
and
25 deletions
+175
-25
src/exe/co_convert/src/cnv_wbltoh.cpp
src/exe/co_convert/src/cnv_wbltoh.cpp
+2
-1
src/exp/inc/src/pwr.h
src/exp/inc/src/pwr.h
+9
-1
src/exp/inc/src/pwr_class.h
src/exp/inc/src/pwr_class.h
+3
-1
wb/lib/wb/src/wb_print_wbl.cpp
wb/lib/wb/src/wb_print_wbl.cpp
+15
-2
wb/lib/wb/src/wb_treeimport.cpp
wb/lib/wb/src/wb_treeimport.cpp
+30
-3
wb/lib/wb/src/wb_vrepwbl.cpp
wb/lib/wb/src/wb_vrepwbl.cpp
+38
-13
wb/lib/wb/src/wb_wblnode.cpp
wb/lib/wb/src/wb_wblnode.cpp
+15
-1
wb/lib/wb/src/wb_wnav.cpp
wb/lib/wb/src/wb_wnav.cpp
+36
-1
xtt/lib/xtt/src/xtt_xnav.cpp
xtt/lib/xtt/src/xtt_xnav.cpp
+27
-2
No files found.
src/exe/co_convert/src/cnv_wbltoh.cpp
View file @
a6966dbf
/*
* Proview $Id: cnv_wbltoh.cpp,v 1.
7 2005-09-22 14:54:46
claes Exp $
* Proview $Id: cnv_wbltoh.cpp,v 1.
8 2005-10-18 05:07:01
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -965,6 +965,7 @@ int CnvWblToH::check_typename( char *type_volume, char *type_name)
"pwr_tOpSysEnum"
,
"pwr_tPrivMask"
,
"pwr_tProString40"
,
"pwr_tDataRef"
,
""
};
for
(
name
=
valid_names
[
0
];
strcmp
(
name
,
""
)
!=
0
;
...
...
src/exp/inc/src/pwr.h
View file @
a6966dbf
/*
* Proview $Id: pwr.h,v 1.1
8 2005-10-07 05:57:28
claes Exp $
* Proview $Id: pwr.h,v 1.1
9 2005-10-18 05:07:40
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -466,6 +466,14 @@ typedef struct {
pwr_mAttrRef
Flags
;
//!< Attribute flags.
}
pwr_sAttrRef
;
/*_*
@aref dataref DataRef
*/
typedef
struct
{
void
*
Ptr
;
//!< Private plc pointer to data object.
pwr_sAttrRef
Aref
;
//!< Attribute reference to data object.
}
pwr_tDataRef
;
/*_*
@aref constants Constants
*/
...
...
src/exp/inc/src/pwr_class.h
View file @
a6966dbf
/*
* Proview $Id: pwr_class.h,v 1.1
8 2005-10-12 13:07:42
claes Exp $
* Proview $Id: pwr_class.h,v 1.1
9 2005-10-18 05:07:40
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -146,6 +146,7 @@ typedef enum {
pwr_eTix_CastId
=
31
,
/* Basic type */
pwr_eTix_ProString
=
32
,
/* Basic type */
pwr_eTix_DisableAttr
=
33
,
/* Basic type */
pwr_eTix_DataRef
=
34
,
/* Basic type */
pwr_eTix_
}
pwr_eTix
;
...
...
@@ -189,6 +190,7 @@ typedef enum {
pwr_eType_CastId
=
pwr_TypeId
(
pwr_eTix_CastId
),
pwr_eType_ProString
=
pwr_TypeId
(
pwr_eTix_ProString
),
pwr_eType_DisableAttr
=
pwr_TypeId
(
pwr_eTix_DisableAttr
),
pwr_eType_DataRef
=
pwr_TypeId
(
pwr_eTix_DataRef
),
pwr_eType_
=
pwr_TypeId
(
pwr_eTix_
)
}
pwr_eType
;
...
...
wb/lib/wb/src/wb_print_wbl.cpp
View file @
a6966dbf
/*
* Proview $Id: wb_print_wbl.cpp,v 1.1
4 2005-10-07 05:57:2
9 claes Exp $
* Proview $Id: wb_print_wbl.cpp,v 1.1
5 2005-10-18 05:12:1
9 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -540,6 +540,7 @@ void wb_print_wbl::printParameter(wb_volume& v,
case
pwr_eType_Enum
:
case
pwr_eType_Status
:
case
pwr_eType_NetStatus
:
case
pwr_eType_DataRef
:
varOffset
=
varSize
*
i
;
val
=
valueb
+
varOffset
;
tval
=
tvalueb
+
varOffset
;
...
...
@@ -747,13 +748,25 @@ bool wb_print_wbl::printValue (wb_volume& v,
sprintf
(
sval
,
"
\"
%s
\"
"
,
cdh_ArefToString
(
NULL
,
(
pwr_sAttrRef
*
)
val
,
1
));
}
}
#if 0
} else {
ConvertObjectName( root, sp, conv_name);
sprintf(sval, "\"%s\"", conv_name);
}
#endif
break
;
case
pwr_eType_DataRef
:
if
(
cdh_ObjidIsNull
(((
pwr_tDataRef
*
)
val
)
->
Aref
.
Objid
))
sprintf
(
sval
,
"0"
);
else
{
wb_attribute
a
=
v
.
attribute
(
&
((
pwr_tDataRef
*
)
val
)
->
Aref
);
if
(
a
)
sprintf
(
sval
,
"
\"
%s
\"
"
,
a
.
longName
().
c_str
());
else
{
sprintf
(
sval
,
"
\"
%s
\"
"
,
cdh_ArefToString
(
NULL
,
&
((
pwr_tDataRef
*
)
val
)
->
Aref
,
1
));
}
}
break
;
case
pwr_eType_String
:
case
pwr_eType_ProString
:
{
...
...
wb/lib/wb/src/wb_treeimport.cpp
View file @
a6966dbf
/*
* Proview $Id: wb_treeimport.cpp,v 1.
4 2005-09-06 10:43:32
claes Exp $
* Proview $Id: wb_treeimport.cpp,v 1.
5 2005-10-18 05:12:47
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -119,6 +119,20 @@ bool wb_treeimport::importUpdateSubClass( wb_adrep *subattr, char *body, wb_vrep
}
break
;
}
case
pwr_eType_DataRef
:
{
pwr_tDataRef
*
drp
=
(
pwr_tDataRef
*
)(
body
+
i
*
subattr
->
size
()
/
subattr_elements
+
adrep
->
offset
());
for
(
int
j
=
0
;
j
<
elements
;
j
++
)
{
if
(
drp
->
Aref
.
Objid
.
vid
==
m_import_source_vid
&&
(
oix
=
importTranslate
(
drp
->
Aref
.
Objid
.
oix
)))
{
drp
->
Aref
.
Objid
.
vid
=
vrep
->
vid
();
drp
->
Aref
.
Objid
.
oix
=
oix
;
*
modified
=
true
;
}
drp
++
;
}
break
;
}
default:
;
}
...
...
@@ -165,7 +179,7 @@ bool wb_treeimport::importUpdateObject( wb_orep *o, wb_vrep *vrep)
switch
(
adrep
->
type
())
{
case
pwr_eType_Objid
:
{
pwr_tOid
*
oidp
=
(
pwr_tOid
*
)(
body
+
adrep
->
offset
());
for
(
i
=
0
;
i
<
elements
;
i
++
)
{
for
(
i
nt
j
=
0
;
j
<
elements
;
j
++
)
{
if
(
oidp
->
vid
==
m_import_source_vid
&&
(
oix
=
importTranslate
(
oidp
->
oix
)))
{
oidp
->
vid
=
vrep
->
vid
();
oidp
->
oix
=
oix
;
...
...
@@ -177,7 +191,7 @@ bool wb_treeimport::importUpdateObject( wb_orep *o, wb_vrep *vrep)
}
case
pwr_eType_AttrRef
:
{
pwr_sAttrRef
*
arp
=
(
pwr_sAttrRef
*
)(
body
+
adrep
->
offset
());
for
(
i
=
0
;
i
<
elements
;
i
++
)
{
for
(
i
nt
j
=
0
;
j
<
elements
;
j
++
)
{
if
(
arp
->
Objid
.
vid
==
m_import_source_vid
&&
(
oix
=
importTranslate
(
arp
->
Objid
.
oix
)))
{
arp
->
Objid
.
vid
=
vrep
->
vid
();
arp
->
Objid
.
oix
=
oix
;
...
...
@@ -187,6 +201,19 @@ bool wb_treeimport::importUpdateObject( wb_orep *o, wb_vrep *vrep)
}
break
;
}
case
pwr_eType_DataRef
:
{
pwr_tDataRef
*
drp
=
(
pwr_tDataRef
*
)(
body
+
adrep
->
offset
());
for
(
int
j
=
0
;
j
<
elements
;
j
++
)
{
if
(
drp
->
Aref
.
Objid
.
vid
==
m_import_source_vid
&&
(
oix
=
importTranslate
(
drp
->
Aref
.
Objid
.
oix
)))
{
drp
->
Aref
.
Objid
.
vid
=
vrep
->
vid
();
drp
->
Aref
.
Objid
.
oix
=
oix
;
modified
=
true
;
}
drp
++
;
}
break
;
}
default:
;
}
...
...
wb/lib/wb/src/wb_vrepwbl.cpp
View file @
a6966dbf
/*
* Proview $Id: wb_vrepwbl.cpp,v 1.4
4 2005-09-06 10:43:32
claes Exp $
* Proview $Id: wb_vrepwbl.cpp,v 1.4
5 2005-10-18 05:13:38
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -1128,21 +1128,46 @@ int wb_vrepwbl::nameToAttrRef( const char *name, pwr_sAttrRef *attrref)
if
(
!
aname
.
hasAttribute
())
{
// No attribute given, attrref to whole RtBody
wb_cdrep
*
cdrep
=
m_merep
->
cdrep
(
&
sts
,
cid
);
if
(
EVEN
(
sts
))
return
sts
;
wb_bdrep
*
bdrep
=
cdrep
->
bdrep
(
&
sts
,
pwr_eBix_rt
);
if
(
EVEN
(
sts
))
return
sts
;
ref_wblnode
cn
=
findClass
(
cid
);
if
(
cn
)
{
if
(
!
cn
->
o
->
is_built
)
cn
->
build
(
0
);
attrref
->
Objid
=
oid
;
attrref
->
Offset
=
0
;
attrref
->
Size
=
bdrep
->
size
();
attrref
->
Body
=
cdh_TypeObjidToId
(
bdrep
->
boid
());
attrref
->
Flags
.
m
=
0
;
attrref
->
Flags
.
b
.
Object
=
1
;
// Get body object
wb_wblnode
*
n_body
=
cn
->
o
->
fch
;
while
(
n_body
)
{
if
(
n_body
->
isObjBodyDef
()
&&
n_body
->
o
->
b
.
bix
==
pwr_eBix_rt
)
break
;
n_body
=
n_body
->
o
->
fws
;
}
if
(
!
n_body
)
return
LDH__NOSUCHBODY
;
delete
cdrep
;
delete
bdrep
;
attrref
->
Objid
=
oid
;
attrref
->
Offset
=
0
;
attrref
->
Size
=
n_body
->
o
->
b
.
size
;
attrref
->
Body
=
cdh_TypeObjidToId
(
n_body
->
o
->
m_oid
);
attrref
->
Flags
.
m
=
0
;
attrref
->
Flags
.
b
.
Object
=
1
;
}
else
{
wb_cdrep
*
cdrep
=
m_merep
->
cdrep
(
&
sts
,
cid
);
if
(
EVEN
(
sts
))
return
sts
;
wb_bdrep
*
bdrep
=
cdrep
->
bdrep
(
&
sts
,
pwr_eBix_rt
);
if
(
EVEN
(
sts
))
return
sts
;
attrref
->
Objid
=
oid
;
attrref
->
Offset
=
0
;
attrref
->
Size
=
bdrep
->
size
();
attrref
->
Body
=
cdh_TypeObjidToId
(
bdrep
->
boid
());
attrref
->
Flags
.
m
=
0
;
attrref
->
Flags
.
b
.
Object
=
1
;
delete
cdrep
;
delete
bdrep
;
}
}
else
{
aname
.
setShadowed
(
true
);
...
...
wb/lib/wb/src/wb_wblnode.cpp
View file @
a6966dbf
/*
* Proview $Id: wb_wblnode.cpp,v 1.
49 2005-10-07 11:28:2
5 claes Exp $
* Proview $Id: wb_wblnode.cpp,v 1.
50 2005-10-18 05:14:0
5 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -107,6 +107,8 @@ static wbl_sSym datatypes[] =
,{
"pwr_eTdix_ClassDefFlags"
,
pwr_eTdix_ClassDefFlags
}
,{
"pwr_eTypeDef_ObjBodyDefFlags"
,
pwr_eTypeDef_ObjBodyDefFlags
}
,{
"pwr_eTdix_ObjBodyDefFlags"
,
pwr_eTdix_ObjBodyDefFlags
}
,{
"pwr_eType_DataRef"
,
pwr_eType_DataRef
}
,{
"pwr_eTix_DataRef"
,
pwr_eTix_DataRef
}
,{
0
,
0
}
};
...
...
@@ -2170,6 +2172,18 @@ int wb_wblnode::attrStringToValue( int type_id, char *value_str,
break
;
}
case
pwr_eType_DataRef
:
{
pwr_tDataRef
dataref
;
sts
=
m_vrep
->
nameToAttrRef
(
value_str
,
&
dataref
.
Aref
);
if
(
EVEN
(
sts
))
return
0
;
dataref
.
Ptr
=
0
;
memcpy
(
buffer_ptr
,
&
dataref
,
sizeof
(
dataref
));
break
;
}
case
pwr_eType_Time
:
{
pwr_tTime
time
;
...
...
wb/lib/wb/src/wb_wnav.cpp
View file @
a6966dbf
/*
* Proview $Id: wb_wnav.cpp,v 1.2
4 2005-10-07 05:57:29
claes Exp $
* Proview $Id: wb_wnav.cpp,v 1.2
5 2005-10-18 05:14:05
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -274,6 +274,16 @@ int wnav_attr_string_to_value( ldh_tSesContext ldhses, int type_id, char *value
memcpy
(
buffer_ptr
,
&
attrref
,
sizeof
(
attrref
));
break
;
}
case
pwr_eType_DataRef
:
{
pwr_tDataRef
dataref
;
dataref
.
Ptr
=
0
;
sts
=
ldh_NameToAttrRef
(
ldhses
,
value_str
,
&
dataref
.
Aref
);
if
(
EVEN
(
sts
))
return
WNAV__OBJNOTFOUND
;
memcpy
(
buffer_ptr
,
&
dataref
,
sizeof
(
dataref
));
break
;
}
case
pwr_eType_Time
:
{
pwr_tTime
time
;
...
...
@@ -442,6 +452,30 @@ void wnav_attrvalue_to_string( ldh_tSesContext ldhses, int type_id, void *value
*
buff
=
str
;
break
;
}
case
pwr_eType_DataRef
:
{
char
*
name_p
;
pwr_tDataRef
*
dataref
;
ldh_sVolumeInfo
info
;
ldh_GetVolumeInfo
(
ldh_SessionToVol
(
ldhses
),
&
info
);
dataref
=
(
pwr_tDataRef
*
)
value_ptr
;
if
(
dataref
->
Aref
.
Objid
.
vid
==
info
.
Volume
)
sts
=
ldh_AttrRefToName
(
ldhses
,
&
dataref
->
Aref
,
ldh_eName_Aref
,
&
name_p
,
len
);
else
sts
=
ldh_AttrRefToName
(
ldhses
,
&
dataref
->
Aref
,
ldh_eName_ArefVol
,
&
name_p
,
len
);
if
(
EVEN
(
sts
))
{
strcpy
(
str
,
""
);
*
len
=
0
;
*
buff
=
str
;
break
;
}
strcpy
(
str
,
name_p
);
*
buff
=
str
;
break
;
}
case
pwr_eType_Time
:
{
sts
=
time_AtoAscii
(
(
pwr_tTime
*
)
value_ptr
,
time_eFormat_DateAndTime
,
...
...
@@ -1187,6 +1221,7 @@ static void wnav_type_id_to_name( int type_id, char *type_id_name)
case pwr_eType_ObjectIx: strcpy( type_id_name, "ObjectIx"); break;
case pwr_eType_RefId: strcpy( type_id_name, "RefId"); break;
case pwr_eType_DeltaTime: strcpy( type_id_name, "DeltaTime"); break;
case pwr_eType_DataRef: strcpy( type_id_name, "DataRef"); break;
default: strcpy( type_id_name, "");
}
}
...
...
xtt/lib/xtt/src/xtt_xnav.cpp
View file @
a6966dbf
/*
* Proview $Id: xtt_xnav.cpp,v 1.2
1 2005-10-07 05:57:28
claes Exp $
* Proview $Id: xtt_xnav.cpp,v 1.2
2 2005-10-18 05:07:40
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -416,6 +416,16 @@ int xnav_attr_string_to_value( int type_id, char *value_str,
memcpy
(
buffer_ptr
,
&
attrref
,
sizeof
(
attrref
));
break
;
}
case
pwr_eType_DataRef
:
{
pwr_tDataRef
dataref
;
sts
=
gdh_NameToAttrref
(
pwr_cNObjid
,
value_str
,
&
dataref
.
Aref
);
if
(
EVEN
(
sts
))
return
XNAV__OBJNOTFOUND
;
dataref
.
Ptr
=
0
;
memcpy
(
buffer_ptr
,
&
dataref
,
sizeof
(
dataref
));
break
;
}
case
pwr_eType_Time
:
{
pwr_tTime
time
;
...
...
@@ -596,7 +606,22 @@ void xnav_attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
case
pwr_eType_AttrRef
:
{
attrref
=
(
pwr_sAttrRef
*
)
value_ptr
;
sts
=
gdh_AttrrefToName
(
attrref
,
hiername
,
sizeof
(
hiername
),
cdh_mNName
);
sts
=
gdh_AttrrefToName
(
attrref
,
hiername
,
sizeof
(
hiername
),
cdh_mNName
);
if
(
EVEN
(
sts
))
{
strcpy
(
str
,
""
);
*
len
=
0
;
break
;
}
*
len
=
sprintf
(
str
,
"%s"
,
hiername
);
break
;
}
case
pwr_eType_DataRef
:
{
pwr_tDataRef
*
dataref
;
dataref
=
(
pwr_tDataRef
*
)
value_ptr
;
sts
=
gdh_AttrrefToName
(
&
dataref
->
Aref
,
hiername
,
sizeof
(
hiername
),
cdh_mNName
);
if
(
EVEN
(
sts
))
{
strcpy
(
str
,
""
);
...
...
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