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
996feb81
Commit
996feb81
authored
Jun 09, 2008
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bit type in SetDig, ResetDig and ToggleDig added
parent
f9b062ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
139 additions
and
27 deletions
+139
-27
xtt/lib/ge/src/ge_dyn.cpp
xtt/lib/ge/src/ge_dyn.cpp
+139
-27
No files found.
xtt/lib/ge/src/ge_dyn.cpp
View file @
996feb81
/*
/*
* Proview $Id: ge_dyn.cpp,v 1.6
3 2008-04-15 16:01:16
claes Exp $
* Proview $Id: ge_dyn.cpp,v 1.6
4 2008-06-09 14:33:12
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -9188,7 +9188,6 @@ int GeSetDig::action( grow_tObject object, glow_tEvent event)
...
@@ -9188,7 +9188,6 @@ int GeSetDig::action( grow_tObject object, glow_tEvent event)
break
;
break
;
case
glow_eEvent_Key_Return
:
case
glow_eEvent_Key_Return
:
case
glow_eEvent_MB1Click
:
{
case
glow_eEvent_MB1Click
:
{
pwr_tBoolean
value
=
1
;
int
sts
;
int
sts
;
pwr_tAName
parsed_name
;
pwr_tAName
parsed_name
;
int
inverted
;
int
inverted
;
...
@@ -9201,18 +9200,57 @@ int GeSetDig::action( grow_tObject object, glow_tEvent event)
...
@@ -9201,18 +9200,57 @@ int GeSetDig::action( grow_tObject object, glow_tEvent event)
db
=
dyn
->
parse_attr_name
(
attribute
,
parsed_name
,
&
inverted
,
&
attr_type
,
db
=
dyn
->
parse_attr_name
(
attribute
,
parsed_name
,
&
inverted
,
&
attr_type
,
&
attr_size
);
&
attr_size
);
switch
(
db
)
{
switch
(
db
)
{
case
graph_eDatabase_Local
:
case
graph_eDatabase_Local
:
{
pwr_tBoolean
value
=
1
;
sts
=
dyn
->
graph
->
localdb_set_value
(
parsed_name
,
&
value
,
sizeof
(
value
));
sts
=
dyn
->
graph
->
localdb_set_value
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
printf
(
"SetDig error: %s
\n
"
,
attribute
);
if
(
EVEN
(
sts
))
printf
(
"SetDig error: %s
\n
"
,
attribute
);
break
;
break
;
}
case
graph_eDatabase_Gdh
:
case
graph_eDatabase_Gdh
:
sts
=
gdh_SetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
switch
(
attr_type
)
{
if
(
EVEN
(
sts
))
printf
(
"SetDig error: %s
\n
"
,
attribute
);
case
pwr_eType_Boolean
:
{
pwr_tBoolean
value
=
1
;
sts
=
gdh_SetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
printf
(
"SetDig error: %s
\n
"
,
attribute
);
break
;
}
case
graph_eType_Bit
:
{
// Get bit number from parsed name
pwr_tUInt32
value
=
1
;
char
*
s
;
int
bitnum
;
if
(
(
s
=
strchr
(
parsed_name
,
'['
)))
{
sscanf
(
s
+
1
,
"%d"
,
&
bitnum
);
*
s
=
0
;
if
(
!
(
bitnum
>=
0
&&
bitnum
<
32
))
break
;
}
sts
=
gdh_GetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
{
printf
(
"SetDig error: %s
\n
"
,
attribute
);
break
;
}
value
|=
(
1
<<
bitnum
);
sts
=
gdh_SetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
printf
(
"SetDig error: %s
\n
"
,
attribute
);
break
;
}
default:
;
}
break
;
break
;
case
graph_eDatabase_Ccm
:
case
graph_eDatabase_Ccm
:
{
pwr_tBoolean
value
=
1
;
sts
=
dyn
->
graph
->
ccm_set_variable
(
parsed_name
,
attr_type
,
&
value
);
sts
=
dyn
->
graph
->
ccm_set_variable
(
parsed_name
,
attr_type
,
&
value
);
if
(
EVEN
(
sts
))
printf
(
"SetDig error: %s
\n
"
,
attribute
);
if
(
EVEN
(
sts
))
printf
(
"SetDig error: %s
\n
"
,
attribute
);
break
;
break
;
}
default:
default:
;
;
}
}
...
@@ -9351,7 +9389,6 @@ int GeResetDig::action( grow_tObject object, glow_tEvent event)
...
@@ -9351,7 +9389,6 @@ int GeResetDig::action( grow_tObject object, glow_tEvent event)
break
;
break
;
case
glow_eEvent_Key_Return
:
case
glow_eEvent_Key_Return
:
case
glow_eEvent_MB1Click
:
{
case
glow_eEvent_MB1Click
:
{
pwr_tBoolean
value
=
0
;
int
sts
;
int
sts
;
pwr_tAName
parsed_name
;
pwr_tAName
parsed_name
;
int
inverted
;
int
inverted
;
...
@@ -9361,8 +9398,43 @@ int GeResetDig::action( grow_tObject object, glow_tEvent event)
...
@@ -9361,8 +9398,43 @@ int GeResetDig::action( grow_tObject object, glow_tEvent event)
break
;
break
;
dyn
->
parse_attr_name
(
attribute
,
parsed_name
,
&
inverted
,
&
attr_type
,
&
attr_size
);
dyn
->
parse_attr_name
(
attribute
,
parsed_name
,
&
inverted
,
&
attr_type
,
&
attr_size
);
sts
=
gdh_SetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
printf
(
"ResetDig error: %s
\n
"
,
attribute
);
switch
(
attr_type
)
{
case
pwr_eType_Boolean
:
{
pwr_tBoolean
value
=
0
;
sts
=
gdh_SetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
printf
(
"SetDig error: %s
\n
"
,
attribute
);
break
;
}
case
graph_eType_Bit
:
{
// Get bit number from parsed name
pwr_tUInt32
value
=
0
;
char
*
s
;
int
bitnum
;
if
(
(
s
=
strchr
(
parsed_name
,
'['
)))
{
sscanf
(
s
+
1
,
"%d"
,
&
bitnum
);
*
s
=
0
;
if
(
!
(
bitnum
>=
0
&&
bitnum
<
32
))
break
;
}
sts
=
gdh_GetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
{
printf
(
"ResetDig error: %s
\n
"
,
attribute
);
break
;
}
value
&=
~
(
1
<<
bitnum
);
sts
=
gdh_SetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
printf
(
"ResetDig error: %s
\n
"
,
attribute
);
break
;
}
default:
;
}
break
;
break
;
}
}
default:
;
default:
;
...
@@ -9468,7 +9540,6 @@ int GeToggleDig::action( grow_tObject object, glow_tEvent event)
...
@@ -9468,7 +9540,6 @@ int GeToggleDig::action( grow_tObject object, glow_tEvent event)
break
;
break
;
case
glow_eEvent_Key_Return
:
case
glow_eEvent_Key_Return
:
case
glow_eEvent_MB1Click
:
{
case
glow_eEvent_MB1Click
:
{
pwr_tBoolean
value
;
int
sts
;
int
sts
;
pwr_tAName
parsed_name
;
pwr_tAName
parsed_name
;
int
inverted
;
int
inverted
;
...
@@ -9483,33 +9554,74 @@ int GeToggleDig::action( grow_tObject object, glow_tEvent event)
...
@@ -9483,33 +9554,74 @@ int GeToggleDig::action( grow_tObject object, glow_tEvent event)
dyn
->
graph
->
get_reference_name
(
parsed_name
,
parsed_name
);
dyn
->
graph
->
get_reference_name
(
parsed_name
,
parsed_name
);
switch
(
db
)
{
switch
(
db
)
{
case
graph_eDatabase_Gdh
:
case
graph_eDatabase_Gdh
:
{
sts
=
gdh_GetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
switch
(
attr_type
)
{
case
pwr_eType_Boolean
:
{
pwr_tBoolean
value
;
sts
=
gdh_GetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
printf
(
"ToggleDig error: %s
\n
"
,
attribute
);
value
=
!
value
;
sts
=
gdh_SetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
printf
(
"ToggleDig error: %s
\n
"
,
attribute
);
break
;
}
case
graph_eType_Bit
:
{
// Get bit number from parsed name
pwr_tUInt32
value
;
char
*
s
;
int
bitnum
;
if
(
(
s
=
strchr
(
parsed_name
,
'['
)))
{
sscanf
(
s
+
1
,
"%d"
,
&
bitnum
);
*
s
=
0
;
if
(
!
(
bitnum
>=
0
&&
bitnum
<
32
))
break
;
}
sts
=
gdh_GetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
{
printf
(
"ToggleDig error: %s
\n
"
,
attribute
);
break
;
}
if
(
value
&
(
1
<<
bitnum
))
value
&=
~
(
1
<<
bitnum
);
else
value
|=
(
1
<<
bitnum
);
sts
=
gdh_SetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
printf
(
"ToggleDig error: %s
\n
"
,
attribute
);
break
;
}
default:
;
}
break
;
break
;
case
graph_eDatabase_Local
:
}
case
graph_eDatabase_Local
:
{
sts
=
dyn
->
graph
->
localdb_toggle_value
(
parsed_name
);
sts
=
dyn
->
graph
->
localdb_toggle_value
(
parsed_name
);
if
(
EVEN
(
sts
))
printf
(
"ToggleDig error: %s
\n
"
,
attribute
);
break
;
break
;
case
graph_eDatabase_Ccm
:
sts
=
dyn
->
graph
->
ccm_get_variable
(
parsed_name
,
attr_type
,
&
value
);
break
;
default:
;
}
}
if
(
EVEN
(
sts
))
printf
(
"ToggleDig error: %s
\n
"
,
attribute
);
case
graph_eDatabase_Ccm
:
{
pwr_tBoolean
value
;
value
=
!
value
;
sts
=
dyn
->
graph
->
ccm_get_variable
(
parsed_name
,
attr_type
,
&
value
);
if
(
EVEN
(
sts
))
printf
(
"ToggleDig error: %s
\n
"
,
attribute
);
switch
(
db
)
{
value
=
!
value
;
case
graph_eDatabase_Gdh
:
sts
=
gdh_SetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
break
;
case
graph_eDatabase_Local
:
break
;
case
graph_eDatabase_Ccm
:
sts
=
dyn
->
graph
->
ccm_set_variable
(
parsed_name
,
attr_type
,
&
value
);
sts
=
dyn
->
graph
->
ccm_set_variable
(
parsed_name
,
attr_type
,
&
value
);
if
(
EVEN
(
sts
))
printf
(
"ToggleDig error: %s
\n
"
,
attribute
);
break
;
break
;
}
default:
;
default:
;
}
}
if
(
EVEN
(
sts
))
printf
(
"ToggleDig error: %s
\n
"
,
attribute
);
break
;
break
;
}
}
default:
;
default:
;
...
...
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