Skip to content

Commit

Permalink
Release 16.1.0 (#25)
Browse files Browse the repository at this point in the history
* Add a feature of team graphic scaling (#21)

* Add a feature to change the draw scale of team graphic images.

* add a command line option, '--team-graphic-scale'

* Improve cmake settings (#22)

Co-authored-by: Hidehisa Akiyama <[email protected]>

* fix a compiler warning caused by illegal strncpy usage. (#23)

* Release 16.1.0 (#24)

* update a minor version number.

* update copyright notice message.

Co-authored-by: Hidehisa Akiyama <[email protected]>
  • Loading branch information
hidehisaakiyama and hidehisaakiyama authored Jan 21, 2022
1 parent a555894 commit 6017d1d
Show file tree
Hide file tree
Showing 13 changed files with 220 additions and 114 deletions.
110 changes: 33 additions & 77 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,99 +1,55 @@
cmake_minimum_required(VERSION 3.5)

project(rcssmonitor VERSION 16.0.0)

add_definitions(-DPACKAGE_NAME=\"rcssmonitor\")
add_definitions(-DVERSION=\"16.0.0\")

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(CMAKE_AUTOMOC ON)
project(rcssmonitor VERSION 16.1.0)

if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()

find_package(Boost 1.36.0 COMPONENTS program_options system REQUIRED)
# compiler options
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
if(NOT Qt5_FOUND)
find_package(Qt4 4.1.0 COMPONENTS QtCore QtGui QtNetwork REQUIRED)
if(NOT Qt4_FOUND)
message(FATAL_ERROR "Qt not found!")
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
set(CMAKE_CXX_FLAGS "-W -Wall")

find_package(ZLIB)

option(HAVE_NETINET_IN_H "use netinet/in.h" ON)
if(HAVE_NETINET_IN_H)
add_definitions(-DHAVE_NETINET_IN_H)
endif()
include(GNUInstallDirs)

option(HAVE_WINDOWS_H "use windows.h" OFF)
if(HAVE_WINDOWS_H)
add_definitions(-DHAVE_WINDOWS_H)
# check header files
include(CheckIncludeFileCXX)
if(WIN32)
check_include_file("windows.h" HAVE_WINDOWS_H)
endif()
check_include_file_cxx("netinet/in.h" HAVE_NETINET_IN_H)

# check boost
find_package(Boost 1.38.0 COMPONENTS program_options system REQUIRED)
if(Boost_PROGRAM_OPTIONS_FOUND)
# message( "found boost::program_options")
add_definitions(-DHAVE_BOOST_PROGRAM_OPTIONS)
set(HAVE_BOOST_PROGRAM_OPTIONS TRUE)
endif()

if(ZLIB_FOUND)
add_definitions(-DHAVE_LIBZ)
# check Qt
find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
if(NOT Qt5_FOUND)
message(FATAL_ERROR "Qt5 not found!")
endif()

add_executable(rcssmonitor
src/rcsslogplayer/gzfstream.cpp
src/rcsslogplayer/parser.cpp
src/rcsslogplayer/types.cpp
src/rcsslogplayer/util.cpp
src/angle_deg.cpp
src/ball_painter.cpp
src/circle_2d.cpp
src/config_dialog.cpp
src/disp_holder.cpp
src/draw_info_painter.cpp
src/field_canvas.cpp
src/field_painter.cpp
src/line_2d.cpp
src/log_player.cpp
src/log_player_slider.cpp
src/main_window.cpp
src/monitor_client.cpp
src/options.cpp
src/player_painter.cpp
src/player_type_dialog.cpp
src/score_board_painter.cpp
src/team_graphic.cpp
src/team_graphic_painter.cpp
src/vector_2d.cpp
src/main.cpp
)

target_include_directories(rcssmonitor PUBLIC
"${PROJECT_BINARY_DIR}"
"${Boost_INCLUDE_DIRS}"
"${ZLIB_INCLUDE_DIRS}"
"${PROJECT_SOURCE_DIR}"
"${PROJECT_SOURCE_DIR}/src"
)
set(CMAKE_AUTOMOC ON)

if(Qt5_FOUND)
target_link_libraries(rcssmonitor
Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network
Boost::program_options Boost::system
ZLIB::ZLIB
)
elseif(Qt4_FOUND)
target_link_libraries(rcssmonitor
Qt4::QtCore Qt4::QtGui Qt4::QtNetwork
Boost::program_options Boost::system
ZLIB::ZLIB
)
# check zlib
find_package(ZLIB)
if(ZLIB_FOUND)
set(HAVE_LIBZ TRUE)
endif()

# generate config.h
add_definitions(-DHAVE_CONFIG_H)
configure_file(
${PROJECT_SOURCE_DIR}/cmake-config.h.in
${PROJECT_BINARY_DIR}/config.h
)

install(TARGETS rcssmonitor DESTINATION bin)
#
add_subdirectory(src)
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2022-01-21 Hidehisa Akiyama <[email protected]>

* CMakeLists.txt:
* NEWS:
* configurea.ac:
- updated a minor version number. Official release 16.1.0.

2020-03-11 Hidehisa Akiyama <[email protected]>

* NEWS:
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[16.1.0]
* Add a team graphic scaling option. Now, users can change the drawing
scale of team graphic images.

[16.0.0]
* Support new server specifications, illegal defense and fixed
teamname. The monitor visualize the state of illegal defense
Expand Down
12 changes: 12 additions & 0 deletions cmake-config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

#define PACKAGE_NAME "rcssmonitor"

#define VERSION "@rcssmonitor_VERSION@"

#cmakedefine HAVE_LIBZ

#cmakedefine HAVE_WINDOWS_H

#cmakedefine HAVE_NETINET_IN_H

#cmakedefine HAVE_BOOST_PROGRAM_OPTIONS
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT([rcssmonitor],[16.0.0],[https://github.com/rcsoccersim/rcssmonitor])
AC_INIT([rcssmonitor],[16.1.0],[https://github.com/rcsoccersim/rcssmonitor])

#LT_PREREQ(2.2.4)

Expand Down
57 changes: 57 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

add_executable(rcssmonitor
rcsslogplayer/gzfstream.cpp
rcsslogplayer/parser.cpp
rcsslogplayer/types.cpp
rcsslogplayer/util.cpp
angle_deg.cpp
ball_painter.cpp
circle_2d.cpp
config_dialog.cpp
disp_holder.cpp
draw_info_painter.cpp
field_canvas.cpp
field_painter.cpp
line_2d.cpp
log_player.cpp
log_player_slider.cpp
main_window.cpp
monitor_client.cpp
options.cpp
player_painter.cpp
player_type_dialog.cpp
score_board_painter.cpp
team_graphic.cpp
team_graphic_painter.cpp
vector_2d.cpp
main.cpp
)

target_include_directories(rcssmonitor
PUBLIC
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
PRIVATE
${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/src
)

target_link_libraries(rcssmonitor
Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network
Boost::program_options Boost::system
ZLIB::ZLIB
)

target_compile_definitions(rcssmonitor
PUBLIC
HAVE_CONFIG_H
)

install(TARGETS rcssmonitor
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
78 changes: 58 additions & 20 deletions src/config_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,34 +475,55 @@ QWidget *
ConfigDialog::createCanvasSizeControls()
{
QGroupBox * group_box = new QGroupBox( tr( "Canvas Size" ) );
QVBoxLayout * top_layout = new QVBoxLayout();

QHBoxLayout * layout = new QHBoxLayout();
layout->setMargin( 1 );
layout->setSpacing( 0 );
{
QHBoxLayout * layout = new QHBoxLayout();
layout->setMargin( 1 );
layout->setSpacing( 0 );

layout->addWidget( new QLabel( tr( " Width:" ) ) );
layout->addWidget( new QLabel( tr( " Width:" ) ) );

M_canvas_width_text = new QLineEdit( tr( "640" ) );
M_canvas_width_text->setValidator( new QIntValidator( 100, 3000, M_canvas_width_text ) );
M_canvas_width_text->setMaximumSize( 48, 24 );
layout->addWidget( M_canvas_width_text );
M_canvas_width_text = new QLineEdit( tr( "640" ) );
M_canvas_width_text->setValidator( new QIntValidator( 100, 3000, M_canvas_width_text ) );
M_canvas_width_text->setMaximumSize( 48, 24 );
layout->addWidget( M_canvas_width_text );

layout->addWidget( new QLabel( tr( " Height:" ) ) );
layout->addWidget( new QLabel( tr( " Height:" ) ) );

M_canvas_height_text = new QLineEdit( tr( "480" ) );
M_canvas_height_text->setValidator( new QIntValidator( 100, 3000, M_canvas_height_text ) );
M_canvas_height_text->setMaximumSize( 48, 24 );
layout->addWidget( M_canvas_height_text );
M_canvas_height_text = new QLineEdit( tr( "480" ) );
M_canvas_height_text->setValidator( new QIntValidator( 100, 3000, M_canvas_height_text ) );
M_canvas_height_text->setMaximumSize( 48, 24 );
layout->addWidget( M_canvas_height_text );

layout->addSpacing( 12 );
layout->addSpacing( 12 );

QPushButton * apply_canvas_size_btn = new QPushButton( tr( "apply" ) );
apply_canvas_size_btn->setMaximumSize( 60, this->fontMetrics().height() + 12 );
connect( apply_canvas_size_btn, SIGNAL( clicked() ),
this, SLOT( applyCanvasSize() ) );
layout->addWidget( apply_canvas_size_btn );
QPushButton * apply_canvas_size_btn = new QPushButton( tr( "apply" ) );
apply_canvas_size_btn->setMaximumSize( 60, this->fontMetrics().height() + 12 );
connect( apply_canvas_size_btn, SIGNAL( clicked() ),
this, SLOT( applyCanvasSize() ) );
layout->addWidget( apply_canvas_size_btn );

group_box->setLayout( layout );
top_layout->addLayout( layout );
}
{
QHBoxLayout * layout = new QHBoxLayout();
layout->setMargin( 1 );
layout->setSpacing( 0 );

layout->addWidget( new QLabel( tr( " Team Graphic Scale:" ) ) );

M_team_graphic_scale = new QDoubleSpinBox();
M_team_graphic_scale->setRange( 0.01, 16.0 );
M_team_graphic_scale->setSingleStep( 0.01 );
M_team_graphic_scale->setMaximumSize( 128, 24 );
connect( M_team_graphic_scale, SIGNAL( valueChanged( double ) ),
this, SLOT( slotTeamGraphicScaleChanged( double ) ) );
layout->addWidget( M_team_graphic_scale );

top_layout->addLayout( layout );
}
group_box->setLayout( top_layout );
return group_box;
}

Expand Down Expand Up @@ -1275,6 +1296,8 @@ ConfigDialog::updateAll()
M_canvas_width_text->setText( QString::number( opt.canvasWidth() ) );
M_canvas_height_text->setText( QString::number( opt.canvasHeight() ) );

M_team_graphic_scale->setValue( opt.teamGraphicScale() );

M_anti_aliasing_cb->setChecked( opt.antiAliasing() );

M_player_number_cb->setChecked( opt.showPlayerNumber() );
Expand Down Expand Up @@ -1510,6 +1533,21 @@ ConfigDialog::applyCanvasSize()
/*-------------------------------------------------------------------*/
/*!
*/
void
ConfigDialog::slotTeamGraphicScaleChanged( double value )
{
if ( std::fabs( value - Options::instance().teamGraphicScale() ) > 0.01 )
{
Options::instance().setTeamGraphicScale( value );

emit configured();
}
}

/*-------------------------------------------------------------------*/
/*!
*/
void
ConfigDialog::clickAntiAliasing( bool checked )
Expand Down
5 changes: 5 additions & 0 deletions src/config_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class QPushButton;
class QCheckBox;
class QCloseEvent;
class QComboBox;
class QDoubleSpinBox;
class QLabel;
class QLineEdit;
class QListWidget;
Expand Down Expand Up @@ -151,6 +152,8 @@ class ConfigDialog
QLineEdit * M_canvas_width_text;
QLineEdit * M_canvas_height_text;

QDoubleSpinBox * M_team_graphic_scale;

// misc options
QCheckBox * M_anti_aliasing_cb;

Expand Down Expand Up @@ -250,6 +253,8 @@ private slots:
void slideFieldScale( int value );
void editFieldScale( const QString & );

void slotTeamGraphicScaleChanged( double value );

void clickShowPlayerNumber( bool checked );
void clickShowPlayerType( bool checked );
void clickShowStamina( bool checked );
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ main( int argc,
char ** argv )
{
std::cout << PACKAGE_NAME << "-" << VERSION << "\n\n"
<< "Copyright (C) 2009 - 2020 RoboCup Soccer Simulator Maintenance Group.\n"
<< "Copyright (C) 2009 - 2022 RoboCup Soccer Simulator Maintenance Group.\n"
<< std::endl;

QApplication app( argc, argv );
Expand Down
Loading

0 comments on commit 6017d1d

Please sign in to comment.