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
ecffea60
Commit
ecffea60
authored
Oct 16, 2009
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.eter:/projects/uniset
Conflicts: src/Communications/Modbus/ModbusTCPMaster.cc
parents
b0a52ad2
c0fc88b2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
8 deletions
+34
-8
JrnTest.cc
Utilities/JrnTests/JrnTest.cc
+5
-1
mbtcptester.cc
Utilities/MBTester/mbtcptester.cc
+3
-0
libuniset.spec
conf/libuniset.spec
+7
-1
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+1
-1
ModbusTCPMaster.cc
src/Communications/Modbus/ModbusTCPMaster.cc
+16
-5
TableBlockStorage.cc
src/Various/TableBlockStorage.cc
+2
-0
No files found.
Utilities/JrnTests/JrnTest.cc
View file @
ecffea60
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
#include <UniSetTypes.h>
#include <UniSetTypes.h>
int
seek
=
0
;
int
seek
=
0
;
int
b_size
=
100
000
;
int
b_size
=
25
000
;
int
bj_size
=
1300000
;
int
bj_size
=
1300000
;
void
testTable1
(
void
)
void
testTable1
(
void
)
{
{
...
@@ -80,6 +80,9 @@ void testTable1(void)
...
@@ -80,6 +80,9 @@ void testTable1(void)
bool
testTable2
(
void
)
bool
testTable2
(
void
)
{
{
char
*
val
=
new
char
[
40
];
char
*
val
=
new
char
[
40
];
TableBlockStorage
t0
;
t0
.
create
(
"small_file.test"
,
b_size
,
4
,
40
,
100
,
5
,
28
,
0
);
t0
.
open
(
"small_file.test"
,
b_size
,
4
,
40
,
100
,
5
,
28
,
0
);
TableBlockStorage
t
;
TableBlockStorage
t
;
//t = new TableBlockStorage();
//t = new TableBlockStorage();
t
.
create
(
"big_file.test"
,
b_size
,
4
,
40
,
100
,
5
,
28
,
0
);
t
.
create
(
"big_file.test"
,
b_size
,
4
,
40
,
100
,
5
,
28
,
0
);
...
@@ -91,6 +94,7 @@ bool testTable2(void)
...
@@ -91,6 +94,7 @@ bool testTable2(void)
if
(
t
.
findKeyValue
(
&
i
,
val
)
!=
0
)
printf
(
"%s, "
,
val
);
if
(
t
.
findKeyValue
(
&
i
,
val
)
!=
0
)
printf
(
"%s, "
,
val
);
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
t0
.
addRow
((
char
*
)
&
i
,
val
);
if
(
t
.
getCurBlock
()
!=
0
)
if
(
t
.
getCurBlock
()
!=
0
)
{
{
delete
val
;
delete
val
;
...
...
Utilities/MBTester/mbtcptester.cc
View file @
ecffea60
...
@@ -191,6 +191,9 @@ int main( int argc, char **argv )
...
@@ -191,6 +191,9 @@ int main( int argc, char **argv )
mb
.
setTimeout
(
tout
);
mb
.
setTimeout
(
tout
);
mb
.
connect
(
ia
,
port
);
mb
.
connect
(
ia
,
port
);
if
(
verb
)
cout
<<
"connection: "
<<
(
mb
.
isConnection
()
?
"YES"
:
"NO"
)
<<
endl
;
while
(
1
)
while
(
1
)
{
{
...
...
conf/libuniset.spec
View file @
ecffea60
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
Name: libuniset
Name: libuniset
Version: 0.97
Version: 0.97
Release: eter2
6
Release: eter2
9
Summary: UniSet - library for building distributed industrial control systems
Summary: UniSet - library for building distributed industrial control systems
License: GPL
License: GPL
Group: Development/C++
Group: Development/C++
...
@@ -178,6 +178,12 @@ rm -f %buildroot%_libdir/*.la
...
@@ -178,6 +178,12 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
%changelog
* Fri Oct 09 2009 Pavel Vainerman <pv@etersoft.ru> 0.97-eter28
- minor optimization
* Mon Oct 05 2009 Pavel Vainerman <pv@etersoft.ru> 0.97-eter27
- new build
* Sun Oct 04 2009 Vitaly Lipatov <lav@altlinux.ru> 0.97-eter26
* Sun Oct 04 2009 Vitaly Lipatov <lav@altlinux.ru> 0.97-eter26
- new build
- new build
...
...
extensions/SharedMemory/SharedMemory.cc
View file @
ecffea60
...
@@ -42,7 +42,7 @@ SharedMemory::SharedMemory( ObjectId id, string datafile ):
...
@@ -42,7 +42,7 @@ SharedMemory::SharedMemory( ObjectId id, string datafile ):
string
d_field
=
conf
->
getArgParam
(
"--d-filter-field"
);
string
d_field
=
conf
->
getArgParam
(
"--d-filter-field"
);
string
d_fvalue
=
conf
->
getArgParam
(
"--d-filter-value"
);
string
d_fvalue
=
conf
->
getArgParam
(
"--d-filter-value"
);
int
lock_msec
=
conf
->
getArg
Int
(
"--lock-value-pause"
);
int
lock_msec
=
conf
->
getArg
PInt
(
"--lock-value-pause"
,
0
);
if
(
lock_msec
<
0
)
if
(
lock_msec
<
0
)
lock_msec
=
0
;
lock_msec
=
0
;
setCheckLockValuePause
(
lock_msec
);
setCheckLockValuePause
(
lock_msec
);
...
...
src/Communications/Modbus/ModbusTCPMaster.cc
View file @
ecffea60
...
@@ -48,17 +48,17 @@ int ModbusTCPMaster::nTransaction = 0;
...
@@ -48,17 +48,17 @@ int ModbusTCPMaster::nTransaction = 0;
mbErrCode
ModbusTCPMaster
::
query
(
ModbusAddr
addr
,
ModbusMessage
&
msg
,
mbErrCode
ModbusTCPMaster
::
query
(
ModbusAddr
addr
,
ModbusMessage
&
msg
,
ModbusMessage
&
reply
,
timeout_t
timeout
)
ModbusMessage
&
reply
,
timeout_t
timeout
)
{
{
// if( !isConnection() )
if
(
iaddr
.
empty
()
)
if
(
iaddr
.
empty
()
)
{
{
dlog
[
Debug
::
WARN
]
<<
"(query):
not connection to
server..."
<<
endl
;
dlog
[
Debug
::
WARN
]
<<
"(query):
unknown ip address for
server..."
<<
endl
;
return
erHardwareError
;
return
erHardwareError
;
}
}
if
(
!
isConnection
()
)
if
(
!
isConnection
()
)
reconnect
();
{
dlog
[
Debug
::
WARN
]
<<
"(query): not connected to server..."
<<
endl
;
return
erTimeOut
;
}
assert
(
timeout
);
assert
(
timeout
);
ptTimeout
.
setTiming
(
timeout
);
ptTimeout
.
setTiming
(
timeout
);
...
@@ -114,6 +114,15 @@ mbErrCode ModbusTCPMaster::query( ModbusAddr addr, ModbusMessage& msg,
...
@@ -114,6 +114,15 @@ mbErrCode ModbusTCPMaster::query( ModbusAddr addr, ModbusMessage& msg,
if
(
tcp
->
isPending
(
ost
::
Socket
::
pendingInput
,
timeout
)
)
if
(
tcp
->
isPending
(
ost
::
Socket
::
pendingInput
,
timeout
)
)
{
{
/*
unsigned char rbuf[100];
memset(rbuf,0,sizeof(rbuf));
int ret = getNextData(rbuf,sizeof(rbuf));
cerr << "ret=" << ret << " recv: ";
for( int i=0; i<sizeof(rbuf); i++ )
cerr << hex << " 0x" << (int)rbuf[i];
cerr << endl;
*/
ModbusTCP
::
MBAPHeader
rmh
;
ModbusTCP
::
MBAPHeader
rmh
;
int
ret
=
getNextData
((
unsigned
char
*
)(
&
rmh
),
sizeof
(
rmh
));
int
ret
=
getNextData
((
unsigned
char
*
)(
&
rmh
),
sizeof
(
rmh
));
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
...
@@ -173,6 +182,8 @@ void ModbusTCPMaster::reconnect()
...
@@ -173,6 +182,8 @@ void ModbusTCPMaster::reconnect()
delete
tcp
;
delete
tcp
;
}
}
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
dlog
[
Debug
::
INFO
]
<<
"(ModbusTCPMaster): reconnect "
<<
iaddr
<<
endl
;
tcp
=
new
ost
::
TCPStream
(
iaddr
.
c_str
());
tcp
=
new
ost
::
TCPStream
(
iaddr
.
c_str
());
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
...
...
src/Various/TableBlockStorage.cc
View file @
ecffea60
...
@@ -189,6 +189,8 @@ bool TableBlockStorage::open(const char* name, int byte_sz, int key_sz, int inf_
...
@@ -189,6 +189,8 @@ bool TableBlockStorage::open(const char* name, int byte_sz, int key_sz, int inf_
if
(
t
->
count
>=
0
)
if
(
t
->
count
>=
0
)
break
;
break
;
}
}
if
(
t
->
count
<
0
)
cur_block
=
0
;
/*! */
/*! */
fseek
(
file
,
seekpos
+
(
cur_block
*
block_size
)
*
(
full_size
),
0
);
fseek
(
file
,
seekpos
+
(
cur_block
*
block_size
)
*
(
full_size
),
0
);
...
...
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