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
5931f4ee
Commit
5931f4ee
authored
Mar 18, 2010
by
Pavel Vaynerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug in SandClock interface
parent
a4123390
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
22 deletions
+28
-22
libuniset.spec
conf/libuniset.spec
+7
-1
SandClock.h
include/SandClock.h
+21
-21
No files found.
conf/libuniset.spec
View file @
5931f4ee
...
...
@@ -3,7 +3,7 @@
Name: libuniset
Version: 0.97
Release: eter
59
Release: eter
60
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
...
...
@@ -184,6 +184,12 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Thu Mar 18 2010 Pavel Vainerman <pv@etersoft.ru> 0.97-eter60
- new build
* Thu Mar 18 2010 Pavel Vainerman <pv@etersoft.ru> 0.97-eter59
- fixed bug in ModbuRTU::autedetect slave adress function
* Sun Mar 14 2010 Pavel Vainerman <pv@altlinux.ru> 0.97-eter58
- minor fixes in MTR setup API
...
...
include/SandClock.h
View file @
5931f4ee
...
...
@@ -29,26 +29,26 @@
class
SandClock
{
public
:
SandClock
()
:
state
(
false
),
sand
(
0
),
size
(
0
){}
SandClock
()
:
_state
(
false
),
_sand
(
0
),
_
size
(
0
){}
~
SandClock
(){}
// ÚÁÐÕÓÔÉÔØ ÞÁÓÙ (ÚÁÎÏ×Ï)
inline
void
run
(
int
msec
)
{
t
.
setTiming
(
msec
);
state
=
true
;
sand
=
msec
;
size
=
msec
;
_
state
=
true
;
_
sand
=
msec
;
_
size
=
msec
;
}
inline
void
reset
()
{
run
(
size
);
run
(
_
size
);
}
inline
int
duration
()
{
return
size
;
return
_
size
;
}
// ÐÅÒÅ×ÅÒÎÕÔØ ÞÁÓÙ
// true - ÚÁÓÅÞØ ×ÒÅÍÑ
...
...
@@ -56,17 +56,17 @@ class SandClock
// ×ÏÚ×ÒÁÝÁÅÔ ÁÒÇÕÍÅÎÔ (Ô.Å. ÉÄ£Ô ÌÉ ÏÔÓÞ£Ô ×ÒÅÍÅÎÉ)
inline
bool
rotate
(
bool
st
)
{
if
(
st
==
state
)
if
(
st
==
_
state
)
return
st
;
state
=
st
;
if
(
!
state
)
_
state
=
st
;
if
(
!
_
state
)
{
int
cur
=
t
.
getCurrent
();
sand
-=
cur
;
_
sand
-=
cur
;
if
(
sand
<
0
)
sand
=
0
;
if
(
_
sand
<
0
)
_
sand
=
0
;
// std::cout << "ÐÅÒÅ×ÅÒÎÕÌÉ: ÐÒÏÛÌÏ " << cur
// << " ÏÓÔÁÌÏÓØ " << sand
...
...
@@ -76,15 +76,15 @@ class SandClock
}
else
{
sand
+=
t
.
getCurrent
();
if
(
sand
>
size
)
sand
=
size
;
_
sand
+=
t
.
getCurrent
();
if
(
_sand
>
_
size
)
_sand
=
_
size
;
// std::cout << "×ÅÒÎÕÌÉ: ÐÒÏÛÌÏ " << t.getCurrent()
// << " ÏÓÔÁÌÏÓØ " << sand
// << " ÚÁÓÅËÁÍ " << sand << endl;
t
.
setTiming
(
sand
);
t
.
setTiming
(
_
sand
);
}
return
st
;
}
...
...
@@ -108,19 +108,19 @@ class SandClock
{
// ÐÏËÁ ÞÁÓÙ ÎÅ "ÓÔÏÑÔ"
// ×ÓÅÇÄÁ false
if
(
!
state
)
if
(
!
_
state
)
return
false
;
return
t
.
checkTime
();
}
inline
bool
state
(){
return
state
;
}
inline
bool
state
(){
return
_
state
;
}
protected
:
PassiveTimer
t
;
bool
state
;
int
sand
;
int
size
;
bool
_
state
;
int
_
sand
;
int
_
size
;
};
// --------------------------------------------------------------------------
#endif
...
...
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