Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_kalman_filter_src
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oscar
jfx_kalman_filter_src
Commits
422b2a95
Commit
422b2a95
authored
Feb 18, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改枚举到int的转换
parent
3af93ee4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
TimeQueueObj.cpp
common/TimeQueueObj.cpp
+9
-9
No files found.
common/TimeQueueObj.cpp
View file @
422b2a95
...
...
@@ -45,14 +45,14 @@ void TimeQueueObj::PushQueueData(TimeQueueDataPtr& data)
m_timeQueue
.
push_back
(
data
);
}
m_totelCount
++
;
m_enumCount
[
data
->
dataType
]
++
;
m_enumCount
[
static_cast
<
int
>
(
data
->
dataType
)
]
++
;
if
(
data
->
dataType
==
m_baseEnum
)
m_baseTimestmap
=
data
->
timestamp
;
//更新基准类型的最新时间戳,为了判断时间差用
if
(
m_max_num
>
0
&&
m_totelCount
>
m_max_num
)
{
auto
begin
=
m_timeQueue
.
begin
();
m_enumCount
[
(
*
begin
)
->
dataType
]
--
;
m_enumCount
[
static_cast
<
int
>
((
*
begin
)
->
dataType
)
]
--
;
m_totelCount
--
;
m_timeQueue
.
pop_front
();
}
...
...
@@ -97,12 +97,12 @@ int TimeQueueObj::GetQueueData(std::vector<TimeQueueDataPtr>& outs)
}
for
(
auto
iter
=
m_timeQueue
.
begin
();
iter
!=
m_timeQueue
.
end
();
iter
++
)
{
if
(
labs
(
m_baseTimestmap
-
(
*
iter
)
->
timestamp
)
<
std
::
min
(
m_baseInterval
,
detaT
[
(
*
iter
)
->
dataType
]))
if
(
labs
(
m_baseTimestmap
-
(
*
iter
)
->
timestamp
)
<
std
::
min
(
m_baseInterval
,
detaT
[
static_cast
<
int
>
((
*
iter
)
->
dataType
)
]))
{
if
(
merge
[
(
*
iter
)
->
dataType
]
==
nullptr
)
if
(
merge
[
static_cast
<
int
>
((
*
iter
)
->
dataType
)
]
==
nullptr
)
num
++
;
detaT
[
(
*
iter
)
->
dataType
]
=
labs
(
m_baseTimestmap
-
(
*
iter
)
->
timestamp
);
merge
[
(
*
iter
)
->
dataType
]
=
*
iter
;
detaT
[
static_cast
<
int
>
((
*
iter
)
->
dataType
)
]
=
labs
(
m_baseTimestmap
-
(
*
iter
)
->
timestamp
);
merge
[
static_cast
<
int
>
((
*
iter
)
->
dataType
)
]
=
*
iter
;
pos
=
iter
;
}
}
...
...
@@ -117,17 +117,17 @@ int TimeQueueObj::GetQueueData(std::vector<TimeQueueDataPtr>& outs)
isFinish
=
1
;
if
((
*
iter
)
->
dataType
!=
m_baseEnum
)
{
if
(
m_enumCount
[
(
*
iter
)
->
dataType
]
==
1
)
if
(
m_enumCount
[
static_cast
<
int
>
((
*
iter
)
->
dataType
)
]
==
1
)
obj
++
;
else
{
m_enumCount
[
(
*
iter
)
->
dataType
]
--
;
m_enumCount
[
static_cast
<
int
>
((
*
iter
)
->
dataType
)
]
--
;
obj
=
m_timeQueue
.
erase
(
obj
);
}
}
else
{
m_enumCount
[
(
*
iter
)
->
dataType
]
--
;
m_enumCount
[
static_cast
<
int
>
((
*
iter
)
->
dataType
)
]
--
;
obj
=
m_timeQueue
.
erase
(
obj
);
}
if
(
isFinish
==
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