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
b0310ae3
Commit
b0310ae3
authored
Nov 11, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(UNet): ненмого подправил изменения от <uzum>.
parent
2b89a801
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
15 deletions
+21
-15
UNetExchange.cc
extensions/UNetUDP/UNetExchange.cc
+4
-4
UNetExchange.h
extensions/UNetUDP/UNetExchange.h
+8
-4
UNetReceiver.cc
extensions/UNetUDP/UNetReceiver.cc
+4
-4
UNetReceiver.h
extensions/UNetUDP/UNetReceiver.h
+5
-2
UNetSender.cc
extensions/UNetUDP/UNetSender.cc
+0
-1
No files found.
extensions/UNetUDP/UNetExchange.cc
View file @
b0310ae3
...
...
@@ -356,8 +356,8 @@ UNetReceiver* UNetExchange::create_receiver( const std::string& h, const ost::tp
return
new
UNetReceiver
(
h
,
p
,
shm
);
}
// -----------------------------------------------------------------------------
UNetSender
*
UNetExchange
::
create_sender
(
const
std
::
string
h
,
const
ost
::
tpport_t
p
,
SMInterface
*
shm
,
const
std
::
string
s_field
,
const
std
::
string
s_fvalue
,
SharedMemory
*
ic
)
UNetSender
*
UNetExchange
::
create_sender
(
const
std
::
string
&
h
,
const
ost
::
tpport_t
p
,
SMInterface
*
shm
,
const
std
::
string
&
s_field
,
const
std
::
string
&
s_fvalue
,
SharedMemory
*
ic
)
{
return
new
UNetSender
(
h
,
p
,
shm
,
s_field
,
s_fvalue
,
ic
);
}
...
...
@@ -776,12 +776,12 @@ void UNetExchange::receiverEvent( UNetReceiver* r, UNetReceiver::Event ev )
}
}
// -----------------------------------------------------------------------------
void
UNetExchange
::
ignore_item
(
UniSetTypes
::
ObjectId
id
,
bool
set
)
void
UNetExchange
::
setIgnore
(
UniSetTypes
::
ObjectId
id
,
bool
set
)
{
std
::
list
<
UNetReceiver
*>
rList
=
get_receivers
();
std
::
list
<
UNetReceiver
*>::
iterator
rIt
=
rList
.
begin
();
for
(;
rIt
!=
rList
.
end
();
++
rIt
)
(
*
rIt
)
->
ignore_item
(
id
,
set
);
(
*
rIt
)
->
setIgnore
(
id
,
set
);
}
// -----------------------------------------------------------------------------
std
::
list
<
UNetReceiver
*>
UNetExchange
::
get_receivers
()
...
...
extensions/UNetUDP/UNetExchange.h
View file @
b0310ae3
...
...
@@ -86,14 +86,20 @@ class UNetExchange:
static
UNetExchange
*
init_unetexchange
(
int
argc
,
const
char
*
argv
[],
UniSetTypes
::
ObjectId
shmID
,
SharedMemory
*
ic
=
0
,
const
std
::
string
&
prefix
=
"unet"
);
virtual
UNetReceiver
*
create_receiver
(
const
std
::
string
&
h
,
const
ost
::
tpport_t
p
,
SMInterface
*
shm
);
virtual
UNetSender
*
create_sender
(
const
std
::
string
&
h
,
const
ost
::
tpport_t
p
,
SMInterface
*
shm
,
const
std
::
string
&
s_field
=
""
,
const
std
::
string
&
s_fvalue
=
""
,
SharedMemory
*
ic
=
0
);
/*! глобальная функция для вывода help-а */
static
void
help_print
(
int
argc
,
const
char
*
argv
[]
);
bool
checkExistUNetHost
(
const
std
::
string
&
host
,
ost
::
tpport_t
port
);
std
::
list
<
UNetReceiver
*>
get_receivers
();
/*! игнорировать запись датчика в SM */
void
ignore_item
(
UniSetTypes
::
ObjectId
id
=
UniSetTypes
::
DefaultObjectId
,
bool
set
=
true
);
void
setIgnore
(
UniSetTypes
::
ObjectId
id
=
UniSetTypes
::
DefaultObjectId
,
bool
set
=
true
);
protected
:
UNetExchange
();
...
...
@@ -104,9 +110,7 @@ class UNetExchange:
SMInterface
*
shm
;
void
step
();
virtual
UNetReceiver
*
create_receiver
(
const
std
::
string
&
h
,
const
ost
::
tpport_t
p
,
SMInterface
*
shm
);
virtual
UNetSender
*
create_sender
(
const
std
::
string
h
,
const
ost
::
tpport_t
p
,
SMInterface
*
shm
,
const
std
::
string
s_field
=
""
,
const
std
::
string
s_fvalue
=
""
,
SharedMemory
*
ic
=
0
);
virtual
void
processingMessage
(
UniSetTypes
::
VoidMessage
*
msg
);
void
sysCommand
(
UniSetTypes
::
SystemMessage
*
msg
);
void
sensorInfo
(
UniSetTypes
::
SensorMessage
*
sm
);
...
...
extensions/UNetUDP/UNetReceiver.cc
View file @
b0310ae3
...
...
@@ -380,16 +380,16 @@ void UNetReceiver::updateDItem( ItemInfo& ii, const long& id, bool val )
else
if
(
ii
.
iotype
==
UniversalIO
::
DigitalOutput
)
shm
->
localSetState
(
ii
.
dit
,
id
,
val
,
shm
->
ID
());
else
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(update
A
Item): Unknown iotype for sid="
<<
id
<<
endl
;
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(update
D
Item): Unknown iotype for sid="
<<
id
<<
endl
;
}
catch
(
UniSetTypes
::
Exception
&
ex
)
{
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(update
A
Item): "
<<
ex
<<
std
::
endl
;
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(update
D
Item): "
<<
ex
<<
std
::
endl
;
throw
ex
;
}
catch
(...)
{
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(update
A
Item): catch ..."
<<
std
::
endl
;
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(update
D
Item): catch ..."
<<
std
::
endl
;
throw
;
}
}
...
...
@@ -575,7 +575,7 @@ void UNetReceiver::initIterators()
}
}
// -----------------------------------------------------------------------------
void
UNetReceiver
::
ignore_item
(
UniSetTypes
::
ObjectId
id
,
bool
set
)
void
UNetReceiver
::
setIgnore
(
UniSetTypes
::
ObjectId
id
,
bool
set
)
{
for
(
ItemVec
::
iterator
it
=
d_icache
.
begin
();
it
!=
d_icache
.
end
();
++
it
)
{
...
...
extensions/UNetUDP/UNetReceiver.h
View file @
b0310ae3
...
...
@@ -93,8 +93,11 @@ class UNetReceiver
typedef
sigc
::
slot
<
void
,
UNetReceiver
*
,
Event
>
EventSlot
;
void
connectEvent
(
EventSlot
sl
);
/*! игнорировать запись датчика в SM */
void
ignore_item
(
UniSetTypes
::
ObjectId
id
=
UniSetTypes
::
DefaultObjectId
,
bool
set
=
true
);
/*! игнорировать запись датчика в SM
\param id - идентификатор датчика. DefaultObjectId - выставить флаг для всех датчиков
*/
void
setIgnore
(
UniSetTypes
::
ObjectId
id
=
UniSetTypes
::
DefaultObjectId
,
bool
set
=
true
);
protected
:
UNetReceiver
();
...
...
extensions/UNetUDP/UNetSender.cc
View file @
b0310ae3
...
...
@@ -70,7 +70,6 @@ s_thr(0)
else
ic
->
addReadItem
(
sigc
::
mem_fun
(
this
,
&
UNetSender
::
readItem
)
);
// выставляем поля, которые не меняются
mypack
.
nodeID
=
conf
->
getLocalNode
();
mypack
.
procID
=
shm
->
ID
();
...
...
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