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
b213361d
Commit
b213361d
authored
Jul 07, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ConfigureComponent with diable setting on more than two levels
parent
22ce5007
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
157 additions
and
26 deletions
+157
-26
src/doc/man/en_us/man_dg.dat
src/doc/man/en_us/man_dg.dat
+5
-0
src/doc/man/sv_se/man_dg.dat
src/doc/man/sv_se/man_dg.dat
+5
-0
src/doc/man/sv_se/man_opg.dat
src/doc/man/sv_se/man_opg.dat
+12
-0
src/msg/wb/src/wb_ldh_msg.msg
src/msg/wb/src/wb_ldh_msg.msg
+1
-0
wb/lib/wb/src/wb_c_object.cpp
wb/lib/wb/src/wb_c_object.cpp
+134
-26
No files found.
src/doc/man/en_us/man_dg.dat
View file @
b213361d
...
...
@@ -7131,6 +7131,11 @@ where '3' is the Disable mask of the object (that disables the attributes Contac
CircuitBreaker), and 'Contactor 1' results in disabling a signal attribute in Contactor, and
'CircuitBreaker 1' disables a signal in CircuitBreaker.
There is also another syntax with paranthesis that allows more than two levels. In this example
the object above, Motor, is a part of a larger aggregate.
<c>(5 (Motor 3 (Contactor 1, CircuitBreaker 1), Temp 1))
<b>Component attributes with individual configuration
When the ConfigureComponent method is activated, Disable is removed from all component
...
...
src/doc/man/sv_se/man_dg.dat
View file @
b213361d
...
...
@@ -7028,6 +7028,11 @@ d
och 'Contactor 1' medför att Disable sätts på ett signalattribut i Contactor, och
'CircuitBreaker 1' gör Disable på en signal i CircuitBreaker.
Det finns även en annan syntax med parenteser som tillåter mer än två nivåer. I det här
exemplet är objektet ovan, Motor, del av ett större aggregat.
<c>(5 (Motor 3 (Contactor 1, CircuitBreaker 1), Temp 1))
<b>Komponent-attribut med individuell konfigurering
När ConfigureComponent metoden aktiveras tas Disable bort i alla komponentattribut för att
återställa den tidigare konfigureringen. Ibland har man komponenter-attribut som inte ingår
...
...
src/doc/man/sv_se/man_opg.dat
View file @
b213361d
...
...
@@ -846,6 +846,18 @@ Bilden kommer att
<c>> @mycollection
<h2>Samlingsfönster
En samlingsbild can kopieras till ett separat fönster med /Functions/Collect/Copy To Window.
Även ett tomt fönster kan skapas från Functions/Collect/New Window. Nya attribut kan adderas
till förstret genom att att välja ut attributet i runtime navigatören, och activera
Edit/Insert (Ctrl+V) i samlingsfönstret. Med Shift+PilUpp och Shift+PilNer kan attribut
flyttas upp resp. ner i fönstret.
Ett samlingsfönster sparas från Edit/Save (Ctrl+S) med ett specificerat namn. Det kan
sen öppnas från Functions/CollectOpen i runtime navigatören, eller från File/Open i
ett samlingfönster. Det önskade fönstret öppnas från en lista med alla sparade
samlingsfönster.
</topic>
<headerlevel>
...
...
src/msg/wb/src/wb_ldh_msg.msg
View file @
b213361d
...
...
@@ -149,3 +149,4 @@ db <Database error> /error
noserver <Server not configured> /error
lockstolen <Database lock is stolen> /error
maxwblfiles <Max number of wb_load files exceeded> /error
compsyntax <Configure component syntax error> /error
\ No newline at end of file
wb/lib/wb/src/wb_c_object.cpp
View file @
b213361d
...
...
@@ -50,6 +50,8 @@
#include "cow_login.h"
#include "wb_wtt.h"
static
pwr_tStatus
configure_parse_attr
(
ldh_sMenuCall
*
ip
,
pwr_tAttrRef
*
parent
,
char
*
str
);
static
pwr_tStatus
CopyObject
(
ldh_sMenuCall
*
ip
)
{
...
...
@@ -868,6 +870,86 @@ static pwr_tStatus configure_object_reset( ldh_sMenuCall *ip, pwr_sAttrRef *aref
return
LDH__SUCCESS
;
}
static
pwr_tStatus
configure_attrmask
(
ldh_sMenuCall
*
ip
,
pwr_tAttrRef
*
parent
,
char
*
str1
)
{
char
vect
[
10
][
80
];
int
vect_cnt
;
char
*
s
;
char
str2
[
80
];
int
i
;
pwr_tStatus
sts
;
vect_cnt
=
0
;
s
=
strchr
(
str1
,
'('
);
if
(
s
)
{
strcpy
(
str2
,
s
+
1
);
if
(
str2
[
strlen
(
str2
)
-
1
]
!=
')'
)
return
LDH__COMPSYNTAX
;
str2
[
strlen
(
str2
)
-
1
]
=
0
;
// Get items
int
len
;
int
parlevel
=
0
;
char
*
start
=
str2
;
for
(
s
=
str2
;
*
s
;
s
++
)
{
if
(
*
s
==
'('
)
parlevel
++
;
else
if
(
*
s
==
')'
)
parlevel
--
;
if
(
parlevel
==
0
&&
*
s
==
','
)
{
len
=
s
-
start
;
strncpy
(
vect
[
vect_cnt
],
start
,
len
);
vect
[
vect_cnt
][
len
]
=
0
;
vect_cnt
++
;
start
=
s
+
1
;
}
}
len
=
s
-
start
;
strncpy
(
vect
[
vect_cnt
],
start
,
len
);
vect
[
vect_cnt
][
len
]
=
0
;
vect_cnt
++
;
}
for
(
i
=
0
;
i
<
vect_cnt
;
i
++
)
{
dcli_trim
(
vect
[
i
],
vect
[
i
]);
sts
=
configure_parse_attr
(
ip
,
parent
,
vect
[
i
]);
if
(
EVEN
(
sts
))
return
sts
;
}
return
LDH__SUCCESS
;
}
static
pwr_tStatus
configure_parse_attr
(
ldh_sMenuCall
*
ip
,
pwr_tAttrRef
*
parent
,
char
*
str
)
{
int
nr
;
unsigned
int
disable_mask
;
char
attr
[
80
];
pwr_tAttrRef
aaref
;
pwr_tStatus
sts
;
// Read attribute and mask
nr
=
sscanf
(
str
,
"%s %d"
,
attr
,
&
disable_mask
);
if
(
nr
!=
2
)
return
LDH__COMPSYNTAX
;
// printf( "-- Setting disable mask %d on object '%s'\n", disable_mask, attr);
sts
=
ldh_ArefANameToAref
(
ip
->
PointedSession
,
parent
,
attr
,
&
aaref
);
if
(
ODD
(
sts
))
{
sts
=
configure_object
(
ip
,
&
aaref
,
disable_mask
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
configure_attrmask
(
ip
,
&
aaref
,
str
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
LDH__SUCCESS
;
}
static
pwr_tStatus
ConfigureComponent
(
ldh_sMenuCall
*
ip
)
{
pwr_tStatus
sts
;
...
...
@@ -888,37 +970,63 @@ static pwr_tStatus ConfigureComponent( ldh_sMenuCall *ip)
configure_object_reset
(
ip
,
&
ip
->
Pointed
,
&
mb
);
// Set disable attributes from argument 0
vect_cnt
=
dcli_parse
(
mb
.
MethodArguments
[
0
],
","
,
""
,
(
char
*
)
vect
,
sizeof
(
vect
)
/
sizeof
(
vect
[
0
]),
sizeof
(
vect
[
0
]),
0
);
if
(
mb
.
MethodArguments
[
0
][
0
]
!=
'('
)
{
// Old syntax, eg '7, CircuitBreaker 4, Contactor 5'
vect_cnt
=
dcli_parse
(
mb
.
MethodArguments
[
0
],
","
,
""
,
(
char
*
)
vect
,
sizeof
(
vect
)
/
sizeof
(
vect
[
0
]),
sizeof
(
vect
[
0
]),
0
);
for
(
i
=
0
;
i
<
vect_cnt
;
i
++
)
{
nr
=
dcli_parse
(
vect
[
i
],
" "
,
""
,
(
char
*
)
item
,
sizeof
(
item
)
/
sizeof
(
item
[
0
]),
sizeof
(
item
[
0
]),
0
);
if
(
nr
==
1
)
{
if
(
sscanf
(
item
[
0
],
"%d"
,
&
disable_mask
)
!=
1
)
graph_configuration
=
0
;
sts
=
configure_object
(
ip
,
&
ip
->
Pointed
,
disable_mask
);
if
(
EVEN
(
sts
))
return
sts
;
for
(
i
=
0
;
i
<
vect_cnt
;
i
++
)
{
nr
=
dcli_parse
(
vect
[
i
],
" "
,
""
,
(
char
*
)
item
,
sizeof
(
item
)
/
sizeof
(
item
[
0
]),
sizeof
(
item
[
0
]),
0
);
if
(
nr
==
1
)
{
if
(
sscanf
(
item
[
0
],
"%d"
,
&
disable_mask
)
!=
1
)
graph_configuration
=
0
;
sts
=
configure_object
(
ip
,
&
ip
->
Pointed
,
disable_mask
);
if
(
EVEN
(
sts
))
return
sts
;
}
else
if
(
nr
==
2
)
{
pwr_tAName
aname
;
if
(
sscanf
(
item
[
1
],
"%d"
,
&
disable_mask
)
!=
1
)
disable_mask
=
0
;
strcpy
(
aname
,
item
[
0
]);
sts
=
ldh_ArefANameToAref
(
ip
->
PointedSession
,
&
ip
->
Pointed
,
aname
,
&
aaref
);
if
(
ODD
(
sts
))
{
sts
=
configure_object
(
ip
,
&
aaref
,
disable_mask
);
if
(
EVEN
(
sts
))
return
sts
;
}
}
}
else
if
(
nr
==
2
)
{
pwr_tAName
aname
;
}
else
{
// New syntax, eg '(7 (CircuitBreaker 4, Contactor 5))'
char
str1
[
80
];
char
*
s
;
if
(
sscanf
(
item
[
1
],
"%d"
,
&
disable_mask
)
!=
1
)
disable_mask
=
0
;
strcpy
(
str1
,
&
mb
.
MethodArguments
[
0
][
1
]);
s
=
strrchr
(
str1
,
')'
);
if
(
!
s
)
return
LDH__COMPSYNTAX
;
strcpy
(
aname
,
item
[
0
]);
*
s
=
0
;
dcli_trim
(
str1
,
str1
);
nr
=
sscanf
(
str1
,
"%d"
,
&
disable_mask
);
if
(
nr
!=
1
)
return
LDH__COMPSYNTAX
;
sts
=
ldh_ArefANameToAref
(
ip
->
PointedSession
,
&
ip
->
Pointed
,
aname
,
&
aaref
);
if
(
ODD
(
sts
))
{
sts
=
configure_object
(
ip
,
&
aaref
,
disable_mask
);
if
(
EVEN
(
sts
))
return
sts
;
}
}
sts
=
configure_object
(
ip
,
&
ip
->
Pointed
,
disable_mask
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
configure_attrmask
(
ip
,
&
ip
->
Pointed
,
str1
);
if
(
EVEN
(
sts
))
return
sts
;
}
// Set GraphConfiguration from argument 1
...
...
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