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
cbd1324c
Commit
cbd1324c
authored
Jul 29, 2010
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил обработку параметра db_ignore, для отключения запичи в БД "конкретного" датчика
parent
ca49444d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
11 deletions
+26
-11
test.xml
conf/test.xml
+1
-1
IOController.h
include/IOController.h
+5
-3
IOController.cc
src/Processes/IOController.cc
+4
-2
IONotifyController.cc
src/Processes/IONotifyController.cc
+10
-5
NCRestorer.cc
src/Various/NCRestorer.cc
+5
-0
NCRestorer_XML.cc
src/Various/NCRestorer_XML.cc
+1
-0
No files found.
conf/test.xml
View file @
cbd1324c
...
...
@@ -109,7 +109,7 @@
<!-- ************************ Датчики ********************** -->
<sensors
name=
"Sensors"
>
<item
name=
"Input1_S"
textname=
"Команда 1"
node=
""
iotype=
"DI"
priority=
"Medium"
default=
"1"
/>
<item
name=
"Input1_S"
textname=
"Команда 1"
node=
""
iotype=
"DI"
priority=
"Medium"
default=
"1"
db_ignore=
"1"
/>
<item
name=
"Input2_S"
textname=
"Команда 2"
node=
""
iotype=
"DI"
priority=
"Medium"
mbtype=
"rtu"
mbaddr=
"0x01"
mbfunc=
"0x04"
mbreg=
"0x02"
rs=
"2"
/>
<item
name=
"Input3_S"
textname=
"Команда 3"
node=
""
iotype=
"DI"
priority=
"Medium"
mbtcp=
"1"
tcp_mbtype=
"rtu"
tcp_mbaddr=
"0x02"
tcp_mbfunc=
"0x06"
tcp_mbreg=
"0x02"
tcp_preinit=
"1"
/>
...
...
include/IOController.h
View file @
cbd1324c
...
...
@@ -147,7 +147,7 @@ class IOController:
struct
UniDigitalIOInfo
:
public
IOController_i
::
DigitalIOInfo
{
UniDigitalIOInfo
()
:
any
(
0
),
dlst_lock
(
false
),
block_state
(
false
)
UniDigitalIOInfo
()
:
any
(
0
),
dlst_lock
(
false
),
block_state
(
false
)
,
db_ignore
(
false
)
{
undefined
=
false
;
blocked
=
false
;
}
virtual
~
UniDigitalIOInfo
(){}
...
...
@@ -164,6 +164,7 @@ class IOController:
DependsList
dlst
;
/*!< список io зависящих от данного */
bool
dlst_lock
;
/*!< флаг блокирующий работу со списком */
bool
block_state
;
bool
db_ignore
;
/*!< не писать изменения в БД */
UniSetTypes
::
uniset_spin_mutex
val_lock
;
/*!< флаг блокирующий работу со значением */
};
...
...
@@ -171,7 +172,7 @@ class IOController:
struct
UniAnalogIOInfo
:
public
IOController_i
::
AnalogIOInfo
{
UniAnalogIOInfo
()
:
any
(
0
),
dlst_lock
(
false
),
block_value
(
0
)
UniAnalogIOInfo
()
:
any
(
0
),
dlst_lock
(
false
),
block_value
(
0
)
,
db_ignore
(
false
)
{
undefined
=
false
;
blocked
=
false
;
}
virtual
~
UniAnalogIOInfo
(){}
...
...
@@ -187,7 +188,8 @@ class IOController:
DependsList
dlst
;
/*!< список io зависящих от данного (для выставления поля undefined) */
bool
dlst_lock
;
/*!< флаг блокирующий работу со списком */
long
block_value
;
bool
db_ignore
;
/*!< не писать изменения в БД */
UniSetTypes
::
uniset_spin_mutex
val_lock
;
/*!< флаг блокирующий работу со значением */
};
...
...
src/Processes/IOController.cc
View file @
cbd1324c
...
...
@@ -801,7 +801,8 @@ void IOController::dumpToDB()
sm
.
priority
=
(
Message
::
Priority
)
li
->
second
.
priority
;
sm
.
sm_tv_sec
=
li
->
second
.
tv_sec
;
sm
.
sm_tv_usec
=
li
->
second
.
tv_usec
;
logging
(
sm
);
if
(
!
li
->
second
.
db_ignore
)
logging
(
sm
);
}
}
// unlock
...
...
@@ -822,7 +823,8 @@ void IOController::dumpToDB()
sm
.
sm_tv_sec
=
li
->
second
.
tv_sec
;
sm
.
sm_tv_usec
=
li
->
second
.
tv_usec
;
sm
.
ci
=
li
->
second
.
ci
;
logging
(
sm
);
// alogging( li->second.si,li->second.value,li->second.type );
if
(
!
li
->
second
.
db_ignore
)
logging
(
sm
);
// alogging( li->second.si,li->second.value,li->second.type );
}
}
// unlock
}
...
...
src/Processes/IONotifyController.cc
View file @
cbd1324c
...
...
@@ -501,7 +501,8 @@ void IONotifyController::localSaveState( IOController::DIOStateList::iterator& i
try
{
loggingInfo
(
sm
);
if
(
!
it
->
second
.
db_ignore
)
loggingInfo
(
sm
);
}
catch
(...){}
...
...
@@ -565,7 +566,8 @@ void IONotifyController::localSaveValue( IOController::AIOStateList::iterator& l
try
{
loggingInfo
(
sm
);
if
(
!
li
->
second
.
db_ignore
)
loggingInfo
(
sm
);
}
catch
(...){}
...
...
@@ -1210,7 +1212,8 @@ void IONotifyController::localSetState( IOController::DIOStateList::iterator& it
try
{
loggingInfo
(
sm
);
if
(
!
it
->
second
.
db_ignore
)
loggingInfo
(
sm
);
}
catch
(...){}
...
...
@@ -1267,7 +1270,8 @@ void IONotifyController::localSetValue( IOController::AIOStateList::iterator& li
try
{
loggingInfo
(
sm
);
if
(
!
li
->
second
.
db_ignore
)
loggingInfo
(
sm
);
}
catch
(...){}
...
...
@@ -1403,7 +1407,8 @@ void IONotifyController::onChangeUndefined( DependsList::iterator it, bool undef
try
{
loggingInfo
(
sm
);
if
(
!
it
->
ait
->
second
.
db_ignore
)
loggingInfo
(
sm
);
}
catch
(...){}
...
...
src/Various/NCRestorer.cc
View file @
cbd1324c
...
...
@@ -186,11 +186,13 @@ NCRestorer::SInfo& NCRestorer::SInfo::operator=(IOController_i::DigitalIOInfo& i
this
->
type
=
inf
.
type
;
this
->
priority
=
inf
.
priority
;
this
->
default_val
=
inf
.
default_val
;
this
->
real_value
=
inf
.
real_state
?
1
:
0
;
this
->
ci
.
minRaw
=
0
;
this
->
ci
.
maxRaw
=
0
;
this
->
ci
.
minCal
=
0
;
this
->
ci
.
maxCal
=
0
;
this
->
ci
.
sensibility
=
0
;
this
->
db_ignore
=
false
;
this
->
undefined
=
false
;
this
->
any
=
0
;
return
*
this
;
...
...
@@ -202,8 +204,10 @@ NCRestorer::SInfo& NCRestorer::SInfo::operator=(IOController_i::AnalogIOInfo& in
this
->
type
=
inf
.
type
;
this
->
priority
=
inf
.
priority
;
this
->
default_val
=
inf
.
default_val
;
this
->
real_value
=
inf
.
real_value
;
this
->
ci
=
inf
.
ci
;
this
->
undefined
=
false
;
this
->
db_ignore
=
false
;
this
->
any
=
0
;
return
*
this
;
}
...
...
@@ -219,6 +223,7 @@ NCRestorer::SInfo::operator IOController::UniDigitalIOInfo()
ret
.
default_val
=
this
->
default_val
?
true
:
false
;
ret
.
any
=
this
->
any
;
ret
.
undefined
=
this
->
undefined
;
ret
.
db_ignore
=
this
->
db_ignore
;
return
ret
;
}
// ------------------------------------------------------------------------------------------
src/Various/NCRestorer_XML.cc
View file @
cbd1324c
...
...
@@ -300,6 +300,7 @@ bool NCRestorer_XML::getSensorInfo( UniXML& xml, xmlNode* it, SInfo& inf )
}
inf
.
default_val
=
xml
.
getIntProp
(
it
,
"default"
);
inf
.
db_ignore
=
xml
.
getIntProp
(
it
,
"db_ignore"
);
inf
.
value
=
inf
.
default_val
;
inf
.
undefined
=
false
;
inf
.
real_value
=
inf
.
value
;
...
...
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