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
ce99ffae
Commit
ce99ffae
authored
May 28, 2009
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new property: "rtuVType" for type="rtu"
parent
856f2b1c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
3 deletions
+52
-3
IOBase.h
extentions/include/IOBase.h
+1
-0
MTR.h
extentions/include/MTR.h
+2
-0
IOBase.cc
extentions/lib/IOBase.cc
+49
-3
No files found.
extentions/include/IOBase.h
View file @
ce99ffae
...
@@ -81,6 +81,7 @@ static const int NoSafety = -1;
...
@@ -81,6 +81,7 @@ static const int NoSafety = -1;
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
IOBase
&
inf
);
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
IOBase
&
inf
);
static
void
processingFasAI
(
IOBase
*
it
,
float
new_val
,
SMInterface
*
shm
,
bool
force
);
static
void
processingAsAI
(
IOBase
*
it
,
long
new_val
,
SMInterface
*
shm
,
bool
force
);
static
void
processingAsAI
(
IOBase
*
it
,
long
new_val
,
SMInterface
*
shm
,
bool
force
);
static
void
processingAsDI
(
IOBase
*
it
,
bool
new_set
,
SMInterface
*
shm
,
bool
force
);
static
void
processingAsDI
(
IOBase
*
it
,
bool
new_set
,
SMInterface
*
shm
,
bool
force
);
static
long
processingAsAO
(
IOBase
*
it
,
SMInterface
*
shm
,
bool
force
);
static
long
processingAsAO
(
IOBase
*
it
,
SMInterface
*
shm
,
bool
force
);
...
...
extentions/include/MTR.h
View file @
ce99ffae
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
#define _MTR_H_
#define _MTR_H_
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
#include <string>
#include <string>
#include <cstring>
#include <cmath>
#include "modbus/ModbusTypes.h"
#include "modbus/ModbusTypes.h"
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
class
ModbusRTUMaster
;
class
ModbusRTUMaster
;
...
...
extentions/lib/IOBase.cc
View file @
ce99ffae
...
@@ -110,8 +110,8 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force
...
@@ -110,8 +110,8 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force
{
{
if
(
it
->
df
.
size
()
>
1
)
if
(
it
->
df
.
size
()
>
1
)
it
->
df
.
add
(
val
);
it
->
df
.
add
(
val
);
else
val
=
it
->
df
.
filterRC
(
val
);
val
=
it
->
df
.
filterRC
(
val
);
}
}
if
(
it
->
cdiagram
)
//
if
(
it
->
cdiagram
)
//
...
@@ -140,7 +140,53 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force
...
@@ -140,7 +140,53 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force
shm
->
localSetUndefinedState
(
it
->
ait
,
false
,
it
->
si
.
id
);
shm
->
localSetUndefinedState
(
it
->
ait
,
false
,
it
->
si
.
id
);
if
(
it
->
cal
.
precision
>
0
)
if
(
it
->
cal
.
precision
>
0
)
it
->
value
*=
lround
(
pow10
(
it
->
cal
.
precision
));
val
*=
lround
(
pow10
(
it
->
cal
.
precision
));
if
(
force
||
it
->
value
!=
val
)
{
if
(
it
->
stype
==
UniversalIO
::
AnalogInput
)
shm
->
localSaveValue
(
it
->
ait
,
it
->
si
.
id
,
val
,
shm
->
ID
()
);
else
if
(
it
->
stype
==
UniversalIO
::
AnalogOutput
)
shm
->
localSetValue
(
it
->
ait
,
it
->
si
.
id
,
val
,
shm
->
ID
()
);
it
->
value
=
val
;
}
}
}
// -----------------------------------------------------------------------------
void
IOBase
::
processingFasAI
(
IOBase
*
it
,
float
val
,
SMInterface
*
shm
,
bool
force
)
{
//
if
(
it
->
check_channel_break
(
val
)
)
{
uniset_spin_lock
lock
(
it
->
val_lock
);
it
->
value
=
ChannelBreakValue
;
shm
->
localSetUndefinedState
(
it
->
ait
,
true
,
it
->
si
.
id
);
return
;
}
// ...
if
(
!
it
->
nofilter
)
{
if
(
it
->
df
.
size
()
>
1
)
it
->
df
.
add
(
val
);
val
=
it
->
df
.
filterRC
(
val
);
}
IOController_i
::
CalibrateInfo
*
cal
(
&
(
it
->
cal
)
);
if
(
cal
->
maxRaw
!=
0
&&
cal
->
maxRaw
!=
cal
->
minRaw
)
//
val
=
UniSetTypes
::
fcalibrate
(
val
,
cal
->
minRaw
,
cal
->
maxRaw
,
cal
->
minCal
,
cal
->
maxCal
,
true
);
// "",
//
{
uniset_spin_lock
lock
(
it
->
val_lock
);
if
(
it
->
value
==
ChannelBreakValue
)
shm
->
localSetUndefinedState
(
it
->
ait
,
false
,
it
->
si
.
id
);
if
(
it
->
cal
.
precision
>
0
)
val
*=
lroundf
(
pow10
(
it
->
cal
.
precision
));
if
(
force
||
it
->
value
!=
val
)
if
(
force
||
it
->
value
!=
val
)
{
{
...
...
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