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
c23a39f0
Commit
c23a39f0
authored
Aug 27, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
..перенёс некоторые исправления из uniset-1.x
parent
9408a997
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
34 deletions
+2
-34
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+2
-2
Extensions.h
extensions/include/Extensions.h
+0
-3
Extensions.cc
extensions/lib/Extensions.cc
+0
-29
No files found.
extensions/ModbusSlave/MBSlave.cc
View file @
c23a39f0
...
...
@@ -85,8 +85,8 @@ prefix(prefix)
if
(
speed
.
empty
()
)
speed
=
"38400"
;
bool
use485F
=
conf
->
getArgInt
(
"--
rs
-use485F"
,
it
.
getProp
(
"use485F"
));
bool
transmitCtl
=
conf
->
getArgInt
(
"--
rs
-transmit-ctl"
,
it
.
getProp
(
"transmitCtl"
));
bool
use485F
=
conf
->
getArgInt
(
"--
"
+
prefix
+
"
-use485F"
,
it
.
getProp
(
"use485F"
));
bool
transmitCtl
=
conf
->
getArgInt
(
"--
"
+
prefix
+
"
-transmit-ctl"
,
it
.
getProp
(
"transmitCtl"
));
ModbusRTUSlaveSlot
*
rs
=
new
ModbusRTUSlaveSlot
(
dev
,
use485F
,
transmitCtl
);
rs
->
setSpeed
(
speed
);
...
...
extensions/include/Extensions.h
View file @
c23a39f0
...
...
@@ -13,9 +13,6 @@ namespace UniSetExtensions
/*! Получение идентификатора объекта(процесса) разделяемой памяти */
UniSetTypes
::
ObjectId
getSharedMemoryID
();
/*! Получение времени для подтверждения "живости" */
int
getHeartBeatTime
();
xmlNode
*
findNode
(
xmlNode
*
node
,
const
std
::
string
&
snode
,
const
std
::
string
&
field
);
xmlNode
*
getCalibrationsSection
();
...
...
extensions/lib/Extensions.cc
View file @
c23a39f0
...
...
@@ -33,35 +33,6 @@ namespace UniSetExtensions
return
shmID
;
}
// -------------------------------------------------------------------------
static
int
heartBeatTime
=
-
1
;
// начальная инициализация
int
getHeartBeatTime
()
{
if
(
heartBeatTime
!=
-
1
)
return
heartBeatTime
;
xmlNode
*
cnode
=
conf
->
getNode
(
"HeartBeatTime"
);
if
(
cnode
==
NULL
)
{
ostringstream
err
;
err
<<
"Not found conf-node for HeartBeatTime"
;
cerr
<<
err
.
str
()
<<
endl
;
throw
SystemError
(
err
.
str
());
}
UniXML_iterator
it
(
cnode
);
heartBeatTime
=
it
.
getIntProp
(
"time_msec"
);
if
(
heartBeatTime
<=
0
)
{
heartBeatTime
=
0
;
dwarn
<<
"(getHeartBeatTime): механизм 'HEARTBEAT' ОТКЛЮЧЁН!"
<<
endl
;
}
dinfo
<<
"(getHeartBeatTime): heartbeat time = "
<<
heartBeatTime
<<
endl
;
return
heartBeatTime
;
}
// -------------------------------------------------------------------------
void
escape_string
(
string
&
s
)
{
if
(
s
.
empty
()
)
...
...
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