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
59446e94
Commit
59446e94
authored
Nov 30, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.eter:/projects/asu/uniset2
parents
84ee08fd
9dcb5d66
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
32 additions
and
29 deletions
+32
-29
MBTCPServer.cc
Utilities/MBTester/MBTCPServer.cc
+2
-2
MBExchange.cc
extensions/ModbusMaster/MBExchange.cc
+7
-7
Makefile.am
extensions/ModbusSlave/Makefile.am
+1
-1
UniSetTypes.h
include/UniSetTypes.h
+2
-0
UModbus.cc
python/lib/pyUniSet/UModbus.cc
+4
-4
ModbusHelpers.cc
src/Communications/Modbus/ModbusHelpers.cc
+8
-8
ORepHelpers.cc
src/ObjectRepository/ORepHelpers.cc
+3
-1
ObjectIndex_Array.cc
src/ObjectRepository/ObjectIndex_Array.cc
+1
-1
UniSetManager.cc
src/ObjectRepository/UniSetManager.cc
+2
-3
SViewer.cc
src/Various/SViewer.cc
+1
-1
UniXML.cc
src/Various/UniXML.cc
+1
-1
No files found.
Utilities/MBTester/MBTCPServer.cc
View file @
59446e94
...
@@ -161,7 +161,7 @@ ModbusRTU::mbErrCode MBTCPServer::readInputStatus( ReadInputStatusMessage& query
...
@@ -161,7 +161,7 @@ ModbusRTU::mbErrCode MBTCPServer::readInputStatus( ReadInputStatusMessage& query
while
(
i
<
query
.
count
)
while
(
i
<
query
.
count
)
{
{
reply
.
addData
(
0
);
reply
.
addData
(
0
);
for
(
unsigned
int
nbit
=
0
;
nbit
<
BitsPerByte
&&
i
<
query
.
count
;
nbit
++
,
i
++
)
for
(
auto
nbit
=
0
;
nbit
<
BitsPerByte
&&
i
<
query
.
count
;
nbit
++
,
i
++
)
reply
.
setBit
(
bnum
,
nbit
,
d
.
b
[
nbit
]);
reply
.
setBit
(
bnum
,
nbit
,
d
.
b
[
nbit
]);
bnum
++
;
bnum
++
;
}
}
...
@@ -172,7 +172,7 @@ ModbusRTU::mbErrCode MBTCPServer::readInputStatus( ReadInputStatusMessage& query
...
@@ -172,7 +172,7 @@ ModbusRTU::mbErrCode MBTCPServer::readInputStatus( ReadInputStatusMessage& query
if
(
(
query
.
count
%
ModbusRTU
::
BitsPerByte
)
>
0
)
if
(
(
query
.
count
%
ModbusRTU
::
BitsPerByte
)
>
0
)
bcnt
++
;
bcnt
++
;
for
(
unsigned
int
i
=
0
;
i
<
bcnt
;
i
++
)
for
(
auto
i
=
0
;
i
<
bcnt
;
i
++
)
reply
.
addData
(
replyVal
);
reply
.
addData
(
replyVal
);
}
}
...
...
extensions/ModbusMaster/MBExchange.cc
View file @
59446e94
...
@@ -860,10 +860,10 @@ bool MBExchange::pollRTU( RTUDevice* dev, RegMap::iterator& it )
...
@@ -860,10 +860,10 @@ bool MBExchange::pollRTU( RTUDevice* dev, RegMap::iterator& it )
{
{
ModbusRTU
::
ReadInputStatusRetMessage
ret
=
mb
->
read02
(
dev
->
mbaddr
,
p
->
mbreg
,
p
->
q_count
);
ModbusRTU
::
ReadInputStatusRetMessage
ret
=
mb
->
read02
(
dev
->
mbaddr
,
p
->
mbreg
,
p
->
q_count
);
int
m
=
0
;
int
m
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ret
.
bcnt
;
i
++
)
for
(
auto
i
=
0
;
i
<
ret
.
bcnt
;
i
++
)
{
{
ModbusRTU
::
DataBits
b
(
ret
.
data
[
i
]);
ModbusRTU
::
DataBits
b
(
ret
.
data
[
i
]);
for
(
unsigned
int
k
=
0
;
k
<
ModbusRTU
::
BitsPerByte
&&
m
<
p
->
q_count
;
k
++
,
it
++
,
m
++
)
for
(
auto
k
=
0
;
k
<
ModbusRTU
::
BitsPerByte
&&
m
<
p
->
q_count
;
k
++
,
it
++
,
m
++
)
it
->
second
->
mbval
=
b
[
k
];
it
->
second
->
mbval
=
b
[
k
];
}
}
it
--
;
it
--
;
...
@@ -874,10 +874,10 @@ bool MBExchange::pollRTU( RTUDevice* dev, RegMap::iterator& it )
...
@@ -874,10 +874,10 @@ bool MBExchange::pollRTU( RTUDevice* dev, RegMap::iterator& it )
{
{
ModbusRTU
::
ReadCoilRetMessage
ret
=
mb
->
read01
(
dev
->
mbaddr
,
p
->
mbreg
,
p
->
q_count
);
ModbusRTU
::
ReadCoilRetMessage
ret
=
mb
->
read01
(
dev
->
mbaddr
,
p
->
mbreg
,
p
->
q_count
);
int
m
=
0
;
int
m
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ret
.
bcnt
;
i
++
)
for
(
auto
i
=
0
;
i
<
ret
.
bcnt
;
i
++
)
{
{
ModbusRTU
::
DataBits
b
(
ret
.
data
[
i
]);
ModbusRTU
::
DataBits
b
(
ret
.
data
[
i
]);
for
(
unsigned
int
k
=
0
;
k
<
ModbusRTU
::
BitsPerByte
&&
m
<
p
->
q_count
;
k
++
,
it
++
,
m
++
)
for
(
auto
k
=
0
;
k
<
ModbusRTU
::
BitsPerByte
&&
m
<
p
->
q_count
;
k
++
,
it
++
,
m
++
)
it
->
second
->
mbval
=
b
[
k
]
?
1
:
0
;
it
->
second
->
mbval
=
b
[
k
]
?
1
:
0
;
}
}
it
--
;
it
--
;
...
@@ -925,7 +925,7 @@ bool MBExchange::pollRTU( RTUDevice* dev, RegMap::iterator& it )
...
@@ -925,7 +925,7 @@ bool MBExchange::pollRTU( RTUDevice* dev, RegMap::iterator& it )
}
}
ModbusRTU
::
WriteOutputMessage
msg
(
dev
->
mbaddr
,
p
->
mbreg
);
ModbusRTU
::
WriteOutputMessage
msg
(
dev
->
mbaddr
,
p
->
mbreg
);
for
(
unsigned
int
i
=
0
;
i
<
p
->
q_count
;
i
++
,
it
++
)
for
(
auto
i
=
0
;
i
<
p
->
q_count
;
i
++
,
it
++
)
msg
.
addData
(
it
->
second
->
mbval
);
msg
.
addData
(
it
->
second
->
mbval
);
it
--
;
it
--
;
...
@@ -962,7 +962,7 @@ bool MBExchange::pollRTU( RTUDevice* dev, RegMap::iterator& it )
...
@@ -962,7 +962,7 @@ bool MBExchange::pollRTU( RTUDevice* dev, RegMap::iterator& it )
}
}
ModbusRTU
::
ForceCoilsMessage
msg
(
dev
->
mbaddr
,
p
->
mbreg
);
ModbusRTU
::
ForceCoilsMessage
msg
(
dev
->
mbaddr
,
p
->
mbreg
);
for
(
unsigned
int
i
=
0
;
i
<
p
->
q_count
;
i
++
,
it
++
)
for
(
auto
i
=
0
;
i
<
p
->
q_count
;
i
++
,
it
++
)
msg
.
addBit
(
(
it
->
second
->
mbval
?
true
:
false
)
);
msg
.
addBit
(
(
it
->
second
->
mbval
?
true
:
false
)
);
it
--
;
it
--
;
...
@@ -2190,7 +2190,7 @@ bool MBExchange::initItem( UniXML::iterator& it )
...
@@ -2190,7 +2190,7 @@ bool MBExchange::initItem( UniXML::iterator& it )
{
{
ri
->
q_count
=
p1
->
rnum
;
ri
->
q_count
=
p1
->
rnum
;
ri
->
q_num
=
1
;
ri
->
q_num
=
1
;
for
(
unsigned
int
i
=
1
;
i
<
p1
->
rnum
;
i
++
)
for
(
auto
i
=
1
;
i
<
p1
->
rnum
;
i
++
)
{
{
RegID
id1
=
genRegID
(
mbreg
+
i
,
ri
->
mbfunc
);
RegID
id1
=
genRegID
(
mbreg
+
i
,
ri
->
mbfunc
);
RegInfo
*
r
=
addReg
(
dev
->
regmap
,
id1
,
mbreg
+
i
,
it
,
dev
);
RegInfo
*
r
=
addReg
(
dev
->
regmap
,
id1
,
mbreg
+
i
,
it
,
dev
);
...
...
extensions/ModbusSlave/Makefile.am
View file @
59446e94
...
@@ -36,4 +36,4 @@ pkgconfig_DATA = libUniSet2MBSlave.pc
...
@@ -36,4 +36,4 @@ pkgconfig_DATA = libUniSet2MBSlave.pc
all-local
:
all-local
:
ln
-sf
../ModbusSlave/
$(devel_include_HEADERS)
../include
ln
-sf
../ModbusSlave/
$(devel_include_HEADERS)
../include
SUBDIRS
=
tests
#
SUBDIRS=tests
include/UniSetTypes.h
View file @
59446e94
...
@@ -204,6 +204,8 @@ namespace UniSetTypes
...
@@ -204,6 +204,8 @@ namespace UniSetTypes
/*! Проверка наличия параметра в командной строке
/*! Проверка наличия параметра в командной строке
\param name - название параметра
\param name - название параметра
\param _argc - argc
\param _argv - argv
\return Возвращает -1, если параметр не найден.
\return Возвращает -1, если параметр не найден.
Или позицию параметра, если найден.
Или позицию параметра, если найден.
*/
*/
...
...
python/lib/pyUniSet/UModbus.cc
View file @
59446e94
...
@@ -6,10 +6,10 @@ using namespace std;
...
@@ -6,10 +6,10 @@ using namespace std;
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
#if 0
#if 0
UModbus::UModbus( UTypes::Params* p )throw(UException):
UModbus::UModbus( UTypes::Params* p )throw(UException):
mb(0),
mb(0),
ip(""
),
port(512
),
port(512
),
ip(""
),
tout_msec(5000)
tout_msec(5000)
{
{
try
try
{
{
...
...
src/Communications/Modbus/ModbusHelpers.cc
View file @
59446e94
...
@@ -36,19 +36,19 @@ ModbusAddr ModbusHelpers::autodetectSlave( ModbusRTUMaster* m,
...
@@ -36,19 +36,19 @@ ModbusAddr ModbusHelpers::autodetectSlave( ModbusRTUMaster* m,
{
{
if
(
fn
==
fnReadInputRegisters
)
if
(
fn
==
fnReadInputRegisters
)
{
{
ReadInputRetMessage
ret
=
m
->
read04
(
a
,
reg
,
1
);
m
->
read04
(
a
,
reg
,
1
);
}
}
else
if
(
fn
==
fnReadInputStatus
)
else
if
(
fn
==
fnReadInputStatus
)
{
{
ReadInputStatusRetMessage
ret
=
m
->
read02
(
a
,
reg
,
1
);
m
->
read02
(
a
,
reg
,
1
);
}
}
else
if
(
fn
==
fnReadCoilStatus
)
else
if
(
fn
==
fnReadCoilStatus
)
{
{
ReadCoilRetMessage
ret
=
m
->
read01
(
a
,
reg
,
1
);
m
->
read01
(
a
,
reg
,
1
);
}
}
else
if
(
fn
==
fnReadOutputRegisters
)
else
if
(
fn
==
fnReadOutputRegisters
)
{
{
ReadOutputRetMessage
ret
=
m
->
read03
(
a
,
reg
,
1
);
m
->
read03
(
a
,
reg
,
1
);
}
}
else
else
throw
mbException
(
erOperationFailed
);
throw
mbException
(
erOperationFailed
);
...
@@ -95,19 +95,19 @@ ComPort::Speed ModbusHelpers::autodetectSpeed( ModbusRTUMaster* m, ModbusAddr sl
...
@@ -95,19 +95,19 @@ ComPort::Speed ModbusHelpers::autodetectSpeed( ModbusRTUMaster* m, ModbusAddr sl
if
(
fn
==
fnReadInputRegisters
)
if
(
fn
==
fnReadInputRegisters
)
{
{
ReadInputRetMessage
ret
=
m
->
read04
(
slave
,
reg
,
1
);
m
->
read04
(
slave
,
reg
,
1
);
}
}
else
if
(
fn
==
fnReadInputStatus
)
else
if
(
fn
==
fnReadInputStatus
)
{
{
ReadInputStatusRetMessage
ret
=
m
->
read02
(
slave
,
reg
,
1
);
m
->
read02
(
slave
,
reg
,
1
);
}
}
else
if
(
fn
==
fnReadCoilStatus
)
else
if
(
fn
==
fnReadCoilStatus
)
{
{
ReadCoilRetMessage
ret
=
m
->
read01
(
slave
,
reg
,
1
);
m
->
read01
(
slave
,
reg
,
1
);
}
}
else
if
(
fn
==
fnReadOutputRegisters
)
else
if
(
fn
==
fnReadOutputRegisters
)
{
{
ReadOutputRetMessage
ret
=
m
->
read03
(
slave
,
reg
,
1
);
m
->
read03
(
slave
,
reg
,
1
);
}
}
else
else
throw
mbException
(
erOperationFailed
);
throw
mbException
(
erOperationFailed
);
...
...
src/ObjectRepository/ORepHelpers.cc
View file @
59446e94
...
@@ -40,7 +40,9 @@ namespace ORepHelpers
...
@@ -40,7 +40,9 @@ namespace ORepHelpers
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
/*!
/*!
* \param cname - полное имя контекста ссылку на который, возвратит функция.
* \param cname - полное имя контекста ссылку на который, возвратит функция.
* \param argc, argv - параметры инициализации ORB
* \param argc - argc
* \param argc - argv
* \param nsName - параметры инициализации ORB
*/
*/
CosNaming
::
NamingContext_ptr
getContext
(
const
string
&
cname
,
int
argc
,
const
char
*
const
*
argv
,
const
string
&
nsName
)
throw
(
ORepFailed
)
CosNaming
::
NamingContext_ptr
getContext
(
const
string
&
cname
,
int
argc
,
const
char
*
const
*
argv
,
const
string
&
nsName
)
throw
(
ORepFailed
)
{
{
...
...
src/ObjectRepository/ObjectIndex_Array.cc
View file @
59446e94
...
@@ -88,7 +88,7 @@ std::ostream& operator<<(std::ostream& os, ObjectIndex_Array& oi )
...
@@ -88,7 +88,7 @@ std::ostream& operator<<(std::ostream& os, ObjectIndex_Array& oi )
std
::
ostream
&
ObjectIndex_Array
::
printMap
(
std
::
ostream
&
os
)
std
::
ostream
&
ObjectIndex_Array
::
printMap
(
std
::
ostream
&
os
)
{
{
auto
oind
=
uniset_conf
()
->
oind
;
auto
oind
=
uniset_conf
()
->
oind
;
for
(
unsigned
int
i
=
0
;;
i
++
)
for
(
auto
i
=
0
;;
i
++
)
{
{
if
(
!
objectInfo
[
i
].
repName
)
if
(
!
objectInfo
[
i
].
repName
)
break
;
break
;
...
...
src/ObjectRepository/UniSetManager.cc
View file @
59446e94
...
@@ -489,7 +489,7 @@ int UniSetManager::objectsCount()
...
@@ -489,7 +489,7 @@ int UniSetManager::objectsCount()
int
UniSetManager
::
getObjectsInfo
(
UniSetManager
*
mngr
,
SimpleInfoSeq
*
seq
,
int
UniSetManager
::
getObjectsInfo
(
UniSetManager
*
mngr
,
SimpleInfoSeq
*
seq
,
int
begin
,
const
long
uplimit
)
int
begin
,
const
long
uplimit
)
{
{
unsigned
int
ind
=
begin
;
auto
ind
=
begin
;
// получаем у самого менджера
// получаем у самого менджера
SimpleInfo_var
msi
=
mngr
->
getInfo
();
SimpleInfo_var
msi
=
mngr
->
getInfo
();
...
@@ -567,4 +567,4 @@ std::ostream& operator<<(std::ostream& os, UniSetManager::OManagerCommand& cmd )
...
@@ -567,4 +567,4 @@ std::ostream& operator<<(std::ostream& os, UniSetManager::OManagerCommand& cmd )
return
os
<<
"unkwnown"
;
return
os
<<
"unkwnown"
;
}
}
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
\ No newline at end of file
src/Various/SViewer.cc
View file @
59446e94
...
@@ -279,7 +279,7 @@ void SViewer::updateThresholds( IONotifyController_i::ThresholdsListSeq_var& tls
...
@@ -279,7 +279,7 @@ void SViewer::updateThresholds( IONotifyController_i::ThresholdsListSeq_var& tls
cout
<<
" | "
<<
setw
(
60
)
<<
sname
<<
" | "
<<
setw
(
5
)
<<
tlst
[
i
].
value
<<
endl
;
cout
<<
" | "
<<
setw
(
60
)
<<
sname
<<
" | "
<<
setw
(
5
)
<<
tlst
[
i
].
value
<<
endl
;
int
m
=
tlst
[
i
].
tlist
.
length
();
int
m
=
tlst
[
i
].
tlist
.
length
();
for
(
unsigned
int
k
=
0
;
k
<
m
;
k
++
)
for
(
auto
k
=
0
;
k
<
m
;
k
++
)
{
{
IONotifyController_i
::
ThresholdInfo
*
ti
=
&
tlst
[
i
].
tlist
[
k
];
IONotifyController_i
::
ThresholdInfo
*
ti
=
&
tlst
[
i
].
tlist
[
k
];
cout
<<
"
\t
("
<<
setw
(
3
)
<<
ti
->
id
<<
") | "
<<
ti
->
state
<<
" | hi: "
<<
setw
(
5
)
<<
ti
->
hilimit
;
cout
<<
"
\t
("
<<
setw
(
3
)
<<
ti
->
id
<<
") | "
<<
ti
->
state
<<
" | hi: "
<<
setw
(
5
)
<<
ti
->
hilimit
;
...
...
src/Various/UniXML.cc
View file @
59446e94
...
@@ -267,7 +267,7 @@ xmlNode* UniXML::findNodeUtf8( xmlNode* node, const string& searchnode, const st
...
@@ -267,7 +267,7 @@ xmlNode* UniXML::findNodeUtf8( xmlNode* node, const string& searchnode, const st
//depth means number of times we can go to the children, if 0 we can't go only to elements of the same level
//depth means number of times we can go to the children, if 0 we can't go only to elements of the same level
xmlNode
*
UniXML
::
extFindNode
(
xmlNode
*
node
,
int
depth
,
int
width
,
const
string
&
searchnode
,
const
string
&
name
,
bool
top
)
const
xmlNode
*
UniXML
::
extFindNode
(
xmlNode
*
node
,
int
depth
,
int
width
,
const
string
&
searchnode
,
const
string
&
name
,
bool
top
)
const
{
{
unsigned
int
i
=
0
;
auto
i
=
0
;
xmlNode
*
fnode
=
node
;
xmlNode
*
fnode
=
node
;
while
(
fnode
!=
NULL
)
while
(
fnode
!=
NULL
)
{
{
...
...
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