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
2f6a0230
Commit
2f6a0230
authored
Sep 05, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(utypes): исправил ошибку в тесте
(SM): мелкие правки инициализации по умолчанию
parent
3897860d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
16 deletions
+13
-16
SharedMemory.h
extensions/SharedMemory/SharedMemory.h
+11
-15
test_utypes.cc
tests/test_utypes.cc
+2
-1
No files found.
extensions/SharedMemory/SharedMemory.h
View file @
2f6a0230
...
@@ -306,6 +306,7 @@ class SharedMemory:
...
@@ -306,6 +306,7 @@ class SharedMemory:
/*! глобальная функция для инициализации объекта */
/*! глобальная функция для инициализации объекта */
static
std
::
shared_ptr
<
SharedMemory
>
init_smemory
(
int
argc
,
const
char
*
const
*
argv
);
static
std
::
shared_ptr
<
SharedMemory
>
init_smemory
(
int
argc
,
const
char
*
const
*
argv
);
/*! глобальная функция для вывода help-а */
/*! глобальная функция для вывода help-а */
static
void
help_print
(
int
argc
,
const
char
*
const
*
argv
);
static
void
help_print
(
int
argc
,
const
char
*
const
*
argv
);
...
@@ -351,25 +352,20 @@ class SharedMemory:
...
@@ -351,25 +352,20 @@ class SharedMemory:
struct
HistoryInfo
struct
HistoryInfo
{
{
HistoryInfo
()
:
HistoryInfo
()
id
(
0
),
size
(
0
),
filter
(
""
),
fuse_id
(
UniSetTypes
::
DefaultObjectId
),
fuse_invert
(
false
),
fuse_use_val
(
false
),
fuse_val
(
0
)
{
{
::
clock_gettime
(
CLOCK_REALTIME
,
&
fuse_tm
);
::
clock_gettime
(
CLOCK_REALTIME
,
&
fuse_tm
);
}
}
long
id
;
// ID
long
id
=
{
0
};
// ID
HistoryList
hlst
;
// history list
HistoryList
hlst
;
// history list
int
size
;
size_t
size
=
{
0
};
std
::
string
filter
;
// filter field
std
::
string
filter
=
{
""
};
// filter field
UniSetTypes
::
ObjectId
fuse_id
;
// fuse sesnsor
UniSetTypes
::
ObjectId
fuse_id
=
{
UniSetTypes
::
DefaultObjectId
};
// fuse sesnsor
bool
fuse_invert
;
bool
fuse_invert
=
{
false
};
bool
fuse_use_val
;
bool
fuse_use_val
=
{
false
};
long
fuse_val
;
long
fuse_val
=
{
0
};
// timestamp
timespec
fuse_tm
=
{
0
,
0
};
// timestamp
timespec
fuse_tm
;
};
};
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
HistoryInfo
&
h
);
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
HistoryInfo
&
h
);
...
@@ -492,7 +488,7 @@ class SharedMemory:
...
@@ -492,7 +488,7 @@ class SharedMemory:
History
hist
;
History
hist
;
HistoryFuseMap
histmap
;
/*!< map для оптимизации поиска */
HistoryFuseMap
histmap
;
/*!< map для оптимизации поиска */
virtual
void
checkFuse
(
std
::
shared_ptr
<
IOController
::
USensorInfo
>&
usi
,
IOController
*
);
virtual
void
checkFuse
(
std
::
shared_ptr
<
IOController
::
USensorInfo
>&
usi
,
IOController
*
);
virtual
void
saveToHistory
();
virtual
void
saveToHistory
();
void
buildHistoryList
(
xmlNode
*
cnode
);
void
buildHistoryList
(
xmlNode
*
cnode
);
...
...
tests/test_utypes.cc
View file @
2f6a0230
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
#include <sstream>
#include <sstream>
#include <limits>
#include <limits>
#include "Configuration.h"
#include "UniSetTypes.h"
#include "UniSetTypes.h"
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
using
namespace
std
;
using
namespace
std
;
...
@@ -108,7 +109,7 @@ TEST_CASE("UniSetTypes: getSInfoList", "[utypes][getsinfo]" )
...
@@ -108,7 +109,7 @@ TEST_CASE("UniSetTypes: getSInfoList", "[utypes][getsinfo]" )
{
{
const
std
::
string
str1
(
"Input4_S@node2,Input1_S,5,5@node3,6@1001"
);
const
std
::
string
str1
(
"Input4_S@node2,Input1_S,5,5@node3,6@1001"
);
auto
t1
=
UniSetTypes
::
getSInfoList
(
str1
);
auto
t1
=
UniSetTypes
::
getSInfoList
(
str1
,
UniSetTypes
::
uniset_conf
()
);
CHECK
(
t1
.
size
()
==
5
);
CHECK
(
t1
.
size
()
==
5
);
...
...
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