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
523ad82b
Commit
523ad82b
authored
Jun 10, 2009
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add processingThresholds function
parent
dd3b30d8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
14 deletions
+28
-14
TODO
TODO
+0
-2
IOControl.cc
extentions/IOControl/IOControl.cc
+3
-0
MBMaster.cc
extentions/MBTCPMaster/MBMaster.cc
+3
-0
MBSlave.cc
extentions/ModbusSlave/MBSlave.cc
+6
-0
RTUExchange.cc
extentions/RTUExchange/RTUExchange.cc
+12
-0
IOBase.h
extentions/include/IOBase.h
+1
-2
IOBase.cc
extentions/lib/IOBase.cc
+3
-10
No files found.
TODO
View file @
523ad82b
...
@@ -24,6 +24,5 @@
...
@@ -24,6 +24,5 @@
SensorInfo ObjectId.
SensorInfo ObjectId.
----------
----------
RTUExchabge: vtype="Byte"
smonit: processing "precision"
smonit: processing "precision"
admin: processing "precision"
admin: processing "precision"
\ No newline at end of file
extentions/IOControl/IOControl.cc
View file @
523ad82b
...
@@ -492,6 +492,9 @@ void IOControl::iopoll()
...
@@ -492,6 +492,9 @@ void IOControl::iopoll()
unideb
[
Debug
::
LEVEL3
]
<<
myname
<<
"(iopoll): catch ..."
<<
endl
;
unideb
[
Debug
::
LEVEL3
]
<<
myname
<<
"(iopoll): catch ..."
<<
endl
;
}
}
}
}
for
(
IOMap
::
iterator
it
=
iomap
.
begin
();
it
!=
iomap
.
end
();
++
it
)
IOBase
::
processingThreshold
(
&
(
*
it
),
shm
,
force
);
}
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
void
IOControl
::
readConfiguration
()
void
IOControl
::
readConfiguration
()
...
...
extentions/MBTCPMaster/MBMaster.cc
View file @
523ad82b
...
@@ -298,6 +298,9 @@ void MBMaster::poll()
...
@@ -298,6 +298,9 @@ void MBMaster::poll()
dlog
[
Debug
::
LEVEL3
]
<<
myname
<<
"(poll): catch ..."
<<
endl
;
dlog
[
Debug
::
LEVEL3
]
<<
myname
<<
"(poll): catch ..."
<<
endl
;
}
}
}
}
for
(
MBMap
::
iterator
it
=
mbmap
.
begin
();
it
!=
mbmap
.
end
();
++
it
)
IOBase
::
processingThreshold
(
&
(
*
it
),
shm
,
force
);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
long
MBMaster
::
readReg
(
MBMap
::
iterator
&
p
)
long
MBMaster
::
readReg
(
MBMap
::
iterator
&
p
)
...
...
extentions/ModbusSlave/MBSlave.cc
View file @
523ad82b
...
@@ -307,6 +307,9 @@ void MBSlave::execute_rtu()
...
@@ -307,6 +307,9 @@ void MBSlave::execute_rtu()
<<
"(execute_rtu): (hb) "
<<
ex
<<
std
::
endl
;
<<
"(execute_rtu): (hb) "
<<
ex
<<
std
::
endl
;
}
}
}
}
for
(
IOMap
::
iterator
it
=
iomap
.
begin
();
it
!=
iomap
.
end
();
++
it
)
IOBase
::
processingThreshold
(
&
it
->
second
,
shm
,
force
);
}
}
catch
(...){}
catch
(...){}
}
}
...
@@ -355,6 +358,9 @@ void MBSlave::execute_tcp()
...
@@ -355,6 +358,9 @@ void MBSlave::execute_tcp()
<<
"(execute_tcp): (hb) "
<<
ex
<<
std
::
endl
;
<<
"(execute_tcp): (hb) "
<<
ex
<<
std
::
endl
;
}
}
}
}
for
(
IOMap
::
iterator
it
=
iomap
.
begin
();
it
!=
iomap
.
end
();
++
it
)
IOBase
::
processingThreshold
(
&
it
->
second
,
shm
,
force
);
}
}
catch
(...){}
catch
(...){}
}
}
...
...
extentions/RTUExchange/RTUExchange.cc
View file @
523ad82b
...
@@ -317,6 +317,18 @@ void RTUExchange::poll()
...
@@ -317,6 +317,18 @@ void RTUExchange::poll()
// update SharedMemory...
// update SharedMemory...
updateSM
();
updateSM
();
// check thresholds
for
(
RTUExchange
::
RTUDeviceMap
::
iterator
it1
=
rmap
.
begin
();
it1
!=
rmap
.
end
();
++
it1
)
{
RTUDevice
*
d
(
it1
->
second
);
for
(
RTUExchange
::
RegMap
::
iterator
it
=
d
->
regmap
.
begin
();
it
!=
d
->
regmap
.
end
();
++
it
)
{
RegInfo
*
r
(
it
->
second
);
for
(
PList
::
iterator
i
=
r
->
slst
.
begin
();
i
!=
r
->
slst
.
end
();
++
i
)
IOBase
::
processingThreshold
(
&
(
*
i
),
shm
,
force
);
}
}
// printMap(rmap);
// printMap(rmap);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
...
extentions/include/IOBase.h
View file @
523ad82b
...
@@ -34,8 +34,7 @@ static const int NoSafety = -1;
...
@@ -34,8 +34,7 @@ static const int NoSafety = -1;
jar_state
(
false
),
jar_state
(
false
),
ondelay_state
(
false
),
ondelay_state
(
false
),
offdelay_state
(
false
),
offdelay_state
(
false
),
t_ai
(
UniSetTypes
::
DefaultObjectId
),
t_ai
(
UniSetTypes
::
DefaultObjectId
)
initOK
(
false
)
{}
{}
...
...
extentions/lib/IOBase.cc
View file @
523ad82b
...
@@ -370,17 +370,10 @@ void IOBase::processingThreshold( IOBase* it, SMInterface* shm, bool force )
...
@@ -370,17 +370,10 @@ void IOBase::processingThreshold( IOBase* it, SMInterface* shm, bool force )
if
(
it
->
t_ai
==
DefaultObjectId
)
if
(
it
->
t_ai
==
DefaultObjectId
)
return
;
return
;
if
(
!
it
->
initOK
)
{
shm
->
initAIterator
(
it
->
ait
);
shm
->
initDIterator
(
it
->
dit
);
it
->
initOK
=
true
;
}
long
val
=
shm
->
localGetValue
(
it
->
ait
,
it
->
t_ai
);
long
val
=
shm
->
localGetValue
(
it
->
ait
,
it
->
t_ai
);
bool
set
=
it
->
value
?
true
:
false
;
bool
set
=
it
->
value
?
true
:
false
;
cout
<<
"val="
<<
val
<<
" set="
<<
set
<<
endl
;
//
cout << "val=" << val << " set=" << set << endl;
//
//
// lowLimit-
// lowLimit-
if
(
val
<=
(
it
->
ti
.
lowlimit
-
it
->
ti
.
sensibility
)
)
if
(
val
<=
(
it
->
ti
.
lowlimit
-
it
->
ti
.
sensibility
)
)
...
@@ -388,8 +381,8 @@ void IOBase::processingThreshold( IOBase* it, SMInterface* shm, bool force )
...
@@ -388,8 +381,8 @@ void IOBase::processingThreshold( IOBase* it, SMInterface* shm, bool force )
else
if
(
val
>=
(
it
->
ti
.
hilimit
+
it
->
ti
.
sensibility
)
)
else
if
(
val
>=
(
it
->
ti
.
hilimit
+
it
->
ti
.
sensibility
)
)
set
=
true
;
set
=
true
;
cout
<<
"thresh: set="
<<
set
<<
endl
;
//
cout << "thresh: set=" << set << endl;
processingDI
(
it
,
set
,
shm
,
force
);
processing
As
DI
(
it
,
set
,
shm
,
force
);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
...
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