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
a29eb6e4
Commit
a29eb6e4
authored
Dec 06, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bit output format for masks
parent
3dcb3683
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
1 deletion
+52
-1
xtt/lib/ge/src/ge_dyn.cpp
xtt/lib/ge/src/ge_dyn.cpp
+52
-1
No files found.
xtt/lib/ge/src/ge_dyn.cpp
View file @
a29eb6e4
/*
* Proview $Id: ge_dyn.cpp,v 1.3
6 2005-11-17 09:04:04
claes Exp $
* Proview $Id: ge_dyn.cpp,v 1.3
7 2005-12-06 10:46:09
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -82,6 +82,24 @@ static int dyn_get_typeid( char *format)
return
pwr_eType_Int32
;
}
// Convert a bitmask to binary string
static
char
*
dyn_mask_to_bits
(
unsigned
int
value
,
int
noofbits
)
{
static
char
str
[
40
];
unsigned
int
m
;
m
=
1
<<
(
noofbits
-
1
);
strcpy
(
str
,
""
);
for
(
int
i
=
0
;
i
<
noofbits
;
i
++
)
{
if
(
m
&
value
)
strcat
(
str
,
"1"
);
else
strcat
(
str
,
"0"
);
m
>>=
1
;
}
return
str
;
}
// Replace " to \"
char
*
GeDyn
::
cmd_cnv
(
char
*
instr
)
{
...
...
@@ -3355,6 +3373,27 @@ int GeValue::scan( grow_tObject object)
}
break
;
}
case
pwr_eType_Mask
:
{
switch
(
format
[
strlen
(
format
)
-
1
])
{
case
'b'
:
if
(
strncmp
(
&
format
[
1
],
"16"
,
2
)
==
0
)
strcpy
(
buf
,
dyn_mask_to_bits
(
*
(
unsigned
int
*
)
p
,
16
));
else
strcpy
(
buf
,
dyn_mask_to_bits
(
*
(
unsigned
int
*
)
p
,
32
));
len
=
strlen
(
buf
);
break
;
default:
{
int
sts
;
sts
=
cdh_AttrValueToString
(
(
pwr_eType
)
annot_typeid
,
p
,
buf
,
sizeof
(
buf
));
if
(
EVEN
(
sts
))
sprintf
(
buf
,
"Invalid type"
);
len
=
strlen
(
buf
);
}
}
break
;
}
default:
{
int
sts
;
sts
=
cdh_AttrValueToString
(
(
pwr_eType
)
annot_typeid
,
...
...
@@ -11135,6 +11174,7 @@ int GePulldownMenu::action( grow_tObject object, glow_tEvent event)
GeInvisible
*
invis_element
=
0
;
char
command
[
256
];
char
*
s
;
pwr_tBoolean
value
;
for
(
GeDynElem
*
elem
=
items_dyn
[
i
]
->
elements
;
elem
;
elem
=
elem
->
next
)
{
if
(
elem
->
dyn_type
==
ge_mDynType_Invisible
)
{
...
...
@@ -11159,6 +11199,17 @@ int GePulldownMenu::action( grow_tObject object, glow_tEvent event)
if
(
EVEN
(
sts
))
info
.
item
[
i
].
type
=
glow_eMenuItem_ButtonDisabled
;
}
else
{
sts
=
gdh_GetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
ODD
(
sts
))
{
if
(
(
!
inverted
&&
value
)
||
(
inverted
&&
!
value
))
{
if
(
invis_element
->
dimmed
)
info
.
item
[
i
].
type
=
glow_eMenuItem_ButtonDisabled
;
else
info
.
item
[
i
].
occupied
=
false
;
}
}
}
}
}
}
...
...
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