diff -Nru rcssmonitor-14.0.0/ChangeLog rcssmonitor-14.1.0/ChangeLog --- rcssmonitor-14.0.0/ChangeLog 2009-11-17 11:40:34.000000000 +0000 +++ rcssmonitor-14.1.0/ChangeLog 2010-03-30 10:32:16.000000000 +0100 @@ -1,3 +1,93 @@ +2010-03-30 Hidehisa Akiyama + + * NEWS: + * configure.ac: + * src/src.pro: + - updated a minor version number. Official release 14.1.0. + + * src/log_player.cpp: + * src/log_player.h: + * src/main_window.cpp: + * src/main_window.h: + * src/monitor_client.cpp: + * src/monitor_client.h: + * src/options.cpp: + * src/options.h: + - implemented automatic reconnection. + - added new options, "--auto-reconnect-mode" and "--auto-reconnect-wait". + - changed the policy of configuration file generation. + - renamed some parameters in rcssmonitor.conf. + +2010-01-29 Hidehisa Akiyama + + * src/main.cpp: + - updated the copyright message. + +2009-12-03 Hidehisa Akiyama + + * src/config_dialog.cpp: + * src/main_window.cpp: + * src/player_type_dialog.cpp: + - fixed a defect of shortcut key dialog on OSX. + - fixd font size on OSX. + - fixd layout on OSX. + + * NEWS: + * configure.ac: + * rcssmonitor.pro: + - updated a point version number. Official release 14.0.1. + + * src/field_canvas.cpp: + * src/main_window.cpp: + * src/options.cpp: + * src/src.pro: + - fixed a defect of repainting region. + - fixed the size of recovering animation. + - fixed defects of default option value.ls + + * src/field_canvas.cpp: + * src/main_window.cpp: + * src/options.cpp: + * src/options.h: + - added parameter for the size of recovering animation. + +2009-12-02 Hidehisa Akiyama + + * src/config_dialog.cpp: + - fixed button layout. + + * src/main_window.cpp: + - fixed an illegal handler for red card action. + + * m4/ax_boost_program_options.m4: + - updated m4 macro for boost::program_options. + + * src/config_dialog.cpp: + * src/log_player.cpp: + * src/log_player.h: + * src/main_window.cpp: + * src/monitor_client.cpp: + * src/options.h: + - fixed defects of monitor client object. + - fixed defects of buffer recovering mode. + + * src/field_canvas.cpp: + * src/field_canvas.h: + * src/log_player.cpp: + * src/log_player.h: + * src/main_window.cpp: + * src/main_window.h: + * src/options.cpp: + * src/options.h: + - added an animation that shows recovering status. + +2009-12-01 Hidehisa Akiyama + + * src/log_player.cpp: + * src/log_player.h: + * src/main_window.cpp: + - implemented a special buffer recovering mode. + 2009-11-17 Hidehisa Akiyama * configure.ac: diff -Nru rcssmonitor-14.0.0/config.h.in rcssmonitor-14.1.0/config.h.in --- rcssmonitor-14.0.0/config.h.in 2009-11-16 09:42:48.000000000 +0000 +++ rcssmonitor-14.1.0/config.h.in 2010-03-30 10:39:50.000000000 +0100 @@ -21,9 +21,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H +/* Define to 1 if you have the `pow' function. */ +#undef HAVE_POW + /* Define to 1 if you have the `rint' function. */ #undef HAVE_RINT +/* Define to 1 if you have the `sqrt' function. */ +#undef HAVE_SQRT + /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H diff -Nru rcssmonitor-14.0.0/configure rcssmonitor-14.1.0/configure --- rcssmonitor-14.0.0/configure 2009-11-16 09:42:48.000000000 +0000 +++ rcssmonitor-14.1.0/configure 2010-03-30 10:39:50.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for rcssmonitor 14.0.0. +# Generated by GNU Autoconf 2.64 for rcssmonitor 14.1.0. # # Report bugs to . # @@ -549,8 +549,8 @@ # Identity of this package. PACKAGE_NAME='rcssmonitor' PACKAGE_TARNAME='rcssmonitor' -PACKAGE_VERSION='14.0.0' -PACKAGE_STRING='rcssmonitor 14.0.0' +PACKAGE_VERSION='14.1.0' +PACKAGE_STRING='rcssmonitor 14.1.0' PACKAGE_BUGREPORT='sserver-admin@users.sf.net' PACKAGE_URL='' @@ -1259,7 +1259,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rcssmonitor 14.0.0 to adapt to many kinds of systems. +\`configure' configures rcssmonitor 14.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1325,7 +1325,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rcssmonitor 14.0.0:";; + short | recursive ) echo "Configuration of rcssmonitor 14.1.0:";; esac cat <<\_ACEOF @@ -1436,7 +1436,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rcssmonitor configure 14.0.0 +rcssmonitor configure 14.1.0 generated by GNU Autoconf 2.64 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2022,7 +2022,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rcssmonitor $as_me 14.0.0, which was +It was created by rcssmonitor $as_me 14.1.0, which was generated by GNU Autoconf 2.64. Invocation command line was $ $0 $@ @@ -2834,7 +2834,7 @@ # Define the identity of the package. PACKAGE='rcssmonitor' - VERSION='14.0.0' + VERSION='14.1.0' cat >>confdefs.h <<_ACEOF @@ -5102,7 +5102,7 @@ fi -for ac_func in memset rint strtol +for ac_func in memset rint strtol pow sqrt do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -5434,7 +5434,7 @@ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/[^\/]*//'` if test "x$ax_boost_user_program_options_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.{so,dylib,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;' -e 's;^lib\(boost_program_options.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_program_options.*\)\.a*$;\1;'` ; do + for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a*$;\1;'` ; do ax_lib=${libextension} as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 @@ -5483,7 +5483,7 @@ done if test "x$link_program_options" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_program_options*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;' -e 's;^\(boost_program_options.*\)\.a*$;\1;'` ; do + for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a*$;\1;'` ; do ax_lib=${libextension} as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 @@ -6442,7 +6442,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rcssmonitor $as_me 14.0.0, which was +This file was extended by rcssmonitor $as_me 14.1.0, which was generated by GNU Autoconf 2.64. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6506,7 +6506,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -rcssmonitor config.status 14.0.0 +rcssmonitor config.status 14.1.0 configured by $0, generated by GNU Autoconf 2.64, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -Nru rcssmonitor-14.0.0/configure.ac rcssmonitor-14.1.0/configure.ac --- rcssmonitor-14.0.0/configure.ac 2009-11-02 01:33:35.000000000 +0000 +++ rcssmonitor-14.1.0/configure.ac 2010-03-30 10:39:41.000000000 +0100 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rcssmonitor],[14.0.0],[sserver-admin@users.sf.net]) +AC_INIT([rcssmonitor],[14.1.0],[sserver-admin@users.sf.net]) #LT_PREREQ(2.2.4) @@ -54,7 +54,7 @@ ################################################## AC_FUNC_ERROR_AT_LINE -AC_CHECK_FUNCS([memset rint strtol]) +AC_CHECK_FUNCS([memset rint strtol pow sqrt]) # ---------------------------------------------------------- # check boost diff -Nru rcssmonitor-14.0.0/debian/changelog rcssmonitor-14.1.0/debian/changelog --- rcssmonitor-14.0.0/debian/changelog 2010-05-06 09:00:51.000000000 +0100 +++ rcssmonitor-14.1.0/debian/changelog 2010-05-06 09:00:51.000000000 +0100 @@ -1,5 +1,5 @@ -rcssmonitor (14.0.0-1hardy1) hardy; urgency=low +rcssmonitor (14.1.0-2hardy) hardy; urgency=high * Stable release - -- Armin Ildermi Tue, 24 Nov 2009 16:27:19 +0330 + -- Hossein Ansari Thu, 06 May 2010 12:13:12 +0430 diff -Nru rcssmonitor-14.0.0/debian/control rcssmonitor-14.1.0/debian/control --- rcssmonitor-14.0.0/debian/control 2010-05-06 09:00:51.000000000 +0100 +++ rcssmonitor-14.1.0/debian/control 2010-05-06 09:00:51.000000000 +0100 @@ -1,14 +1,26 @@ Source: rcssmonitor -Section: devel Priority: optional -Maintainer: Armin Ildermi -Build-Depends: debhelper (>= 7), autotools-dev, libboost-dev, libxpm-dev, flex, bison, pkg-config, libqt4-dev, libqt4-opengl-dev -Standards-Version: 3.8.1 +Maintainer: Hossein Ansari +Build-Depends: debhelper (>= 7), autotools-dev, libboost-dev,libboost-filesystem-dev, libboost-program-options-dev, libxpm-dev, flex, bison, pkg-config, libqt4-dev, libqt4-opengl-dev, libaudio-dev, libxt-dev, libpng-dev, libglib2.0-dev, libfreetype6-dev, libxrender-dev, libxext-dev, libfontconfig-dev +Standards-Version: 3.8.3 +Section: devel Homepage: http://robocup.allafiha.com +Package: rcssmonitor-dev +Section: libdevel +Architecture: any +Depends: rcssmonitor (= ${binary:Version}),debhelper (>= 7), autotools-dev, libboost-dev,libboost-filesystem-dev, libboost-program-options-dev, libxpm-dev, flex, bison, pkg-config, libqt4-dev, libqt4-opengl-dev, libaudio-dev, libxt-dev, libpng-dev, libglib2.0-dev, libfreetype6-dev, libxrender-dev, libxext-dev, libfontconfig-dev +Description: The RoboCup Soccer Simulator Monitor Development files + The RoboCup Soccer Simulator Monitor (rcssmonitor) is used to view the + simulation as it takes place by connecting to the rcssserver or to + view the playback of a simulation by connecting to the rcsslogplayer. + Package: rcssmonitor +Section: devel Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: The RoboCup Soccer Simulator Monitor (rcssmonitor) - The RoboCup Soccer Simulator Monitor is a viewer for moved 2d vector graphics. It runs on - Linux (Unix) computers that run the X Window System. +Description: The RoboCup Soccer Simulator Monitor + The RoboCup Soccer Simulator Monitor (rcssmonitor) is used to view the + simulation as it takes place by connecting to the rcssserver or to + view the playback of a simulation by connecting to the rcsslogplayer. + diff -Nru rcssmonitor-14.0.0/debian/copyright rcssmonitor-14.1.0/debian/copyright --- rcssmonitor-14.0.0/debian/copyright 2010-05-06 09:00:51.000000000 +0100 +++ rcssmonitor-14.1.0/debian/copyright 2010-05-06 09:00:51.000000000 +0100 @@ -1,5 +1,5 @@ -This package was debianized by Armin Ildermi on -Tue, 24 Nov 2009 16:27:19 +0330. +This package was debianized by Hossein Ansari on +Mon, 03 May 2010 20:13:03 +0430. It was downloaded from @@ -17,8 +17,7 @@ The Debian packaging is: - Copyright (C) 2009 Armin Ildermi + Copyright (C) 2009 Hossein Ansari and is licensed under the GPL version 3, see `/usr/share/common-licenses/GPL-3'. - diff -Nru rcssmonitor-14.0.0/debian/rcssmonitor.install rcssmonitor-14.1.0/debian/rcssmonitor.install --- rcssmonitor-14.0.0/debian/rcssmonitor.install 1970-01-01 01:00:00.000000000 +0100 +++ rcssmonitor-14.1.0/debian/rcssmonitor.install 2010-05-06 09:00:51.000000000 +0100 @@ -0,0 +1 @@ +usr/bin/* diff -Nru rcssmonitor-14.0.0/debian/README.Debian rcssmonitor-14.1.0/debian/README.Debian --- rcssmonitor-14.0.0/debian/README.Debian 2010-05-06 09:00:51.000000000 +0100 +++ rcssmonitor-14.1.0/debian/README.Debian 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -rcssmonitor for Debian ----------------------- - - - - -- Armin Ildermi Tue, 24 Nov 2009 16:27:19 +0330 diff -Nru rcssmonitor-14.0.0/debian/rules rcssmonitor-14.1.0/debian/rules --- rcssmonitor-14.0.0/debian/rules 2010-05-06 09:00:51.000000000 +0100 +++ rcssmonitor-14.1.0/debian/rules 2010-05-06 09:00:51.000000000 +0100 @@ -22,6 +22,16 @@ + +# shared library versions, option 1 +version=2.0.5 +major=2 +# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so +#version=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` +#major=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` + config.status: configure dh_testdir # Add here commands to configure the package. @@ -35,13 +45,11 @@ build: build-stamp - build-stamp: config.status dh_testdir # Add here commands to compile the package. $(MAKE) - #docbook-to-man debian/rcssmonitor.sgml > rcssmonitor.1 touch $@ @@ -62,8 +70,8 @@ dh_prep dh_installdirs - # Add here commands to install the package into debian/rcssmonitor. - $(MAKE) DESTDIR=$(CURDIR)/debian/rcssmonitor install + # Add here commands to install the package into debian/tmp + $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install # Build architecture-independent files here. @@ -72,34 +80,34 @@ # Build architecture-dependent files here. binary-arch: install - dh_testdir - dh_testroot - dh_installchangelogs ChangeLog - dh_installdocs - dh_installexamples -# dh_install -# dh_installmenu -# dh_installdebconf + dh_testdir -a + dh_testroot -a + dh_installchangelogs -a ChangeLog + dh_installdocs -a + dh_installexamples -a + dh_install -a -s --sourcedir=debian/tmp --list-missing +# dh_installmenu -a +# dh_installdebconf -a # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime -# dh_python # dh_installinit # dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb + dh_installinfo -a + dh_installman -a + dh_link -a + dh_strip -a + dh_compress -a + dh_fixperms -a +# dh_perl -a +# dh_python + dh_makeshlibs -a + dh_installdeb -a + dh_shlibdeps -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install diff -Nru rcssmonitor-14.0.0/m4/ax_boost_program_options.m4 rcssmonitor-14.1.0/m4/ax_boost_program_options.m4 --- rcssmonitor-14.0.0/m4/ax_boost_program_options.m4 2009-11-02 01:33:34.000000000 +0000 +++ rcssmonitor-14.1.0/m4/ax_boost_program_options.m4 2009-12-02 08:05:49.000000000 +0000 @@ -1,5 +1,5 @@ # =========================================================================== -# http://autoconf-archive.cryp.to/ax_boost_program_options.html +# http://www.nongnu.org/autoconf-archive/ax_boost_program_options.html # =========================================================================== # # SYNOPSIS @@ -20,13 +20,9 @@ # # HAVE_BOOST_PROGRAM_OPTIONS # -# LAST MODIFICATION +# LICENSE # -# 2008-04-12 -# -# COPYLEFT -# -# Copyright (c) 2008 Thomas Porschberg +# Copyright (c) 2009 Thomas Porschberg # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice @@ -75,14 +71,14 @@ AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available]) BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` if test "x$ax_boost_user_program_options_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.{so,dylib,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;' -e 's;^lib\(boost_program_options.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_program_options.*\)\.a*$;\1;'` ; do + for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a*$;\1;'` ; do ax_lib=${libextension} AC_CHECK_LIB($ax_lib, exit, [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], [link_program_options="no"]) done if test "x$link_program_options" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_program_options*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;' -e 's;^\(boost_program_options.*\)\.a*$;\1;'` ; do + for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a*$;\1;'` ; do ax_lib=${libextension} AC_CHECK_LIB($ax_lib, exit, [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], diff -Nru rcssmonitor-14.0.0/NEWS rcssmonitor-14.1.0/NEWS --- rcssmonitor-14.0.0/NEWS 2009-11-17 11:40:06.000000000 +0000 +++ rcssmonitor-14.1.0/NEWS 2010-03-30 10:38:20.000000000 +0100 @@ -1,8 +1,37 @@ +[14.1.0] + * Added new command line options, "--auto-reconnect-mode" and + "--auto-reconnect-wait". When auto-reconnect-mode is on, rcssmonitor + will try to reconnect to rcssserver if rcssserver does not send + information for auto-reconnect-wait(default:5) seconds. Note that + auto-reconnect-mode overwrites auto-quit-mode. If + auto-reconnect-mode is on, auto-quit-mode is always disabled. + + * Some parameters are renamed in '~/.rcssmonitor.conf'. It is highly + recommended to delete the existing configuration file and + regenerate new one. + + * Changed the policy of configuration file. Now, 'MainWindow' and + 'Monitor' sections in '~/.rcssmonitor.conf' are not updated by + rcssmonitor. Users have to edit these values manually or set by + command line options every time. + +[14.0.1] + * Changed the buffer recovering policy. Now, rcssmonitor tries to + recover the buffer until filling up the default buffer size + without advancing game status if the buffer becomes empty in + the buffering mode. + + * Added a simple animation to show the buffer recovering status. + + * Fixed defects of default option value. + + * Fixed a bug of the red card action. + [14.0.0] * Reimplemented rcssmonitor using Qt4. Please note that Qt 4.3.0 or later is required to build the new monitor. The new monitor - supports the qmake build system. If you have troubles with - Makefile generated by the configure script, please try + supports the qmake build system. If you have troubles with + Makefile generated by the configure script, please try 'qmake && make'. * Supported QtOpenGL which render the data onto QGLWidget. If the diff -Nru rcssmonitor-14.0.0/rcssmonitor.pro rcssmonitor-14.1.0/rcssmonitor.pro --- rcssmonitor-14.0.0/rcssmonitor.pro 2009-11-16 09:22:25.000000000 +0000 +++ rcssmonitor-14.1.0/rcssmonitor.pro 2009-12-03 03:27:18.000000000 +0000 @@ -3,5 +3,5 @@ SUBDIRS = src # Input -DISPFILES += \ +DISTFILES += \ icons/rcss.xpm diff -Nru rcssmonitor-14.0.0/src/config_dialog.cpp rcssmonitor-14.1.0/src/config_dialog.cpp --- rcssmonitor-14.0.0/src/config_dialog.cpp 2009-11-12 10:24:22.000000000 +0000 +++ rcssmonitor-14.1.0/src/config_dialog.cpp 2009-12-03 08:18:06.000000000 +0000 @@ -263,6 +263,8 @@ layout->addWidget( createBallInfoControls(), 0, Qt::AlignLeft ); + layout->addStretch(); + frame->setLayout( layout ); M_tab_widget->addTab( frame, tr( "Show" ) ); } @@ -287,6 +289,8 @@ layout->addWidget( createMiscControls(), 0, Qt::AlignLeft ); + layout->addStretch(); + frame->setLayout( layout ); M_tab_widget->addTab( frame, tr( "Canvas" ) ); } @@ -1205,23 +1209,25 @@ o->scoreBoardFont(), boost::bind1st( std::mem_fun( &Options::setScoreBoardFont ), o ), this ); - layout->addWidget( btn, 1, Qt::AlignLeft ); + layout->addWidget( btn, 0, Qt::AlignLeft ); } { FontButton * btn = new FontButton( tr( "Player" ), o->playerFont(), boost::bind1st( std::mem_fun( &Options::setPlayerFont ), o ), this ); - layout->addWidget( btn, 1, Qt::AlignLeft ); + layout->addWidget( btn, 0, Qt::AlignLeft ); } { FontButton * btn = new FontButton( tr( "Measure" ), o->measureFont(), boost::bind1st( std::mem_fun( &Options::setMeasureFont ), o ), this ); - layout->addWidget( btn, 1, Qt::AlignLeft ); + layout->addWidget( btn, 0, Qt::AlignLeft ); } + layout->addStretch(); + return layout; } diff -Nru rcssmonitor-14.0.0/src/field_canvas.cpp rcssmonitor-14.1.0/src/field_canvas.cpp --- rcssmonitor-14.0.0/src/field_canvas.cpp 2009-11-12 08:56:19.000000000 +0000 +++ rcssmonitor-14.1.0/src/field_canvas.cpp 2009-12-03 05:24:46.000000000 +0000 @@ -50,6 +50,7 @@ #include "options.h" #include +#include /*-------------------------------------------------------------------*/ /*! @@ -286,6 +287,8 @@ { drawMouseMeasure( painter ); } + + drawRecoveringState( painter ); } /*-------------------------------------------------------------------*/ @@ -492,6 +495,71 @@ */ void +FieldCanvas::drawRecoveringState( QPainter & painter ) +{ + const Options & opt = Options::instance(); + + if ( ! opt.bufferingMode() + || ! opt.bufferRecoverMode() + || M_disp_holder.currentIndex() == DispHolder::INVALID_INDEX ) + { + return; + } + + static const int divs = 16; + static const double angle_step = 360.0 / divs; + + static int s_current_index = 0; + + painter.save(); + + painter.translate( QPoint( this->width() / 2, + this->height() / 2 ) ); +#if 0 + size_t cur = M_disp_holder.currentIndex() == DispHolder::INVALID_INDEX + ? 0 + : M_disp_holder.currentIndex(); + int caching = M_disp_holder.dispCont().size() - cur - 1; + + painter.setPen( Qt::white ); + painter.setBrush( Qt::gray ); + QFont font = opt.scoreBoardFont(); + font.setPointSize( 18 ); + font.setBold( true ); + painter.setFont( font ); + painter.drawText( QRect( -10, -10, 20, 20 ), + Qt::AlignCenter | Qt::TextSingleLine, + QString::number( caching ) ); +#endif + painter.rotate( angle_step * s_current_index ); + + painter.setPen( Qt::NoPen ); + + const int x_size = std::max( 2, Options::WAITING_ANIMATION_SIZE/4 ); + const int y_size = std::max( 2, x_size/4 ); + const int x = std::max( 2, Options::WAITING_ANIMATION_SIZE/2 - x_size ); + + for ( int i = 0; i < divs; ++i ) + { + int c = std::max( 95, 255 - ( i * 32 ) ); + //int c = std::min( 191, i * 32 ); + painter.setBrush( QColor( c, c, c ) ); + painter.drawRoundedRect( x, 0, + x_size, y_size, + 4.0, 4.0 ); + painter.rotate( -angle_step ); + } + + painter.restore(); + + s_current_index = ( s_current_index + 1 ) % divs; +} + +/*-------------------------------------------------------------------*/ +/*! + +*/ +void FieldCanvas::dropBall() { emit dropBall( M_menu_mouse->pressedPoint() ); diff -Nru rcssmonitor-14.0.0/src/field_canvas.h rcssmonitor-14.1.0/src/field_canvas.h --- rcssmonitor-14.0.0/src/field_canvas.h 2009-11-12 03:07:34.000000000 +0000 +++ rcssmonitor-14.1.0/src/field_canvas.h 2009-12-01 10:00:22.000000000 +0000 @@ -114,6 +114,7 @@ void draw( QPainter & painter ); void drawMouseMeasure( QPainter & painter ); + void drawRecoveringState( QPainter & painter ); public slots: diff -Nru rcssmonitor-14.0.0/src/log_player.cpp rcssmonitor-14.1.0/src/log_player.cpp --- rcssmonitor-14.0.0/src/log_player.cpp 2009-11-17 11:35:49.000000000 +0000 +++ rcssmonitor-14.1.0/src/log_player.cpp 2010-03-30 09:42:51.000000000 +0100 @@ -54,13 +54,14 @@ M_timer( new QTimer( this ) ), M_forward( true ), M_live_mode( false ), - M_first_cache( false ), - M_need_caching( false ) + M_need_recovering( false ) { connect( M_timer, SIGNAL( timeout() ), this, SLOT( handleTimer() ) ); M_timer->setInterval( Options::instance().timerInterval() ); + + Options::instance().setBufferRecoverMode( true ); } /*-------------------------------------------------------------------*/ @@ -86,9 +87,10 @@ M_forward = true; M_live_mode = false; - M_first_cache = false; - M_need_caching = false; + M_need_recovering = false; M_timer->setInterval( Options::instance().timerInterval() ); + + Options::instance().setBufferRecoverMode( true ); } /*-------------------------------------------------------------------*/ @@ -98,26 +100,29 @@ void LogPlayer::handleTimer() { - if ( M_forward ) - { - stepForwardImpl(); - } - else + const Options & opt = Options::instance(); + + if ( ! opt.bufferingMode() + || ! opt.bufferRecoverMode() + || M_disp_holder.currentIndex() == DispHolder::INVALID_INDEX ) { - stepBackImpl(); + if ( M_forward ) + { + stepForwardImpl(); + } + else + { + stepBackImpl(); + } } adjustTimer(); -} -/*-------------------------------------------------------------------*/ -/*! - -*/ -bool -LogPlayer::isLiveMode() const -{ - return M_live_mode; + if ( opt.bufferingMode() + && opt.bufferRecoverMode() ) + { + emit recoverTimerHandled(); + } } /*-------------------------------------------------------------------*/ @@ -151,15 +156,19 @@ else { M_timer->stop(); + } - if ( M_disp_holder.playmode() == rcss::rcg::PM_TimeOver - && Options::instance().autoQuitMode() ) + if ( Options::instance().autoReconnectMode() ) + { + + } + else if ( Options::instance().autoQuitMode() ) + { + DispConstPtr disp = M_disp_holder.currentDisp(); + if ( disp + && disp->pmode_ == rcss::rcg::PM_TimeOver ) { - int wait_msec = ( Options::instance().autoQuitWait() > 0 - ? Options::instance().autoQuitWait() * 1000 - : 100 ); - QTimer::singleShot( wait_msec, - qApp, SLOT( quit() ) ); + emit quitRequested(); } } } @@ -463,19 +472,35 @@ void LogPlayer::showLive() { + if ( M_timer->isActive() ) + { + M_timer->stop(); + } + if ( Options::instance().bufferingMode() ) { if ( M_disp_holder.setIndexLast() ) { - M_timer->stop(); - emit updated(); } } else { + M_disp_holder.setIndexLast(); emit updated(); } + + if ( M_disp_holder.playmode() == rcss::rcg::PM_TimeOver ) + { + if ( Options::instance().autoReconnectMode() ) + { + + } + else if ( Options::instance().autoQuitMode() ) + { + emit quitRequested(); + } + } } /*-------------------------------------------------------------------*/ @@ -519,93 +544,84 @@ M_live_mode = false; const int buffer_size = M_disp_holder.dispCont().size(); - size_t current = M_disp_holder.currentIndex(); if ( buffer_size == 0 ) { + if ( M_timer->isActive() ) + { + M_timer->stop(); + } return; } - if ( current == DispHolder::INVALID_INDEX ) - { - current = 0; - } - const rcss::rcg::ServerParamT & SP = M_disp_holder.serverParam(); - const int cache_size = std::max( 1, opt.bufferSize() ); - const int current_cache = buffer_size - current - 1; - if ( ! M_first_cache ) + int interval = std::min( opt.timerInterval(), SP.simulator_step_ ); + + size_t current = M_disp_holder.currentIndex(); + if ( current == DispHolder::INVALID_INDEX ) { - if ( current_cache >= cache_size ) + Options::instance().setBufferRecoverMode( true ); + + if ( M_timer->interval() != interval + || ! M_timer->isActive() ) { - M_first_cache = true; + M_timer->start( interval ); } + + return; } - int interval = std::min( opt.timerInterval(), - SP.simulator_step_ ); + const int max_cache_size = std::max( 1, opt.bufferSize() ); + const int current_cache = buffer_size - current - 1; - if ( ! M_first_cache ) +// std::cerr << "index=" << current +// << " buffer_size=" << buffer_size +// << " max_cache_size=" << max_cache_size +// << " current_cache=" << current_cache +// << std::endl; + + if ( ! opt.monitorClientMode() + || M_disp_holder.playmode() == rcss::rcg::PM_TimeOver ) { - interval = opt.timerInterval() * 5; + Options::instance().setBufferRecoverMode( false ); } - else if ( current_cache >= cache_size ) + else if ( current_cache <= 1 ) { - M_need_caching = false; + Options::instance().setBufferRecoverMode( true ); } - else if ( M_need_caching ) + else if ( current_cache >= max_cache_size ) { - interval = std::max( opt.timerInterval() * 11 / 10, - SP.simulator_step_ * 11 / 10 ); + Options::instance().setBufferRecoverMode( false ); } - else if ( current_cache <= cache_size / 2 - && M_disp_holder.playmode() != rcss::rcg::PM_TimeOver ) + + if ( ! opt.monitorClientMode() + || M_disp_holder.playmode() == rcss::rcg::PM_TimeOver ) { - M_need_caching = true; - interval = std::max( opt.timerInterval() * 11 / 10, - SP.simulator_step_ * 11 / 10 ); + // default interval } - else if ( current_cache > cache_size / 2 ) + else if ( opt.bufferRecoverMode() ) { - interval = std::max( opt.timerInterval(), - SP.simulator_step_ ); + interval = std::max( opt.timerInterval(), SP.simulator_step_ ); } -#if 0 - else if ( cache_size > 1 - && current_cache < cache_size + else if ( current_cache >= max_cache_size ) + { + M_need_recovering = false; + } + else if ( M_need_recovering ) + { + interval = std::max( opt.timerInterval(), SP.simulator_step_ ) * 11 / 10; + } + else if ( current_cache <= max_cache_size / 2 && M_disp_holder.playmode() != rcss::rcg::PM_TimeOver ) { - if ( M_timer->interval() <= opt.timerInterval() - && current_cache > cache_size * 0.8 ) - { - // keep default interval - } - else - { - const int max_timer_interval = opt.timerInterval() * 3 / 2; - - if ( current_cache <= 1 ) - { - interval = max_timer_interval; - } - else - { - double rate - = 1.0 - - rint( static_cast< double >( current_cache ) / static_cast< double >( cache_size ) - / 0.2 ) * 0.2; - int interval_offset = max_timer_interval - opt.timerInterval(); - interval += static_cast< int >( rint( interval_offset * rate ) ); - interval = std::min( max_timer_interval, interval ); - std::cerr << "interval_offset=" << interval_offset - << " rate = " << rate - << " value=" << static_cast< int >( rint( interval_offset * rate ) ) - << std::endl; - } - } + M_need_recovering = true; + interval = std::max( opt.timerInterval(), SP.simulator_step_ ) * 11 / 10; + } + else if ( current_cache > max_cache_size / 2 ) + { + interval = std::max( opt.timerInterval(), SP.simulator_step_ ); } -#endif #if 0 if ( M_timer->interval() != interval ) diff -Nru rcssmonitor-14.0.0/src/log_player.h rcssmonitor-14.1.0/src/log_player.h --- rcssmonitor-14.0.0/src/log_player.h 2009-11-17 10:48:07.000000000 +0000 +++ rcssmonitor-14.1.0/src/log_player.h 2010-03-30 09:40:20.000000000 +0100 @@ -52,8 +52,7 @@ bool M_forward; bool M_live_mode; - bool M_first_cache; - bool M_need_caching; + bool M_need_recovering; // not used LogPlayer(); @@ -67,7 +66,7 @@ void clear(); - bool isLiveMode() const; + bool isLiveMode() const { return M_live_mode; } void startTimer(); @@ -114,6 +113,8 @@ signals: void updated(); + void recoverTimerHandled(); + void quitRequested(); }; diff -Nru rcssmonitor-14.0.0/src/main.cpp rcssmonitor-14.1.0/src/main.cpp --- rcssmonitor-14.0.0/src/main.cpp 2009-11-02 01:33:34.000000000 +0000 +++ rcssmonitor-14.1.0/src/main.cpp 2010-01-29 07:47:48.000000000 +0000 @@ -47,7 +47,7 @@ char ** argv ) { std::cout << PACKAGE"-"VERSION << "\n\n" - << "Copyright (C) 2009 RoboCup Soccer Simulator Maintenance Group.\n" + << "Copyright (C) 2009 - 2010 RoboCup Soccer Simulator Maintenance Group.\n" << std::endl; QApplication app( argc, argv ); diff -Nru rcssmonitor-14.0.0/src/main_window.cpp rcssmonitor-14.1.0/src/main_window.cpp --- rcssmonitor-14.0.0/src/main_window.cpp 2009-11-17 10:05:11.000000000 +0000 +++ rcssmonitor-14.1.0/src/main_window.cpp 2010-03-30 09:47:46.000000000 +0100 @@ -88,6 +88,12 @@ this, SIGNAL( viewUpdated() ) ); connect( M_log_player, SIGNAL( updated() ), this, SLOT( updateBufferingLabel() ) ); + connect( M_log_player, SIGNAL( recoverTimerHandled() ), + this, SLOT( updateBufferingLabel() ) ); + connect( M_log_player, SIGNAL( recoverTimerHandled() ), + this, SLOT( showRecoveringState() ) ); + connect( M_log_player, SIGNAL( quitRequested() ), + this, SLOT( setQuitTimer() ) ); this->resize( Options::instance().windowWidth() > 0 ? Options::instance().windowWidth() @@ -311,7 +317,7 @@ } M_red_card_act->setStatusTip( tr( "Call red card." ) ); connect( M_red_card_act, SIGNAL( triggered() ), - this, SLOT( yellowCard() ) ); + this, SLOT( redCard() ) ); this->addAction( M_red_card_act ); // playmode change @@ -1022,10 +1028,13 @@ { if ( std::strlen( hostname ) == 0 ) { - std::cerr << "Empty host name! Connection failed!" << std::endl; + std::cerr << "Empty host name. Connection failed." << std::endl; + this->statusBar()->showMessage( tr( "Empty host name." ), 5000 ); return; } + disconnectMonitor(); + std::cerr << "Connect to [" << hostname << "] ..." << std::endl; this->statusBar()->showMessage( tr( "Connect to %1 ..." ).arg( QString::fromAscii( hostname ) ), 5000 ); @@ -1059,21 +1068,24 @@ M_config_dialog->fitToScreen(); } - //Options::instance().setMonitorClientMode( true ); Options::instance().setServerHost( hostname ); + Options::instance().setMonitorClientMode( true ); + Options::instance().setBufferRecoverMode( true ); // M_save_image_act->setEnabled( false ); // M_open_output_act->setEnabled( true ); // M_set_live_mode_act->setEnabled( true ); -// M_connect_monitor_act->setEnabled( false ); -// M_connect_monitor_to_act->setEnabled( false ); -// M_disconnect_monitor_act->setEnabled( true ); + M_connect_monitor_act->setEnabled( false ); + M_connect_monitor_to_act->setEnabled( false ); + M_disconnect_monitor_act->setEnabled( true ); connect( M_monitor_client, SIGNAL( received() ), this, SLOT( receiveMonitorPacket() ) ); -// connect( M_monitor_client, SIGNAL( timeout() ), -// this, SLOT( disconnectMonitor() ) ); + connect( M_monitor_client, SIGNAL( disconnectRequested() ), + this, SLOT( disconnectMonitor() ) ); + connect( M_monitor_client, SIGNAL( reconnectRequested() ), + this, SLOT( reconnectMonitor() ) ); // M_log_player->setLiveMode(); @@ -1128,45 +1140,53 @@ void MainWindow::printShortcutKeys() { - QDialog dialog( this ); - QVBoxLayout * layout = new QVBoxLayout(); + static QDialog * dialog = static_cast< QDialog * >( 0 ); - QTableWidget * table_widget = new QTableWidget( &dialog ); - table_widget->insertColumn( 0 ); - table_widget->insertColumn( 1 ); - - QStringList header; - header.push_back( tr( "key" ) ); - header.push_back( tr( "action" ) ); - table_widget->setHorizontalHeaderLabels( header ); - - table_widget->horizontalHeader()->setStretchLastSection( true ); - table_widget->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents ); - table_widget->verticalHeader()->hide(); + if ( ! dialog ) + { + dialog = new QDialog( this ); + dialog->setWindowTitle( tr( "Shortcut Keys" ) ); - int row = 0; + QVBoxLayout * layout = new QVBoxLayout(); - Q_FOREACH( QAction * act, this->actions() ) - { - if ( ! act->shortcut().isEmpty() ) + QTableWidget * table_widget = new QTableWidget( dialog ); + table_widget->insertColumn( 0 ); + table_widget->insertColumn( 1 ); + + QStringList header; + header.push_back( tr( "key" ) ); + header.push_back( tr( "action" ) ); + table_widget->setHorizontalHeaderLabels( header ); + + table_widget->horizontalHeader()->setStretchLastSection( true ); + table_widget->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents ); + table_widget->verticalHeader()->hide(); + + int row = 0; + + Q_FOREACH( QAction * act, this->actions() ) { - table_widget->insertRow( row ); - table_widget->setItem ( row, 0, new QTableWidgetItem( act->shortcut().toString() ) ); - table_widget->setItem ( row, 1, new QTableWidgetItem( QString( act->statusTip() ).remove( QChar( '&' ) ) ) ); - ++row; + if ( ! act->shortcut().isEmpty() ) + { + table_widget->insertRow( row ); + table_widget->setItem ( row, 0, new QTableWidgetItem( act->shortcut().toString() ) ); + table_widget->setItem ( row, 1, new QTableWidgetItem( QString( act->statusTip() ).remove( QChar( '&' ) ) ) ); + ++row; + } } - } - table_widget->setSortingEnabled( true ); -// std::cout << "table row_count = " << table_widget->rowCount() -// << "table col_count = " << table_widget->columnCount() -// << std::endl; + table_widget->setSortingEnabled( true ); + // std::cout << "table row_count = " << table_widget->rowCount() + // << "table col_count = " << table_widget->columnCount() + // << std::endl; - layout->addWidget( table_widget ); - dialog.setLayout( layout ); - if ( row > 0 ) + layout->addWidget( table_widget ); + dialog->setLayout( layout ); + } + + if ( dialog ) { - dialog.exec(); + dialog->show(); } #if 0 @@ -1188,6 +1208,20 @@ */ void +MainWindow::setQuitTimer() +{ + int wait_msec = ( Options::instance().autoQuitWait() > 0 + ? Options::instance().autoQuitWait() * 1000 + : 100 ); + QTimer::singleShot( wait_msec, + qApp, SLOT( quit() ) ); +} + +/*-------------------------------------------------------------------*/ +/*! + + */ +void MainWindow::kickOff() { if ( M_monitor_client @@ -1248,22 +1282,33 @@ void MainWindow::disconnectMonitor() { - //std::cerr << "MainWindow::disconnectMonitor()" << std::endl; if ( M_monitor_client ) { M_monitor_client->disconnect(); disconnect( M_monitor_client, SIGNAL( received() ), this, SLOT( receiveMonitorPacket() ) ); - - disconnect( M_monitor_client, SIGNAL( timeout() ), + disconnect( M_monitor_client, SIGNAL( disconnectRequested() ), this, SLOT( disconnectMonitor() ) ); + disconnect( M_monitor_client, SIGNAL( reconnectRequested() ), + this, SLOT( reconnectMonitor() ) ); delete M_monitor_client; M_monitor_client = static_cast< MonitorClient * >( 0 ); + + // + // quit application if auto_quit_mode is on + // + if ( ! Options::instance().autoReconnectMode() + && ! Options::instance().bufferingMode() + && Options::instance().autoQuitMode() ) + { + setQuitTimer(); + } } - //Options::instance().setMonitorClientMode( false ); + Options::instance().setMonitorClientMode( false ); + Options::instance().setBufferRecoverMode( false ); // M_set_live_mode_act->setEnabled( false ); M_connect_monitor_act->setEnabled( true ); @@ -1276,6 +1321,27 @@ */ void +MainWindow::reconnectMonitor() +{ + //std::cerr << "MainWindow::reconnectMonitor()" << std::endl; + if ( M_monitor_client ) + { + disconnectMonitor(); + std::cerr << "Trying to reconnect ..." << std::endl; + QTimer::singleShot( 1 * 1000, + this, SLOT( connectMonitor() ) ); + } + else + { + connectMonitor(); + } +} + +/*-------------------------------------------------------------------*/ +/*! + + */ +void MainWindow::toggleMenuBar( bool checked ) { this->menuBar()->setVisible( checked ); @@ -1794,24 +1860,10 @@ if ( Options::instance().bufferingMode() ) { M_log_player->startTimer(); - - //updateBufferingLabel(); } else { M_log_player->showLive(); - - if ( M_disp_holder.playmode() == rcss::rcg::PM_TimeOver ) - { - if ( Options::instance().autoQuitMode() ) - { - int wait_msec = ( Options::instance().autoQuitWait() > 0 - ? Options::instance().autoQuitWait() * 1000 - : 100 ); - QTimer::singleShot( wait_msec, - qApp, SLOT( quit() ) ); - } - } } } @@ -1900,20 +1952,34 @@ { static int s_last_value = -1; - if ( this->statusBar()->isVisible() ) + if ( this->statusBar()->isVisible() + && M_buffering_label->isVisible() ) { - size_t cur = M_disp_holder.currentIndex() == DispHolder::INVALID_INDEX - ? 0 - : M_disp_holder.currentIndex(); + int current_index = M_disp_holder.currentIndex() == DispHolder::INVALID_INDEX + ? 0 + : M_disp_holder.currentIndex(); //M_buffering_label->setText( tr( "Buffering %1/%2" ) // .arg( cur ) // .arg( M_disp_holder.dispCont().size() ) ); - int caching = M_disp_holder.dispCont().size() - cur; - caching -= 1; - if ( s_last_value != caching ) + int current_cache = M_disp_holder.dispCont().size() - current_index; + current_cache = std::max( 0, current_cache - 1 ); + if ( s_last_value != current_cache ) { - M_buffering_label->setText( tr( "Buffering %1" ).arg( caching ) ); - s_last_value = caching; + M_buffering_label->setText( tr( "Buffering %1" ).arg( current_cache ) ); + s_last_value = current_cache; } } } + +/*-------------------------------------------------------------------*/ +/*! + + */ +void +MainWindow::showRecoveringState() +{ + M_field_canvas->update( M_field_canvas->width()/2 - Options::WAITING_ANIMATION_SIZE/2, + M_field_canvas->height()/2 - Options::WAITING_ANIMATION_SIZE/2, + Options::WAITING_ANIMATION_SIZE, + Options::WAITING_ANIMATION_SIZE ); +} diff -Nru rcssmonitor-14.0.0/src/main_window.h rcssmonitor-14.1.0/src/main_window.h --- rcssmonitor-14.0.0/src/main_window.h 2009-11-16 10:01:50.000000000 +0000 +++ rcssmonitor-14.1.0/src/main_window.h 2010-03-30 09:41:14.000000000 +0100 @@ -146,11 +146,14 @@ void about(); void printShortcutKeys(); + void setQuitTimer(); + // monitor menu action slots void kickOff(); void connectMonitor(); // connect to the host given by command lien or localhost void connectMonitorTo(); // open host input dialog void disconnectMonitor(); + void reconnectMonitor(); // view menu actions slots void toggleMenuBar( bool checked ); @@ -182,6 +185,8 @@ void updatePositionLabel( const QPoint & point ); void updateBufferingLabel(); + void showRecoveringState(); + signals: void viewUpdated(); diff -Nru rcssmonitor-14.0.0/src/monitor_client.cpp rcssmonitor-14.1.0/src/monitor_client.cpp --- rcssmonitor-14.0.0/src/monitor_client.cpp 2009-11-09 05:48:02.000000000 +0000 +++ rcssmonitor-14.1.0/src/monitor_client.cpp 2010-03-30 08:40:23.000000000 +0100 @@ -39,6 +39,7 @@ #include "monitor_client.h" #include "disp_holder.h" +#include "options.h" #include #include @@ -144,7 +145,6 @@ sendDispBye(); M_socket->close(); } - } /*-------------------------------------------------------------------*/ @@ -282,9 +282,36 @@ //std::cerr << "handleTimer waited = " << M_waited_msec << std::endl; - if ( M_waited_msec >= 5 * 1000 ) + if ( Options::instance().bufferingMode() ) + { + //std::cerr << "disp current index=" << M_disp_holder.currentIndex() << '\n' + // << " container size=" << M_disp_holder.dispCont().size() << std::endl; + DispConstPtr disp = M_disp_holder.currentDisp(); + if ( M_disp_holder.dispCont().empty() + || ( disp && disp->pmode_ == rcss::rcg::PM_TimeOver ) + || M_disp_holder.currentIndex() >= M_disp_holder.dispCont().size() - 2 ) + { + + } + else + { + //std::cerr << "now, playing buffered data" << std::endl; + M_waited_msec -= POLL_INTERVAL_MS; + } + } + + if ( Options::instance().autoReconnectMode() ) { - emit timeout(); + if ( M_waited_msec >= Options::instance().autoReconnectWait() * 1000 ) + { + //std::cerr << "MonitorClient::handleTimer() waited=" << M_waited_msec << "[ms]" + // << " emit reconnectRequested()" << std::endl; + emit reconnectRequested(); + } + } + else if ( M_waited_msec >= 5 * 1000 ) + { + emit disconnectRequested(); } } @@ -327,7 +354,7 @@ if ( M_timer ) { - M_timer->start( 1000 ); + M_timer->start( POLL_INTERVAL_MS ); } } diff -Nru rcssmonitor-14.0.0/src/monitor_client.h rcssmonitor-14.1.0/src/monitor_client.h --- rcssmonitor-14.0.0/src/monitor_client.h 2009-11-09 05:47:50.000000000 +0000 +++ rcssmonitor-14.1.0/src/monitor_client.h 2010-03-30 08:09:51.000000000 +0100 @@ -168,11 +168,11 @@ void handleReceive(); void handleTimer(); - signals: void received(); - void timeout(); + void disconnectRequested(); + void reconnectRequested(); }; diff -Nru rcssmonitor-14.0.0/src/options.cpp rcssmonitor-14.1.0/src/options.cpp --- rcssmonitor-14.0.0/src/options.cpp 2009-11-17 11:36:00.000000000 +0000 +++ rcssmonitor-14.1.0/src/options.cpp 2010-03-30 09:15:19.000000000 +0100 @@ -36,6 +36,7 @@ #include #include +#include #include #include "options.h" @@ -45,6 +46,7 @@ #endif #include +#include #include #include @@ -84,6 +86,9 @@ const double Options::ZOOM_RATIO = 1.5; const int Options::DEFAULT_TIMER_INTERVAL = 100; +//const int Options::WAITING_ANIMATION_SIZE = 64; +const int Options::WAITING_ANIMATION_SIZE = 96; + const QColor Options::FIELD_COLOR( 31, 160, 31 ); const QColor Options::LINE_COLOR( 255, 255, 255 ); const QColor Options::MEASURE_LINE_COLOR( 0, 255, 255 ); @@ -118,6 +123,29 @@ const QColor Options::FOUL_CHARGED_COLOR( 0, 127, 0 ); const QColor Options::POINTTO_COLOR( 255, 0, 191 ); + +namespace { + +inline +std::string +to_onoff( const bool val ) +{ + return val ? std::string( "on" ) : std::string( "off" ); +} + +inline +std::string +to_string( const double & val, + const double prec = 0.001 ) +{ + std::ostringstream os; + os << rint( val / prec ) * prec; + return os.str(); + //return boost::lexical_cast< std::string >( rint( val / prec ) * prec ); +} + +} + /*-------------------------------------------------------------------*/ /*! singleton interface @@ -134,114 +162,125 @@ */ Options::Options() - : M_connect( true ) - , M_server_host( "127.0.0.1" ) - , M_server_port( 6000 ) - , M_client_version( 4 ) - , M_buffering_mode( false ) - , M_buffer_size( 10 ) - , M_max_disp_buffer( 65535 ) - //, M_game_log_file( "" ) - //, M_output_file( "" ) - , M_auto_quit_mode( false ) - , M_auto_quit_wait( 5 ) - , M_timer_interval( DEFAULT_TIMER_INTERVAL ) - // window options - , M_window_x( -1 ) - , M_window_y( -1 ) - , M_window_width( -1 ) - , M_window_height( -1 ) - , M_maximize( false ) - , M_full_screen( false ) - , M_canvas_width( -1 ) - , M_canvas_height( -1 ) - , M_show_menu_bar( true ) - //, M_show_tool_bar( false ) - , M_show_status_bar( false ) - // view options - , M_anti_aliasing( true ) - , M_show_score_board( true ) - , M_show_keepaway_area( false ) - , M_show_team_graphic( true ) - , M_show_flag( false ) - , M_show_ball( true ) - , M_show_player( true ) - , M_show_player_number( true ) - , M_show_player_type( false ) - , M_show_view_area( false ) - , M_show_tackle_area( false ) - , M_show_stamina( false ) - , M_show_pointto( true ) - , M_show_card( true ) - , M_show_offside_line( false ) - , M_show_draw_info( true ) - , M_ball_size( 0.35 ) - , M_player_size( 0.0 ) - , M_grid_step( 0.0 ) - , M_show_grid_coord( false ) - , M_field_scale( 1.0 ) - , M_zoomed( false ) - , M_field_center( 0, 0 ) - , M_focus_type( FOCUS_POINT ) - , M_focus_point( 0.0, 0.0 ) - , M_selected_number( 0 ) - , M_player_select_type( UNSELECT ) - , M_ball_vel_cycle( 0 ) + : + // monitor client options + M_connect( true ), + M_server_host( "127.0.0.1" ), + M_server_port( 6000 ), + M_client_version( 4 ), + M_buffering_mode( false ), + M_buffer_size( 10 ), + M_max_disp_buffer( 65535 ), + M_auto_quit_mode( false ), + M_auto_quit_wait( 5 ), + M_auto_reconnect_mode( false ), + M_auto_reconnect_wait( 5 ), + M_timer_interval( DEFAULT_TIMER_INTERVAL ), + // window options + M_window_x( -1 ), + M_window_y( -1 ), + M_window_width( -1 ), + M_window_height( -1 ), + M_maximize( false ), + M_full_screen( false ), + M_canvas_width( -1 ), + M_canvas_height( -1 ), + M_show_menu_bar( true ), + // M_show_tool_bar( false ) + M_show_status_bar( false ), + // view options + M_anti_aliasing( true ), + M_show_score_board( true ), + M_show_keepaway_area( false ), + M_show_team_graphic( true ), + M_show_flag( false ), + M_show_ball( true ), + M_show_player( true ), + M_show_player_number( true ), + M_show_player_type( false ), + M_show_view_area( false ), + M_show_tackle_area( false ), + M_show_stamina( false ), + M_show_pointto( false ), + M_show_card( true ), + M_show_offside_line( false ), + M_show_draw_info( true ), + M_ball_size( 0.35 ), + M_player_size( 0.0 ), + M_grid_step( 0.0 ), + M_show_grid_coord( false ), + M_field_scale( 1.0 ), + M_zoomed( false ), + M_field_center( 0, 0 ), + M_focus_type( FOCUS_POINT ), + M_focus_point( 0.0, 0.0 ), + M_selected_number( 0 ), + M_player_select_type( UNSELECT ), + M_ball_vel_cycle( 0 ), + // + M_buffer_recover_mode( true ), // - , M_field_brush( FIELD_COLOR, Qt::SolidPattern ) - , M_line_pen( LINE_COLOR, 0, Qt::SolidLine ) - , M_measure_line_pen( MEASURE_LINE_COLOR, 0, Qt::SolidLine ) - , M_measure_mark_pen( MEASURE_MARK_COLOR, 0, Qt::SolidLine ) - , M_measure_font_pen( MEASURE_FONT_COLOR, 0, Qt::SolidLine ) - , M_measure_font_pen2( MEASURE_FONT_COLOR2, 0, Qt::SolidLine ) + M_field_brush( FIELD_COLOR, Qt::SolidPattern ), + M_line_pen( LINE_COLOR, 0, Qt::SolidLine ), + M_measure_line_pen( MEASURE_LINE_COLOR, 0, Qt::SolidLine ), + M_measure_mark_pen( MEASURE_MARK_COLOR, 0, Qt::SolidLine ), + M_measure_font_pen( MEASURE_FONT_COLOR, 0, Qt::SolidLine ), + M_measure_font_pen2( MEASURE_FONT_COLOR2, 0, Qt::SolidLine ), // - , M_score_board_pen( SCORE_BOARD_PEN_COLOR, 0, Qt::SolidLine ) - , M_score_board_brush( SCORE_BOARD_BRUSH_COLOR, Qt::SolidPattern ) + M_score_board_pen( SCORE_BOARD_PEN_COLOR, 0, Qt::SolidLine ), + M_score_board_brush( SCORE_BOARD_BRUSH_COLOR, Qt::SolidPattern ), // - , M_ball_pen( BALL_COLOR, 0, Qt::SolidLine ) - , M_ball_brush( BALL_COLOR, Qt::SolidPattern ) - , M_ball_vel_pen( BALL_VEL_COLOR, 0, Qt::SolidLine ) + M_ball_pen( BALL_COLOR, 0, Qt::SolidLine ), + M_ball_brush( BALL_COLOR, Qt::SolidPattern ), + M_ball_vel_pen( BALL_VEL_COLOR, 0, Qt::SolidLine ), // - , M_player_pen( PLAYER_PEN_COLOR, 0, Qt::SolidLine ) - , M_selected_player_pen( PLAYER_PEN_COLOR, 2, Qt::SolidLine ) - , M_left_team_pen( LEFT_TEAM_COLOR, 0, Qt::SolidLine ) - , M_left_team_brush( LEFT_TEAM_COLOR, Qt::SolidPattern ) - , M_left_goalie_pen( LEFT_GOALIE_COLOR, 0, Qt::SolidLine ) - , M_left_goalie_stretch_pen( LEFT_GOALIE_COLOR.darker( 200 ), 0, Qt::DotLine ) - , M_left_goalie_brush( LEFT_GOALIE_COLOR, Qt::SolidPattern ) - , M_right_team_pen( RIGHT_TEAM_COLOR, 0, Qt::SolidLine ) - , M_right_team_brush( RIGHT_TEAM_COLOR, Qt::SolidPattern ) - , M_right_goalie_pen( RIGHT_GOALIE_COLOR, 0, Qt::SolidLine ) - , M_right_goalie_stretch_pen( RIGHT_GOALIE_COLOR.darker( 200 ), 0, Qt::DotLine ) - , M_right_goalie_brush( RIGHT_GOALIE_COLOR, Qt::SolidPattern ) - , M_player_number_pen( PLAYER_NUMBER_COLOR, 0, Qt::SolidLine ) - , M_player_number_inner_pen( PLAYER_NUMBER_INNER_COLOR, 0, Qt::SolidLine ) - , M_neck_pen( NECK_COLOR, 0, Qt::SolidLine ) - , M_view_area_pen( VIEW_AREA_COLOR, 0, Qt::SolidLine ) - , M_large_view_area_pen( LARGE_VIEW_AREA_COLOR, 0, Qt::SolidLine ) - , M_ball_collide_brush( BALL_COLLIDE_COLOR, Qt::SolidPattern ) - , M_player_collide_brush( PLAYER_COLLIDE_COLOR, Qt::SolidPattern ) - , M_effort_decayed_pen( EFFORT_DECAYED_COLOR, 0, Qt::SolidLine ) - , M_recovery_decayed_pen( RECOVERY_DECAYED_COLOR, 0, Qt::SolidLine ) - , M_kick_pen( KICK_COLOR, 2, Qt::SolidLine ) - , M_kick_fault_brush( KICK_FAULT_COLOR, Qt::SolidPattern ) - , M_kick_accel_pen( KICK_ACCEL_COLOR, 0, Qt::SolidLine ) - , M_catch_brush( CATCH_COLOR, Qt::SolidPattern ) - , M_catch_fault_brush( CATCH_FAULT_COLOR, Qt::SolidPattern ) - , M_tackle_pen( TACKLE_COLOR, 2, Qt::SolidLine ) - , M_tackle_brush( TACKLE_COLOR, Qt::SolidPattern ) - , M_tackle_fault_brush( TACKLE_FAULT_COLOR, Qt::SolidPattern ) - , M_foul_charged_brush( FOUL_CHARGED_COLOR, Qt::SolidPattern ) - , M_pointto_pen( POINTTO_COLOR, 0, Qt::SolidLine ) + M_player_pen( PLAYER_PEN_COLOR, 0, Qt::SolidLine ), + M_selected_player_pen( PLAYER_PEN_COLOR, 2, Qt::SolidLine ), + M_left_team_pen( LEFT_TEAM_COLOR, 0, Qt::SolidLine ), + M_left_team_brush( LEFT_TEAM_COLOR, Qt::SolidPattern ), + M_left_goalie_pen( LEFT_GOALIE_COLOR, 0, Qt::SolidLine ), + M_left_goalie_stretch_pen( LEFT_GOALIE_COLOR.darker( 200 ), 0, Qt::DotLine ), + M_left_goalie_brush( LEFT_GOALIE_COLOR, Qt::SolidPattern ), + M_right_team_pen( RIGHT_TEAM_COLOR, 0, Qt::SolidLine ), + M_right_team_brush( RIGHT_TEAM_COLOR, Qt::SolidPattern ), + M_right_goalie_pen( RIGHT_GOALIE_COLOR, 0, Qt::SolidLine ), + M_right_goalie_stretch_pen( RIGHT_GOALIE_COLOR.darker( 200 ), 0, Qt::DotLine ), + M_right_goalie_brush( RIGHT_GOALIE_COLOR, Qt::SolidPattern ), + M_player_number_pen( PLAYER_NUMBER_COLOR, 0, Qt::SolidLine ), + M_player_number_inner_pen( PLAYER_NUMBER_INNER_COLOR, 0, Qt::SolidLine ), + M_neck_pen( NECK_COLOR, 0, Qt::SolidLine ), + M_view_area_pen( VIEW_AREA_COLOR, 0, Qt::SolidLine ), + M_large_view_area_pen( LARGE_VIEW_AREA_COLOR, 0, Qt::SolidLine ), + M_ball_collide_brush( BALL_COLLIDE_COLOR, Qt::SolidPattern ), + M_player_collide_brush( PLAYER_COLLIDE_COLOR, Qt::SolidPattern ), + M_effort_decayed_pen( EFFORT_DECAYED_COLOR, 0, Qt::SolidLine ), + M_recovery_decayed_pen( RECOVERY_DECAYED_COLOR, 0, Qt::SolidLine ), + M_kick_pen( KICK_COLOR, 2, Qt::SolidLine ), + M_kick_fault_brush( KICK_FAULT_COLOR, Qt::SolidPattern ), + M_kick_accel_pen( KICK_ACCEL_COLOR, 0, Qt::SolidLine ), + M_catch_brush( CATCH_COLOR, Qt::SolidPattern ), + M_catch_fault_brush( CATCH_FAULT_COLOR, Qt::SolidPattern ), + M_tackle_pen( TACKLE_COLOR, 2, Qt::SolidLine ), + M_tackle_brush( TACKLE_COLOR, Qt::SolidPattern ), + M_tackle_fault_brush( TACKLE_FAULT_COLOR, Qt::SolidPattern ), + M_foul_charged_brush( FOUL_CHARGED_COLOR, Qt::SolidPattern ), + M_pointto_pen( POINTTO_COLOR, 0, Qt::SolidLine ), // - , M_score_board_font( "Sans Serif", 16, QFont::Bold ) - , M_player_font( "Sans Serif", 9, QFont::Bold ) - , M_measure_font( "Sans Serif", 9 ) + M_score_board_font( "Sans Serif", 16, QFont::Bold ), + M_player_font( "Sans Serif", 9, QFont::Bold ), + M_measure_font( "Sans Serif", 9 ) { //M_player_font.setStyleHint( QFont::System, QFont::PreferBitmap ); //M_player_font.setFixedPitch( true ); - readSettings(); + if ( ! QFile::exists( Options::CONF_FILE ) ) + { + writeSettings( true ); + } + else + { + readSettings(); + } } /*-------------------------------------------------------------------*/ @@ -250,7 +289,7 @@ */ Options::~Options() { - writeSettings(); + writeSettings( false ); } /*-------------------------------------------------------------------*/ @@ -309,13 +348,13 @@ val = settings.value( "connect" ); if ( val.isValid() ) M_connect = val.toBool(); - val = settings.value( "server-host" ); + val = settings.value( "server_host" ); if ( val.isValid() ) M_server_host = val.toString().toStdString(); - val = settings.value( "server-port" ); + val = settings.value( "server_port" ); if ( val.isValid() ) M_server_port = val.toInt(); - val = settings.value( "client-version" ); + val = settings.value( "client_version" ); if ( val.isValid() ) M_client_version = val.toInt(); val = settings.value( "buffering_mode" ); @@ -333,6 +372,12 @@ val = settings.value( "auto_quit_wait" ); if ( val.isValid() ) M_auto_quit_wait = val.toInt(); + val = settings.value( "auto_reconnect_mode" ); + if ( val.isValid() ) M_auto_reconnect_mode = val.toBool(); + + val = settings.value( "auto_reconnect_wait" ); + if ( val.isValid() ) M_auto_reconnect_wait = val.toInt(); + val = settings.value( "timer_interval" ); if ( val.isValid() ) M_timer_interval = val.toInt(); @@ -587,43 +632,47 @@ */ void -Options::writeSettings() +Options::writeSettings( bool all ) { QSettings settings( Options::CONF_FILE, QSettings::IniFormat ); - // - // main window - // - settings.beginGroup( "MainWindow" ); -// settings.setValue( "window_width", M_window_width ); -// settings.setValue( "window_height", M_window_height ); -// settings.setValue( "window_x", M_window_x ); -// settings.setValue( "window_y", M_window_y ); -// settings.setValue( "canvas_width", M_canvas_width ); -// settings.setValue( "canvas_height", M_canvas_height ); -// settings.setValue( "maximize", M_maximize ); -// settings.setValue( "full_screen", M_full_screen ); -// settings.setValue( "show_menu_bar", M_show_menu_bar ); -// settings.setValue( "show_tool_bar", M_show_tool_bar ); -// settings.setValue( "show_status_bar", M_show_status_bar ); - settings.endGroup(); - - // - // monitor - // - settings.beginGroup( "Monitor" ); - settings.setValue( "connect", M_connect ); - settings.setValue( "server-host", QString::fromStdString( M_server_host ) ); - settings.setValue( "server-port", M_server_port ); - settings.setValue( "client-version", M_client_version ); - settings.setValue( "buffering_mode", M_buffering_mode ); - settings.setValue( "buffer_size", M_buffer_size ); - settings.setValue( "max_disp_buffer", M_max_disp_buffer ); - settings.setValue( "auto_quit_mode", M_auto_quit_mode ); - settings.setValue( "auto_quit_wait", M_auto_quit_wait ); - settings.setValue( "timer_interval", M_timer_interval ); - settings.endGroup(); + if ( all ) + { + // + // main window + // + settings.beginGroup( "MainWindow" ); + settings.setValue( "window_width", M_window_width ); + settings.setValue( "window_height", M_window_height ); + settings.setValue( "window_x", M_window_x ); + settings.setValue( "window_y", M_window_y ); + // settings.setValue( "canvas_width", M_canvas_width ); + // settings.setValue( "canvas_height", M_canvas_height ); + settings.setValue( "maximize", M_maximize ); + settings.setValue( "full_screen", M_full_screen ); + settings.setValue( "show_menu_bar", M_show_menu_bar ); + // settings.setValue( "show_tool_bar", M_show_tool_bar ); + settings.setValue( "show_status_bar", M_show_status_bar ); + settings.endGroup(); + + // + // monitor + // + settings.beginGroup( "Monitor" ); + settings.setValue( "connect", M_connect ); + settings.setValue( "server_host", QString::fromStdString( M_server_host ) ); + settings.setValue( "server_port", M_server_port ); + settings.setValue( "client_version", M_client_version ); + settings.setValue( "buffering_mode", M_buffering_mode ); + settings.setValue( "buffer_size", M_buffer_size ); + settings.setValue( "max_disp_buffer", M_max_disp_buffer ); + settings.setValue( "auto_quit_mode", M_auto_quit_mode ); + settings.setValue( "auto_quit_wait", M_auto_quit_wait ); + settings.setValue( "auto_reconnect_wait", M_auto_reconnect_wait ); + settings.setValue( "timer_interval", M_timer_interval ); + settings.endGroup(); + } // // field @@ -738,16 +787,16 @@ po::bool_switch( &M_connect )->default_value( M_connect ), "connect to the soccer server." ) ( "server-host", - po::value< std::string >( &M_server_host )->default_value( "127.0.0.1", "127.0.0.1" ), + po::value< std::string >( &M_server_host )->default_value( M_server_host ), "set host name or ip address where the soccer server is running." ) ( "server-port", - po::value< int >( &M_server_port )->default_value( 6000, "6000" ), + po::value< int >( &M_server_port )->default_value( M_server_port ), "set port number to connect as the monitor client." ) ( "client-version", - po::value< int >( &M_client_version )->default_value( 4, "4" ), + po::value< int >( &M_client_version )->default_value( M_client_version ), "set a monitor client protocol version." ) ( "buffering-mode", - po::value< bool >( &M_buffering_mode )->default_value( false, "off" ), + po::value< bool >( &M_buffering_mode )->default_value( M_buffering_mode, to_onoff( M_buffering_mode ) ), "enable buffering mode." ) ( "buffer-size", po::value< int >( &M_buffer_size )->default_value( M_buffer_size ), @@ -756,14 +805,20 @@ // po::value< int >( &M_max_disp_buffer )->default_value( 65535, "65535" ), // "set max size of display data buffer." ) ( "timer-interval", - po::value< int >( &M_timer_interval )->default_value( DEFAULT_TIMER_INTERVAL ), + po::value< int >( &M_timer_interval )->default_value( M_timer_interval ), "set the desired timer interval [ms] for buffering mode." ) ( "auto-quit-mode", - po::value< bool >( &M_auto_quit_mode )->default_value( false, "off" ), + po::value< bool >( &M_auto_quit_mode )->default_value( M_auto_quit_mode, to_onoff( M_auto_quit_mode ) ), "enable automatic quit mode." ) ( "auto-quit-wait", - po::value< int >( &M_auto_quit_wait )->default_value( 5, "5" ), - "set a wait period for the automatic quit mode." ) + po::value< int >( &M_auto_quit_wait )->default_value( M_auto_quit_wait ), + "set an wait period for the automatic quit mode." ) + ( "auto-reconnect-mode", + po::value< bool >( &M_auto_reconnect_mode )->default_value( M_auto_reconnect_mode, to_onoff( M_auto_reconnect_mode ) ), + "enable automatic reconnect mode." ) + ( "auto-reconnect-wait", + po::value< int >( &M_auto_reconnect_wait )->default_value( M_auto_reconnect_wait ), + "set an wait period for the automatic reconnect mode." ) // window options ( "geometry", po::value< std::string >( &geometry )->default_value( "" ), @@ -775,83 +830,83 @@ po::bool_switch( &M_full_screen )->default_value( M_full_screen ), "start with a full screen window." ) ( "show-menu-bar", - po::value< bool >( &M_show_menu_bar )->default_value( true, "on" ), + po::value< bool >( &M_show_menu_bar )->default_value( M_show_menu_bar, to_onoff( M_show_menu_bar ) ), "show menu bar." ) // ( "show-tool-bar", // po::value< bool >( &M_show_tool_bar )->default_value( M_show_tool_bar ), // "start without a tool bar." ) ( "show-status-bar", - po::value< bool >( &M_show_status_bar )->default_value( false, "off" ), + po::value< bool >( &M_show_status_bar )->default_value( M_show_status_bar, to_onoff( M_show_status_bar ) ), "show status bar." ) // view options ( "anti-aliasing", - po::value< bool >( &M_anti_aliasing )->default_value( true, "on" ), + po::value< bool >( &M_anti_aliasing )->default_value( M_anti_aliasing, to_onoff( M_anti_aliasing ) ), "show anti-aliased objects." ) ( "show-score-board", - po::value< bool >( &M_show_score_board )->default_value( true, "on" ), + po::value< bool >( &M_show_score_board )->default_value( M_show_score_board, to_onoff( M_show_score_board ) ), "show score board." ) ( "show-keepaway-area", - po::value< bool >( &M_show_keepaway_area )->default_value( false, "off" ), + po::value< bool >( &M_show_keepaway_area )->default_value( M_show_keepaway_area, to_onoff( M_show_keepaway_area ) ), "show keepaway area." ) ( "show-team-graphic", - po::value< bool >( &M_show_team_graphic )->default_value( true, "on" ), + po::value< bool >( &M_show_team_graphic )->default_value( M_show_team_graphic, to_onoff( M_show_team_graphic ) ), "show team graphic." ) ( "show-draw-info", - po::value< bool >( &M_show_draw_info )->default_value( true, "on" ), + po::value< bool >( &M_show_draw_info )->default_value( M_show_draw_info, to_onoff( M_show_draw_info ) ), "show draw information." ) ( "show-ball", - po::value< bool >( &M_show_ball )->default_value( true, "on" ), + po::value< bool >( &M_show_ball )->default_value( M_show_ball, to_onoff( M_show_ball ) ), "show ball." ) ( "show-player", - po::value< bool >( &M_show_player )->default_value( true, "on" ), + po::value< bool >( &M_show_player )->default_value( M_show_player, to_onoff( M_show_player ) ), "show players." ) ( "show-player-number", - po::value< bool >( &M_show_player_number )->default_value( true, "on" ), + po::value< bool >( &M_show_player_number )->default_value( M_show_player_number, to_onoff( M_show_player_number ) ), "show player\'s uniform number." ) ( "show-player-type", - po::value< bool >( &M_show_player_type )->default_value( false, "off" ), + po::value< bool >( &M_show_player_type )->default_value( M_show_player_type, to_onoff( M_show_player_type ) ), "show player\'s heterogeneous type ID." ) ( "show-view-area", - po::value< bool >( &M_show_view_area )->default_value( false, "off" ), + po::value< bool >( &M_show_view_area )->default_value( M_show_view_area, to_onoff( M_show_view_area ) ), "show player\'s view area." ) ( "show-catch-area", - po::value< bool >( &M_show_catch_area )->default_value( false, "off" ), + po::value< bool >( &M_show_catch_area )->default_value( M_show_catch_area, to_onoff( M_show_catch_area ) ), "show player\'s catch area." ) ( "show-tackle-area", - po::value< bool >( &M_show_tackle_area )->default_value( false, "off" ), + po::value< bool >( &M_show_tackle_area )->default_value( M_show_tackle_area, to_onoff( M_show_tackle_area ) ), "show player\'s tackle area." ) ( "show-kick-accel-area", - po::value< bool >( &M_show_kick_accel_area )->default_value( false, "off" ), + po::value< bool >( &M_show_kick_accel_area )->default_value( M_show_kick_accel_area, to_onoff( M_show_kick_accel_area ) ), "show player\'s kick acceleration area." ) ( "show-stamina", - po::value< bool >( &M_show_stamina )->default_value( false, "off" ), + po::value< bool >( &M_show_stamina )->default_value( M_show_stamina, to_onoff( M_show_stamina ) ), "show player\'s stamina." ) ( "show-stamina-capacity", - po::value< bool >( &M_show_stamina_capacity )->default_value( false, "off" ), + po::value< bool >( &M_show_stamina_capacity )->default_value( M_show_stamina_capacity, to_onoff( M_show_stamina_capacity ) ), "show player\'s stamina capacity." ) ( "show-pointto", - po::value< bool >( &M_show_pointto )->default_value( false, "off" ), + po::value< bool >( &M_show_pointto )->default_value( M_show_pointto, to_onoff( M_show_pointto ) ), "show player\'s pointto status." ) ( "show-card", - po::value< bool >( &M_show_card )->default_value( true, "on" ), + po::value< bool >( &M_show_card )->default_value( M_show_card, to_onoff( M_show_card ) ), "show player\'s yellow/red cards." ) ( "ball-size", - po::value< double >( &M_ball_size )->default_value( 0.35, "0.35" ), + po::value< double >( &M_ball_size )->default_value( M_ball_size, to_string( M_ball_size ) ), "set a ball radius." ) ( "player-size", - po::value< double >( &M_player_size )->default_value( 0.0, "0.0" ), + po::value< double >( &M_player_size )->default_value( M_player_size, to_string( M_player_size ) ), "set a fixed player radius." ) ( "show-grid-coord", - po::value< bool >( &M_show_grid_coord )->default_value( false, "off" ), + po::value< bool >( &M_show_grid_coord )->default_value( M_show_grid_coord, to_onoff( M_show_grid_coord ) ), "show coordinates value of grid lines." ) ( "grid-step", - po::value< double >( &M_grid_step )->default_value( 0.0, "0.0" ), + po::value< double >( &M_grid_step )->default_value( M_grid_step, to_string( M_grid_step ) ), "set a grid step size." ) ( "show-flag", - po::value< bool >( &M_show_flag )->default_value( false, "off" ), + po::value< bool >( &M_show_flag )->default_value( M_show_flag, to_onoff( M_show_flag) ), "show landmark flags." ) ( "show-offside-line", - po::value< bool >( &M_show_offside_line )->default_value( false, "off" ), + po::value< bool >( &M_show_offside_line )->default_value( M_show_offside_line, to_onoff( M_show_offside_line ) ), "show offside lines." ) ; diff -Nru rcssmonitor-14.0.0/src/options.h rcssmonitor-14.1.0/src/options.h --- rcssmonitor-14.0.0/src/options.h 2009-11-17 11:34:38.000000000 +0000 +++ rcssmonitor-14.1.0/src/options.h 2010-03-30 09:15:30.000000000 +0100 @@ -94,9 +94,12 @@ static const double MAX_FIELD_SCALE; //! zoom rate factor static const double ZOOM_RATIO; + //! default logplayer timer step (ms). static const int DEFAULT_TIMER_INTERVAL; + static const int WAITING_ANIMATION_SIZE; + static const QColor FIELD_COLOR; static const QColor LINE_COLOR; static const QColor MEASURE_LINE_COLOR; @@ -151,6 +154,8 @@ //std::string M_output_file; bool M_auto_quit_mode; int M_auto_quit_wait; + bool M_auto_reconnect_mode; + int M_auto_reconnect_wait; int M_timer_interval; //!< logplayer timer interval // @@ -220,6 +225,11 @@ // inertia movement int M_ball_vel_cycle; //!< specify the cycle to draw ball future point + // + // monitor state + // + bool M_monitor_client_mode; + bool M_buffer_recover_mode; // // painter resources @@ -288,7 +298,7 @@ Options & operator=( const Options & ); void readSettings(); - void writeSettings(); + void writeSettings( bool all ); public: ~Options(); @@ -324,6 +334,9 @@ bool autoQuitMode() const { return M_auto_quit_mode; } int autoQuitWait() const { return M_auto_quit_wait; } + bool autoReconnectMode() const { return M_auto_reconnect_mode; } + int autoReconnectWait() const { return M_auto_reconnect_wait; } + int timerInterval() const { return M_timer_interval; } // @@ -510,6 +523,18 @@ if ( 0 <= cycle && cycle <= 100 ) M_ball_vel_cycle = cycle; } + // + // + // + bool monitorClientMode() const { return M_monitor_client_mode; } + void setMonitorClientMode( const bool on ) { M_monitor_client_mode = on; } + + bool bufferRecoverMode() const { return M_buffer_recover_mode; } + void setBufferRecoverMode( const bool on ) { M_buffer_recover_mode = on; } + + // + // + // const QBrush & fieldBrush() const { return M_field_brush; } void setFieldColor( const QColor & col ) { M_field_brush.setColor( col ); } diff -Nru rcssmonitor-14.0.0/src/player_type_dialog.cpp rcssmonitor-14.1.0/src/player_type_dialog.cpp --- rcssmonitor-14.0.0/src/player_type_dialog.cpp 2009-11-13 07:21:06.000000000 +0000 +++ rcssmonitor-14.1.0/src/player_type_dialog.cpp 2009-12-03 08:18:20.000000000 +0000 @@ -128,7 +128,7 @@ M_item_view->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents ); QFont font = M_item_view->font(); - font.setPointSize( 8 ); + font.setPointSize( 9 ); M_item_view->setFont( font ); diff -Nru rcssmonitor-14.0.0/src/src.pro rcssmonitor-14.1.0/src/src.pro --- rcssmonitor-14.0.0/src/src.pro 2009-11-17 02:35:51.000000000 +0000 +++ rcssmonitor-14.1.0/src/src.pro 2010-03-30 10:01:31.000000000 +0100 @@ -48,7 +48,7 @@ } DEFINES += PACKAGE="\\\"rcssmonitor\\\"" DEFINES += PACKAGE_NAME="\\\"rcssmonitor\\\"" -DEFINES += VERSION="\\\"14.0.0\\\"" +DEFINES += VERSION="\\\"14.1.0\\\"" CONFIG += qt warn_on release win32 {