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
2ad8d098
Commit
2ad8d098
authored
Sep 27, 2009
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new vtype
parent
70d2a89b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
5 deletions
+82
-5
Makefile.am
Utilities/codegen/tests/Makefile.am
+3
-3
libuniset.spec
conf/libuniset.spec
+4
-1
VTypes.h
extensions/include/VTypes.h
+63
-1
VTypes.cc
extensions/lib/VTypes.cc
+12
-0
No files found.
Utilities/codegen/tests/Makefile.am
View file @
2ad8d098
...
@@ -5,9 +5,9 @@ test_LDADD = $(top_builddir)/lib/libUniSet.la
...
@@ -5,9 +5,9 @@ test_LDADD = $(top_builddir)/lib/libUniSet.la
test_CXXFLAGS
=
-I
$(top_builddir)
/include
test_CXXFLAGS
=
-I
$(top_builddir)
/include
test_SOURCES
=
TestGen_SK.cc TestGen.cc TestGen-main.cc
test_SOURCES
=
TestGen_SK.cc TestGen.cc TestGen-main.cc
test2_LDADD
=
$(top_builddir)
/lib/libUniSet.la
#
test2_LDADD = $(top_builddir)/lib/libUniSet.la
test2_CXXFLAGS
=
-I
$(top_builddir)
/include
#
test2_CXXFLAGS = -I$(top_builddir)/include
test2_SOURCES
=
TestGenAlone_SK.cc TestGenAlone.cc TestGenAlone-main.cc
#
test2_SOURCES = TestGenAlone_SK.cc TestGenAlone.cc TestGenAlone-main.cc
GENERATED
=
TestGen_SK.h TestGen_SK.cc TestGen-main.cc
GENERATED
=
TestGen_SK.h TestGen_SK.cc TestGen-main.cc
GENERATED2
=
TestGenAlone_SK.h TestGenAlone_SK.cc TestGenAlone-main.cc
GENERATED2
=
TestGenAlone_SK.h TestGenAlone_SK.cc TestGenAlone-main.cc
...
...
conf/libuniset.spec
View file @
2ad8d098
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
Name: libuniset
Name: libuniset
Version: 0.97
Version: 0.97
Release: eter1
5
Release: eter1
6
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,9 @@ rm -f %buildroot%_libdir/*.la
...
@@ -178,6 +178,9 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
%changelog
* Sat Sep 26 2009 Pavel Vainerman <pv@altlinux.ru> 0.97-eter15
- new build
* Sat Sep 26 2009 Pavel Vainerman <pv@etersoft.ru> 0.97-eter14
* Sat Sep 26 2009 Pavel Vainerman <pv@etersoft.ru> 0.97-eter14
- add default heartbeat time to Configuration
- add default heartbeat time to Configuration
...
...
extensions/include/VTypes.h
View file @
2ad8d098
...
@@ -17,7 +17,9 @@ namespace VTypes
...
@@ -17,7 +17,9 @@ namespace VTypes
vtUnknown
,
vtUnknown
,
vtF2
,
vtF2
,
vtF4
,
vtF4
,
vtByte
vtByte
,
vtUnsigned
,
vtSigned
};
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
VType
&
vt
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
VType
&
vt
);
...
@@ -140,6 +142,66 @@ namespace VTypes
...
@@ -140,6 +142,66 @@ namespace VTypes
Bytemem
raw
;
Bytemem
raw
;
};
};
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
class
Unsigned
{
public
:
// ------------------------------------------
// ...
Unsigned
()
:
raw
(
0
){}
Unsigned
(
const
long
val
)
{
raw
=
val
;
}
Unsigned
(
const
ModbusRTU
::
ModbusData
dat
)
{
raw
=
dat
;
}
~
Unsigned
(){}
// ------------------------------------------
/*! */
static
int
wsize
(){
return
sizeof
(
unsigned
short
);
}
/*! */
static
VType
type
(){
return
vtUnsigned
;
}
// ------------------------------------------
operator
long
(){
return
raw
;
}
unsigned
short
raw
;
};
// --------------------------------------------------------------------------
class
Signed
{
public
:
// ------------------------------------------
// ...
Signed
()
:
raw
(
0
){}
Signed
(
const
long
val
)
{
raw
=
val
;
}
Signed
(
const
ModbusRTU
::
ModbusData
dat
)
{
raw
=
dat
;
}
~
Signed
(){}
// ------------------------------------------
/*! */
static
int
wsize
(){
return
sizeof
(
signed
short
);
}
/*! */
static
VType
type
(){
return
vtSigned
;
}
// ------------------------------------------
operator
long
(){
return
raw
;
}
signed
short
raw
;
};
// --------------------------------------------------------------------------
}
// end of namespace VTypes
}
// end of namespace VTypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
...
...
extensions/lib/VTypes.cc
View file @
2ad8d098
...
@@ -23,6 +23,10 @@ VType str2type( const std::string s )
...
@@ -23,6 +23,10 @@ VType str2type( const std::string s )
return
vtF2
;
return
vtF2
;
if
(
s
==
"F4"
)
if
(
s
==
"F4"
)
return
vtF4
;
return
vtF4
;
if
(
s
==
"Unsigned"
)
return
vtUnsigned
;
if
(
s
==
"Signed"
)
return
vtSigned
;
return
vtUnknown
;
return
vtUnknown
;
}
}
...
@@ -35,6 +39,10 @@ string type2str( VType t )
...
@@ -35,6 +39,10 @@ string type2str( VType t )
return
"F2"
;
return
"F2"
;
if
(
t
==
vtF4
)
if
(
t
==
vtF4
)
return
"F4"
;
return
"F4"
;
if
(
t
==
vtUnsigned
)
return
"Unsigned"
;
if
(
t
==
vtSigned
)
return
"Signed"
;
return
"vtUnknown"
;
return
"vtUnknown"
;
}
}
...
@@ -47,6 +55,10 @@ int wsize( VType t )
...
@@ -47,6 +55,10 @@ int wsize( VType t )
return
F2
::
wsize
();
return
F2
::
wsize
();
if
(
t
==
vtF4
)
if
(
t
==
vtF4
)
return
F4
::
wsize
();
return
F4
::
wsize
();
if
(
t
==
vtUnsigned
)
return
Unsigned
::
wsize
();
if
(
t
==
vtSigned
)
return
Signed
::
wsize
();
return
1
;
return
1
;
}
}
...
...
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