Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
230f76d7
Commit
230f76d7
authored
Jul 30, 2014
by
Aleksey Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
переименовал флаг и методы
parent
19acdd2a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
47 deletions
+16
-47
UNetExchange.cc
extensions/UNetUDP/UNetExchange.cc
+2
-10
UNetExchange.h
extensions/UNetUDP/UNetExchange.h
+3
-2
UNetReceiver.cc
extensions/UNetUDP/UNetReceiver.cc
+7
-31
UNetReceiver.h
extensions/UNetUDP/UNetReceiver.h
+4
-4
No files found.
extensions/UNetUDP/UNetExchange.cc
View file @
230f76d7
...
...
@@ -765,20 +765,12 @@ void UNetExchange::receiverEvent( UNetReceiver* r, UNetReceiver::Event ev )
}
}
// -----------------------------------------------------------------------------
void
UNetExchange
::
enable
(
UniSetTypes
::
ObjectId
id
)
void
UNetExchange
::
ignore_item
(
UniSetTypes
::
ObjectId
id
,
bool
set
)
{
std
::
list
<
UNetReceiver
*>
rList
=
get_receivers
();
std
::
list
<
UNetReceiver
*>::
iterator
rIt
=
rList
.
begin
();
for
(;
rIt
!=
rList
.
end
();
++
rIt
)
(
*
rIt
)
->
enable
(
id
);
}
// -----------------------------------------------------------------------------
void
UNetExchange
::
disable
(
UniSetTypes
::
ObjectId
id
)
{
std
::
list
<
UNetReceiver
*>
rList
=
get_receivers
();
std
::
list
<
UNetReceiver
*>::
iterator
rIt
=
rList
.
begin
();
for
(;
rIt
!=
rList
.
end
();
++
rIt
)
(
*
rIt
)
->
disable
(
id
);
(
*
rIt
)
->
ignore_item
(
id
,
set
);
}
// -----------------------------------------------------------------------------
std
::
list
<
UNetReceiver
*>
UNetExchange
::
get_receivers
()
...
...
extensions/UNetUDP/UNetExchange.h
View file @
230f76d7
...
...
@@ -90,9 +90,10 @@ class UNetExchange:
static
void
help_print
(
int
argc
,
const
char
*
argv
[]
);
bool
checkExistUNetHost
(
const
std
::
string
&
host
,
ost
::
tpport_t
port
);
std
::
list
<
UNetReceiver
*>
get_receivers
();
void
enable
(
UniSetTypes
::
ObjectId
id
=
UniSetTypes
::
DefaultObjectId
);
void
disable
(
UniSetTypes
::
ObjectId
id
=
UniSetTypes
::
DefaultObjectId
);
/*! игнорировать запись датчик в шару */
void
ignore_item
(
UniSetTypes
::
ObjectId
id
=
UniSetTypes
::
DefaultObjectId
,
bool
set
=
true
);
protected
:
xmlNode
*
cnode
;
...
...
extensions/UNetUDP/UNetReceiver.cc
View file @
230f76d7
...
...
@@ -297,7 +297,7 @@ void UNetReceiver::real_update()
if
(
lockUpdate
)
continue
;
}
if
(
!
ii
.
updat
e
)
if
(
ii
.
ignor
e
)
continue
;
else
if
(
ii
.
iotype
==
UniversalIO
::
DigitalInput
)
shm
->
localSaveState
(
ii
.
dit
,
id
,
val
,
shm
->
ID
());
...
...
@@ -342,7 +342,7 @@ void UNetReceiver::real_update()
continue
;
}
if
(
!
ii
.
updat
e
)
if
(
ii
.
ignor
e
)
continue
;
else
if
(
ii
.
iotype
==
UniversalIO
::
DigitalInput
)
shm
->
localSaveState
(
ii
.
dit
,
d
.
id
,
d
.
val
,
shm
->
ID
());
...
...
@@ -522,49 +522,25 @@ void UNetReceiver::initIterators()
}
}
// -----------------------------------------------------------------------------
void
UNetReceiver
::
enable
(
UniSetTypes
::
ObjectId
id
)
void
UNetReceiver
::
ignore_item
(
UniSetTypes
::
ObjectId
id
,
bool
set
)
{
for
(
ItemVec
::
iterator
it
=
d_icache
.
begin
();
it
!=
d_icache
.
end
();
++
it
)
{
if
(
id
==
UniSetTypes
::
DefaultObjectId
)
it
->
update
=
true
;
it
->
ignore
=
set
;
else
if
(
id
==
it
->
id
)
{
it
->
update
=
true
;
it
->
ignore
=
set
;
return
;
}
}
for
(
ItemVec
::
iterator
it
=
a_icache
.
begin
();
it
!=
a_icache
.
end
();
++
it
)
{
if
(
id
==
UniSetTypes
::
DefaultObjectId
)
it
->
update
=
true
;
it
->
ignore
=
set
;
else
if
(
id
==
it
->
id
)
{
it
->
update
=
true
;
return
;
}
}
}
// -----------------------------------------------------------------------------
void
UNetReceiver
::
disable
(
UniSetTypes
::
ObjectId
id
)
{
for
(
ItemVec
::
iterator
it
=
d_icache
.
begin
();
it
!=
d_icache
.
end
();
++
it
)
{
if
(
id
==
UniSetTypes
::
DefaultObjectId
)
it
->
update
=
false
;
else
if
(
id
==
it
->
id
)
{
it
->
update
=
false
;
return
;
}
}
for
(
ItemVec
::
iterator
it
=
a_icache
.
begin
();
it
!=
a_icache
.
end
();
++
it
)
{
if
(
id
==
UniSetTypes
::
DefaultObjectId
)
it
->
update
=
false
;
else
if
(
id
==
it
->
id
)
{
it
->
update
=
false
;
it
->
ignore
=
set
;
return
;
}
}
...
...
extensions/UNetUDP/UNetReceiver.h
View file @
230f76d7
...
...
@@ -93,8 +93,8 @@ class UNetReceiver
typedef
sigc
::
slot
<
void
,
UNetReceiver
*
,
Event
>
EventSlot
;
void
connectEvent
(
EventSlot
sl
);
void
enable
(
UniSetTypes
::
ObjectId
id
=
UniSetTypes
::
DefaultObjectId
);
void
disable
(
UniSetTypes
::
ObjectId
id
=
UniSetTypes
::
DefaultObjectId
);
/*! игнорировать запись датчик в шару */
void
ignore_item
(
UniSetTypes
::
ObjectId
id
=
UniSetTypes
::
DefaultObjectId
,
bool
set
=
true
);
protected
:
...
...
@@ -176,12 +176,12 @@ class UNetReceiver
IOController
::
AIOStateList
::
iterator
ait
;
IOController
::
DIOStateList
::
iterator
dit
;
UniversalIO
::
IOTypes
iotype
;
bool
update
;
bool
ignore
;
/*!< флаг игнорирования сохранения в SM*/
ItemInfo
()
:
id
(
UniSetTypes
::
DefaultObjectId
),
iotype
(
UniversalIO
::
UnknownIOType
),
update
(
tru
e
){}
ignore
(
fals
e
){}
};
typedef
std
::
vector
<
ItemInfo
>
ItemVec
;
...
...
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