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
3f561ce6
Commit
3f561ce6
authored
Nov 03, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Functionobject EnumToStr added
parent
a792d6c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
2 deletions
+36
-2
src/lib/rt/src/rt_plc_io.c
src/lib/rt/src/rt_plc_io.c
+31
-0
src/wbl/pwrb/src/pwrb_c_enumtostr.wb_load
src/wbl/pwrb/src/pwrb_c_enumtostr.wb_load
+2
-2
wb/exp/wb/src/pwr_wb_palette.cnf
wb/exp/wb/src/pwr_wb_palette.cnf
+3
-0
No files found.
src/lib/rt/src/rt_plc_io.c
View file @
3f561ce6
...
...
@@ -492,3 +492,34 @@ void EnumToStr_exec( plc_sThread *tp,
strcpy
(
o
->
ActVal
,
""
);
}
/*_*
STRTOENUM
@aref strtoenum STRTOENUM
*/
void
StrToEnum_init
(
pwr_sClass_StrToEnum
*
o
)
{
if
(
EVEN
(
gdh_GetEnumValueDef
(
o
->
TypeId
,
(
gdh_sValueDef
**
)
&
o
->
EnumDefP
,
(
int
*
)
&
o
->
EnumDefRows
)))
o
->
EnumDefP
=
0
;
}
void
StrToEnum_exec
(
plc_sThread
*
tp
,
pwr_sClass_StrToEnum
*
o
)
{
int
i
;
int
found
=
0
;
if
(
!
o
->
EnumDefP
)
return
;
for
(
i
=
0
;
i
<
o
->
EnumDefRows
;
i
++
)
{
if
(
strcmp
(
(
char
*
)
o
->
StrP
,
((
gdh_sValueDef
*
)
o
->
EnumDefP
)[
i
].
Value
->
Text
)
==
0
)
{
o
->
ActVal
=
((
gdh_sValueDef
*
)
o
->
EnumDefP
)[
i
].
Value
->
Value
;
found
=
1
;
break
;
}
}
if
(
!
found
)
o
->
ActVal
=
0
;
}
src/wbl/pwrb/src/pwrb_c_enumtostr.wb_load
View file @
3f561ce6
...
...
@@ -91,7 +91,7 @@ SObject pwrb:Class
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_
NOEDIT
Attr Flags |= PWR_MASK_
INVISIBLE
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
...
...
@@ -101,7 +101,7 @@ SObject pwrb:Class
Object EnumDefRows $Intern 4
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_
NOEDIT
Attr Flags |= PWR_MASK_
INVISIBLE
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
...
...
wb/exp/wb/src/pwr_wb_palette.cnf
View file @
3f561ce6
...
...
@@ -338,6 +338,7 @@ palette NavigatorPalette
{
class OneWire
class OneWire_AiDevice
class OneWire_AoDevice
class Maxim_DS18B20
}
menu SPI
...
...
@@ -381,6 +382,7 @@ palette NavigatorPalette
class RemnodeTCP
class RemnodeUDP
class Remnode3964R
class RemnodeRK512
class RemTrans
menu Buffers
{
...
...
@@ -922,6 +924,7 @@ palette PlcEditorPalette
class ItoUInt64
class MaskToD
class NameToStr
class StrToEnum
class UInt64toI
class UInt32toI
}
...
...
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