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
e3c855c5
Commit
e3c855c5
authored
Sep 19, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Правки после проверки cppcheck (1.70)
parent
910bdd5a
Show whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
95 additions
and
87 deletions
+95
-87
admin.cc
Utilities/Admin/admin.cc
+4
-4
ctl-cpp-common.xsl
Utilities/codegen/ctl-cpp-common.xsl
+9
-0
DBServer_MySQL.h
extensions/DBServer-MySQL/DBServer_MySQL.h
+1
-1
DBServer_PostgreSQL.cc
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.cc
+1
-1
PostgreSQLInterface.h
extensions/DBServer-PostgreSQL/PostgreSQLInterface.h
+1
-1
IOControl.cc
extensions/IOControl/IOControl.cc
+8
-8
IOControl.h
extensions/IOControl/IOControl.h
+2
-2
Element.cc
extensions/LogicProcessor/Element.cc
+1
-1
Element.h
extensions/LogicProcessor/Element.h
+2
-3
PassiveLProcessor.cc
extensions/LogicProcessor/PassiveLProcessor.cc
+5
-6
PassiveLProcessor.h
extensions/LogicProcessor/PassiveLProcessor.h
+3
-3
Schema.h
extensions/LogicProcessor/Schema.h
+1
-1
MBExchange.cc
extensions/ModbusMaster/MBExchange.cc
+2
-2
MBExchange.h
extensions/ModbusMaster/MBExchange.h
+1
-1
MBTCPMaster.cc
extensions/ModbusMaster/MBTCPMaster.cc
+4
-4
MBTCPMaster.h
extensions/ModbusMaster/MBTCPMaster.h
+2
-2
MBTCPMultiMaster.cc
extensions/ModbusMaster/MBTCPMultiMaster.cc
+3
-3
MBTCPMultiMaster.h
extensions/ModbusMaster/MBTCPMultiMaster.h
+3
-3
RTUExchange.cc
extensions/ModbusMaster/RTUExchange.cc
+3
-3
RTUExchange.h
extensions/ModbusMaster/RTUExchange.h
+2
-2
MBTCPTestServer.cc
extensions/ModbusMaster/tests/MBTCPTestServer.cc
+1
-1
test_mbtcpmaster.cc
extensions/ModbusMaster/tests/test_mbtcpmaster.cc
+1
-1
test_mbtcpmultimaster.cc
extensions/ModbusMaster/tests/test_mbtcpmultimaster.cc
+2
-2
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+3
-3
MBSlave.h
extensions/ModbusSlave/MBSlave.h
+2
-2
MBTCPPersistentSlave.cc
extensions/ModbusSlave/MBTCPPersistentSlave.cc
+2
-2
MBTCPPersistentSlave.h
extensions/ModbusSlave/MBTCPPersistentSlave.h
+2
-2
RRDServer.cc
extensions/RRDServer/RRDServer.cc
+3
-3
RRDServer.h
extensions/RRDServer/RRDServer.h
+2
-2
SMViewer.cc
extensions/SMViewer/SMViewer.cc
+3
-2
UNetExchange.cc
extensions/UNetUDP/UNetExchange.cc
+4
-4
UNetExchange.h
extensions/UNetUDP/UNetExchange.h
+4
-4
UniExchange.cc
extensions/UniNetwork/UniExchange.cc
+4
-4
UniExchange.h
extensions/UniNetwork/UniExchange.h
+2
-2
IOBase.cc
extensions/lib/IOBase.cc
+2
-2
No files found.
Utilities/Admin/admin.cc
View file @
e3c855c5
...
...
@@ -59,8 +59,8 @@ static struct option longopts[] =
string
conffile
(
"configure.xml"
);
// --------------------------------------------------------------------------
static
bool
commandToAll
(
const
string
&
section
,
std
::
shared_ptr
<
ObjectRepository
>
rep
,
Command
cmd
);
static
void
createSections
(
const
std
::
shared_ptr
<
UniSetTypes
::
Configuration
>
c
);
static
bool
commandToAll
(
const
string
&
section
,
std
::
shared_ptr
<
ObjectRepository
>
&
rep
,
Command
cmd
);
static
void
createSections
(
const
std
::
shared_ptr
<
Configuration
>&
c
);
// --------------------------------------------------------------------------
int
omap
();
int
configure
(
const
string
&
args
,
UInterface
&
ui
);
...
...
@@ -364,7 +364,7 @@ int main(int argc, char** argv)
}
// ==============================================================================================
static
bool
commandToAll
(
const
string
&
section
,
std
::
shared_ptr
<
ObjectRepository
>
rep
,
Command
cmd
)
static
bool
commandToAll
(
const
string
&
section
,
std
::
shared_ptr
<
ObjectRepository
>
&
rep
,
Command
cmd
)
{
if
(
verb
)
cout
<<
"
\n
||=======******** "
<<
section
<<
" ********=========||
\n
"
<<
endl
;
...
...
@@ -504,7 +504,7 @@ static bool commandToAll(const string& section, std::shared_ptr<ObjectRepository
}
// ==============================================================================================
static
void
createSections
(
const
std
::
shared_ptr
<
UniSetTypes
::
Configuration
>
rconf
)
static
void
createSections
(
const
std
::
shared_ptr
<
UniSetTypes
::
Configuration
>
&
rconf
)
{
ObjectRepositoryFactory
repf
(
rconf
);
...
...
Utilities/codegen/ctl-cpp-common.xsl
View file @
e3c855c5
...
...
@@ -248,6 +248,7 @@
/*! Вывод состояния внутренних переменных */
inline std::string dumpVars(){ return std::move(vmon.pretty_str()); }
// ------------------------------------------------------------
std::string help();
</xsl:template>
...
...
@@ -530,6 +531,14 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId _te
</xsl:if>
}
// ----------------------------------------------------------------------------
std::string
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::help()
{
ostringstream s;
return std::move(s.str());
}
// ----------------------------------------------------------------------------
</xsl:template>
<xsl:template
name=
"COMMON-ID-LIST"
>
...
...
extensions/DBServer-MySQL/DBServer_MySQL.h
View file @
e3c855c5
...
...
@@ -136,7 +136,7 @@ class DBServer_MySQL:
{
public
:
DBServer_MySQL
(
UniSetTypes
::
ObjectId
id
,
const
std
::
string
&
prefix
);
DBServer_MySQL
(
const
std
::
string
&
prefix
);
explicit
DBServer_MySQL
(
const
std
::
string
&
prefix
);
virtual
~
DBServer_MySQL
();
/*! глобальная функция для инициализации объекта */
...
...
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.cc
View file @
e3c855c5
...
...
@@ -34,6 +34,7 @@ DBServer_PostgreSQL::DBServer_PostgreSQL(ObjectId id, const std::string& prefix
DBServer_PostgreSQL
::
DBServer_PostgreSQL
()
:
DBServer
(
uniset_conf
()
->
getDBServer
()),
db
(
make_shared
<
PostgreSQLInterface
>
()),
PingTime
(
300000
),
ReconnectTime
(
180000
),
connect_ok
(
false
),
...
...
@@ -41,7 +42,6 @@ DBServer_PostgreSQL::DBServer_PostgreSQL():
qbufSize
(
200
),
lastRemove
(
false
)
{
db
=
make_shared
<
PostgreSQLInterface
>
();
// init();
if
(
getId
()
==
DefaultObjectId
)
...
...
extensions/DBServer-PostgreSQL/PostgreSQLInterface.h
View file @
e3c855c5
...
...
@@ -46,7 +46,7 @@ class PostgreSQLInterface
class
PostgreSQLResult
{
public
:
PostgreSQLResult
()
{}
PostgreSQLResult
(){}
PostgreSQLResult
(
const
pqxx
::
result
&
res
);
~
PostgreSQLResult
();
...
...
extensions/IOControl/IOControl.cc
View file @
e3c855c5
...
...
@@ -23,8 +23,8 @@ std::ostream& operator<<( std::ostream& os, IOControl::IOInfo& inf )
}
// -----------------------------------------------------------------------------
IOControl
::
IOControl
(
UniSetTypes
::
ObjectId
id
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
int
numcards
,
const
std
::
string
&
prefix_
)
:
IOControl
::
IOControl
(
UniSetTypes
::
ObjectId
id
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
int
numcards
,
const
std
::
string
&
prefix_
)
:
UniSetObject
(
id
),
polltime
(
150
),
cards
(
11
),
...
...
@@ -533,7 +533,7 @@ void IOControl::ioread( IOInfo* it )
return
;
}
IOBase
*
ib
=
&
(
*
it
);
IOBase
*
ib
=
static_cast
<
IOBase
*>
(
it
);
try
{
...
...
@@ -588,7 +588,7 @@ void IOControl::ioread( IOInfo* it )
delBlink
(
it
,
lstBlink3
);
}
if
(
it
->
no_testlamp
||
(
!
it
->
no_testlamp
&&
!
isTestLamp
)
)
if
(
it
->
no_testlamp
||
!
isTestLamp
)
card
->
setDigitalChannel
(
it
->
subdev
,
it
->
channel
,
0
);
}
break
;
...
...
@@ -604,7 +604,7 @@ void IOControl::ioread( IOInfo* it )
delBlink
(
it
,
lstBlink3
);
}
if
(
it
->
no_testlamp
||
(
!
it
->
no_testlamp
&&
!
isTestLamp
)
)
if
(
it
->
no_testlamp
||
!
isTestLamp
)
card
->
setDigitalChannel
(
it
->
subdev
,
it
->
channel
,
1
);
}
break
;
...
...
@@ -657,7 +657,7 @@ void IOControl::ioread( IOInfo* it )
{
bool
set
=
IOBase
::
processingAsDO
(
ib
,
shm
,
force_out
);
if
(
!
it
->
lamp
||
(
it
->
lamp
&&
!
isTestLamp
)
)
if
(
!
it
->
lamp
||
!
isTestLamp
)
card
->
setDigitalChannel
(
it
->
subdev
,
it
->
channel
,
set
);
}
}
...
...
@@ -1158,8 +1158,8 @@ void IOControl::check_testlamp()
}
// -----------------------------------------------------------------------------
std
::
shared_ptr
<
IOControl
>
IOControl
::
init_iocontrol
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
std
::
shared_ptr
<
IOControl
>
IOControl
::
init_iocontrol
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
{
auto
conf
=
uniset_conf
();
...
...
extensions/IOControl/IOControl.h
View file @
e3c855c5
...
...
@@ -208,12 +208,12 @@ class IOControl:
public
UniSetObject
{
public
:
IOControl
(
UniSetTypes
::
ObjectId
id
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
shm
=
nullptr
,
int
numcards
=
2
,
const
std
::
string
&
prefix
=
"io"
);
IOControl
(
UniSetTypes
::
ObjectId
id
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
shm
=
nullptr
,
int
numcards
=
2
,
const
std
::
string
&
prefix
=
"io"
);
virtual
~
IOControl
();
/*! глобальная функция для инициализации объекта */
static
std
::
shared_ptr
<
IOControl
>
init_iocontrol
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"io"
);
/*! глобальная функция для вывода help-а */
static
void
help_print
(
int
argc
,
const
char
*
const
*
argv
);
...
...
extensions/LogicProcessor/Element.cc
View file @
e3c855c5
...
...
@@ -61,7 +61,7 @@ void Element::setChildOut()
it
.
el
->
setIn
(
it
.
num
,
_myout
);
}
// -------------------------------------------------------------------------
std
::
shared_ptr
<
Element
>
Element
::
find
(
const
ElementID
id
)
std
::
shared_ptr
<
Element
>
Element
::
find
(
const
ElementID
&
id
)
{
for
(
const
auto
&
it
:
outs
)
{
...
...
extensions/LogicProcessor/Element.h
View file @
e3c855c5
...
...
@@ -13,7 +13,7 @@ class LogicException:
{
public
:
LogicException
()
:
UniSetTypes
::
Exception
(
"LogicException"
)
{}
LogicException
(
const
std
::
string
err
)
:
UniSetTypes
::
Exception
(
err
)
{}
LogicException
(
const
std
::
string
&
err
)
:
UniSetTypes
::
Exception
(
err
)
{}
};
...
...
@@ -44,7 +44,6 @@ class Element
virtual
void
setIn
(
int
num
,
bool
state
)
=
0
;
virtual
bool
getOut
()
=
0
;
inline
ElementID
getId
()
{
return
myid
;
...
...
@@ -54,7 +53,7 @@ class Element
return
"?type?"
;
}
virtual
std
::
shared_ptr
<
Element
>
find
(
const
ElementID
id
);
virtual
std
::
shared_ptr
<
Element
>
find
(
const
ElementID
&
id
);
virtual
void
addChildOut
(
std
::
shared_ptr
<
Element
>
el
,
int
in_num
);
virtual
void
delChildOut
(
std
::
shared_ptr
<
Element
>
el
);
...
...
extensions/LogicProcessor/PassiveLProcessor.cc
View file @
e3c855c5
...
...
@@ -7,7 +7,7 @@ using namespace UniSetTypes;
using
namespace
UniSetExtensions
;
// -------------------------------------------------------------------------
PassiveLProcessor
::
PassiveLProcessor
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
const
std
::
string
&
prefix
)
:
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
:
UniSetObject_LT
(
objId
),
shm
(
nullptr
)
{
...
...
@@ -24,8 +24,6 @@ PassiveLProcessor::PassiveLProcessor( UniSetTypes::ObjectId objId,
throw
SystemError
(
"Not found conf-node for "
+
conf_name
);
UniXML
::
iterator
it
(
confnode
);
confnode
=
conf
->
getNode
(
myname
);
string
lfile
=
conf
->
getArgParam
(
"--"
+
prefix
+
"-schema"
,
it
.
getProp
(
"schema"
));
if
(
lfile
.
empty
()
)
...
...
@@ -62,7 +60,7 @@ PassiveLProcessor::PassiveLProcessor( UniSetTypes::ObjectId objId,
maxHeartBeat
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-heartbeat-max"
,
"10"
,
10
);
}
}
// -------------------------------------------------------------------------
PassiveLProcessor
::~
PassiveLProcessor
()
{
...
...
@@ -264,8 +262,8 @@ void PassiveLProcessor::help_print( int argc, const char* const* argv )
}
// -----------------------------------------------------------------------------
std
::
shared_ptr
<
PassiveLProcessor
>
PassiveLProcessor
::
init_plproc
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
std
::
shared_ptr
<
PassiveLProcessor
>
PassiveLProcessor
::
init_plproc
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
{
auto
conf
=
uniset_conf
();
...
...
@@ -290,3 +288,4 @@ std::shared_ptr<PassiveLProcessor> PassiveLProcessor::init_plproc( int argc, con
dinfo
<<
"(plproc): name = "
<<
name
<<
"("
<<
ID
<<
")"
<<
endl
;
return
make_shared
<
PassiveLProcessor
>
(
ID
,
shmID
,
ic
,
prefix
);
}
// -----------------------------------------------------------------------------
extensions/LogicProcessor/PassiveLProcessor.h
View file @
e3c855c5
...
...
@@ -18,8 +18,8 @@ class PassiveLProcessor:
{
public
:
PassiveLProcessor
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"lproc"
);
PassiveLProcessor
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"lproc"
);
virtual
~
PassiveLProcessor
();
enum
Timers
...
...
@@ -30,7 +30,7 @@ class PassiveLProcessor:
static
void
help_print
(
int
argc
,
const
char
*
const
*
argv
);
static
std
::
shared_ptr
<
PassiveLProcessor
>
init_plproc
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"plproc"
);
protected
:
...
...
extensions/LogicProcessor/Schema.h
View file @
e3c855c5
...
...
@@ -143,7 +143,7 @@ class Schema
// наружный выход
struct
EXTOut
{
EXTOut
(
const
std
::
string
n
,
std
::
shared_ptr
<
Element
>
f
)
:
EXTOut
(
const
std
::
string
&
n
,
std
::
shared_ptr
<
Element
>&
f
)
:
name
(
n
),
from
(
f
)
{}
EXTOut
()
:
name
(
""
)
{}
...
...
extensions/ModbusMaster/MBExchange.cc
View file @
e3c855c5
...
...
@@ -13,8 +13,8 @@ using namespace std;
using
namespace
UniSetTypes
;
using
namespace
UniSetExtensions
;
// -----------------------------------------------------------------------------
MBExchange
::
MBExchange
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>
_ic
,
const
std
::
string
&
prefix
)
:
MBExchange
::
MBExchange
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>
&
_ic
,
const
std
::
string
&
prefix
)
:
UniSetObject_LT
(
objId
),
allInitOK
(
false
),
initPause
(
0
),
...
...
extensions/ModbusMaster/MBExchange.h
View file @
e3c855c5
...
...
@@ -37,7 +37,7 @@ class MBExchange:
public
UniSetObject_LT
{
public
:
MBExchange
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
MBExchange
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"mb"
);
virtual
~
MBExchange
();
...
...
extensions/ModbusMaster/MBTCPMaster.cc
View file @
e3c855c5
...
...
@@ -11,8 +11,8 @@ using namespace std;
using
namespace
UniSetTypes
;
using
namespace
UniSetExtensions
;
// -----------------------------------------------------------------------------
MBTCPMaster
::
MBTCPMaster
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
const
std
::
string
&
prefix
)
:
MBTCPMaster
::
MBTCPMaster
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
:
MBExchange
(
objId
,
shmId
,
ic
,
prefix
),
force_disconnect
(
true
)
{
...
...
@@ -219,8 +219,8 @@ void MBTCPMaster::help_print( int argc, const char* const* argv )
cout
<<
"--prefix-persistent-connection 0,1 - Не закрывать соединение на каждом цикле опроса"
<<
endl
;
}
// -----------------------------------------------------------------------------
std
::
shared_ptr
<
MBTCPMaster
>
MBTCPMaster
::
init_mbmaster
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
std
::
shared_ptr
<
MBTCPMaster
>
MBTCPMaster
::
init_mbmaster
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
{
auto
conf
=
uniset_conf
();
...
...
extensions/ModbusMaster/MBTCPMaster.h
View file @
e3c855c5
...
...
@@ -198,13 +198,13 @@ class MBTCPMaster:
public
MBExchange
{
public
:
MBTCPMaster
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
MBTCPMaster
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"mbtcp"
);
virtual
~
MBTCPMaster
();
/*! глобальная функция для инициализации объекта */
static
std
::
shared_ptr
<
MBTCPMaster
>
init_mbmaster
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"mbtcp"
);
/*! глобальная функция для вывода help-а */
...
...
extensions/ModbusMaster/MBTCPMultiMaster.cc
View file @
e3c855c5
...
...
@@ -12,7 +12,7 @@ using namespace UniSetTypes;
using
namespace
UniSetExtensions
;
// -----------------------------------------------------------------------------
MBTCPMultiMaster
::
MBTCPMultiMaster
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
const
std
::
string
&
prefix
)
:
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
:
MBExchange
(
objId
,
shmId
,
ic
,
prefix
),
force_disconnect
(
true
)
{
...
...
@@ -204,7 +204,7 @@ std::shared_ptr<ModbusClient> MBTCPMultiMaster::initMB( bool reopen )
// Если по текущему каналу связь есть, то возвращаем его
if
(
mbi
!=
mblist
.
rend
()
&&
!
mbi
->
ignore
&&
mbi
->
respond
)
{
if
(
mbi
->
mbtcp
->
isConnection
()
||
(
!
mbi
->
mbtcp
->
isConnection
()
&&
mbi
->
init
(
mblog
)
)
)
if
(
mbi
->
mbtcp
->
isConnection
()
||
mbi
->
init
(
mblog
)
)
{
if
(
!
mbi
->
ignore
)
{
...
...
@@ -469,7 +469,7 @@ void MBTCPMultiMaster::help_print( int argc, const char* const* argv )
}
// -----------------------------------------------------------------------------
std
::
shared_ptr
<
MBTCPMultiMaster
>
MBTCPMultiMaster
::
init_mbmaster
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
{
auto
conf
=
uniset_conf
();
...
...
extensions/ModbusMaster/MBTCPMultiMaster.h
View file @
e3c855c5
...
...
@@ -222,13 +222,13 @@ class MBTCPMultiMaster:
public
MBExchange
{
public
:
MBTCPMultiMaster
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
MBTCPMultiMaster
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"mbtcp"
);
virtual
~
MBTCPMultiMaster
();
/*! глобальная функция для инициализации объекта */
static
std
::
shared_ptr
<
MBTCPMultiMaster
>
init_mbmaster
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
static
std
::
shared_ptr
<
MBTCPMultiMaster
>
init_mbmaster
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"mbtcp"
);
/*! глобальная функция для вывода help-а */
...
...
extensions/ModbusMaster/RTUExchange.cc
View file @
e3c855c5
...
...
@@ -9,7 +9,7 @@ using namespace std;
using
namespace
UniSetTypes
;
using
namespace
UniSetExtensions
;
// -----------------------------------------------------------------------------
RTUExchange
::
RTUExchange
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
RTUExchange
::
RTUExchange
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>&
ic
,
const
std
::
string
&
prefix_
)
:
MBExchange
(
objId
,
shmId
,
ic
,
prefix_
),
mbrtu
(
0
),
...
...
@@ -320,8 +320,8 @@ bool RTUExchange::poll()
return
!
allNotRespond
;
}
// -----------------------------------------------------------------------------
std
::
shared_ptr
<
RTUExchange
>
RTUExchange
::
init_rtuexchange
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
const
std
::
string
&
prefix
)
std
::
shared_ptr
<
RTUExchange
>
RTUExchange
::
init_rtuexchange
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
{
auto
conf
=
uniset_conf
();
...
...
extensions/ModbusMaster/RTUExchange.h
View file @
e3c855c5
...
...
@@ -14,12 +14,12 @@ class RTUExchange:
{
public
:
RTUExchange
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"rs"
);
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"rs"
);
virtual
~
RTUExchange
();
/*! глобальная функция для инициализации объекта */
static
std
::
shared_ptr
<
RTUExchange
>
init_rtuexchange
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"rs"
);
/*! глобальная функция для вывода help-а */
...
...
extensions/ModbusMaster/tests/MBTCPTestServer.cc
View file @
e3c855c5
...
...
@@ -58,7 +58,7 @@ MBTCPTestServer::MBTCPTestServer( ModbusAddr myaddr, const string& inetaddr, int
catch
(
const
std
::
exception
&
ex
)
{
cerr
<<
"(MBTCPTestServer::init): Can`t create socket "
<<
addr
<<
":"
<<
port
<<
" err: "
<<
ex
.
what
()
<<
endl
;
throw
ex
;
throw
;
}
// sslot->initLog(conf,name,logfile);
...
...
extensions/ModbusMaster/tests/test_mbtcpmaster.cc
View file @
e3c855c5
...
...
@@ -65,7 +65,7 @@ static void InitTest()
catch
(
const
std
::
exception
&
ex
)
{
cerr
<<
"(mbs): Can`t create socket "
<<
addr
<<
":"
<<
port
<<
" err: "
<<
ex
.
what
()
<<
endl
;
throw
ex
;
throw
;
}
//mbs->setVerbose(true);
...
...
extensions/ModbusMaster/tests/test_mbtcpmultimaster.cc
View file @
e3c855c5
...
...
@@ -67,7 +67,7 @@ static void InitTest()
catch
(
const
std
::
exception
&
ex
)
{
cerr
<<
"(mb1): Can`t create socket "
<<
addr
<<
":"
<<
port
<<
" err: "
<<
ex
.
what
()
<<
endl
;
throw
ex
;
throw
;
}
CHECK
(
mbs1
!=
nullptr
);
...
...
@@ -99,7 +99,7 @@ static void InitTest()
catch
(
const
std
::
exception
&
ex
)
{
cerr
<<
"(mb2): Can`t create socket "
<<
addr
<<
":"
<<
port
<<
" err: "
<<
ex
.
what
()
<<
endl
;
throw
ex
;
throw
;
}
CHECK
(
mbs2
!=
nullptr
);
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
e3c855c5
...
...
@@ -12,7 +12,7 @@ using namespace UniSetTypes;
using
namespace
UniSetExtensions
;
using
namespace
ModbusRTU
;
// -----------------------------------------------------------------------------
MBSlave
::
MBSlave
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
const
string
&
prefix
)
:
MBSlave
::
MBSlave
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>&
ic
,
const
string
&
prefix
)
:
UniSetObject_LT
(
objId
),
addr
(
0x01
),
initPause
(
0
),
...
...
@@ -1232,8 +1232,8 @@ void MBSlave::help_print( int argc, const char* const* argv )
cout
<<
LogServer
::
help_print
(
"prefix-logserver"
)
<<
endl
;
}
// -----------------------------------------------------------------------------
std
::
shared_ptr
<
MBSlave
>
MBSlave
::
init_mbslave
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
const
string
&
prefix
)
std
::
shared_ptr
<
MBSlave
>
MBSlave
::
init_mbslave
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
string
&
prefix
)
{
auto
conf
=
uniset_conf
();
string
name
=
conf
->
getArgParam
(
"--"
+
prefix
+
"-name"
,
"MBSlave1"
);
...
...
extensions/ModbusSlave/MBSlave.h
View file @
e3c855c5
...
...
@@ -285,12 +285,12 @@ class MBSlave:
public
UniSetObject_LT
{
public
:
MBSlave
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"mbs"
);
MBSlave
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"mbs"
);
virtual
~
MBSlave
();
/*! глобальная функция для инициализации объекта */
static
std
::
shared_ptr
<
MBSlave
>
init_mbslave
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"mbs"
);
/*! глобальная функция для вывода help-а */
...
...
extensions/ModbusSlave/MBTCPPersistentSlave.cc
View file @
e3c855c5
...
...
@@ -12,7 +12,7 @@ using namespace UniSetTypes;
using
namespace
UniSetExtensions
;
using
namespace
ModbusRTU
;
// -----------------------------------------------------------------------------
MBTCPPersistentSlave
::
MBTCPPersistentSlave
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
const
string
&
prefix
)
:
MBTCPPersistentSlave
::
MBTCPPersistentSlave
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>&
ic
,
const
string
&
prefix
)
:
MBSlave
(
objId
,
shmId
,
ic
,
prefix
),
sesscount_id
(
DefaultObjectId
)
{
...
...
@@ -127,7 +127,7 @@ void MBTCPPersistentSlave::help_print( int argc, const char* const* argv )
}
// -----------------------------------------------------------------------------
std
::
shared_ptr
<
MBTCPPersistentSlave
>
MBTCPPersistentSlave
::
init_mbslave
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
const
string
&
prefix
)
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
string
&
prefix
)
{
auto
conf
=
uniset_conf
();
string
name
=
conf
->
getArgParam
(
"--"
+
prefix
+
"-name"
,
"MBSlave1"
);
...
...
extensions/ModbusSlave/MBTCPPersistentSlave.h
View file @
e3c855c5
...
...
@@ -21,12 +21,12 @@ class MBTCPPersistentSlave:
public
MBSlave
{
public
:
MBTCPPersistentSlave
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"mbs"
);
MBTCPPersistentSlave
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"mbs"
);
virtual
~
MBTCPPersistentSlave
();
/*! глобальная функция для инициализации объекта */
static
std
::
shared_ptr
<
MBTCPPersistentSlave
>
init_mbslave
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"mbs"
);
/*! глобальная функция для вывода help-а */
...
...
extensions/RRDServer/RRDServer.cc
View file @
e3c855c5
...
...
@@ -11,7 +11,7 @@ using namespace std;
using
namespace
UniSetTypes
;
using
namespace
UniSetExtensions
;
// -----------------------------------------------------------------------------
RRDServer
::
RRDServer
(
UniSetTypes
::
ObjectId
objId
,
xmlNode
*
cnode
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
RRDServer
::
RRDServer
(
UniSetTypes
::
ObjectId
objId
,
xmlNode
*
cnode
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>&
ic
,
const
string
&
prefix
)
:
UObject_SK
(
objId
,
cnode
,
string
(
prefix
+
"-"
)),
prefix
(
prefix
)
...
...
@@ -251,8 +251,8 @@ void RRDServer::help_print( int argc, const char* const* argv )
cout
<<
LogServer
::
help_print
(
"prefix-logserver"
)
<<
endl
;
}
// -----------------------------------------------------------------------------
std
::
shared_ptr
<
RRDServer
>
RRDServer
::
init_rrdstorage
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
std
::
shared_ptr
<
RRDServer
>
RRDServer
::
init_rrdstorage
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
{
auto
conf
=
uniset_conf
();
...
...
extensions/RRDServer/RRDServer.h
View file @
e3c855c5
...
...
@@ -60,13 +60,13 @@ class RRDServer:
public
UObject_SK
{
public
:
RRDServer
(
UniSetTypes
::
ObjectId
objId
,
xmlNode
*
cnode
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
RRDServer
(
UniSetTypes
::
ObjectId
objId
,
xmlNode
*
cnode
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"rrd"
);
virtual
~
RRDServer
();
/*! глобальная функция для инициализации объекта */
static
std
::
shared_ptr
<
RRDServer
>
init_rrdstorage
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"rrd"
);
/*! глобальная функция для вывода help-а */
...
...
extensions/SMViewer/SMViewer.cc
View file @
e3c855c5
...
...
@@ -7,9 +7,10 @@ using namespace UniSetTypes;
using
namespace
UniSetExtensions
;
//--------------------------------------------------------------------------------
SMViewer
::
SMViewer
(
UniSetTypes
::
ObjectId
shmID
)
:
SViewer
(
uniset_conf
()
->
getControllersSection
(),
true
)
SViewer
(
uniset_conf
()
->
getControllersSection
(),
true
),
shm
(
make_shared
<
SMInterface
>
(
shmID
,
ui
,
DefaultObjectId
))
{
shm
=
make_shared
<
SMInterface
>
(
shmID
,
ui
,
DefaultObjectId
);
}
// --------------------------------------------------------------------------
SMViewer
::~
SMViewer
()
...
...
extensions/UNetUDP/UNetExchange.cc
View file @
e3c855c5
...
...
@@ -9,7 +9,7 @@ using namespace std;
using
namespace
UniSetTypes
;
using
namespace
UniSetExtensions
;
// -----------------------------------------------------------------------------
UNetExchange
::
UNetExchange
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
const
std
::
string
&
prefix
)
:
UNetExchange
::
UNetExchange
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmId
,
const
std
::
shared_ptr
<
SharedMemory
>&
ic
,
const
std
::
string
&
prefix
)
:
UniSetObject_LT
(
objId
),
initPause
(
0
),
activated
(
false
),
...
...
@@ -502,7 +502,7 @@ void UNetExchange::step()
}
// -----------------------------------------------------------------------------
void
UNetExchange
::
ReceiverInfo
::
step
(
const
std
::
shared_ptr
<
SMInterface
>
shm
,
const
std
::
string
&
myname
,
std
::
shared_ptr
<
DebugStream
>&
unetlog
)
void
UNetExchange
::
ReceiverInfo
::
step
(
const
std
::
shared_ptr
<
SMInterface
>
&
shm
,
const
std
::
string
&
myname
,
std
::
shared_ptr
<
DebugStream
>&
unetlog
)
{
try
{
...
...
@@ -785,8 +785,8 @@ void UNetExchange::help_print( int argc, const char* argv[] )
cout
<<
LogServer
::
help_print
(
"prefix-logserver"
)
<<
endl
;
}
// -----------------------------------------------------------------------------
std
::
shared_ptr
<
UNetExchange
>
UNetExchange
::
init_unetexchange
(
int
argc
,
const
char
*
const
argv
[],
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
const
std
::
string
&
prefix
)
std
::
shared_ptr
<
UNetExchange
>
UNetExchange
::
init_unetexchange
(
int
argc
,
const
char
*
const
argv
[],
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
{
auto
conf
=
uniset_conf
();
...
...
extensions/UNetUDP/UNetExchange.h
View file @
e3c855c5
...
...
@@ -102,12 +102,12 @@ class UNetExchange:
public
UniSetObject_LT
{
public
:
UNetExchange
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"unet"
);
UNetExchange
(
UniSetTypes
::
ObjectId
objId
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"unet"
);
virtual
~
UNetExchange
();
/*! глобальная функция для инициализации объекта */
static
std
::
shared_ptr
<
UNetExchange
>
init_unetexchange
(
int
argc
,
const
char
*
const
argv
[],
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
0
,
const
std
::
string
&
prefix
=
"unet"
);
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
0
,
const
std
::
string
&
prefix
=
"unet"
);
/*! глобальная функция для вывода help-а */
static
void
help_print
(
int
argc
,
const
char
*
argv
[]
);
...
...
@@ -190,7 +190,7 @@ class UNetExchange:
std
::
shared_ptr
<
UNetReceiver
>
r1
;
/*!< приём по первому каналу */
std
::
shared_ptr
<
UNetReceiver
>
r2
;
/*!< приём по второму каналу */
void
step
(
const
std
::
shared_ptr
<
SMInterface
>
shm
,
const
std
::
string
&
myname
,
std
::
shared_ptr
<
DebugStream
>&
log
);
void
step
(
const
std
::
shared_ptr
<
SMInterface
>&
shm
,
const
std
::
string
&
myname
,
std
::
shared_ptr
<
DebugStream
>&
log
);
inline
void
setRespondID
(
UniSetTypes
::
ObjectId
id
,
bool
invert
=
false
)
{
...
...
@@ -206,7 +206,7 @@ class UNetExchange:
sidChannelNum
=
id
;
}
inline
void
initIterators
(
const
std
::
shared_ptr
<
SMInterface
>
shm
)
inline
void
initIterators
(
const
std
::
shared_ptr
<
SMInterface
>
&
shm
)
{
shm
->
initIterator
(
itLostPackets
);
shm
->
initIterator
(
itRespond
);
...
...
extensions/UniNetwork/UniExchange.cc
View file @
e3c855c5
...
...
@@ -17,8 +17,8 @@ UniExchange::NetNodeInfo::NetNodeInfo():
}
// --------------------------------------------------------------------------
UniExchange
::
UniExchange
(
UniSetTypes
::
ObjectId
id
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
const
std
::
string
&
prefix
)
:
UniExchange
::
UniExchange
(
UniSetTypes
::
ObjectId
id
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
:
IOController
(
id
),
polltime
(
200
),
mymap
(
1
),
...
...
@@ -337,8 +337,8 @@ void UniExchange::sigterm( int signo )
{
}
// -----------------------------------------------------------------------------
std
::
shared_ptr
<
UniExchange
>
UniExchange
::
init_exchange
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
,
std
::
shared_ptr
<
UniExchange
>
UniExchange
::
init_exchange
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
icID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
,
const
std
::
string
&
prefix
)
{
auto
conf
=
uniset_conf
();
...
...
extensions/UniNetwork/UniExchange.h
View file @
e3c855c5
...
...
@@ -38,13 +38,13 @@ class UniExchange:
{
public
:
UniExchange
(
UniSetTypes
::
ObjectId
id
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"unet"
);
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"unet"
);
virtual
~
UniExchange
();
void
execute
();
static
std
::
shared_ptr
<
UniExchange
>
init_exchange
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
ic
=
nullptr
,
UniSetTypes
::
ObjectId
shmID
,
const
std
::
shared_ptr
<
SharedMemory
>
&
ic
=
nullptr
,
const
std
::
string
&
prefix
=
"unet"
);
/*! глобальная функция для вывода help-а */
...
...
extensions/lib/IOBase.cc
View file @
e3c855c5
...
...
@@ -127,7 +127,7 @@ bool IOBase::check_on_delay( bool val )
// обновляем значение только если наступило время
// или если оно "0"...
if
(
!
val
||
(
val
&&
ptOnDelay
.
checkTime
()
)
)
if
(
!
val
||
ptOnDelay
.
checkTime
(
)
)
ondelay_state
=
val
;
// возвращаем ТЕКУЩЕЕ, А НЕ НОВОЕ значение
...
...
@@ -147,7 +147,7 @@ bool IOBase::check_off_delay( bool val )
// обновляем значение только если наступило время
// или если оно "1"...
if
(
val
||
(
!
val
&&
ptOffDelay
.
checkTime
()
)
)
if
(
val
||
ptOffDelay
.
checkTime
(
)
)
offdelay_state
=
val
;
// возвращаем ТЕКУЩЕЕ, А НЕ НОВОЕ значение
...
...
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