Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
dd63bfc0
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dd63bfc0
编写于
9月 28, 2018
作者:
G
gruminions
提交者:
fengqikai1414
9月 28, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tools: cyber_monitor add support for display enum type
上级
f22d1e3a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
47 addition
and
83 deletion
+47
-83
framework/cybertron/tools/cvt/monitor/general_message.cpp
framework/cybertron/tools/cvt/monitor/general_message.cpp
+31
-27
framework/cybertron/tools/cvt/monitor/general_message_base.cpp
...work/cybertron/tools/cvt/monitor/general_message_base.cpp
+16
-12
modules/tools/visualizer/CMakeLists.txt
modules/tools/visualizer/CMakeLists.txt
+0
-44
未找到文件。
framework/cybertron/tools/cvt/monitor/general_message.cpp
浏览文件 @
dd63bfc0
...
...
@@ -27,6 +27,7 @@ RenderableMessage* GeneralMessage::Child(int lineNo) const {
void
GeneralMessage
::
PrintRepeatedField
(
const
Screen
*
s
,
unsigned
&
lineNo
,
int
indent
,
int
index
,
int
jumpLines
)
{
std
::
ostringstream
outStr
;
std
::
ios_base
::
fmtflags
old_flags
;
const
std
::
string
&
fieldName
=
field_
->
name
();
outStr
<<
fieldName
<<
": "
;
...
...
@@ -35,29 +36,33 @@ void GeneralMessage::PrintRepeatedField(const Screen* s, unsigned& lineNo,
}
switch
(
field_
->
cpp_type
())
{
#define OUTPUT_FIELD(CPPTYPE, METHOD
)
\
#define OUTPUT_FIELD(CPPTYPE, METHOD
, PRECISION)
\
case google::protobuf::FieldDescriptor::CPPTYPE_##CPPTYPE: \
outStr << std::setprecision(64) << field_->is_repeated() \
old_flags = outStr.flags(); \
outStr << std::fixed << std::setprecision(PRECISION) \
<< field_->is_repeated() \
? reflection_ptr_->GetRepeated##METHOD(*message_ptr_, field_, index) \
: reflection_ptr_->Get##METHOD(*message_ptr_, field_); \
outStr.flags(old_flags); \
break
OUTPUT_FIELD
(
INT32
,
Int32
);
OUTPUT_FIELD
(
INT64
,
Int64
);
OUTPUT_FIELD
(
UINT32
,
UInt32
);
OUTPUT_FIELD
(
UINT64
,
UInt64
);
OUTPUT_FIELD
(
FLOAT
,
Float
);
OUTPUT_FIELD
(
DOUBLE
,
Double
);
OUTPUT_FIELD
(
BOOL
,
Bool
);
OUTPUT_FIELD
(
INT32
,
Int32
,
6
);
OUTPUT_FIELD
(
INT64
,
Int64
,
6
);
OUTPUT_FIELD
(
UINT32
,
UInt32
,
6
);
OUTPUT_FIELD
(
UINT64
,
UInt64
,
6
);
OUTPUT_FIELD
(
FLOAT
,
Float
,
6
);
OUTPUT_FIELD
(
DOUBLE
,
Double
,
9
);
OUTPUT_FIELD
(
BOOL
,
Bool
,
6
);
#undef OUTPUT_FIELD
case
google
::
protobuf
::
FieldDescriptor
::
CPPTYPE_STRING
:
{
std
::
string
scratch
;
const
std
::
string
&
value
=
field_
->
is_repeated
()
?
reflection_ptr_
->
GetRepeatedStringReference
(
field_
->
is_repeated
()
?
reflection_ptr_
->
GetRepeatedStringReference
(
*
message_ptr_
,
field_
,
index
,
&
scratch
)
:
reflection_ptr_
->
GetStringReference
(
*
message_ptr_
,
field_
,
&
scratch
);
:
reflection_ptr_
->
GetStringReference
(
*
message_ptr_
,
field_
,
&
scratch
);
outStr
<<
value
.
substr
(
jumpLines
);
break
;
}
...
...
@@ -71,9 +76,9 @@ void GeneralMessage::PrintRepeatedField(const Screen* s, unsigned& lineNo,
const
google
::
protobuf
::
EnumValueDescriptor
*
enum_desc
=
field_
->
enum_type
()
->
FindValueByNumber
(
enum_value
);
if
(
enum_desc
!=
nullptr
)
{
outStr
<<
enum_desc
->
name
()
<<
" "
<<
enum_value
;
outStr
<<
enum_desc
->
name
();
}
else
{
outStr
<<
enum_value
<<
" "
<<
enum_value
;
outStr
<<
enum_value
;
}
break
;
}
...
...
@@ -81,8 +86,7 @@ void GeneralMessage::PrintRepeatedField(const Screen* s, unsigned& lineNo,
case
google
::
protobuf
::
FieldDescriptor
::
CPPTYPE_MESSAGE
:
s
->
AddStr
(
indent
,
lineNo
++
,
outStr
.
str
().
c_str
());
GeneralMessageBase
::
PrintMessage
(
this
,
field_
->
is_repeated
()
this
,
field_
->
is_repeated
()
?
reflection_ptr_
->
GetRepeatedMessage
(
*
message_ptr_
,
field_
,
index
)
:
reflection_ptr_
->
GetMessage
(
*
message_ptr_
,
field_
),
...
...
@@ -94,10 +98,9 @@ void GeneralMessage::PrintRepeatedField(const Screen* s, unsigned& lineNo,
s
->
AddStr
(
indent
,
lineNo
++
,
outStr
.
str
().
c_str
());
}
GeneralMessage
::
GeneralMessage
(
GeneralMessageBase
*
parent
,
const
google
::
protobuf
::
Message
*
msg
,
const
google
::
protobuf
::
Reflection
*
reflection
,
GeneralMessage
::
GeneralMessage
(
GeneralMessageBase
*
parent
,
const
google
::
protobuf
::
Message
*
msg
,
const
google
::
protobuf
::
Reflection
*
reflection
,
const
google
::
protobuf
::
FieldDescriptor
*
field
)
:
GeneralMessageBase
(
parent
),
itemIndex_
(
0
),
...
...
@@ -158,7 +161,8 @@ void GeneralMessage::Render(const Screen* s, int key) {
default:
;
}
int
lcount
=
lineCountOfField
(
*
message_ptr_
,
s
->
Width
(),
field_
,
reflection_ptr_
);
int
lcount
=
lineCountOfField
(
*
message_ptr_
,
s
->
Width
(),
field_
,
reflection_ptr_
);
int
pageItemCount
=
s
->
Height
()
-
lineNo
;
pages_
=
lcount
/
pageItemCount
+
1
;
SplitPages
(
key
);
...
...
framework/cybertron/tools/cvt/monitor/general_message_base.cpp
浏览文件 @
dd63bfc0
...
...
@@ -108,6 +108,7 @@ void GeneralMessageBase::PrintMessage(GeneralMessageBase* baseMsg,
}
std
::
ostringstream
outStr
;
std
::
ios_base
::
fmtflags
old_flags
;
for
(;
i
<
fields
.
size
();
++
i
)
{
const
google
::
protobuf
::
FieldDescriptor
*
field
=
fields
[
i
];
const
std
::
string
&
fieldName
=
field
->
name
();
...
...
@@ -124,18 +125,21 @@ void GeneralMessageBase::PrintMessage(GeneralMessageBase* baseMsg,
}
else
{
switch
(
field
->
cpp_type
())
{
#define OUTPUT_FIELD(CPPTYPE, METHOD
)
\
#define OUTPUT_FIELD(CPPTYPE, METHOD
, PRECISION)
\
case google::protobuf::FieldDescriptor::CPPTYPE_##CPPTYPE: \
outStr << std::setprecision(64) << reflection->Get##METHOD(msg, field); \
old_flags = outStr.flags(); \
outStr << std::fixed << std::setprecision(PRECISION) \
<< reflection->Get##METHOD(msg, field); \
outStr.flags(old_flags); \
break
OUTPUT_FIELD
(
INT32
,
Int32
);
OUTPUT_FIELD
(
INT64
,
Int64
);
OUTPUT_FIELD
(
UINT32
,
UInt32
);
OUTPUT_FIELD
(
UINT64
,
UInt64
);
OUTPUT_FIELD
(
FLOAT
,
Float
);
OUTPUT_FIELD
(
DOUBLE
,
Double
);
OUTPUT_FIELD
(
BOOL
,
Bool
);
OUTPUT_FIELD
(
INT32
,
Int32
,
6
);
OUTPUT_FIELD
(
INT64
,
Int64
,
6
);
OUTPUT_FIELD
(
UINT32
,
UInt32
,
6
);
OUTPUT_FIELD
(
UINT64
,
UInt64
,
6
);
OUTPUT_FIELD
(
FLOAT
,
Float
,
6
);
OUTPUT_FIELD
(
DOUBLE
,
Double
,
9
);
OUTPUT_FIELD
(
BOOL
,
Bool
,
6
);
#undef OUTPUT_FIELD
case
google
::
protobuf
::
FieldDescriptor
::
CPPTYPE_ENUM
:
{
...
...
@@ -144,9 +148,9 @@ void GeneralMessageBase::PrintMessage(GeneralMessageBase* baseMsg,
const
google
::
protobuf
::
EnumValueDescriptor
*
enum_desc
=
field
->
enum_type
()
->
FindValueByNumber
(
enum_value
);
if
(
enum_desc
!=
nullptr
)
{
outStr
<<
enum_desc
->
name
()
<<
" "
<<
enum_value
;
outStr
<<
enum_desc
->
name
();
}
else
{
outStr
<<
enum_value
<<
" "
<<
enum_value
;
outStr
<<
enum_value
;
}
break
;
}
...
...
modules/tools/visualizer/CMakeLists.txt
已删除
100644 → 0
浏览文件 @
f22d1e3a
cmake_minimum_required
(
VERSION 2.8.12
)
project
(
cyber_visualizer
)
set
(
CMAKE_INCLUDE_CURRENT_DIR ON
)
set
(
CMAKE_AUTOMOC ON
)
set
(
CMAKE_PREFIX_PATH
${
CMAKE_SOURCE_DIR
}
/third_party/Qt5.5.1/5.5/gcc_64
)
find_package
(
Qt5 REQUIRED COMPONENTS Gui Widgets Core
)
set
(
OUTTER_LIBRARIES
cybertron
cybertron_proto
cybertron_common
sensor_msgs
fastrtps
console_bridge
protobuf
glog
pthread
GL
)
include_directories
(
.
)
file
(
GLOB SOURCES
${
CMAKE_CURRENT_SOURCE_DIR
}
/*.cc
)
file
(
GLOB HEADERS
${
CMAKE_CURRENT_SOURCE_DIR
}
/*.h
)
file
(
GLOB UIS
${
CMAKE_CURRENT_SOURCE_DIR
}
/uis/*.ui
)
file
(
GLOB RESOURCE
${
CMAKE_CURRENT_SOURCE_DIR
}
/*.qrc
)
qt5_wrap_ui
(
WRAP_UIS
${
UIS
}
)
#qt5_wrap_cpp(MOC widget.h)
qt5_add_resources
(
RCC
${
RESOURCE
}
)
add_executable
(
${
PROJECT_NAME
}
${
SOURCES
}
${
HEADERS
}
${
UIS
}
${
RCC
}
)
target_link_libraries
(
${
PROJECT_NAME
}
Qt5::Widgets
)
target_link_libraries
(
${
PROJECT_NAME
}
Qt5::Gui
)
target_link_libraries
(
${
PROJECT_NAME
}
Qt5::Core
)
target_link_libraries
(
${
PROJECT_NAME
}
${
OUTTER_LIBRARIES
}
)
target_include_directories
(
${
PROJECT_NAME
}
PUBLIC
${
PROTO_SRC_DIR
}
)
install
(
TARGETS
${
PROJECT_NAME
}
DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/bin
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录