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
e14d1bc8
Commit
e14d1bc8
authored
May 31, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of claes@pwrcvs:/data1/git/pwr
parents
3b338359
9a50a70f
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1276 additions
and
413 deletions
+1276
-413
misc/lib/misc/src/misc_plc.c
misc/lib/misc/src/misc_plc.c
+25
-6
misc/mmi/misc/src/misc_pingpong_settings.pwg
misc/mmi/misc/src/misc_pingpong_settings.pwg
+1
-1
misc/mmi/misc/src/pwr_c_misc_pingpong.pwg
misc/mmi/misc/src/pwr_c_misc_pingpong.pwg
+695
-300
misc/wbl/misc/src/miscellaneous.wb_load
misc/wbl/misc/src/miscellaneous.wb_load
+22
-3
otherio/lib/cifx_dummy/src/cifx_dummy_functions.c
otherio/lib/cifx_dummy/src/cifx_dummy_functions.c
+42
-0
otherio/lib/cifx_dummy/src/os_templ/hw_templ/makefile
otherio/lib/cifx_dummy/src/os_templ/hw_templ/makefile
+15
-0
otherio/lib/rt/src/os_linux/rt_io_m_hilscher_cifx_pncontroller.cpp
...ib/rt/src/os_linux/rt_io_m_hilscher_cifx_pncontroller.cpp
+152
-101
otherio/wbl/mcomp/src/otherio.wb_load
otherio/wbl/mcomp/src/otherio.wb_load
+314
-0
profibus/lib/rt/src/os_linux/rt_io_pn_locals.h
profibus/lib/rt/src/os_linux/rt_io_pn_locals.h
+3
-2
profibus/wbl/mcomp/src/profibus.wb_load
profibus/wbl/mcomp/src/profibus.wb_load
+7
-0
No files found.
misc/lib/misc/src/misc_plc.c
View file @
e14d1bc8
...
...
@@ -21,6 +21,7 @@
#include <math.h>
#include <stdlib.h>
#include <float.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_miscellaneousclasses.h"
...
...
@@ -29,6 +30,7 @@
#include "co_time.h"
#define BASE_SPEED 10
#define MAX_ANGLE 60
static
float
my_random
()
{
static
unsigned
int
seed
=
100
;
...
...
@@ -66,7 +68,7 @@ void Misc_PingPongFo_init( pwr_sClass_Misc_PingPongFo *o)
void
Misc_PingPongFo_exec
(
plc_sThread
*
tp
,
pwr_sClass_Misc_PingPongFo
*
o
)
{
pwr_sClass_Misc_PingPong
*
co
=
(
pwr_sClass_Misc_PingPong
*
)
o
->
PlcConnectP
;
if
(
!
co
)
if
(
!
co
||
fabs
(
co
->
Width
<
FLT_EPSILON
)
)
return
;
co
->
XCoordinate
+=
co
->
Speed
*
tp
->
PlcThread
->
ScanTime
*
cos
(
co
->
Direction
/
180
*
M_PI
);
...
...
@@ -81,7 +83,7 @@ void Misc_PingPongFo_exec( plc_sThread *tp, pwr_sClass_Misc_PingPongFo *o)
co
->
RightPos
=
*
co
->
RightKnobPtr
;
else
co
->
RightPos
=
co
->
RightSlider
;
switch
(
co
->
Mode
)
{
case
pwr_eMisc_PingPongModeEnum_Idle
:
{
if
(
co
->
OldMode
!=
co
->
Mode
)
{
...
...
@@ -100,7 +102,7 @@ void Misc_PingPongFo_exec( plc_sThread *tp, pwr_sClass_Misc_PingPongFo *o)
co
->
Direction
=
-
co
->
Direction
+
180
+
my_random
()
*
10
;
else
co
->
Direction
=
-
co
->
Direction
-
180
+
my_random
()
*
10
;
if
(
fabs
(
co
->
Direction
)
>
45
)
if
(
fabs
(
co
->
Direction
)
>
MAX_ANGLE
)
co
->
Direction
=
my_random
()
*
10
;
}
...
...
@@ -151,7 +153,7 @@ void Misc_PingPongFo_exec( plc_sThread *tp, pwr_sClass_Misc_PingPongFo *o)
co
->
Direction
=
-
co
->
Direction
+
180
+
my_random
()
*
20
;
else
co
->
Direction
=
-
co
->
Direction
-
180
+
my_random
()
*
20
;
if
(
fabs
(
co
->
Direction
)
>
45
)
if
(
fabs
(
co
->
Direction
)
>
MAX_ANGLE
)
co
->
Direction
=
my_random
()
*
10
;
co
->
Speed
=
BASE_SPEED
*
co
->
LeftLevel
*
co
->
LevelFactor
;
}
...
...
@@ -212,7 +214,8 @@ void Misc_PingPongFo_exec( plc_sThread *tp, pwr_sClass_Misc_PingPongFo *o)
break
;
}
case
pwr_eMisc_PingPongModeEnum_TwoPlayers
:
{
if
(
co
->
OldMode
!=
co
->
Mode
)
{
if
(
co
->
OldMode
!=
co
->
Mode
||
co
->
NewMatch
)
{
co
->
NewMatch
=
0
;
co
->
State
=
pwr_eMisc_PingPongStateEnum_ServeRight
;
time_GetTime
(
&
co
->
StateShiftTime
);
co
->
LeftScore
=
0
;
...
...
@@ -239,7 +242,7 @@ void Misc_PingPongFo_exec( plc_sThread *tp, pwr_sClass_Misc_PingPongFo *o)
co
->
Direction
=
-
co
->
Direction
+
180
+
my_random
()
*
20
;
else
co
->
Direction
=
-
co
->
Direction
-
180
+
my_random
()
*
20
;
if
(
fabs
(
co
->
Direction
)
>
45
)
if
(
fabs
(
co
->
Direction
)
>
MAX_ANGLE
)
co
->
Direction
=
my_random
()
*
10
;
co
->
Speed
=
BASE_SPEED
*
co
->
LeftLevel
*
co
->
LevelFactor
;
}
...
...
@@ -323,5 +326,21 @@ void Misc_PingPongFo_exec( plc_sThread *tp, pwr_sClass_Misc_PingPongFo *o)
break
;
}
}
float
height
;
if
(
fabs
(
co
->
Direction
)
<
90
)
{
if
(
co
->
XCoordinate
<
co
->
Width
*
3
/
4
)
height
=
(
1
-
co
->
XCoordinate
/
co
->
Width
*
4
/
3
);
else
height
=
((
co
->
XCoordinate
-
co
->
Width
*
3
/
4
)
/
co
->
Width
*
4
);
}
else
{
if
(
co
->
XCoordinate
<
co
->
Width
/
4
)
height
=
(
1
-
co
->
XCoordinate
/
co
->
Width
*
4
);
else
height
=
((
co
->
XCoordinate
-
co
->
Width
/
4
)
/
co
->
Width
*
4
/
3
);
}
co
->
XShadow
=
co
->
XCoordinate
+
height
*
4
;
co
->
YShadow
=
co
->
YCoordinate
+
height
*
1
;
co
->
OldMode
=
co
->
Mode
;
}
misc/mmi/misc/src/misc_pingpong_settings.pwg
View file @
e14d1bc8
...
...
@@ -1150,7 +1150,7 @@ pwr_exe:
1204 0
99
13
1302
1
1302
0
1303 3
1304 0
1305 0
...
...
misc/mmi/misc/src/pwr_c_misc_pingpong.pwg
View file @
e14d1bc8
This diff is collapsed.
Click to expand it.
misc/wbl/misc/src/miscellaneous.wb_load
View file @
e14d1bc8
...
...
@@ -121,7 +121,7 @@ Volume Miscellaneous $ClassVolume 0.0.0.9
Object RtBody $ObjBodyDef 1 08-APR-2011 08:56:23.47
Body SysBody 08-APR-2011 08:56:23.47
Attr StructName = "Misc_PingPong"
Attr NextAix = "_X3
3
"
Attr NextAix = "_X3
6
"
EndBody
!/**
! Mode idle, one player or two players.
...
...
@@ -287,6 +287,20 @@ Volume Miscellaneous $ClassVolume 0.0.0.9
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object XShadow $Attribute 34 25-MAY-2011 19:08:53.70
Body SysBody 25-MAY-2011 19:08:55.25
Attr PgmName = "XShadow"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object YShadow $Attribute 33 25-MAY-2011 19:09:01.74
Body SysBody 25-MAY-2011 19:09:02.90
Attr PgmName = "YShadow"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! Racket width.
!*/
...
...
@@ -349,7 +363,6 @@ Volume Miscellaneous $ClassVolume 0.0.0.9
Object LeftPos $Attribute 31 25-MAY-2011 10:51:24.12
Body SysBody 25-MAY-2011 10:51:26.62
Attr PgmName = "LeftPos"
Attr Flags = 16777216
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
...
...
@@ -359,7 +372,6 @@ Volume Miscellaneous $ClassVolume 0.0.0.9
Object RightPos $Attribute 32 25-MAY-2011 10:51:37.69
Body SysBody 25-MAY-2011 10:51:39.58
Attr PgmName = "RightPos"
Attr Flags = 16777216
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
...
...
@@ -401,6 +413,13 @@ Volume Miscellaneous $ClassVolume 0.0.0.9
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object NewMatch $Attribute 35 26-MAY-2011 16:36:33.79
Body SysBody 26-MAY-2011 16:36:24.24
Attr PgmName = "NewMatch"
Attr Flags = 16778240
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object OldMode $Attribute 22 08-APR-2011 15:09:14.47
Body SysBody 08-APR-2011 15:09:16.01
Attr PgmName = "OldMode"
...
...
otherio/lib/cifx_dummy/src/cifx_dummy_functions.c
0 → 100644
View file @
e14d1bc8
/*
Dummy for libcifx.a
*/
#include <stdint.h>
typedef
void
*
CIFXHANDLE
;
typedef
struct
{
char
p
[
10
];
}
CIFX_PACKET
;
struct
CIFX_LINUX_INIT
{
char
p
[
10
];
};
int32_t
cifXDriverInit
(
const
struct
CIFX_LINUX_INIT
*
init_params
)
{
return
-
1
;}
int32_t
xSysdeviceOpen
(
CIFXHANDLE
hDriver
,
char
*
szBoard
,
CIFXHANDLE
*
phSysdevice
)
{
return
-
1
;}
int32_t
xSysdeviceInfo
(
CIFXHANDLE
hSysdevice
,
uint32_t
ulCmd
,
uint32_t
ulSize
,
void
*
pvInfo
)
{
return
-
1
;}
int32_t
xChannelCommonStatusBlock
(
CIFXHANDLE
hChannel
,
uint32_t
ulCmd
,
uint32_t
ulOffset
,
uint32_t
ulDataLen
,
void
*
pvData
)
{
return
-
1
;}
int32_t
xChannelHostState
(
CIFXHANDLE
hChannel
,
uint32_t
ulCmd
,
uint32_t
*
pulState
,
uint32_t
ulTimeout
)
{
return
-
1
;}
int32_t
xChannelBusState
(
CIFXHANDLE
hChannel
,
uint32_t
ulCmd
,
uint32_t
*
pulState
,
uint32_t
ulTimeout
)
{
return
-
1
;}
int32_t
xDriverOpen
(
CIFXHANDLE
*
phDriver
)
{
return
-
1
;}
int32_t
xChannelOpen
(
CIFXHANDLE
hDriver
,
char
*
szBoard
,
uint32_t
ulChannel
,
CIFXHANDLE
*
phChannel
)
{
return
-
1
;
}
int32_t
xChannelReset
(
CIFXHANDLE
hChannel
,
uint32_t
ulResetMode
,
uint32_t
ulTimeout
)
{
return
-
1
;
}
int32_t
xDriverEnumBoards
(
CIFXHANDLE
hDriver
,
uint32_t
ulBoard
,
uint32_t
ulSize
,
void
*
pvBoardInfo
)
{
return
-
1
;}
int32_t
xDriverEnumChannels
(
CIFXHANDLE
hDriver
,
uint32_t
ulBoard
,
uint32_t
ulChannel
,
uint32_t
ulSize
,
void
*
pvChannelInfo
)
{
return
-
1
;
}
int32_t
xChannelPutPacket
(
CIFXHANDLE
hChannel
,
CIFX_PACKET
*
ptSendPkt
,
uint32_t
ulTimeout
)
{
return
-
1
;}
int32_t
xChannelGetPacket
(
CIFXHANDLE
hChannel
,
uint32_t
ulSize
,
CIFX_PACKET
*
ptRecvPkt
,
uint32_t
ulTimeout
)
{
return
-
1
;
}
int32_t
xChannelIORead
(
CIFXHANDLE
hChannel
,
uint32_t
ulAreaNumber
,
uint32_t
ulOffset
,
uint32_t
ulDataLen
,
void
*
pvData
,
uint32_t
ulTimeout
)
{
return
-
1
;}
int32_t
xDriverGetErrorDescription
(
int32_t
lError
,
char
*
szBuffer
,
uint32_t
ulBufferLen
)
{
return
-
1
;}
int32_t
xChannelIOWrite
(
CIFXHANDLE
hChannel
,
uint32_t
ulAreaNumber
,
uint32_t
ulOffset
,
uint32_t
ulDataLen
,
void
*
pvData
,
uint32_t
ulTimeout
)
{
return
-
1
;}
int32_t
xDriverClose
(
CIFXHANDLE
hDriver
)
{
return
-
1
;}
otherio/lib/cifx_dummy/src/os_templ/hw_templ/makefile
0 → 100644
View file @
e14d1bc8
include
$(pwre_dir_symbols)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq
($($(type_name)_generic_mk),)
-include
$(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq
($($(type_name)_generic_mk),)
include
$(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include
../../special.mk
-include
../special.mk
-include
special.mk
otherio/lib/rt/src/os_linux/rt_io_m_hilscher_cifx_pncontroller.cpp
View file @
e14d1bc8
This diff is collapsed.
Click to expand it.
otherio/wbl/mcomp/src/otherio.wb_load
View file @
e14d1bc8
This diff is collapsed.
Click to expand it.
profibus/lib/rt/src/os_linux/rt_io_pn_locals.h
View file @
e14d1bc8
...
...
@@ -25,8 +25,9 @@
typedef
struct
_io_sPnRackLocal
{
unsigned
short
bytes_of_input
;
unsigned
short
bytes_of_output
;
unsigned
char
*
inputs
;
unsigned
char
*
outputs
;
unsigned
char
*
inputs
;
unsigned
char
*
outputs
;
void
*
userdata
;
}
io_sPnRackLocal
;
typedef
struct
_io_sPnCardLocal
{
...
...
profibus/wbl/mcomp/src/profibus.wb_load
View file @
e14d1bc8
...
...
@@ -2808,6 +2808,9 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Group IO
! @Summary Defines that a Profinet controller stack is installed.
! Configures a Profinet controller stack.
!
! @b See also
! @classlink PnDevice profibus_pndevice.html
!*/
Object PnControllerSoftingPNAK $ClassDef 15 21-APR-2009 13:41:08.17
Body SysBody 21-APR-2009 13:41:08.17
...
...
@@ -2912,6 +2915,10 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Group IO
! @Summary Configures one Profinet device.
! Configures one Profinet device.
!
! @b See also
! @classlink PnControllerSoftingPNAK profibus_pncontrollersoftingpnak.html
! @classlink Hilscher_cifX_PnController otherio_hilscher_cifx_pncontroller.html
!*/
Object PnDevice $ClassDef 16 21-APR-2009 13:41:08.17
Body SysBody 21-APR-2009 13:41:08.17
...
...
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