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
969fac56
Commit
969fac56
authored
Apr 04, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(MBTCPMaster): корректировка параметов по умолчанию.
(MBSlave): добавил дополнительнулью информацию в vmonit
parent
82d01b3d
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
10 deletions
+16
-10
MBExchange.cc
extensions/ModbusMaster/MBExchange.cc
+8
-2
MBExchange.h
extensions/ModbusMaster/MBExchange.h
+2
-1
MBTCPMaster.cc
extensions/ModbusMaster/MBTCPMaster.cc
+1
-1
MBTCPMultiMaster.cc
extensions/ModbusMaster/MBTCPMultiMaster.cc
+1
-1
RTUExchange.cc
extensions/ModbusMaster/RTUExchange.cc
+2
-2
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+2
-2
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+0
-1
No files found.
extensions/ModbusMaster/MBExchange.cc
View file @
969fac56
...
@@ -130,7 +130,7 @@ MBExchange::MBExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId,
...
@@ -130,7 +130,7 @@ MBExchange::MBExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId,
initPause
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-initPause"
,
it
.
getProp
(
"initPause"
),
3000
);
initPause
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-initPause"
,
it
.
getProp
(
"initPause"
),
3000
);
sleepPause_
usec
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-sleepPause-usec"
,
it
.
getProp
(
"sleepPause"
),
10
0
);
sleepPause_
msec
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-sleepPause-msec"
,
it
.
getProp
(
"sleepPause"
),
1
0
);
force
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force"
,
it
.
getProp
(
"force"
));
force
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force"
,
it
.
getProp
(
"force"
));
force_out
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force-out"
,
it
.
getProp
(
"force_out"
));
force_out
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force-out"
,
it
.
getProp
(
"force_out"
));
...
@@ -3134,7 +3134,10 @@ bool MBExchange::poll()
...
@@ -3134,7 +3134,10 @@ bool MBExchange::poll()
if
(
stat_time
>
0
&&
ptStatistic
.
checkTime
()
)
if
(
stat_time
>
0
&&
ptStatistic
.
checkTime
()
)
{
{
mblog9
<<
endl
<<
"(poll statistic): number of calls is "
<<
poll_count
<<
" (poll time: "
<<
stat_time
<<
" sec)"
<<
endl
<<
endl
;
ostringstream
s
;
s
<<
"number of calls is "
<<
poll_count
<<
" (poll time: "
<<
stat_time
<<
" sec)"
;
statInfo
=
std
::
move
(
s
.
str
());
mblog9
<<
myname
<<
"(stat): "
<<
statInfo
<<
endl
;
ptStatistic
.
reset
();
ptStatistic
.
reset
();
poll_count
=
0
;
poll_count
=
0
;
}
}
...
@@ -3293,6 +3296,9 @@ UniSetTypes::SimpleInfo* MBExchange::getInfo( CORBA::Long userparam )
...
@@ -3293,6 +3296,9 @@ UniSetTypes::SimpleInfo* MBExchange::getInfo( CORBA::Long userparam )
inf
<<
"Parameters: reopenTimeout="
<<
ptReopen
.
getInterval
()
inf
<<
"Parameters: reopenTimeout="
<<
ptReopen
.
getInterval
()
<<
endl
;
<<
endl
;
if
(
stat_time
>
0
)
inf
<<
"Statistics: "
<<
statInfo
<<
endl
;
inf
<<
"Devices: "
<<
endl
;
inf
<<
"Devices: "
<<
endl
;
for
(
const
auto
&
it
:
devices
)
for
(
const
auto
&
it
:
devices
)
inf
<<
" "
<<
it
.
second
->
getShortInfo
()
<<
endl
;
inf
<<
" "
<<
it
.
second
->
getShortInfo
()
<<
endl
;
...
...
extensions/ModbusMaster/MBExchange.h
View file @
969fac56
...
@@ -341,7 +341,7 @@ class MBExchange:
...
@@ -341,7 +341,7 @@ class MBExchange:
bool
force_out
=
{
false
};
/*!< флаг означающий, принудительного чтения выходов */
bool
force_out
=
{
false
};
/*!< флаг означающий, принудительного чтения выходов */
bool
mbregFromID
=
{
false
};
bool
mbregFromID
=
{
false
};
int
polltime
=
{
100
};
/*!< переодичность обновления данных, [мсек] */
int
polltime
=
{
100
};
/*!< переодичность обновления данных, [мсек] */
timeout_t
sleepPause_
u
sec
;
timeout_t
sleepPause_
m
sec
;
unsigned
int
maxQueryCount
=
{
ModbusRTU
::
MAXDATALEN
};
/*!< максимальное количество регистров для одного запроса */
unsigned
int
maxQueryCount
=
{
ModbusRTU
::
MAXDATALEN
};
/*!< максимальное количество регистров для одного запроса */
PassiveTimer
ptHeartBeat
;
PassiveTimer
ptHeartBeat
;
...
@@ -364,6 +364,7 @@ class MBExchange:
...
@@ -364,6 +364,7 @@ class MBExchange:
timeout_t
stat_time
=
{
0
};
/*!< время сбора статистики обмена, 0 - отключена */
timeout_t
stat_time
=
{
0
};
/*!< время сбора статистики обмена, 0 - отключена */
unsigned
int
poll_count
=
{
0
};
unsigned
int
poll_count
=
{
0
};
PassiveTimer
ptStatistic
;
/*!< таймер для сбора статистики обмена */
PassiveTimer
ptStatistic
;
/*!< таймер для сбора статистики обмена */
std
::
string
statInfo
=
{
""
};
std
::
string
prop_prefix
;
/*!< префикс для считывания параметров обмена */
std
::
string
prop_prefix
;
/*!< префикс для считывания параметров обмена */
...
...
extensions/ModbusMaster/MBTCPMaster.cc
View file @
969fac56
...
@@ -111,7 +111,7 @@ std::shared_ptr<ModbusClient> MBTCPMaster::initMB( bool reopen )
...
@@ -111,7 +111,7 @@ std::shared_ptr<ModbusClient> MBTCPMaster::initMB( bool reopen )
if
(
recv_timeout
>
0
)
if
(
recv_timeout
>
0
)
mbtcp
->
setTimeout
(
recv_timeout
);
mbtcp
->
setTimeout
(
recv_timeout
);
mbtcp
->
setSleepPause
(
sleepPause_
u
sec
);
mbtcp
->
setSleepPause
(
sleepPause_
m
sec
);
mbtcp
->
setAfterSendPause
(
aftersend_pause
);
mbtcp
->
setAfterSendPause
(
aftersend_pause
);
mbinfo
<<
myname
<<
"(init): ipaddr="
<<
iaddr
<<
" port="
<<
port
<<
endl
;
mbinfo
<<
myname
<<
"(init): ipaddr="
<<
iaddr
<<
" port="
<<
port
<<
endl
;
...
...
extensions/ModbusMaster/MBTCPMultiMaster.cc
View file @
969fac56
...
@@ -120,7 +120,7 @@ MBTCPMultiMaster::MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::Ob
...
@@ -120,7 +120,7 @@ MBTCPMultiMaster::MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::Ob
sinf
.
ptIgnoreTimeout
.
setTiming
(
it1
.
getPIntProp
(
"ignore_timeout"
,
ignore_timeout
)
);
sinf
.
ptIgnoreTimeout
.
setTiming
(
it1
.
getPIntProp
(
"ignore_timeout"
,
ignore_timeout
)
);
sinf
.
recv_timeout
=
it1
.
getPIntProp
(
"recv_timeout"
,
recv_timeout
);
sinf
.
recv_timeout
=
it1
.
getPIntProp
(
"recv_timeout"
,
recv_timeout
);
sinf
.
aftersend_pause
=
it1
.
getPIntProp
(
"aftersend_pause"
,
aftersend_pause
);
sinf
.
aftersend_pause
=
it1
.
getPIntProp
(
"aftersend_pause"
,
aftersend_pause
);
sinf
.
sleepPause_usec
=
it1
.
getPIntProp
(
"sleepPause_
usec"
,
sleepPause_u
sec
);
sinf
.
sleepPause_usec
=
it1
.
getPIntProp
(
"sleepPause_
msec"
,
sleepPause_m
sec
);
sinf
.
respond_invert
=
it1
.
getPIntProp
(
"invert"
,
0
);
sinf
.
respond_invert
=
it1
.
getPIntProp
(
"invert"
,
0
);
sinf
.
respond_force
=
it1
.
getPIntProp
(
"force"
,
0
);
sinf
.
respond_force
=
it1
.
getPIntProp
(
"force"
,
0
);
...
...
extensions/ModbusMaster/RTUExchange.cc
View file @
969fac56
...
@@ -78,7 +78,7 @@ RTUExchange::RTUExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmI
...
@@ -78,7 +78,7 @@ RTUExchange::RTUExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmI
transmitCtl
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-transmit-ctl"
,
it
.
getProp
(
"transmitCtl"
));
transmitCtl
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-transmit-ctl"
,
it
.
getProp
(
"transmitCtl"
));
defSpeed
=
ComPort
::
getSpeed
(
speed
);
defSpeed
=
ComPort
::
getSpeed
(
speed
);
sleepPause_
u
sec
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-sleepPause-usec"
,
it
.
getProp
(
"slepePause"
),
100
);
sleepPause_
m
sec
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-sleepPause-usec"
,
it
.
getProp
(
"slepePause"
),
100
);
rs_pre_clean
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-pre-clean"
,
it
.
getProp
(
"pre_clean"
));
rs_pre_clean
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-pre-clean"
,
it
.
getProp
(
"pre_clean"
));
...
@@ -155,7 +155,7 @@ std::shared_ptr<ModbusClient> RTUExchange::initMB( bool reopen )
...
@@ -155,7 +155,7 @@ std::shared_ptr<ModbusClient> RTUExchange::initMB( bool reopen )
if
(
recv_timeout
>
0
)
if
(
recv_timeout
>
0
)
mbrtu
->
setTimeout
(
recv_timeout
);
mbrtu
->
setTimeout
(
recv_timeout
);
mbrtu
->
setSleepPause
(
sleepPause_
u
sec
);
mbrtu
->
setSleepPause
(
sleepPause_
m
sec
);
mbrtu
->
setAfterSendPause
(
aftersend_pause
);
mbrtu
->
setAfterSendPause
(
aftersend_pause
);
mbinfo
<<
myname
<<
"(init): dev="
<<
devname
<<
" speed="
<<
ComPort
::
getSpeed
(
mbrtu
->
getSpeed
()
)
<<
endl
;
mbinfo
<<
myname
<<
"(init): dev="
<<
devname
<<
" speed="
<<
ComPort
::
getSpeed
(
mbrtu
->
getSpeed
()
)
<<
endl
;
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
969fac56
...
@@ -227,7 +227,7 @@ MBSlave::MBSlave(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const
...
@@ -227,7 +227,7 @@ MBSlave::MBSlave(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const
sessMaxNum
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-session-maxnum"
,
it
.
getProp
(
"sessMaxNum"
));
sessMaxNum
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-session-maxnum"
,
it
.
getProp
(
"sessMaxNum"
));
if
(
sessMaxNum
==
0
)
if
(
sessMaxNum
==
0
)
sessMaxNum
=
3
;
sessMaxNum
=
5
;
vmonit
(
sessMaxNum
);
vmonit
(
sessMaxNum
);
...
@@ -2591,7 +2591,7 @@ UniSetTypes::SimpleInfo* MBSlave::getInfo( CORBA::Long userparam )
...
@@ -2591,7 +2591,7 @@ UniSetTypes::SimpleInfo* MBSlave::getInfo( CORBA::Long userparam )
{
{
uniset_mutex_lock
l
(
sessMutex
);
uniset_mutex_lock
l
(
sessMutex
);
inf
<<
"TCP sessions["
<<
sess
.
size
()
<<
"]:
"
<<
endl
;
inf
<<
"TCP sessions["
<<
sess
.
size
()
<<
"]:
max="
<<
sessMaxNum
<<
" updateStatTime="
<<
updateStatTime
<<
endl
;
for
(
const
auto
&
m
:
sess
)
for
(
const
auto
&
m
:
sess
)
inf
<<
" "
<<
m
.
iaddr
<<
" askCount="
<<
m
.
askCount
<<
endl
;
inf
<<
" "
<<
m
.
iaddr
<<
" askCount="
<<
m
.
askCount
<<
endl
;
}
}
...
...
extensions/SharedMemory/SharedMemory.cc
View file @
969fac56
...
@@ -38,7 +38,6 @@ void SharedMemory::help_print( int argc, const char* const* argv )
...
@@ -38,7 +38,6 @@ void SharedMemory::help_print( int argc, const char* const* argv )
cout
<<
"--wdt-device - Использовать в качестве WDT указанный файл."
<<
endl
;
cout
<<
"--wdt-device - Использовать в качестве WDT указанный файл."
<<
endl
;
cout
<<
"--heartbeat-node - Загружать heartbeat датчики для указанного узла."
<<
endl
;
cout
<<
"--heartbeat-node - Загружать heartbeat датчики для указанного узла."
<<
endl
;
cout
<<
"--heartbeat-check-time - период проверки 'счётчиков'. По умолчанию 1000 мсек"
<<
endl
;
cout
<<
"--heartbeat-check-time - период проверки 'счётчиков'. По умолчанию 1000 мсек"
<<
endl
;
cout
<<
"--lock-rvalue-pause-msec - пауза между проверкой rw-блокировки на разрешение чтения"
<<
endl
;
cout
<<
"--e-filter - фильтр для считывания <eventlist>"
<<
endl
;
cout
<<
"--e-filter - фильтр для считывания <eventlist>"
<<
endl
;
cout
<<
"--e-startup-pause - пауза перед посылкой уведомления о старте SM. (По умолчанию: 1500 мсек)."
<<
endl
;
cout
<<
"--e-startup-pause - пауза перед посылкой уведомления о старте SM. (По умолчанию: 1500 мсек)."
<<
endl
;
cout
<<
"--activate-timeout - время ожидания активизации (По умолчанию: 15000 мсек)."
<<
endl
;
cout
<<
"--activate-timeout - время ожидания активизации (По умолчанию: 15000 мсек)."
<<
endl
;
...
...
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