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
3de2c879
Commit
3de2c879
authored
May 30, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make style..
parent
d40f8a8c
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
129 additions
and
63 deletions
+129
-63
log.cc
Utilities/ULog/log.cc
+1
-1
logserver.cc
Utilities/ULog/logserver.cc
+1
-1
skel-main.cc
Utilities/codegen/skel-main.cc
+1
-0
DBServer_MySQL.h
extensions/DBServer-MySQL/DBServer_MySQL.h
+8
-2
main.cc
extensions/DBServer-MySQL/main.cc
+1
-1
DBServer_PostgreSQL.h
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.h
+8
-2
main.cc
extensions/DBServer-PostgreSQL/main.cc
+1
-1
DBServer_SQLite.h
extensions/DBServer-SQLite/DBServer_SQLite.h
+8
-2
main.cc
extensions/DBServer-SQLite/main.cc
+1
-1
iocalibr.cc
extensions/IOControl/iocalibr.cc
+1
-1
iocontrol.cc
extensions/IOControl/iocontrol.cc
+1
-1
logicproc.cc
extensions/LogicProcessor/logicproc.cc
+1
-1
plogicproc.cc
extensions/LogicProcessor/plogicproc.cc
+1
-1
MBExchange.h
extensions/ModbusMaster/MBExchange.h
+8
-2
mtr-conv.cc
extensions/ModbusMaster/mtr-conv.cc
+1
-1
mtr-read.cc
extensions/ModbusMaster/mtr-read.cc
+1
-1
mtr-setup.cc
extensions/ModbusMaster/mtr-setup.cc
+1
-1
rtuexchange.cc
extensions/ModbusMaster/rtuexchange.cc
+1
-1
MBSlave.h
extensions/ModbusSlave/MBSlave.h
+8
-2
mbslave.cc
extensions/ModbusSlave/mbslave.cc
+1
-1
mbtcp-multislave.cc
extensions/ModbusSlave/mbtcp-multislave.cc
+1
-1
RRDServer.h
extensions/RRDServer/RRDServer.h
+8
-2
main.cc
extensions/RRDServer/main.cc
+1
-1
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+1
-1
SharedMemory.h
extensions/SharedMemory/SharedMemory.h
+8
-2
smemory.cc
extensions/SharedMemory/smemory.cc
+1
-1
TestObject.cc
extensions/SharedMemory/tests/TestObject.cc
+1
-1
TestObject.h
extensions/SharedMemory/tests/TestObject.h
+9
-3
tests.cc
extensions/SharedMemory/tests/tests.cc
+1
-1
smemory-plus.cc
extensions/SharedMemoryPlus/smemory-plus.cc
+1
-1
UNetExchange.h
extensions/UNetUDP/UNetExchange.h
+8
-2
unetexchange.cc
extensions/UNetUDP/unetexchange.cc
+1
-1
UObject_SK.h
extensions/include/UObject_SK.h
+1
-1
UObject_SK.cc
extensions/lib/UObject_SK.cc
+15
-8
Pulse.h
include/Pulse.h
+2
-2
LogAgregator.cc
src/Log/LogAgregator.cc
+4
-2
LogReader.cc
src/Log/LogReader.cc
+4
-3
LogSession.cc
src/Log/LogSession.cc
+7
-6
No files found.
Utilities/ULog/log.cc
View file @
3de2c879
...
...
@@ -55,7 +55,7 @@ static void print_help()
// --------------------------------------------------------------------------
int
main
(
int
argc
,
char
**
argv
)
{
// std::ios::sync_with_stdio(false); // нельзя отключать.. тогда "обмен с сервером" рассинхронизируется
// std::ios::sync_with_stdio(false); // нельзя отключать.. тогда "обмен с сервером" рассинхронизируется
int
optindex
=
0
;
int
opt
=
0
;
...
...
Utilities/ULog/logserver.cc
View file @
3de2c879
...
...
@@ -34,7 +34,7 @@ static void print_help()
// --------------------------------------------------------------------------
int
main
(
int
argc
,
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
int
optindex
=
0
;
int
opt
=
0
;
...
...
Utilities/codegen/skel-main.cc
View file @
3de2c879
...
...
@@ -13,6 +13,7 @@ int main( int argc, const char** argv )
auto
conf
=
uniset_init
(
argc
,
argv
);
xmlNode
*
cnode
=
conf
->
getNode
(
"Skel"
);
if
(
cnode
==
NULL
)
{
cerr
<<
"(Skel): not found <Skel> in conffile"
<<
endl
;
...
...
extensions/DBServer-MySQL/DBServer_MySQL.h
View file @
3de2c879
...
...
@@ -145,8 +145,14 @@ class DBServer_MySQL:
/*! глобальная функция для вывода help-а */
static
void
help_print
(
int
argc
,
const
char
*
const
*
argv
);
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
(){
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
(){
return
dblog
;
}
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
()
{
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
()
{
return
dblog
;
}
protected
:
typedef
std
::
map
<
int
,
std
::
string
>
DBTableMap
;
...
...
extensions/DBServer-MySQL/main.cc
View file @
3de2c879
...
...
@@ -8,7 +8,7 @@ using namespace std;
// --------------------------------------------------------------------------
int
main
(
int
argc
,
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
try
{
...
...
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.h
View file @
3de2c879
...
...
@@ -21,8 +21,14 @@ class DBServer_PostgreSQL:
/*! глобальная функция для вывода help-а */
static
void
help_print
(
int
argc
,
const
char
*
const
*
argv
);
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
(){
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
(){
return
dblog
;
}
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
()
{
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
()
{
return
dblog
;
}
protected
:
typedef
std
::
map
<
int
,
std
::
string
>
DBTableMap
;
...
...
extensions/DBServer-PostgreSQL/main.cc
View file @
3de2c879
...
...
@@ -8,7 +8,7 @@ using namespace std;
// --------------------------------------------------------------------------
int
main
(
int
argc
,
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
try
{
...
...
extensions/DBServer-SQLite/DBServer_SQLite.h
View file @
3de2c879
...
...
@@ -145,8 +145,14 @@ class DBServer_SQLite:
/*! глобальная функция для вывода help-а */
static
void
help_print
(
int
argc
,
const
char
*
const
*
argv
);
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
(){
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
(){
return
dblog
;
}
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
()
{
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
()
{
return
dblog
;
}
protected
:
typedef
std
::
map
<
int
,
std
::
string
>
DBTableMap
;
...
...
extensions/DBServer-SQLite/main.cc
View file @
3de2c879
...
...
@@ -13,7 +13,7 @@ static void short_usage()
// --------------------------------------------------------------------------
int
main
(
int
argc
,
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
try
{
...
...
extensions/IOControl/iocalibr.cc
View file @
3de2c879
...
...
@@ -76,7 +76,7 @@ static struct option longopts[] =
// --------------------------------------------------------------------------
int
main
(
int
argc
,
char
*
argv
[])
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
comedi_t
*
card
;
const
char
*
dev
=
"/dev/comedi0"
;
lsampl_t
data
=
0
;
...
...
extensions/IOControl/iocontrol.cc
View file @
3de2c879
...
...
@@ -11,7 +11,7 @@ using namespace UniSetExtensions;
// --------------------------------------------------------------------------
int
main
(
int
argc
,
const
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
if
(
argc
>
1
&&
strcmp
(
argv
[
1
],
"--help"
)
==
0
)
{
...
...
extensions/LogicProcessor/logicproc.cc
View file @
3de2c879
...
...
@@ -9,7 +9,7 @@ using namespace UniSetExtensions;
// -----------------------------------------------------------------------------
int
main
(
int
argc
,
const
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
try
{
...
...
extensions/LogicProcessor/plogicproc.cc
View file @
3de2c879
...
...
@@ -11,7 +11,7 @@ using namespace UniSetExtensions;
// -----------------------------------------------------------------------------
int
main
(
int
argc
,
const
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
if
(
argc
>
1
&&
(
!
strcmp
(
argv
[
1
],
"--help"
)
||
!
strcmp
(
argv
[
1
],
"-h"
))
)
{
...
...
extensions/ModbusMaster/MBExchange.h
View file @
3de2c879
...
...
@@ -217,8 +217,14 @@ class MBExchange:
void
execute
();
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
(){
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
(){
return
mblog
;
}
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
()
{
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
()
{
return
mblog
;
}
protected
:
virtual
void
step
();
...
...
extensions/ModbusMaster/mtr-conv.cc
View file @
3de2c879
...
...
@@ -14,7 +14,7 @@ static void print_help()
// --------------------------------------------------------------------------
int
main
(
int
argc
,
const
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
unsigned
short
v1
=
0
;
unsigned
short
v2
=
0
;
const
char
*
type
=
""
;
...
...
extensions/ModbusMaster/mtr-read.cc
View file @
3de2c879
...
...
@@ -58,7 +58,7 @@ static void readMTR( ModbusRTUMaster* mb, ModbusRTU::ModbusAddr addr,
int
main
(
int
argc
,
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
Command
cmd
=
cmdNOP
;
int
optindex
=
0
;
int
opt
=
0
;
...
...
extensions/ModbusMaster/mtr-setup.cc
View file @
3de2c879
...
...
@@ -74,7 +74,7 @@ static char* checkArg( int ind, int argc, char* argv[] );
// --------------------------------------------------------------------------
int
main
(
int
argc
,
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
Command
cmd
=
cmdNOP
;
int
optindex
=
0
;
int
opt
=
0
;
...
...
extensions/ModbusMaster/rtuexchange.cc
View file @
3de2c879
...
...
@@ -9,7 +9,7 @@ using namespace UniSetExtensions;
// -----------------------------------------------------------------------------
int
main
(
int
argc
,
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
try
{
...
...
extensions/ModbusSlave/MBSlave.h
View file @
3de2c879
...
...
@@ -349,8 +349,14 @@ class MBSlave:
return
askCount
;
}
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
(){
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
(){
return
mblog
;
}
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
()
{
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
()
{
return
mblog
;
}
protected
:
...
...
extensions/ModbusSlave/mbslave.cc
View file @
3de2c879
...
...
@@ -15,7 +15,7 @@ using namespace std;
// --------------------------------------------------------------------------
int
main
(
int
argc
,
const
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
if
(
argc
>
1
&&
(
!
strcmp
(
argv
[
1
],
"--help"
)
||
!
strcmp
(
argv
[
1
],
"-h"
))
)
{
...
...
extensions/ModbusSlave/mbtcp-multislave.cc
View file @
3de2c879
...
...
@@ -15,7 +15,7 @@ using namespace std;
// --------------------------------------------------------------------------
int
main
(
int
argc
,
const
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
if
(
argc
>
1
&&
(
!
strcmp
(
argv
[
1
],
"--help"
)
||
!
strcmp
(
argv
[
1
],
"-h"
))
)
{
...
...
extensions/RRDServer/RRDServer.h
View file @
3de2c879
...
...
@@ -72,8 +72,14 @@ class RRDServer:
/*! глобальная функция для вывода help-а */
static
void
help_print
(
int
argc
,
const
char
*
const
*
argv
);
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
(){
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
(){
return
mylog
;
}
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
()
{
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
()
{
return
mylog
;
}
protected
:
RRDServer
();
...
...
extensions/RRDServer/main.cc
View file @
3de2c879
...
...
@@ -11,7 +11,7 @@ using namespace UniSetExtensions;
// -----------------------------------------------------------------------------
int
main
(
int
argc
,
const
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
if
(
argc
>
1
&&
(
!
strcmp
(
argv
[
1
],
"--help"
)
||
!
strcmp
(
argv
[
1
],
"-h"
))
)
{
...
...
extensions/SharedMemory/SharedMemory.cc
View file @
3de2c879
...
...
@@ -539,7 +539,7 @@ void SharedMemory::sendEvent( UniSetTypes::SystemMessage& sm )
{
try
{
ui
->
send
(
it
,
tm
);
ui
->
send
(
it
,
tm
);
ok
=
true
;
break
;
}
...
...
extensions/SharedMemory/SharedMemory.h
View file @
3de2c879
...
...
@@ -374,8 +374,14 @@ class SharedMemory:
return
histSaveTime
;
/*!< период между точками "дампа", мсек */
}
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
(){
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
(){
return
smlog
;
}
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
()
{
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
()
{
return
smlog
;
}
protected
:
typedef
std
::
list
<
Restorer_XML
::
ReaderSlot
>
ReadSlotList
;
...
...
extensions/SharedMemory/smemory.cc
View file @
3de2c879
...
...
@@ -10,7 +10,7 @@ using namespace UniSetExtensions;
// --------------------------------------------------------------------------
int
main
(
int
argc
,
const
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
if
(
argc
>
1
&&
(
strcmp
(
argv
[
1
],
"--help"
)
==
0
||
strcmp
(
argv
[
1
],
"-h"
)
==
0
)
)
{
...
...
extensions/SharedMemory/tests/TestObject.cc
View file @
3de2c879
...
...
@@ -32,7 +32,7 @@ void TestObject::sysCommand( const UniSetTypes::SystemMessage* sm )
{
// фиксируем что SM прислала WDT при своём запуске
if
(
sm
->
command
==
SystemMessage
::
WatchDog
)
evntIsOK
=
true
;
evntIsOK
=
true
;
}
// -----------------------------------------------------------------------------
void
TestObject
::
stopHeartbeat
()
...
...
extensions/SharedMemory/tests/TestObject.h
View file @
3de2c879
...
...
@@ -14,12 +14,18 @@ class TestObject:
void
askNotifyChange
();
void
askNotifyFirstNotNull
();
inline
bool
getEvnt
(){
return
evntIsOK
;
}
inline
bool
getEvnt
()
{
return
evntIsOK
;
}
void
stopHeartbeat
();
void
runHeartbeat
(
int
max
=
3
);
void
runHeartbeat
(
int
max
=
3
);
inline
timeout_t
getHeartbeatTime
(){
return
ptHeartBeat
.
getInterval
();
}
inline
timeout_t
getHeartbeatTime
()
{
return
ptHeartBeat
.
getInterval
();
}
protected
:
TestObject
();
...
...
extensions/SharedMemory/tests/tests.cc
View file @
3de2c879
...
...
@@ -65,7 +65,7 @@ int main(int argc, char* argv[] )
xmlNode
*
o_node
=
conf
->
getNode
(
"TestObject"
);
obj
=
make_shared
<
TestObject
>
(
o_id
,
o_node
);
obj
=
make_shared
<
TestObject
>
(
o_id
,
o_node
);
act
->
add
(
obj
);
auto
nullsm
=
make_shared
<
NullSM
>
(
ns_id
,
"reserv-sm-configure.xml"
);
...
...
extensions/SharedMemoryPlus/smemory-plus.cc
View file @
3de2c879
...
...
@@ -35,7 +35,7 @@ std::list< ThreadCreator<IOControl>* > lst_iothr;
// --------------------------------------------------------------------------
int
main
(
int
argc
,
const
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
if
(
argc
>
1
&&
(
strcmp
(
argv
[
1
],
"--help"
)
==
0
||
strcmp
(
argv
[
1
],
"-h"
)
==
0
)
)
{
...
...
extensions/UNetUDP/UNetExchange.h
View file @
3de2c879
...
...
@@ -99,8 +99,14 @@ class UNetExchange:
bool
checkExistUNetHost
(
const
std
::
string
&
host
,
ost
::
tpport_t
port
);
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
(){
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
(){
return
unetlog
;
}
inline
std
::
shared_ptr
<
LogAgregator
>
getLogAggregator
()
{
return
loga
;
}
inline
std
::
shared_ptr
<
DebugStream
>
log
()
{
return
unetlog
;
}
protected
:
...
...
extensions/UNetUDP/unetexchange.cc
View file @
3de2c879
...
...
@@ -9,7 +9,7 @@ using namespace UniSetExtensions;
// -----------------------------------------------------------------------------
int
main
(
int
argc
,
const
char
**
argv
)
{
// std::ios::sync_with_stdio(false);
// std::ios::sync_with_stdio(false);
try
{
...
...
extensions/include/UObject_SK.h
View file @
3de2c879
...
...
@@ -8,7 +8,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 2015-05-
24
+03:00
// generate timestamp: 2015-05-
30
+03:00
// -----------------------------------------------------------------------------
#ifndef UObject_SK_H_
#define UObject_SK_H_
...
...
extensions/lib/UObject_SK.cc
View file @
3de2c879
...
...
@@ -11,7 +11,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 2015-05-
24
+03:00
// generate timestamp: 2015-05-
30
+03:00
// -----------------------------------------------------------------------------
#include <memory>
#include "Configuration.h"
...
...
@@ -117,17 +117,17 @@ UObject_SK::UObject_SK( ObjectId id, xmlNode* cnode, const std::string& _argpref
loga
->
add
(
ulog
());
logserv
=
make_shared
<
LogServer
>
(
loga
);
logserv
->
init
(
argprefix
+
"
-
logserver"
,
confnode
);
logserv
->
init
(
argprefix
+
"logserver"
,
confnode
);
UniXML
::
iterator
it
(
cnode
);
// ------- init logserver ---
if
(
findArgParam
(
"--"
+
argprefix
+
"
-
run-logserver"
,
conf
->
getArgc
(),
conf
->
getArgv
())
!=
-
1
)
if
(
findArgParam
(
"--"
+
argprefix
+
"run-logserver"
,
conf
->
getArgc
(),
conf
->
getArgv
())
!=
-
1
)
{
logserv_host
=
conf
->
getArg2Param
(
"--"
+
argprefix
+
"
-
logserver-host"
,
it
.
getProp
(
"logserverHost"
),
"localhost"
);
logserv_port
=
conf
->
getArgPInt
(
"--"
+
argprefix
+
"
-
logserver-port"
,
it
.
getProp
(
"logserverPort"
),
getId
());
logserv_host
=
conf
->
getArg2Param
(
"--"
+
argprefix
+
"logserver-host"
,
it
.
getProp
(
"logserverHost"
),
"localhost"
);
logserv_port
=
conf
->
getArgPInt
(
"--"
+
argprefix
+
"logserver-port"
,
it
.
getProp
(
"logserverPort"
),
getId
());
}
forceOut
=
conf
->
getArgPInt
(
"--"
+
argprefix
+
"force-out"
,
it
.
getProp
(
"forceOut"
),
false
);
...
...
@@ -309,7 +309,7 @@ void UObject_SK::preSysCommand( const SystemMessage* _sm )
switch
(
_sm
->
command
)
{
case
SystemMessage
:
:
WatchDog
:
u
logany
<<
myname
<<
"(preSysCommand): WatchDog"
<<
endl
;
u
info
<<
myname
<<
"(preSysCommand): WatchDog"
<<
endl
;
if
(
!
active
||
!
ptStartUpTimeout
.
checkTime
()
)
{
...
...
@@ -458,8 +458,15 @@ void UObject_SK::callback()
// "сердцебиение"
if
(
idHeartBeat
!=
DefaultObjectId
&&
ptHeartBeat
.
checkTime
()
)
{
ui
->
setValue
(
idHeartBeat
,
maxHeartBeat
,
UniversalIO
::
AI
);
ptHeartBeat
.
reset
();
try
{
ui
->
setValue
(
idHeartBeat
,
maxHeartBeat
);
ptHeartBeat
.
reset
();
}
catch
(
const
Exception
&
ex
)
{
ucrit
<<
myname
<<
"(execute): "
<<
ex
<<
endl
;
}
}
// обновление выходов
...
...
include/Pulse.h
View file @
3de2c879
...
...
@@ -55,7 +55,7 @@ class Pulse
ostate
=
false
;
// учитываем что step мог вызваться гораздо позже..
t0
.
setTiming
(
t0_msec
-
t1
.
getCurrent
()
%
t1
.
getInterval
()
);
t0
.
setTiming
(
t0_msec
-
t1
.
getCurrent
()
%
t1
.
getInterval
()
);
}
if
(
!
ostate
&&
t0
.
checkTime
()
)
...
...
@@ -63,7 +63,7 @@ class Pulse
ostate
=
true
;
// учитываем что step мог вызваться гораздо позже..
t1
.
setTiming
(
t1_msec
-
t0
.
getCurrent
()
%
t0
.
getInterval
()
);
t1
.
setTiming
(
t1_msec
-
t0
.
getCurrent
()
%
t0
.
getInterval
()
);
}
return
ostate
;
...
...
src/Log/LogAgregator.cc
View file @
3de2c879
...
...
@@ -113,7 +113,7 @@ std::list<LogAgregator::LogInfo> LogAgregator::getLogList()
{
std
::
list
<
LogAgregator
::
LogInfo
>
l
;
for
(
auto
&&
i
:
lmap
)
for
(
auto
&&
i
:
lmap
)
l
.
push_back
(
i
.
second
);
return
std
::
move
(
l
);
...
...
@@ -122,10 +122,12 @@ std::list<LogAgregator::LogInfo> LogAgregator::getLogList()
std
::
list
<
LogAgregator
::
LogInfo
>
LogAgregator
::
getLogList
(
const
std
::
string
&
regex_str
)
{
std
::
list
<
LogAgregator
::
LogInfo
>
l
;
try
{
std
::
regex
rule
(
regex_str
);
for
(
auto
&&
i
:
lmap
)
for
(
auto
&&
i
:
lmap
)
{
if
(
std
::
regex_match
(
i
.
second
.
log
->
getLogName
(),
rule
)
)
l
.
push_back
(
i
.
second
);
...
...
src/Log/LogReader.cc
View file @
3de2c879
...
...
@@ -177,6 +177,7 @@ void LogReader::readlogs( const std::string& _addr, ost::tpport_t _port, LogServ
if
(
tcp
->
isPending
(
ost
::
Socket
::
pendingOutput
,
outTimeout
)
)
{
rlog
.
info
()
<<
"(LogReader): ** send command: cmd='"
<<
msg
.
cmd
<<
"' logname='"
<<
msg
.
logname
<<
"' data='"
<<
msg
.
data
<<
"'"
<<
endl
;
for
(
size_t
i
=
0
;
i
<
sizeof
(
msg
);
i
++
)
(
*
tcp
)
<<
((
unsigned
char
*
)(
&
msg
))[
i
];
...
...
@@ -186,14 +187,14 @@ void LogReader::readlogs( const std::string& _addr, ost::tpport_t _port, LogServ
else
rlog
.
warn
()
<<
"(LogReader): **** SEND COMMAND ('"
<<
msg
.
cmd
<<
"' FAILED!"
<<
endl
;
if
(
cmdonly
&&
msg
.
cmd
!=
LogServerTypes
::
cmdList
)
if
(
cmdonly
&&
msg
.
cmd
!=
LogServerTypes
::
cmdList
)
{
disconnect
();
return
;
}
}
while
(
(
!
cmdonly
||
msg
.
cmd
==
LogServerTypes
::
cmdList
)
&&
tcp
->
isPending
(
ost
::
Socket
::
pendingInput
,
inTimeout
)
)
while
(
(
!
cmdonly
||
msg
.
cmd
==
LogServerTypes
::
cmdList
)
&&
tcp
->
isPending
(
ost
::
Socket
::
pendingInput
,
inTimeout
)
)
{
int
n
=
tcp
->
peek
(
buf
,
sizeof
(
buf
)
-
1
);
...
...
@@ -203,7 +204,7 @@ void LogReader::readlogs( const std::string& _addr, ost::tpport_t _port, LogServ
buf
[
n
]
=
'\0'
;
log
<<
buf
;
if
(
msg
.
cmd
==
LogServerTypes
::
cmdList
)
if
(
msg
.
cmd
==
LogServerTypes
::
cmdList
)
break
;
}
else
...
...
src/Log/LogSession.cc
View file @
3de2c879
...
...
@@ -149,6 +149,7 @@ void LogSession::run()
}
s
<<
"====================="
<<
endl
;
if
(
isPending
(
Socket
::
pendingOutput
,
cmdTimeout
)
)
{
...
...
@@ -158,7 +159,7 @@ void LogSession::run()
}
// обрабатываем команды только если нашли log
for
(
auto
&&
li
:
loglist
)
for
(
auto
&&
li
:
loglist
)
{
// Обработка команд..
// \warning Работа с логом ведётся без mutex-а, хотя он разделяется отдельными потоками
...
...
@@ -166,15 +167,15 @@ void LogSession::run()
{
case
LogServerTypes
:
:
cmdSetLevel
:
li
.
log
->
level
(
(
Debug
::
type
)
msg
.
data
);
break
;
break
;
case
LogServerTypes
:
:
cmdAddLevel
:
li
.
log
->
addLevel
(
(
Debug
::
type
)
msg
.
data
);
break
;
break
;
case
LogServerTypes
:
:
cmdDelLevel
:
li
.
log
->
delLevel
(
(
Debug
::
type
)
msg
.
data
);
break
;
break
;
case
LogServerTypes
:
:
cmdRotate
:
{
...
...
@@ -184,11 +185,11 @@ void LogSession::run()
break
;
case
LogServerTypes
:
:
cmdList
:
// обработали выше (в начале)
break
;
break
;
case
LogServerTypes
:
:
cmdOffLogFile
:
li
.
log
->
logFile
(
""
);
break
;
break
;
case
LogServerTypes
:
:
cmdOnLogFile
:
{
...
...
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