pax_global_header 0000666 0000000 0000000 00000000064 12301400275 0014504 g ustar 00root root 0000000 0000000 52 comment=20ab8ffe20689179a0d30f0b3ccd404f9b74ed03
icecc-monitor-2.9.90~git20140222/ 0000775 0000000 0000000 00000000000 12301400275 0016057 5 ustar 00root root 0000000 0000000 icecc-monitor-2.9.90~git20140222/.gitignore 0000664 0000000 0000000 00000001702 12301400275 0020047 0 ustar 00root root 0000000 0000000 # This file is used to ignore files which are generated
# ----------------------------------------------------------------------------
*~
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.pro.user*
# xemacs temporary files
# ---------------------
*.flc
# Vim temporary files
# ---------------------
.*.swp
# KDevelop
# ---------------------
*.kdev4
.kdev4/
# Visual Studio generated files
# ---------------------
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
# MinGW generated files
# ---------------------
*.Debug
*.Release
# Directories to ignore
# ---------------------
debug
lib/*
lib64/*
release
doc/html/*
doc/html-dev/*
doc/api/html/*
doc/pluginhowto/html/*
.rcc
.pch
# Binaries
# --------
*.dll
*.exe
icemon
# From Git merge
# --------------
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
icecc-monitor-2.9.90~git20140222/CMakeLists.txt 0000664 0000000 0000000 00000003133 12301400275 0020617 0 ustar 00root root 0000000 0000000 project(icemon)
cmake_minimum_required(VERSION 2.8.5)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
include(GNUInstallDirs)
include(KDE4Macros-Icecream)
# version info
set(ICEMON_VERSION_MAJOR "2")
set(ICEMON_VERSION_MINOR "9")
set(ICEMON_VERSION_PATCH "90")
set(ICEMON_VERSION "${ICEMON_VERSION_MAJOR}.${ICEMON_VERSION_MINOR}.${ICEMON_VERSION_PATCH}")
set(ICEMON_VERSION_STRING "${ICEMON_VERSION}")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
find_package(Git)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE _git_revision
)
string(REGEX REPLACE "\n" "" _git_revision "${_git_revision}")
set(ICEMON_VERSION_STRING "${ICEMON_VERSION_STRING} (revision: ${_git_revision})")
endif()
endif()
find_package(Qt4 REQUIRED)
find_package(Icecream REQUIRED)
find_program(DOCBOOK2X
NAMES docbook2x-man docbook-to-man docbook2man.pl
)
add_definitions(
${QT_DEFINITIONS}
)
include_directories(
${LIBICECREAM_INCLUDE_DIR}
${QT_INCLUDES}
${CMAKE_CURRENT_BINARY_DIR} # config-icemon.h
)
set(
INSTALL_TARGETS_DEFAULT_ARGS
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Devel
)
set(XDG_APPS_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/applications)
set(ICON_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/icons)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config-icemon.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config-icemon.h
)
add_subdirectory(src)
add_subdirectory(doc)
icecc-monitor-2.9.90~git20140222/COPYING 0000664 0000000 0000000 00000043133 12301400275 0017116 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
icecc-monitor-2.9.90~git20140222/README.md 0000664 0000000 0000000 00000001053 12301400275 0017335 0 ustar 00root root 0000000 0000000 Icemon
======
Introduction
------------
Icemon is an Icecream GUI monitor.
Installation
------------
To compile icemon, install, the icecc development package, e.g. for Debian/Ubuntu:
$ apt-get install libicecc-dev
Finally, make sure you have g++, Qt and cmake installed
$ apt-get install build-essential libqt4-dev cmake
Finally, compile and install the application:
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
$ make
$ make install
Have a lot of fun ;)
icecc-monitor-2.9.90~git20140222/cmake/ 0000775 0000000 0000000 00000000000 12301400275 0017137 5 ustar 00root root 0000000 0000000 icecc-monitor-2.9.90~git20140222/cmake/modules/ 0000775 0000000 0000000 00000000000 12301400275 0020607 5 ustar 00root root 0000000 0000000 icecc-monitor-2.9.90~git20140222/cmake/modules/COPYING-CMAKE-SCRIPTS 0000664 0000000 0000000 00000002457 12301400275 0023615 0 ustar 00root root 0000000 0000000 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
icecc-monitor-2.9.90~git20140222/cmake/modules/FindIcecream.cmake 0000664 0000000 0000000 00000003565 12301400275 0024133 0 ustar 00root root 0000000 0000000 # - Try to find the icecream library
# Once done this defines
#
# LIBICECREAM_FOUND - system has libicecream
# LIBICECREAM_INCLUDE_DIR - the libicecream include directory
# LIBICECREAM_LIBRARIES - Link these to use libicecream
# LIBICECREAM_VERSION - the libicecream version, if available
if (LIBICECREAM_INCLUDE_DIR AND LIBICECREAM_LIBRARIES)
# in cache already
set(LIBICECREAM_FOUND TRUE)
else (LIBICECREAM_INCLUDE_DIR AND LIBICECREAM_LIBRARIES)
set( LIBICECREAM_LIB_EXTRA )
if(NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PC_ICECC icecc)
# The icecream lib may optionally need linking to -lcap-ng, so dig it out
# of pkg-config data.
# Somewhat hackish, but I can't find a simpler way to do this with CMake.
foreach(lib ${PC_ICECC_STATIC_LIBRARIES})
if(NOT ${lib} STREQUAL "icecc")
list(APPEND LIBICECREAM_LIB_EXTRA "-l${lib}")
endif(NOT ${lib} STREQUAL "icecc")
endforeach(lib ${PC_ICECC_STATIC_LIBRARIES})
set(LIBICECREAM_VERSION "${PC_ICECC_VERSION}")
endif(NOT WIN32)
find_path(LIBICECREAM_INCLUDE_DIR icecc/comm.h
HINTS
${PC_ICECC_INCLUDEDIR}
${PC_ICECC_INCLUDE_DIRS}
/opt/icecream/include
)
find_library(LIBICECREAM_LIBRARY NAMES icecc
HINTS
${PC_ICECC_LIBDIR}
${PC_ICECC_LIBRARY_DIRS}
/opt/icecream/lib
)
set( LIBICECREAM_LIBRARIES ${LIBICECREAM_LIBRARY} ${LIBICECREAM_LIB_EXTRA} CACHE INTERNAL "The libraries for libicecream" )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Icecream
REQUIRED_VARS LIBICECREAM_LIBRARIES LIBICECREAM_INCLUDE_DIR
VERSION_VAR LIBICECREAM_VERSION
)
mark_as_advanced(
LIBICECREAM_INCLUDE_DIR LIBICECREAM_LIBRARIES
)
endif (LIBICECREAM_INCLUDE_DIR AND LIBICECREAM_LIBRARIES)
icecc-monitor-2.9.90~git20140222/cmake/modules/KDE4Macros-Icecream.cmake 0000664 0000000 0000000 00000012665 12301400275 0025165 0 ustar 00root root 0000000 0000000 # for documentation look at FindKDE4Internal.cmake
# this file contains the following macros (or functions):
# KDE4_UPDATE_ICONCACHE
# KDE4_INSTALL_ICONS
# Copyright (c) 2006-2009 Alexander Neundorf,
# Copyright (c) 2006, 2007, Laurent Montel,
# Copyright (c) 2007 Matthias Kretz
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
macro (KDE4_UPDATE_ICONCACHE)
# Update mtime of hicolor icon theme dir.
# We don't always have touch command (e.g. on Windows), so instead create
# and delete a temporary file in the theme dir.
install(CODE "
set(DESTDIR_VALUE \"\$ENV{DESTDIR}\")
if (NOT DESTDIR_VALUE)
file(WRITE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\" \"update\")
file(REMOVE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\")
endif (NOT DESTDIR_VALUE)
")
endmacro (KDE4_UPDATE_ICONCACHE)
# a "map" of short type names to the directories
# unknown names should give empty results
# KDE 3 compatibility
set(_KDE4_ICON_GROUP_mime "mimetypes")
set(_KDE4_ICON_GROUP_filesys "places")
set(_KDE4_ICON_GROUP_device "devices")
set(_KDE4_ICON_GROUP_app "apps")
set(_KDE4_ICON_GROUP_action "actions")
# KDE 4 / icon naming specification compatibility
set(_KDE4_ICON_GROUP_mimetypes "mimetypes")
set(_KDE4_ICON_GROUP_places "places")
set(_KDE4_ICON_GROUP_devices "devices")
set(_KDE4_ICON_GROUP_apps "apps")
set(_KDE4_ICON_GROUP_actions "actions")
set(_KDE4_ICON_GROUP_categories "categories")
set(_KDE4_ICON_GROUP_status "status")
set(_KDE4_ICON_GROUP_emblems "emblems")
set(_KDE4_ICON_GROUP_emotes "emotes")
set(_KDE4_ICON_GROUP_animations "animations")
set(_KDE4_ICON_GROUP_intl "intl")
# a "map" of short theme names to the theme directory
set(_KDE4_ICON_THEME_ox "oxygen")
set(_KDE4_ICON_THEME_cr "crystalsvg")
set(_KDE4_ICON_THEME_lo "locolor")
set(_KDE4_ICON_THEME_hi "hicolor")
# only used internally by KDE4_INSTALL_ICONS
macro (_KDE4_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME _l10n_SUBDIR)
# if the string doesn't match the pattern, the result is the full string, so all three have the same content
if (NOT ${_group} STREQUAL ${_install_NAME} )
set(_icon_GROUP ${_KDE4_ICON_GROUP_${_group}})
if(NOT _icon_GROUP)
set(_icon_GROUP "actions")
endif(NOT _icon_GROUP)
# message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name} l10n: ${_l10n_SUBDIR}")
install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/${_l10n_SUBDIR}/ RENAME ${_install_NAME} )
endif (NOT ${_group} STREQUAL ${_install_NAME} )
endmacro (_KDE4_ADD_ICON_INSTALL_RULE)
macro (KDE4_INSTALL_ICONS _defaultpath )
# the l10n-subdir if language given as second argument (localized icon)
set(_lang ${ARGV1})
if(_lang)
set(_l10n_SUBDIR l10n/${_lang})
else(_lang)
set(_l10n_SUBDIR ".")
endif(_lang)
# first the png icons
file(GLOB _icons *.png)
foreach (_current_ICON ${_icons} )
# since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" _dummy "${_current_ICON}")
set(_type "${CMAKE_MATCH_1}")
set(_size "${CMAKE_MATCH_2}")
set(_group "${CMAKE_MATCH_3}")
set(_name "${CMAKE_MATCH_4}")
set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
if( _theme_GROUP)
_KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
${_defaultpath}/${_theme_GROUP}/${_size}x${_size}
${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
endif( _theme_GROUP)
endforeach (_current_ICON)
# mng icons
file(GLOB _icons *.mng)
foreach (_current_ICON ${_icons} )
# since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" _dummy "${_current_ICON}")
set(_type "${CMAKE_MATCH_1}")
set(_size "${CMAKE_MATCH_2}")
set(_group "${CMAKE_MATCH_3}")
set(_name "${CMAKE_MATCH_4}")
set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
if( _theme_GROUP)
_KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
${_defaultpath}/${_theme_GROUP}/${_size}x${_size}
${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
endif( _theme_GROUP)
endforeach (_current_ICON)
# and now the svg icons
file(GLOB _icons *.svgz)
foreach (_current_ICON ${_icons} )
# since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
string(REGEX MATCH "^.*/([a-zA-Z]+)sc\\-([a-z]+)\\-(.+\\.svgz)$" _dummy "${_current_ICON}")
set(_type "${CMAKE_MATCH_1}")
set(_group "${CMAKE_MATCH_2}")
set(_name "${CMAKE_MATCH_3}")
set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
if( _theme_GROUP)
_KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
${_defaultpath}/${_theme_GROUP}/scalable
${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
endif( _theme_GROUP)
endforeach (_current_ICON)
kde4_update_iconcache()
endmacro (KDE4_INSTALL_ICONS)
icecc-monitor-2.9.90~git20140222/config-icemon.h.cmake 0000664 0000000 0000000 00000000071 12301400275 0022022 0 ustar 00root root 0000000 0000000 #define ICEMON_VERSION_STRING "@ICEMON_VERSION_STRING@"
icecc-monitor-2.9.90~git20140222/doc/ 0000775 0000000 0000000 00000000000 12301400275 0016624 5 ustar 00root root 0000000 0000000 icecc-monitor-2.9.90~git20140222/doc/CMakeLists.txt 0000664 0000000 0000000 00000001351 12301400275 0021364 0 ustar 00root root 0000000 0000000 # It's not possible to install the docbook right now (Qt-only project)
#add_subdirectory(icemon)
macro(install_docbook_man_page name section)
set(inputfn "man-${name}.${section}.xml")
set(input "${CMAKE_CURRENT_SOURCE_DIR}/${inputfn}")
set(outputfn "${name}.${section}")
set(output "${CMAKE_CURRENT_BINARY_DIR}/${outputfn}")
set(target "manpage-${outputfn}")
add_custom_command(
OUTPUT ${output}
COMMAND ${DOCBOOK2X} ${input}
DEPENDS ${input}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(${target} ALL
DEPENDS "${output}"
)
install(
FILES ${output}
DESTINATION ${CMAKE_INSTALL_MANDIR}/man${section}
)
endmacro()
if(DOCBOOK2X)
install_docbook_man_page(icemon 1)
endif()
icecc-monitor-2.9.90~git20140222/doc/icemon/ 0000775 0000000 0000000 00000000000 12301400275 0020076 5 ustar 00root root 0000000 0000000 icecc-monitor-2.9.90~git20140222/doc/icemon/CMakeLists.txt 0000664 0000000 0000000 00000000173 12301400275 0022637 0 ustar 00root root 0000000 0000000 ########### install files ###############
#
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en)
icecc-monitor-2.9.90~git20140222/doc/icemon/index.docbook 0000664 0000000 0000000 00000016654 12301400275 0022563 0 ustar 00root root 0000000 0000000
]>
The &icemon; HandbookCorneliusSchumachercschum@suse.de2004Cornelius Schumacher&FDLNotice;2004-08-250.1&icemon; is the monitor for &icecream;, which is a distributed
compile system. &icemon; visualizes the distributed compile jobs and shows
statistics and overview information.&icecream;Introduction&icecream; is a distributed compile system. It allows parallel compiling by
distributing the compile jobs to several nodes of a compile net running the
icecream daemon. The icecream scheduler routes the jobs and provides status and
statistics information to the icemon monitor.Each compile node can accept one or more compile jobs depending on the
number of processors and the settings of the daemon. Link jobs and other jobs
which cannot be distributed are executed locally on the node where the
compilation is started.&icemon; provides a view on the compile net, which jobs run where and
details about jobs and nodes.Views&icemon; provides a variety of views on the icecream net. Which view is
shown can be selected in the "View" menu. If the view can be configured a
configuration dialog can be opened by choosing the "Configure" item from the
"Settings" menu.By selecting "Stop" from the "View" menu the view can be stopped from
updating. By selecting "Start" from the view menu the updating is
resumed.To refresh the nodes in the current view select "Check Nodes" from the
"View" menu.The following sections describe the available views.Star View
The star view shows the compile net as rings of nodes centered around the
scheduler. Each node is assigned a color which is used to color the node itself
and the compile jobs started from this node. A dashed line between the scheduler
and a node indicates that the corresponding node has sent a compile job to the
icecream net. A solid line between the scheduler and a node indicates that the
node has been assigned a job by the scheduler. The lines have the color of the
node issuing the jobs as well as the rings around the compiling node. Each ring
represents one compile job.
The nodes have a label with the name of the corresponding host. When leaving the
mouse pointer over the label for a couple of seconds a tooltip is shown
containing some more information about the node like IP address, processor
architecture, name of the icecream flavor the color is based on, icecream id and
a speed index.
When selecting the "Configure" item of the "Settings" menu you get a
configuration dialog where you can configure the number of nodes shown in a
ring and specify a filter on the shown architectures. The number of nodes per
ring affects in how many rings around the scheduler the nodes are shown. The
architecture filter is a regular expression which is applied to the architecture
names of the nodes. Only the nodes are shown for which the regular expression
matches. If the expression is an empty string all nodes are shown.
Summary ViewThe summary view shows a list with a summary for each node. The summary
contains the number of jobs the node has processed while the view has been
shown, an indicator for each possible job the node can accept and a list of
files currently processed by the node. The indicator is black if the node is
idle and has the color of the node issuing the compile job when the node is
active. The filename and the state of the compile job is shown in the right box
of the summary.
Gantt ViewThe Gantt View shows a history of compile jobs for each node. Each node
has a bar for each compile job it can accept. The compile jobs are shown
scrolling on the bar from left to right. A grey bar means idle time. Compile
jobs are shown in the color of the node issuing the job and have a label
providing the name of the file which is compiled. Local jobs are shown on the
bar of the node running the job in a lighter version of the node color.
With the configuration dialog available under the "Configure" item of the
"Settings" menu you can chose if a time scale should be added to the top of the
gantt view or not. The time scale uses units of a second.
Host ViewThe host view shows the icecream status of the node the monitor is
running on. The background of the view is painted in the color of the node and
its name is shown in the center. On top it contains two LED displays, the left
one shows the state of the jobs issued by the
node the monitor is running on. It is dark if the node is idle, red if the node
has issued one or more jobs to other nodes and orange if it is running a local
job. The right LED shows the compile status of the node. It is dark when the
node is idle and green when the node is running an icecream compile job.
At the bottom of the view the current number of local, remote and compile
jobs on the node is shown.
List ViewThe list view shows a list of all compile jobs which were run since
activation of the view.
The list shows the identifier of the job, the name of the compiled
file, which node issued the job and which node compiled it. The state of the job
and some statistics about the job.Credits and License&icemon;Program copyright 2004, The &icecream; Developers&icecream; Authors:Michael Matz matz@suse.deStephan Kulow coolo@suse.deCornelius Schumacher cschum@suse.deBased on the work of:The distcc developersFrerich Raabe raabe@kde.orgDocumentation copyright 2004Author:
Cornelius Schumacher cschum@suse.deSee the &icecream;
homepage for more details.
&underFDL;
&underGPL;
&documentation.index;
icecc-monitor-2.9.90~git20140222/doc/man-icemon.1.xml 0000664 0000000 0000000 00000003211 12301400275 0021525 0 ustar 00root root 0000000 0000000
icemon">
]>
Icecream User's ManualPinoToscanoJune 12th, 2013Icecreamicemon1icemonIcecream network monitoricemon-n net-nameDescription&icemon; is a graphical application to view an Icecream compile
network and monitor its traffic.Options, Print help message and exit.,
net-nameThe name of the Icecream network &icemon; should connect to.
See Alsoicecream(7), icecc-scheduler(1), iceccd(1)AuthorPino Toscano
icecc-monitor-2.9.90~git20140222/icemon.kdev4 0000664 0000000 0000000 00000000057 12301400275 0020272 0 ustar 00root root 0000000 0000000 [Project]
Manager=KDevCMakeManager
Name=icemon
icecc-monitor-2.9.90~git20140222/src/ 0000775 0000000 0000000 00000000000 12301400275 0016646 5 ustar 00root root 0000000 0000000 icecc-monitor-2.9.90~git20140222/src/CMakeLists.txt 0000664 0000000 0000000 00000001543 12301400275 0021411 0 ustar 00root root 0000000 0000000 add_subdirectory(images)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
set(icemon_SRCS
fakemonitor.cc
job.cc
mainwindow.cc
monitor.cc
icecreammonitor.cc
hostlistmodel.cc
hostinfo.cc
statusview.cc
detailedhostview.cc
flowtableview.cc
hostlistview.cc
joblistmodel.cc
joblistview.cc
listview.cc
ganttstatusview.cc
summaryview.cc
starview.cc
poolview.cc
main.cc
)
qt4_add_resources(resources_SRCS icemon.qrc)
qt4_automoc(${icemon_SRCS})
add_executable(icemon ${icemon_SRCS} ${resources_SRCS})
target_link_libraries(icemon
${LIBICECREAM_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${CMAKE_DL_LIBS}
)
########### install files ###############
install(TARGETS icemon ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES icemon.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
icecc-monitor-2.9.90~git20140222/src/IDEAS.poolview 0000664 0000000 0000000 00000000525 12301400275 0021263 0 ustar 00root root 0000000 0000000 - Basically like the star view; scheduler appears as an isle in the middle,
nodes appear as differently colored luftmatrazen around the scheduler.
- Nodes slowly drift around the scheduler, in a circle
- When a node gets a call from the scheduler, that increases it's attraction
to the scheduler for a time, away from the scheduler.
-
icecc-monitor-2.9.90~git20140222/src/Messages.sh 0000664 0000000 0000000 00000000131 12301400275 0020744 0 ustar 00root root 0000000 0000000 #! /usr/bin/env bash
$EXTRACTRC *.rc >> rc.cpp
$XGETTEXT *.cpp *.cc -o $podir/icemon.pot
icecc-monitor-2.9.90~git20140222/src/detailedhostview.cc 0000664 0000000 0000000 00000012664 12301400275 0022532 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2004-2006 Andre Wöbbeking
(c) 2014 Allan Sandfeld Jensen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
#include
#include
#include
#include "detailedhostview.h"
#include "hostinfo.h"
#include "hostlistview.h"
#include "hostlistmodel.h"
#include "joblistview.h"
#include "joblistmodel.h"
#include
static QString myHostName()
{
struct utsname uname_buf;
if ( ::uname( &uname_buf ) == 0 )
return uname_buf.nodename;
else
return QString();
}
DetailedHostView::DetailedHostView( HostInfoManager* manager,
QWidget* parent )
: QWidget( parent ),
StatusView( manager )
{
QBoxLayout* topLayout = new QVBoxLayout( this );
topLayout->setMargin( 10 );
QSplitter* viewSplitter = new QSplitter( Qt::Vertical, this );
topLayout->addWidget( viewSplitter );
QWidget *hosts = new QWidget( viewSplitter );
QVBoxLayout *dummy = new QVBoxLayout( hosts );
dummy->setSpacing( 10 );
dummy->setMargin( 0 );
mHostListModel = new HostListModel(manager, this);
mSortedHostListModel = new QSortFilterProxyModel(this);
mSortedHostListModel->setDynamicSortFilter(true);
mSortedHostListModel->setSourceModel(mHostListModel);
dummy->addWidget(new QLabel( tr("Hosts" ), hosts ));
mHostListView = new HostListView( manager, hosts );
mHostListView->setModel(mSortedHostListModel);
dummy->addWidget(mHostListView);
connect(mHostListView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
SLOT(slotNodeActivated()));
QWidget *locals = new QWidget( viewSplitter );
dummy = new QVBoxLayout( locals );
dummy->setSpacing( 10 );
dummy->setMargin( 0 );
mLocalJobsModel = new JobListModel(manager, this);
mLocalJobsModel->setExpireDuration(5);
mSortedLocalJobsModel = new JobListSortFilterProxyModel(this);
mSortedLocalJobsModel->setDynamicSortFilter(true);
mSortedLocalJobsModel->setSourceModel(mLocalJobsModel);
dummy->addWidget(new QLabel( tr("Outgoing jobs" ), locals ));
mLocalJobsView = new JobListView(locals);
mLocalJobsView->setModel(mSortedLocalJobsModel);
mLocalJobsView->setClientColumnVisible( false );
dummy->addWidget(mLocalJobsView);
QWidget* remotes = new QWidget( viewSplitter );
dummy = new QVBoxLayout( remotes );
dummy->setSpacing( 10 );
dummy->setMargin( 0 );
mRemoteJobsModel = new JobListModel(manager, this);
mRemoteJobsModel->setExpireDuration(5);
mSortedRemoteJobsModel = new JobListSortFilterProxyModel(this);
mSortedRemoteJobsModel->setDynamicSortFilter(true);
mSortedRemoteJobsModel->setSourceModel(mRemoteJobsModel);
dummy->addWidget(new QLabel( tr("Incoming jobs" ), remotes ));
mRemoteJobsView = new JobListView(remotes);
mRemoteJobsView->setModel(mSortedRemoteJobsModel);
mRemoteJobsView->setServerColumnVisible( false );
dummy->addWidget(mRemoteJobsView);
createKnownHosts();
}
void DetailedHostView::update( const Job &job )
{
const unsigned int hostid = mSortedHostListModel->mapToSource(mHostListView->currentIndex()).data(HostListModel::HostIdRole).value();
if ( !hostid )
return;
if ( job.client() != hostid && job.server() != hostid )
return;
if ( job.client() == hostid )
mLocalJobsModel->update( job );
if ( job.server() == hostid )
mRemoteJobsModel->update( job );
}
void DetailedHostView::checkNode( unsigned int hostid )
{
if ( !hostid )
return;
mHostListModel->checkNode( hostid );
if ( !mHostListView->selectionModel()->hasSelection() ) {
HostInfo* info = hostInfoManager()->find( hostid );
if ( info->name() == myHostName() )
mHostListView->setCurrentIndex( mSortedHostListModel->mapFromSource(mHostListModel->indexForHostInfo(*info, 0) ));
}
}
void DetailedHostView::removeNode( unsigned int hostid )
{
mHostListModel->removeNodeById( hostid );
}
void DetailedHostView::updateSchedulerState( bool online )
{
if ( !online )
{
mHostListModel->clear();
mLocalJobsModel->clear();
mRemoteJobsModel->clear();
}
}
void DetailedHostView::slotNodeActivated()
{
mLocalJobsModel->clear();
mRemoteJobsModel->clear();
}
void DetailedHostView::createKnownHosts()
{
const HostInfoManager::HostMap& hosts(hostInfoManager()->hostMap());
for (HostInfoManager::HostMap::ConstIterator it( hosts.begin() ),
itEnd( hosts.end() );
it != itEnd; ++it )
{
const unsigned int hostid( (*it)->id() );
checkNode( hostid );
}
}
QWidget* DetailedHostView::widget()
{
return this;
}
#include "detailedhostview.moc"
icecc-monitor-2.9.90~git20140222/src/detailedhostview.h 0000664 0000000 0000000 00000003570 12301400275 0022370 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2004-2006 Andre Wöbbeking
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef ICEMON_DETAILEDHOSTVIEW_H
#define ICEMON_DETAILEDHOSTVIEW_H
#include "statusview.h"
#include
class HostListModel;
class JobListView;
class JobListModel;
class HostListView;
class QSortFilterProxyModel;
class DetailedHostView : public QWidget, public StatusView
{
Q_OBJECT
public:
DetailedHostView( HostInfoManager* manager, QWidget *parent );
void update( const Job &job );
QWidget* widget();
QString id() const { return "detailedhost"; }
void checkNode( unsigned int hostid );
void removeNode( unsigned int hostid );
void updateSchedulerState( bool online );
private slots:
void slotNodeActivated();
private:
void createKnownHosts();
HostListModel* mHostListModel;
HostListView* mHostListView;
QSortFilterProxyModel* mSortedHostListModel;
JobListModel* mLocalJobsModel;
JobListView* mLocalJobsView;
QSortFilterProxyModel* mSortedLocalJobsModel;
JobListModel* mRemoteJobsModel;
JobListView* mRemoteJobsView;
QSortFilterProxyModel* mSortedRemoteJobsModel;
};
#endif
icecc-monitor-2.9.90~git20140222/src/fakemonitor.cc 0000664 0000000 0000000 00000005554 12301400275 0021504 0 ustar 00root root 0000000 0000000 #include "fakemonitor.h"
#include "statusview.h"
#include "job.h"
#include "hostinfo.h"
#include
#include
#include
// counter variable
static int JOB_ID = 0;
static const int MAX_JOB_COUNT = 10;
static const QVector HOST_IDS(QVector() << 1 << 2 << 3);
static const QStringList JOB_FILENAMES(QStringList()
<< QLatin1String("/tmp/filename.cc")
<< QLatin1String("/some/very/long/path/containing/filename.cc")
<< QLatin1String("/some/very/long/path/containing/averyverylongfilename.cc")
);
FakeMonitor::FakeMonitor(HostInfoManager* manager, QObject* parent)
: Monitor(manager, parent)
, m_view(0)
, m_updateTimer(new QTimer(this))
{
m_updateTimer->setInterval(1000);
m_updateTimer->start();
connect(m_updateTimer, SIGNAL(timeout()), SLOT(update()));
init();
}
void FakeMonitor::init()
{
{
HostInfo info(1);
info.setIp("1.0.0.1");
info.setColor(Qt::red);
info.setMaxJobs(5);
info.setName("Host1");
info.setOffline(false);
info.setPlatform("Linux 3.6");
info.setServerLoad(1.0);
info.setServerSpeed(10);
hostInfoManager()->checkNode(info);
}
{
HostInfo info(2);
info.setIp("1.0.0.2");
info.setColor(Qt::blue);
info.setMaxJobs(10);
info.setName("Host2");
info.setOffline(false);
info.setPlatform("Linux 3.4");
info.setServerLoad(1.0);
info.setServerSpeed(10);
hostInfoManager()->checkNode(info);
}
{
HostInfo info(3);
info.setIp("1.0.0.3");
info.setColor(Qt::green);
info.setMaxJobs(5);
info.setName("Host3");
info.setOffline(false);
info.setPlatform("Windows 3.1");
info.setServerLoad(1.0);
info.setServerSpeed(10);
hostInfoManager()->checkNode(info);
}
}
void FakeMonitor::setCurrentView( StatusView *view, bool rememberJobs )
{
m_view = view;
m_view->updateSchedulerState(true);
}
void FakeMonitor::update()
{
if (!m_view)
return;
// create job
const int clientId = HOST_IDS[JOB_ID % HOST_IDS.size()];
const QString fileName = JOB_FILENAMES[JOB_ID % JOB_FILENAMES.length()];
Job job(JOB_ID++, clientId, fileName);
time_t rawtime;
time(&rawtime);
job.setStartTime(rawtime);
job.setState(Job::Compiling);
const int serverId = HOST_IDS[(JOB_ID+1) % HOST_IDS.size()];
job.setServer(serverId);
m_view->update(job);
m_activeJobs << job;
// clean up old jobs
if (m_activeJobs.size() > MAX_JOB_COUNT) {
Job job = m_activeJobs.first();
m_activeJobs.removeFirst();
job.setState(Job::Finished);
m_view->update(job);
}
Q_FOREACH(const HostInfo* info, hostInfoManager()->hostMap().values()) {
if ( info->isOffline() ) {
m_view->removeNode( info->id() );
} else {
m_view->checkNode( info->id() );
}
}
}
#include "fakemonitor.moc"
icecc-monitor-2.9.90~git20140222/src/fakemonitor.h 0000664 0000000 0000000 00000001346 12301400275 0021341 0 ustar 00root root 0000000 0000000 #ifndef ICEMON_FAKEMONITOR_H
#define ICEMON_FAKEMONITOR_H
#include "monitor.h"
#include "job.h"
class HostInfoManager;
class StatusView;
class QTimer;
class FakeMonitor : public Monitor
{
Q_OBJECT
public:
explicit FakeMonitor(HostInfoManager* manager, QObject* parent = 0);
virtual void setCurrentView(StatusView* view, bool rememberJobs);
virtual void setCurrentNet(const QByteArray& net) { Q_UNUSED(net); }
virtual void setSchedulerState(bool online) { Q_UNUSED(online); }
virtual bool schedulerState() const { return true; }
private Q_SLOTS:
void update();
private:
void init();
StatusView* m_view;
QList m_activeJobs;
QTimer* m_updateTimer;
};
#endif // ICEMON_FAKEMONITOR_H
icecc-monitor-2.9.90~git20140222/src/flowtableview.cc 0000664 0000000 0000000 00000014331 12301400275 0022031 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2011 Daniel Molkentin
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "flowtableview.h"
#include
#include
#include
#include
#include
ProgressWidget::ProgressWidget(HostInfo *info, StatusView *statusView, QWidget *parent) :
QWidget(parent), m_hostInfo(info), m_statusView(statusView), m_isVirgin(true)
{
setAutoFillBackground(false);
setAttribute(Qt::WA_OpaquePaintEvent);
setAttribute(Qt::WA_NoSystemBackground);
m_backingStore = QImage(size(), QImage::Format_RGB32);
m_backingStore.fill(palette().base().color().rgb());
}
void ProgressWidget::paintEvent(QPaintEvent *)
{
QImage temp(size(), QImage::Format_RGB32);
QPainter p(&temp);
p.drawImage(-1,0, m_backingStore);
if (m_isVirgin) {
p.fillRect(rect(), palette().base());
m_isVirgin = false;
}
if (m_currentJob.state() == Job::Compiling ||
m_currentJob.state() == Job::LocalOnly) {
QLinearGradient gradient;
gradient.setCoordinateMode(QGradient::ObjectBoundingMode);
gradient.setColorAt(0, palette().base().color());
gradient.setColorAt(1, m_statusView->hostColor(m_currentJob.client()));
p.fillRect(width()-1,0, 1, height(), gradient);
} else {
p.fillRect(width()-1,0, 1, height(), palette().base().color());
}
QPainter screenp(this);
screenp.drawImage(0, 0, temp);
m_backingStore = temp;
}
void ProgressWidget::resizeEvent(QResizeEvent *) {
m_isVirgin = true;
}
////////////////////////////////////////////////////////////////////////////////
FlowTableView::FlowTableView(HostInfoManager *hostInfoManager, QWidget *parent) :
QTableWidget(parent), StatusView(hostInfoManager), m_updateTimer(new QTimer)
{
setColumnCount(4);
QStringList labels;
labels << tr("Host") << tr("File") << tr("History") << tr("State");
setHorizontalHeaderLabels(labels);
horizontalHeader()->setResizeMode(2, QHeaderView::Stretch);
verticalHeader()->hide();
setSelectionMode(QAbstractItemView::NoSelection);
m_updateTimer->setInterval(50);
m_updateTimer->start();
}
void FlowTableView::update(const Job &job)
{
int serverId = job.server();
if (serverId == 0)
return;
// checkNode hasn't been run for this server yet.
if (!m_idToRowMap.contains(serverId))
return;
int serverRow = m_idToRowMap.value(serverId);
QTableWidgetItem *fileNameItem = item(serverRow, 1);
QTableWidgetItem *jobStateItem = item(serverRow, 3);
if (job.state() == Job::Finished) {
fileNameItem->setText("");
jobStateItem->setText("");
} else {
QString filePath = job.fileName();
QString fileName = filePath.mid(filePath.lastIndexOf('/')+1);
fileNameItem->setText(fileName);
fileNameItem->setToolTip(job.fileName());
fileNameItem->setFlags(Qt::ItemIsEnabled);
jobStateItem->setText(job.stateAsString());
jobStateItem->setToolTip(job.stateAsString());
jobStateItem->setFlags(Qt::ItemIsEnabled);
}
if (ProgressWidget *progressWidget = static_cast(cellWidget(serverRow, 2))) {
progressWidget->setCurrentJob(job);
}
// update the host column for the server requesting the job
QTableWidgetItem *hostNameItem = item(serverRow, 0);
int usageCount = hostNameItem->data(Qt::UserRole).toInt();
if (job.state() == Job::LocalOnly || job.state() == Job::Compiling)
++usageCount;
else if (job.state() == Job::Finished || job.state() == Job::Failed)
--usageCount;
hostNameItem->setData(Qt::UserRole, usageCount);
QFont f = font();
f.setBold(usageCount > 0);
hostNameItem->setFont(f);
hostNameItem->setText(hostInfoText(hostInfoManager()->find(serverId), usageCount));
}
QString FlowTableView::hostInfoText(HostInfo *hostInfo, int runningProcesses) {
if (hostInfo->serverSpeed() == 0) // host disabled
return tr("%1 (Disabled)").arg(hostInfo->name());
else
return tr("%1 (%2/%3)").arg(hostInfo->name()).arg(runningProcesses).arg(hostInfo->maxJobs());
}
void FlowTableView::checkNode(unsigned int hostId)
{
if (m_idToRowMap.contains(hostId))
return;
HostInfo *hostInfo = hostInfoManager()->hostMap().value(hostId);
QTableWidgetItem *widgetItem = new QTableWidgetItem(hostInfoText(hostInfo));
widgetItem->setIcon(QIcon(":/images/icemonnode.png"));
widgetItem->setToolTip(hostInfo->toolTip());
widgetItem->setBackgroundColor(hostInfo->color());
// usage count
widgetItem->setData(Qt::UserRole, 0);
widgetItem->setFlags(Qt::ItemIsEnabled);
int insertRow = rowCount();
setRowCount(insertRow + 1);
m_idToRowMap.insert(hostId, insertRow);
setItem(insertRow, 0, widgetItem);
// adjust column width
int width = QFontMetrics(widgetItem->font()).width(widgetItem->text())+32;
horizontalHeader()->resizeSection(0, qMax(horizontalHeader()->sectionSize(0), width));
widgetItem = new QTableWidgetItem;
widgetItem->setFlags(Qt::ItemIsEnabled);
setItem(insertRow, 1, widgetItem);
widgetItem = new QTableWidgetItem;
widgetItem->setFlags(Qt::ItemIsEnabled);
setItem(insertRow, 3, widgetItem);
ProgressWidget *pw = new ProgressWidget(hostInfo, this);
connect(m_updateTimer, SIGNAL(timeout()), pw, SLOT(update()));
setCellWidget(insertRow, 2, pw);
}
void FlowTableView::removeNode(unsigned int hostId)
{
removeRow(m_idToRowMap.value(hostId));
m_idToRowMap.remove(hostId);
}
#include "flowtableview.moc"
icecc-monitor-2.9.90~git20140222/src/flowtableview.h 0000664 0000000 0000000 00000004421 12301400275 0021672 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2011 Daniel Molkentin
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef FLOWTABLEVIEW_H
#define FLOWTABLEVIEW_H
#include
#include
#include "statusview.h"
#include "hostinfo.h"
#include "job.h"
class Job;
typedef QHash HostIdRowMap;
class ProgressWidget : public QWidget
{
Q_OBJECT
public:
ProgressWidget(HostInfo *info, StatusView *statusView, QWidget *parent = 0);
void setCurrentJob(const Job &job) { m_currentJob = job; }
Job currentJob() const { return m_currentJob; }
void resizeEvent(QResizeEvent *);
void paintEvent(QPaintEvent *);
private:
HostInfo *m_hostInfo;
StatusView *m_statusView;
Job m_currentJob;
QImage m_backingStore;
bool m_isVirgin;
};
class FlowTableView : public QTableWidget, public StatusView
{
Q_OBJECT
public:
explicit FlowTableView(HostInfoManager *, QWidget *parent = 0);
// status view reimpls
QWidget* widget() { return this; }
void update( const Job &job);
void checkNode( unsigned int hostid );
void removeNode( unsigned int hostid );
void updateSchedulerState( bool online ) {}
void checkNodes() {}
QString id() const { return "flow"; }
void stop() {}
void start() {}
bool canCheckNodes() { return false; }
bool isPausable() { return false; }
bool isConfigurable() { return false; }
private:
QString hostInfoText(HostInfo *hostInfo, int runningProcesses = 0);
HostIdRowMap m_idToRowMap;
QTimer *m_updateTimer;
};
#endif // FLOWTABLEVIEW_H
icecc-monitor-2.9.90~git20140222/src/ganttstatusview.cc 0000664 0000000 0000000 00000043250 12301400275 0022435 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2003 Frerich Raabe
Copyright (c) 2003,2004 Cornelius Schumacher
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "ganttstatusview.h"
#include "job.h"
#include "hostinfo.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
GanttConfigDialog::GanttConfigDialog( QWidget *parent )
: QDialog( parent )
{
QBoxLayout *topLayout = new QVBoxLayout( this );
topLayout->setMargin( 10 );
topLayout->setSpacing( 10 );
mTimeScaleVisibleCheck = new QCheckBox( tr("Show time scale"), this );
topLayout->addWidget( mTimeScaleVisibleCheck );
connect( mTimeScaleVisibleCheck, SIGNAL( clicked() ),
SIGNAL( configChanged() ) );
QFrame *hline = new QFrame( this );
hline->setFrameShape( QFrame::HLine );
topLayout->addWidget( hline );
QBoxLayout *buttonLayout = new QHBoxLayout();
topLayout->addLayout( buttonLayout );
buttonLayout->addStretch( 1 );
QPushButton *button = new QPushButton( tr("&Close"), this );
buttonLayout->addWidget( button );
connect( button, SIGNAL( clicked() ), SLOT( hide() ) );
setWindowTitle(tr("Configure Gantt View"));
// apply some minimum size
resize(300, 100);
}
bool GanttConfigDialog::isTimeScaleVisible()
{
return mTimeScaleVisibleCheck->isChecked();
}
GanttTimeScaleWidget::GanttTimeScaleWidget( QWidget *parent )
: QWidget( parent ),
mPixelsPerSecond( 40 )
{
QPalette pal = palette();
pal.setColor( backgroundRole(), Qt::white );
setPalette( pal );
}
void GanttTimeScaleWidget::setPixelsPerSecond( int v )
{
mPixelsPerSecond = v;
}
void GanttTimeScaleWidget::paintEvent( QPaintEvent *pe )
{
const QRect r = pe->rect();
QPainter p( this );
const QFontMetrics fm = p.fontMetrics();
// Maybe the rectangle overlaps the right half of a number, check whether
// that is the case and repaint that number if necessary.
if ( r.x() % 100 != 0 ) {
const int lastNumberXPos = r.x() - ( r.x() % 100 );
QString lastNumber = QString::number( lastNumberXPos / 100 * 5 );
if ( r.x() % 100 < p.fontMetrics().width( lastNumber ) ) {
p.drawText( lastNumberXPos - r.x() + 2, fm.ascent(), lastNumber );
}
}
// Now draw all the bars and numbers, very straightforward.
for ( int x = 0; x < r.width(); ++x ) {
const int absX = x + r.x();
if ( absX % ( mPixelsPerSecond * 10 ) == 0 ) {
p.drawLine( x, -r.y(), x, height() / 2 - r.y() );
p.drawText( x + 2, fm.ascent() - r.y(),
QString::number( absX /
mPixelsPerSecond ) );
} else if ( absX % ( mPixelsPerSecond * 5 ) == 0 ) {
p.drawLine( x, -r.y(), x, height() / 4 - r.y() );
p.drawText( x + 2, fm.ascent() - r.y(),
QString::number( absX /
mPixelsPerSecond ) );
} else if ( absX % ( mPixelsPerSecond ) == 0 ) {
p.drawLine( x, -r.y(), x, height() / 8 - r.y() );
}
}
}
GanttProgress::GanttProgress( StatusView *statusView, QWidget *parent )
: QWidget( parent ),
mStatusView( statusView ), mClock( 0 ), mIsFree( true )
{
QPalette pal = palette();
pal.setColor( backgroundRole(), Qt::white );
setPalette( pal );
}
void GanttProgress::progress()
{
mClock += 1;
adjustGraph();
QWidget::update();
}
void GanttProgress::adjustGraph()
{
// Remove non-visible jobs
if ( m_jobs.count() >= 2 &&
mClock - m_jobs[ m_jobs.count() - 2 ].clock > width() ) {
m_jobs.removeAt( m_jobs.count() - 1 );
}
}
void GanttProgress::update( const Job &job )
{
#if 0
qDebug() << "GanttProgress::update( job ): " << job.fileName() << endl;
qDebug() << " num jobs: " << m_jobs.count() << endl;
if (!m_jobs.isEmpty())
qDebug() << " first id: " << m_jobs.first().job.jobId() << endl;
qDebug() << " this id: " << job.jobId() << endl;
#endif
if ( !m_jobs.isEmpty() && m_jobs.first().job == job ) {
// qDebug() << " Known Job. State: " << job.state() << endl;
if ( job.state() == Job::Finished || job.state() == Job::Failed ) {
Job j = IdleJob();
m_jobs.prepend( JobData( j, mClock ) );
mIsFree = true;
}
} else {
// qDebug() << " New Job" << endl;
m_jobs.prepend( JobData( job, mClock ) );
mIsFree = ( job.state() == Job::Idle );
}
// qDebug() << "num jobs: " << m_jobs.count() << " jobs" << endl;
}
void GanttProgress::drawGraph( QPainter &p )
{
// qDebug() << "drawGraph() " << m_jobs.count() << " jobs" << endl;
if( height() == 0 )
return;
bool lastBox = false;
int xStart = 0;
QList< JobData >::ConstIterator it = m_jobs.constBegin();
for ( ; ( it != m_jobs.constEnd() ) && !lastBox; ++it ) {
int xEnd = mClock - (*it).clock;
if ( xEnd > width() ) {
xEnd = width();
lastBox = true;
}
int xWidth = xEnd - xStart;
if( xWidth == 0 )
continue;
// qDebug() << "XStart: " << xStart << " xWidth: " << xWidth << endl;
// Draw the rectangle for the current job
QColor color = colorForStatus( ( *it ).job );
p.fillRect( xStart, 0, xWidth, height(), color );
p.setPen( color.dark() );
p.drawRect( xStart, 0, xWidth, height() );
if( xWidth > 4 && height() > 4 ) {
int width = xWidth - 4;
QString s = ( *it ).job.fileName();
if ( !s.isEmpty() ) {
s = s.mid( s.lastIndexOf( '/' ) + 1, s.length() );
// s = s.left( s.lastIndexOf( '.' ) );
// s[0] = s[0].upper();
// Optimization - cache the drawn text in a pixmap, and update the cache
// only if the pixmap height doesn't match, if the pixmap width is too large,
// or if the shortened text with another character added (next_text_width) would fit
if( width >= (*it).next_text_width || width < (*it).text_cache.width()
|| height() - 4 != (*it).text_cache.height()) {
// If we print the filename, check whether we need to truncate it and
// append "..." at the end.
int text_width = p.fontMetrics().width( s );
if( text_width > width ) {
int threeDotsWidth = p.fontMetrics().width( "..." );
int next_width = 0;
int newLength = 0;
for(;
next_width <= width;
++newLength ) {
text_width = next_width;
next_width = p.fontMetrics().width( s.left( newLength ) ) +
threeDotsWidth;
}
(*it).next_text_width = next_width;
s = s.left( newLength > 2 ? newLength - 2 : 0 ) + "...";
} else {
(*it).next_text_width = 1000000; // large number (no next width)
}
// Finally draw the text.
if( text_width > 0 ) {
(*it).text_cache = QPixmap( text_width, height() - 4 );
(*it).text_cache.fill( color );
QPainter painter( &(*it).text_cache );
painter.setPen( StatusView::textColor( color ) );
painter.drawText( 0, 0, text_width, height() - 4,
Qt::AlignVCenter | Qt::AlignLeft, s );
}
}
if( !(*it).text_cache.isNull())
p.drawPixmap( xStart + 2, 2, (*it).text_cache );
}
}
xStart = xEnd;
}
}
QColor GanttProgress::colorForStatus( const Job &job ) const
{
if ( job.state() == Job::Idle ) {
return Qt::gray;
} else {
QColor c = mStatusView->hostColor( job.client() );
if ( job.state() == Job::LocalOnly ) return c.light();
else return c;
}
}
void GanttProgress::paintEvent( QPaintEvent * )
{
QPainter p( this );
p.setBackgroundMode(Qt::OpaqueMode);
p.setBackground(palette().background());
drawGraph( p );
}
void GanttProgress::resizeEvent( QResizeEvent * )
{
adjustGraph();
}
GanttStatusView::GanttStatusView( HostInfoManager *m, QWidget *parent)
: QScrollArea( parent ),
StatusView( m ),
mTopWidget(new QWidget( viewport() ))
{
mConfigDialog = new GanttConfigDialog( this );
connect( mConfigDialog, SIGNAL( configChanged() ),
SLOT( slotConfigChanged() ) );
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
setWidget( mTopWidget );
setWidgetResizable( true );
QPalette palette = mTopWidget->palette();
palette.setColor( mTopWidget->backgroundRole(), Qt::white );
mTopWidget->setPalette( palette );
m_topLayout = new QGridLayout( mTopWidget );
m_topLayout->setSpacing( 5 );
m_topLayout->setMargin( 4 );
m_topLayout->setColumnStretch( 1, 10 );
mTimeScale = new GanttTimeScaleWidget( mTopWidget );
mTimeScale->setFixedHeight( 50 );
m_topLayout->addWidget( mTimeScale, 0, 1 );
m_progressTimer = new QTimer( this );
connect( m_progressTimer, SIGNAL( timeout() ), SLOT( updateGraphs() ) );
m_ageTimer = new QTimer( this );
connect( m_ageTimer, SIGNAL( timeout() ), SLOT( checkAge() ) );
mUpdateInterval = 25;
mTimeScale->setPixelsPerSecond( 1000 / mUpdateInterval );
mMinimumProgressHeight = QFontMetrics( font() ).height() + 6;
slotConfigChanged();
start();
}
void GanttStatusView::update( const Job &job )
{
if ( !mRunning ) return;
if ( job.state() == Job::WaitingForCS ) return;
#if 0
qDebug() << "GanttStatusView::update(): ID: " << job.jobId() << " "
<< job.fileName() << " Status:" << int( job.state() )
<< " Server: " << job.server() << endl;
#endif
QMap::Iterator it;
it = mJobMap.find( job.jobId() );
if ( it != mJobMap.end() ) {
// qDebug() << " Job found" << endl;
it.value()->update( job );
if ( job.state() == Job::Finished || job.state() == Job::Failed ) {
mJobMap.erase( it );
}
return;
}
if ( job.state() == Job::Finished || job.state() == Job::Failed )
return;
GanttProgress *slot = 0;
unsigned int processor;
if ( job.state() == Job::LocalOnly ) processor = job.client();
else processor = job.server();
if ( !processor ) {
#if 0
qDebug() << "GanttStatusView::update(): processor for job "
<< job.jobId() << " is empty.";
#endif
return;
}
NodeMap::ConstIterator it2 = mNodeMap.constFind( processor );
if ( it2 == mNodeMap.constEnd() ) {
// qDebug() << " Server not known" << endl;
slot = registerNode( processor );
} else {
SlotList slotList = it2.value();
SlotList::ConstIterator it3;
for( it3 = slotList.constBegin(); it3 != slotList.constEnd(); ++it3 ) {
if ( (*it3)->isFree() ) {
// qDebug() << " Found free slot" << endl;
slot = *it3;
break;
}
}
if ( it3 == slotList.constEnd() ) {
// qDebug() << " Create new slot" << endl;
slot = registerNode( processor );
}
}
Q_ASSERT(slot);
mJobMap.insert( job.jobId(), slot );
slot->update( job );
mAgeMap[ processor ] = 0;
}
QWidget * GanttStatusView::widget()
{
return this;
}
void GanttStatusView::checkNode( unsigned int hostid )
{
if ( !mRunning ) return;
if ( mNodeMap.find( hostid ) == mNodeMap.end())
registerNode( hostid )->update( IdleJob());
unsigned int max_kids = hostInfoManager()->maxJobs( hostid );
for( unsigned int i = mNodeMap[ hostid ].count();
i < max_kids;
++i )
registerNode( hostid )->update( IdleJob());
mAgeMap[ hostid ] = 0;
SlotList slotList = mNodeMap[ hostid ]; // make a copy
int to_remove = slotList.count() - max_kids;
if( to_remove <= 0 )
return;
QListIterator it2( slotList );
it2.toBack();
while ( it2.hasPrevious() ) {
GanttProgress *progress = it2.previous();
if( progress->isFree() && progress->fullyIdle()) {
removeSlot( hostid, progress );
if( --to_remove == 0 )
return;
}
}
}
GanttProgress *GanttStatusView::registerNode( unsigned int hostid )
{
// qDebug() << "GanttStatusView::registerNode(): " << ip << endl;
static int lastRow = 0;
QColor color = hostColor( hostid );
QVBoxLayout *nodeLayout;
NodeLayoutMap::ConstIterator it = mNodeLayouts.constFind( hostid );
if ( it == mNodeLayouts.constEnd() ) {
++lastRow;
nodeLayout = new QVBoxLayout();
nodeLayout->setObjectName( ( QString::number( hostid ) + "_layout" ).toLatin1() );
m_topLayout->addLayout( nodeLayout, lastRow, 1 );
mNodeLayouts.insert( hostid, nodeLayout );
mNodeRows.insert( hostid, lastRow );
} else {
nodeLayout = it.value();
}
NodeRowMap::ConstIterator rowIt = mNodeRows.constFind( hostid );
if ( rowIt == mNodeRows.constEnd() ) {
#if 0
qDebug() << "Unknown node row.";
#endif
} else {
int row = *rowIt;
NodeLabelMap::ConstIterator labelIt = mNodeLabels.constFind( hostid );
if ( labelIt == mNodeLabels.constEnd() ) {
QString name = nameForHost( hostid );
QLabel *l = new QLabel( name, mTopWidget );
QPalette palette = l->palette();
palette.setColor( l->foregroundRole(), color );
palette.setColor( l->backgroundRole(), Qt::white );
l->setPalette( palette );
m_topLayout->addWidget( l, row, 0 );
QFont f = l->font();
f.setBold( true );
l->setFont( f );
l->show();
mNodeLabels.insert( hostid, l );
}
}
GanttProgress *w = new GanttProgress( this, mTopWidget );
w->setMinimumHeight( mMinimumProgressHeight );
nodeLayout->addWidget( w );
mNodeMap[ hostid ].append( w );
mAgeMap[ hostid ] = 0;
m_topLayout->setRowStretch( mNodeRows[ hostid ], mNodeMap[ hostid ].size() );
w->show();
return w;
}
void GanttStatusView::removeSlot( unsigned int hostid, GanttProgress* slot )
{
NodeLayoutMap::ConstIterator it = mNodeLayouts.constFind( hostid );
if ( it == mNodeLayouts.constEnd() )
return;
mNodeMap[ hostid ].removeAll( slot );
JobMap newJobMap;
for( QMap::Iterator it = mJobMap.begin();
it != mJobMap.end(); // QMap::remove doesn't return an iterator like
++it ) { // e.g. in QValueList, and I'm not sure if 'it'
if( (*it) != slot ) // or '++it' would be still valid, so let's copy
newJobMap[ it.key() ] = *it; // still valid items to a new map
}
mJobMap = newJobMap;
m_topLayout->setRowStretch( mNodeRows[ hostid ], mNodeMap[ hostid ].size() );
delete slot;
}
void GanttStatusView::unregisterNode( unsigned int hostid )
{
NodeLayoutMap::ConstIterator it = mNodeLayouts.constFind( hostid );
if ( it == mNodeLayouts.constEnd() )
return;
while( !mNodeMap[ hostid ].isEmpty())
removeSlot( hostid, mNodeMap[ hostid ].first());
NodeLabelMap::Iterator labelIt = mNodeLabels.find( hostid );
if ( labelIt != mNodeLabels.end() ) {
delete *labelIt;
mNodeLabels.erase( labelIt );
}
mAgeMap[ hostid ] = -1;
}
void GanttStatusView::updateGraphs()
{
NodeMap::ConstIterator it;
for ( it = mNodeMap.constBegin(); it != mNodeMap.constEnd(); ++it ) {
SlotList::ConstIterator it2;
for( it2 = (*it).constBegin(); it2 != (*it).constEnd(); ++it2 ) {
(*it2)->progress();
}
}
}
void GanttStatusView::stop()
{
mRunning = false;
m_progressTimer->stop();
m_ageTimer->stop();
}
void GanttStatusView::start()
{
mRunning = true;
m_progressTimer->start( mUpdateInterval );
m_ageTimer->start( 10000 );
}
void GanttStatusView::checkNodes()
{
checkAge();
}
void GanttStatusView::checkAge()
{
QList to_unregister;
for( AgeMap::Iterator it = mAgeMap.begin();
it != mAgeMap.end();
++it ) {
if( *it > 1 )
to_unregister.append( it.key() );
else if( *it < 0 )
; // unregistered ones
else
++(*it);
}
for( QList::ConstIterator it = to_unregister.constBegin();
it != to_unregister.constEnd();
++it )
unregisterNode( *it );
}
void GanttStatusView::configureView()
{
mConfigDialog->show();
mConfigDialog->raise();
}
void GanttStatusView::slotConfigChanged()
{
if ( mConfigDialog->isTimeScaleVisible() ) mTimeScale->show();
else mTimeScale->hide();
}
#include "ganttstatusview.moc"
icecc-monitor-2.9.90~git20140222/src/ganttstatusview.h 0000664 0000000 0000000 00000010366 12301400275 0022301 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2003 Frerich Raabe
Copyright (c) 2003,2004 Cornelius Schumacher
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef GANTTSTATUSVIEW_H
#define GANTTSTATUSVIEW_H
#include "job.h"
#include "statusview.h"
#include
#include
#include
#include
#include
class QCheckBox;
class QGridLayout;
class QTimer;
class QVBoxLayout;
class GanttConfigDialog : public QDialog
{
Q_OBJECT
public:
GanttConfigDialog( QWidget *parent );
bool isTimeScaleVisible();
signals:
void configChanged();
private:
QCheckBox *mTimeScaleVisibleCheck;
};
class GanttTimeScaleWidget : public QWidget
{
Q_OBJECT
public:
GanttTimeScaleWidget( QWidget *parent );
void setPixelsPerSecond( int );
protected:
virtual void paintEvent( QPaintEvent *e );
private:
int mPixelsPerSecond;
};
class GanttProgress : public QWidget
{
Q_OBJECT
public:
GanttProgress( StatusView *statusView,
QWidget *parent );
bool isFree() const { return mIsFree; }
bool fullyIdle() const { return m_jobs.count() == 1 && isFree(); }
public slots:
void progress();
void update( const Job &job );
protected:
virtual void paintEvent( QPaintEvent *e );
virtual void resizeEvent( QResizeEvent *e );
private:
void adjustGraph();
void drawGraph( QPainter &p );
QColor colorForStatus( const Job &job ) const;
struct JobData
{
JobData( const Job& j, int c )
: job( j ), clock( c ), next_text_width( 0 ) {}
JobData() {} // stupid QValueList
bool operator==( const JobData& d )
{
return job == d.job && clock == d.clock;
}
Job job;
int clock;
mutable int next_text_width;
mutable QPixmap text_cache;
};
StatusView *mStatusView;
QList< JobData > m_jobs;
int mClock;
bool mIsFree;
};
class GanttStatusView : public QScrollArea, public StatusView
{
Q_OBJECT
public:
GanttStatusView( HostInfoManager *, QWidget *parent );
virtual ~GanttStatusView() {}
QString id() const { return "gantt"; }
virtual void checkNode( unsigned int hostid );
void start();
void stop();
void checkNodes();
void configureView();
bool canCheckNodes() { return true; }
bool isPausable() { return true; }
bool isConfigurable() { return true; }
public slots:
virtual void update( const Job &job );
virtual QWidget *widget();
private slots:
void slotConfigChanged();
void updateGraphs();
void checkAge();
private:
GanttProgress *registerNode( unsigned int hostid );
void removeSlot( unsigned int hostid, GanttProgress* slot );
void unregisterNode( unsigned int hostid );
GanttConfigDialog *mConfigDialog;
QWidget *mTopWidget;
QGridLayout *m_topLayout;
GanttTimeScaleWidget *mTimeScale;
typedef QList SlotList;
typedef QMap NodeMap;
NodeMap mNodeMap;
typedef QMap AgeMap;
AgeMap mAgeMap;
typedef QMap JobMap;
JobMap mJobMap;
typedef QMap NodeLayoutMap;
NodeLayoutMap mNodeLayouts;
typedef QMap NodeRowMap;
NodeRowMap mNodeRows;
typedef QMap NodeLabelMap;
NodeLabelMap mNodeLabels;
QTimer *m_progressTimer;
QTimer *m_ageTimer;
bool mRunning;
int mUpdateInterval;
int mMinimumProgressHeight;
};
#endif
// vim:ts=4:sw=4:noet
icecc-monitor-2.9.90~git20140222/src/hostinfo.cc 0000664 0000000 0000000 00000016132 12301400275 0021011 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2004 Cornelius Schumacher
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "hostinfo.h"
#include
#include
#include
QVector HostInfo::mColorTable;
QMap HostInfo::mColorNameMap;
void HostInfo::initColorTable()
{
initColor( "#A5080B", QApplication::tr("cherry") );
initColor( "#76d26f", QApplication::tr("pistachio"));
initColor( "#664a08", QApplication::tr("chocolate"));
initColor( "#4c9dff", QApplication::tr("smurf"));
initColor( "#6c2ca8", QApplication::tr("blueberry"));
initColor( "#fa8344", QApplication::tr("orange"));
initColor( "#55CFBD", QApplication::tr("mint"));
initColor( "#db1230", QApplication::tr("strawberry"));
initColor( "#a6ea5e", QApplication::tr("apple"));
initColor( "#D6A3D8", QApplication::tr("bubblegum"));
initColor( "#f2aa4d", QApplication::tr("peach"));
initColor( "#aa1387", QApplication::tr("plum"));
initColor( "#26c3f7", QApplication::tr("polar sea"));
initColor( "#b8850e", QApplication::tr("nut"));
initColor( "#6a188d", QApplication::tr("blackberry"));
initColor( "#24b063", QApplication::tr("woodruff"));
initColor( "#ffff0f", QApplication::tr("banana"));
initColor( "#1e1407", QApplication::tr("mocha"));
initColor( "#29B450", QApplication::tr("kiwi"));
initColor( "#F8DD31", QApplication::tr("lemon"));
initColor( "#fa7e91", QApplication::tr("raspberry"));
initColor( "#c5a243", QApplication::tr("caramel"));
initColor( "#b8bcff", QApplication::tr("blueberry"));
// try to make the count a prime number (reminder: 19, 23, 29, 31)
// initColor( "#ffb8c0", QApplication::tr("blackcurrant"));
// initColor( "#f7d36f", QApplication::tr("passionfruit"));
// initColor( "#d51013", QApplication::tr("pomegranate"));
// initColor( "#C2C032", QApplication::tr("pumpkin" ) );
}
void HostInfo::initColor( const QString &value , const QString &name )
{
QColor c( value );
// modify colors so they become readable
c.setHsv( c.hsvHue(), c.hsvSaturation()/2, (c.value()/3)+150 );
mColorTable.append( c );
mColorNameMap.insert( c.red() + c.green() * 256 + c.blue() * 65536, name );
}
QString HostInfo::colorName( const QColor &c )
{
int key = c.red() + c.green() * 256 + c.blue() * 65536;
return mColorNameMap.value( key, QApplication::tr("") );
}
HostInfo::HostInfo( unsigned int id )
: mId( id )
{
}
QString HostInfo::toolTip() const
{
return QApplication::translate(("tooltip"),
"
"
" %1"
" "
"
"
"
IP:
%2
"
"
Platform:
%3
"
"
Flavor:
%4
"
"
Id:
%5
"
"
Speed:
%6
"
"
")
.arg(name()).arg(ip())
.arg(platform()).arg(colorName(color()))
.arg(QString::number(id()))
.arg(QString::number(serverSpeed()));
}
void HostInfo::updateFromStatsMap( const StatsMap &stats )
{
#if 0
qDebug() << "HostInfo::updateFromStatsMap():" << endl;
StatsMap::ConstIterator it;
for( it = stats.begin(); it != stats.end(); it++ ) {
qDebug() << " STAT: " << it.key() << ": " << it.data() << endl;
}
#endif
QString name = stats["Name"];
if ( name != mName ) {
mName = name;
mColor = createColor( mName );
mIp = stats["IP"];
mPlatform = stats["Platform"];
}
mMaxJobs = stats["MaxJobs"].toUInt();
mOffline = ( stats["State"] == "Offline" );
mServerSpeed = stats["Speed"].toFloat();
mServerLoad = stats["Load"].toUInt();
}
QColor HostInfo::createColor( const QString &name )
{
unsigned long h = 0;
unsigned long g;
int ch;
for( uint i = 0; i < (uint)name.length(); ++i ) {
ch = name[i].unicode();
h = (h << 4) + ch;
if ((g = (h & 0xf0000000)) != 0)
{
h ^= g >> 24;
h ^= g;
}
}
h += name.length() + ( name.length() << 17 );
h ^= h >> 2;
// qDebug() << "HostInfo::createColor: " << h % mColorTable.count() << ": " << name << endl;
return mColorTable[ h % mColorTable.count() ];
}
QColor HostInfo::createColor()
{
static int num = 0;
return mColorTable.at( num++ % mColorTable.count() );
#if 0
QColor color( num, 255 - num, ( num * 3 ) % 255 );
num += 48;
num %= 255;
return color;
#endif
}
HostInfoManager::HostInfoManager()
{
HostInfo::initColorTable();
}
HostInfoManager::~HostInfoManager()
{
qDeleteAll(mHostMap);
}
HostInfo *HostInfoManager::find( unsigned int hostid ) const
{
return mHostMap.value( hostid, 0 );
}
void HostInfoManager::checkNode(const HostInfo &info)
{
HostMap::ConstIterator it = mHostMap.constFind(info.id());
if (it == mHostMap.constEnd()) {
HostInfo *hostInfo = new HostInfo(info);
mHostMap.insert(info.id(), hostInfo);
} else {
// no-op
}
}
HostInfo *HostInfoManager::checkNode( unsigned int hostid,
const HostInfo::StatsMap &stats )
{
HostMap::ConstIterator it = mHostMap.constFind( hostid );
HostInfo *hostInfo;
if ( it == mHostMap.constEnd() ) {
hostInfo = new HostInfo( hostid );
mHostMap.insert( hostid, hostInfo );
} else {
hostInfo = *it;
}
hostInfo->updateFromStatsMap( stats );
return hostInfo;
}
QString HostInfoManager::nameForHost( unsigned int id ) const
{
HostInfo *hostInfo = find( id );
if ( hostInfo ) return hostInfo->name();
return QApplication::tr("");
}
QColor HostInfoManager::hostColor( unsigned int id ) const
{
if ( id ) {
HostInfo *hostInfo = find( id );
if ( hostInfo ) {
QColor tmp = hostInfo->color();
assert( tmp.isValid() && ( tmp.red() + tmp.green() + tmp.blue() ));
return tmp;
}
}
//qDebug() << "id " << id << " got no color\n";
assert( false );
return QColor( 0, 0, 0 );
}
unsigned int HostInfoManager::maxJobs( unsigned int id ) const
{
if ( id ) {
HostInfo *hostInfo = find( id );
if ( hostInfo ) return hostInfo->maxJobs();
}
return 0;
}
HostInfoManager::HostMap HostInfoManager::hostMap() const
{
return mHostMap;
}
void HostInfoManager::setSchedulerName( const QString& schedulerName )
{
mSchedulerName = schedulerName;
}
void HostInfoManager::setNetworkName( const QString& networkName )
{
mNetworkName = networkName;
}
icecc-monitor-2.9.90~git20140222/src/hostinfo.h 0000664 0000000 0000000 00000007244 12301400275 0020657 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2004 Cornelius Schumacher
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef ICEMON_HOSTINFO_H
#define ICEMON_HOSTINFO_H
#include
#include
#include
#include
class HostInfo
{
public:
explicit HostInfo( unsigned int id = 0 );
unsigned int id() const { return mId; }
void setName(const QString& name) { mName = name; }
QString name() const { return mName; }
void setColor(const QColor& color) { mColor = color; }
QColor color() const { return mColor; }
void setIp(const QString& ip) { mIp = ip; }
QString ip() const { return mIp; }
void setPlatform(const QString& platform) { mPlatform = platform; }
QString platform() const { return mPlatform; }
void setMaxJobs(unsigned int jobs) { mMaxJobs = jobs; }
unsigned int maxJobs() const { return mMaxJobs; }
void setOffline(bool offline) { mOffline = offline; }
bool isOffline() const { return mOffline; }
typedef QMap StatsMap;
void updateFromStatsMap( const StatsMap &stats );
static void initColorTable();
static QString colorName( const QColor & );
void setServerSpeed(float serverSpeed) { mServerSpeed = serverSpeed; }
float serverSpeed() const { return mServerSpeed; }
void setServerLoad(unsigned int load) { mServerLoad = load; }
unsigned int serverLoad() const { return mServerLoad; }
QString toolTip() const;
bool operator==( const HostInfo &rhs ) const { return mId == rhs.mId; }
bool operator!=( const HostInfo &rhs ) const { return mId != rhs.mId; }
int operator<( const HostInfo &rhs ) const{ return mId < rhs.mId; }
protected:
static void initColor( const QString &value, const QString &name );
QColor createColor();
QColor createColor( const QString &name );
private:
unsigned int mId;
QString mName;
QColor mColor;
QString mPlatform;
QString mIp;
unsigned int mMaxJobs;
bool mOffline;
float mServerSpeed;
unsigned int mServerLoad;
static QVector mColorTable;
static QMap mColorNameMap;
};
class HostInfoManager
{
public:
HostInfoManager();
~HostInfoManager();
HostInfo *find( unsigned int hostid ) const;
typedef QMap HostMap;
HostMap hostMap() const;
void checkNode(const HostInfo &info);
HostInfo *checkNode( unsigned int hostid,
const HostInfo::StatsMap &statmsg );
QString nameForHost( unsigned int id ) const;
QColor hostColor( unsigned int id ) const;
unsigned int maxJobs( unsigned int id ) const;
QString schedulerName() const { return mSchedulerName; }
void setSchedulerName( const QString& schedulerName );
QString networkName() const { return mNetworkName; }
void setNetworkName( const QString& networkName );
private:
HostMap mHostMap;
QString mSchedulerName;
QString mNetworkName;
};
#endif
// vim:ts=4:sw=4:noet
icecc-monitor-2.9.90~git20140222/src/hostlistmodel.cc 0000664 0000000 0000000 00000011466 12301400275 0022057 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2012 Kevin Funk
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "hostlistmodel.h"
#include
#include
HostListModel::HostListModel(HostInfoManager* manager, QObject* parent)
: QAbstractListModel(parent)
, m_hostInfoManager(manager)
{
}
QVariant HostListModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
switch(section) {
case ColumnID:
return tr("ID");
case ColumnName:
return tr("Name");
case ColumnColor:
return tr("Color");
case ColumnIP:
return tr("IP");
case ColumnPlatform:
return tr("Platform");
case ColumnMaxJobs:
return tr("Max Jobs");
case ColumnSpeed:
return tr("Speed");
case ColumnLoad:
return tr("Load");
default:
break;
}
}
return QAbstractItemModel::headerData(section, orientation, role);
}
QVariant HostListModel::data(const QModelIndex& index, int role) const
{
if (!index.isValid())
return QVariant();
const HostInfo info = hostInfoForIndex(index);
const int column = index.column();
if (role == HostIdRole) {
return info.id();
} else if (role == Qt::DisplayRole) {
switch (column) {
case ColumnID:
return info.id();
case ColumnName:
return info.name();
case ColumnColor:
return HostInfo::colorName(info.color());
case ColumnIP:
return info.ip();
case ColumnPlatform:
return info.platform();
case ColumnMaxJobs:
return info.maxJobs();
case ColumnSpeed:
return int(info.serverSpeed());
case ColumnLoad:
return info.serverLoad();
default:
break;
}
} else if (role == Qt::TextAlignmentRole) {
switch (column) {
case ColumnID:
return Qt::AlignRight;
case ColumnMaxJobs:
return Qt::AlignRight;
case ColumnSpeed:
return Qt::AlignRight;
case ColumnLoad:
return Qt::AlignRight;
default:
break;
}
}
return QVariant();
}
int HostListModel::columnCount(const QModelIndex& parent) const
{
return _ColumnCount;
}
int HostListModel::rowCount(const QModelIndex& parent) const
{
Q_UNUSED(parent);
return m_hostInfos.size();
}
QModelIndex HostListModel::parent(const QModelIndex& child) const
{
Q_UNUSED(child);
return QModelIndex();
}
HostInfo HostListModel::hostInfoForIndex(const QModelIndex& index) const
{
return m_hostInfos.value(index.row());
}
QModelIndex HostListModel::indexForHostInfo(const HostInfo& info, int column) const
{
const int i = m_hostInfos.indexOf(info);
return index(i, column);
}
void HostListModel::checkNode(unsigned int hostid)
{
const HostInfo* info = m_hostInfoManager->find( hostid );
if (!info)
return;
const int index = m_hostInfos.indexOf(*info);
if (index != -1) {
m_hostInfos[index] = *info;
emit dataChanged(indexForHostInfo(*info, 0), indexForHostInfo(*info, _ColumnCount - 1));
} else {
beginInsertRows(QModelIndex(), m_hostInfos.size(), m_hostInfos.size());
m_hostInfos << *info;
endInsertRows();
}
}
struct find_hostid : public std::unary_function
{
public:
find_hostid(unsigned int hostId) : m_hostId(hostId) {}
bool operator()(const HostInfo& info) const
{
return info.id() == m_hostId;
}
private:
unsigned int m_hostId;
};
void HostListModel::removeNodeById(unsigned int hostId)
{
QVector::iterator it = std::find_if(m_hostInfos.begin(), m_hostInfos.end(), find_hostid(hostId));
int index = std::distance(m_hostInfos.begin(), it);
beginRemoveRows(QModelIndex(), index, index);
m_hostInfos.erase(it);
endRemoveRows();
}
void HostListModel::clear()
{
m_hostInfos.clear();
reset();
}
#include "hostlistmodel.moc"
icecc-monitor-2.9.90~git20140222/src/hostlistmodel.h 0000664 0000000 0000000 00000004064 12301400275 0021715 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2012 Kevin Funk
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef ICEMON_HOSTLISTMODEL_H
#define ICEMON_HOSTLISTMODEL_H
#include
#include "hostinfo.h"
class HostListModel : public QAbstractListModel
{
Q_OBJECT
public:
enum Column
{
ColumnID,
ColumnName,
ColumnColor,
ColumnIP,
ColumnPlatform,
ColumnMaxJobs,
ColumnSpeed,
ColumnLoad,
_ColumnCount
};
enum Role
{
HostIdRole = Qt::UserRole
};
explicit HostListModel(HostInfoManager* manager, QObject* parent = 0);
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
virtual QVariant data(const QModelIndex& index, int role) const;
virtual int columnCount(const QModelIndex& parent) const;
virtual int rowCount(const QModelIndex& parent) const;
virtual QModelIndex parent(const QModelIndex& child) const;
void checkNode(unsigned int hostId);
void removeNodeById(unsigned int hostId);
void clear();
HostInfo hostInfoForIndex(const QModelIndex& index) const;
QModelIndex indexForHostInfo(const HostInfo& info, int column) const;
private:
const HostInfoManager* m_hostInfoManager;
QVector m_hostInfos;
};
#endif // ICEMON_HOSTLISTMODEL_H
icecc-monitor-2.9.90~git20140222/src/hostlistview.cc 0000664 0000000 0000000 00000002617 12301400275 0021727 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2004-2006 Andre Wöbbeking
Copyright (c) 2012 Kevin Funk
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "hostlistview.h"
#include "hostlistmodel.h"
HostListView::HostListView( HostInfoManager* manager,
QWidget* parent )
: QTreeView( parent )
, mHostInfoManager( manager )
{
setAllColumnsShowFocus(true);
setRootIsDecorated(false);
setSortingEnabled(true);
setWindowTitle(tr("Hosts"));
}
void HostListView::setModel(QAbstractItemModel* model)
{
if (model) {
sortByColumn(HostListModel::ColumnID);
}
QTreeView::setModel(model);
}
#include "hostlistview.moc"
icecc-monitor-2.9.90~git20140222/src/hostlistview.h 0000664 0000000 0000000 00000002311 12301400275 0021560 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2004 Andre Wöbbeking
Copyright (c) 2012 Kevin Funk
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef ICEMON_HOSTLISTVIEW_H
#define ICEMON_HOSTLISTVIEW_H
#include "hostinfo.h"
#include
class HostListView :public QTreeView
{
Q_OBJECT
public:
HostListView( HostInfoManager* manager, QWidget* parent );
virtual void setModel(QAbstractItemModel* model);
private:
HostInfoManager* mHostInfoManager;
};
#endif
icecc-monitor-2.9.90~git20140222/src/icecreammonitor.cc 0000664 0000000 0000000 00000025103 12301400275 0022336 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2003 Frerich Raabe
Copyright (c) 2003,2004 Stephan Kulow
Copyright (c) 2003,2004 Cornelius Schumacher
Copyright (c) 2007 Dirk Mueller
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "icecreammonitor.h"
#include "hostinfo.h"
#include "statusview.h"
#include
#include
#include
#include
#include
#include
#include
using namespace std;
IcecreamMonitor::IcecreamMonitor( HostInfoManager *manager, QObject *parent)
: Monitor(manager, parent)
, m_scheduler( 0 )
, m_schedulerState( false )
, m_discover( 0 )
, m_fd_notify( 0 )
, m_fd_type(QSocketNotifier::Exception)
{
setupDebug();
checkScheduler();
}
IcecreamMonitor::~IcecreamMonitor()
{
delete m_scheduler;
delete m_discover;
}
void IcecreamMonitor::checkScheduler(bool deleteit)
{
#if 0
qDebug() << "checkScheduler " << deleteit << endl;
#endif
if ( deleteit ) {
m_rememberedJobs.clear();
delete m_scheduler;
m_scheduler = 0;
delete m_fd_notify;
m_fd_notify = 0;
m_fd_type = QSocketNotifier::Exception;
delete m_discover;
m_discover = 0;
setSchedulerState(false);
} else if ( m_scheduler )
return;
QTimer::singleShot( 1000+(qrand()&1023), this, SLOT( slotCheckScheduler() ) ); // TODO: check if correct
}
void IcecreamMonitor::registerNotify(int fd, QSocketNotifier::Type type, const char* slot)
{
if (m_fd_notify) {
m_fd_notify->disconnect(this);
m_fd_notify->deleteLater();
}
m_fd_notify = new QSocketNotifier(fd, type, this);
m_fd_type = type;
QObject::connect(m_fd_notify, SIGNAL(activated(int)), slot);
}
void IcecreamMonitor::slotCheckScheduler()
{
if ( m_scheduler )
return;
list names;
if ( !m_current_netname.isEmpty() )
names.push_front( m_current_netname.data() );
else
names.push_front("ICECREAM");
if (!qgetenv("USE_SCHEDULER").isEmpty())
names.push_front(""); // try $USE_SCHEDULER
for ( list::const_iterator it = names.begin(); it != names.end();
++it ) {
m_current_netname = it->c_str();
if (!m_discover
|| m_discover->timed_out()) {
delete m_discover;
m_discover = new DiscoverSched ( m_current_netname.data() );
}
m_scheduler = m_discover->try_get_scheduler ();
if ( m_scheduler ) {
hostInfoManager()->setSchedulerName( QString::fromLatin1(m_discover->schedulerName().data()) );
hostInfoManager()->setNetworkName( QString::fromLatin1(m_discover->networkName().data()) );
m_scheduler->setBulkTransfer();
delete m_discover;
m_discover = 0;
registerNotify(m_scheduler->fd,
QSocketNotifier::Read, SLOT(msgReceived()));
if ( !m_scheduler->send_msg ( MonLoginMsg() ) ) {
checkScheduler(true);
QTimer::singleShot(0, this, SLOT(slotCheckScheduler()));
}
else {
setSchedulerState( true );
}
return;
}
if (m_fd_type != QSocketNotifier::Write
&& m_discover->connect_fd() >= 0) {
registerNotify(m_discover->connect_fd(),
QSocketNotifier::Write, SLOT(slotCheckScheduler()));
return;
}
else if (m_fd_type != QSocketNotifier::Read
&& m_discover->listen_fd() >= 0) {
registerNotify(m_discover->listen_fd(),
QSocketNotifier::Read, SLOT(slotCheckScheduler()));
}
if (m_fd_type == QSocketNotifier::Read)
QTimer::singleShot(1000+(qrand()&1023), this, SLOT(slotCheckScheduler()));
}
setSchedulerState( false );
}
void IcecreamMonitor::msgReceived()
{
while (!m_scheduler->read_a_bit() || m_scheduler->has_msg())
if (!handle_activity())
break;
}
bool IcecreamMonitor::handle_activity()
{
Msg *m = m_scheduler->get_msg ();
if ( !m ) {
#if 0
qDebug() << "lost connection to scheduler\n";
#endif
checkScheduler( true );
setSchedulerState( false );
return false;
}
switch ( m->type ) {
case M_MON_GET_CS:
handle_getcs( m );
break;
case M_MON_JOB_BEGIN:
handle_job_begin( m );
break;
case M_MON_JOB_DONE:
handle_job_done( m );
break;
case M_END:
std::cout << "END" << endl;
checkScheduler( true );
break;
case M_MON_STATS:
handle_stats( m );
break;
case M_MON_LOCAL_JOB_BEGIN:
handle_local_begin( m );
break;
case M_JOB_LOCAL_DONE:
handle_local_done( m );
break;
default:
cout << "UNKNOWN" << endl;
break;
}
delete m;
return true;
}
void IcecreamMonitor::handle_getcs( Msg *_m )
{
MonGetCSMsg *m = dynamic_cast( _m );
if ( !m ) return;
m_rememberedJobs[m->job_id] = Job( m->job_id, m->clientid,
m->filename.c_str(),
m->lang == CompileJob::Lang_C ? "C" :
"C++" );
m_view->update( m_rememberedJobs[m->job_id] );
}
void IcecreamMonitor::handle_local_begin( Msg *_m )
{
MonLocalJobBeginMsg *m = dynamic_cast( _m );
if ( !m ) return;
m_rememberedJobs[m->job_id] = Job( m->job_id, m->hostid,
m->file.c_str(),
"C++" );
m_rememberedJobs[m->job_id].setState( Job::LocalOnly );
m_view->update( m_rememberedJobs[m->job_id] );
}
void IcecreamMonitor::handle_local_done( Msg *_m )
{
JobLocalDoneMsg *m = dynamic_cast( _m );
if ( !m ) return;
JobList::iterator it = m_rememberedJobs.find( m->job_id );
if ( it == m_rememberedJobs.end() ) {
// we started in between
return;
}
( *it ).setState( Job::Finished );
m_view->update( *it );
if ( m_rememberedJobs.size() > 3000 ) { // now remove 1000
uint count = 1000;
while ( --count )
m_rememberedJobs.erase( m_rememberedJobs.begin() );
}
}
void IcecreamMonitor::handle_stats( Msg *_m )
{
MonStatsMsg *m = dynamic_cast( _m );
if ( !m ) return;
QStringList statmsg = QString( m->statmsg.c_str() ).split( '\n' );
HostInfo::StatsMap stats;
for ( QStringList::ConstIterator it = statmsg.constBegin(); it != statmsg.constEnd();
++it ) {
QString key = *it;
key = key.left( key.indexOf( ':' ) );
QString value = *it;
value = value.mid( value.indexOf( ':' ) + 1 );
stats[key] = value;
}
HostInfo *hostInfo = hostInfoManager()->checkNode( m->hostid, stats );
if ( hostInfo->isOffline() ) {
m_view->removeNode( m->hostid );
} else {
m_view->checkNode( m->hostid );
}
}
void IcecreamMonitor::handle_job_begin( Msg *_m )
{
MonJobBeginMsg *m = dynamic_cast( _m );
if ( !m ) return;
JobList::iterator it = m_rememberedJobs.find( m->job_id );
if ( it == m_rememberedJobs.end() ) {
// we started in between
return;
}
( *it ).setServer( m->hostid );
( *it ).setStartTime( m->stime );
( *it ).setState( Job::Compiling );
#if 0
qDebug() << "BEGIN: " << (*it).fileName() << " (" << (*it).jobId()
<< ")" << endl;
#endif
m_view->update( *it );
}
void IcecreamMonitor::handle_job_done( Msg *_m )
{
MonJobDoneMsg *m = dynamic_cast( _m );
if ( !m ) return;
JobList::iterator it = m_rememberedJobs.find( m->job_id );
if ( it == m_rememberedJobs.end() ) {
// we started in between
return;
}
( *it ).exitcode = m->exitcode;
if ( m->exitcode ) {
( *it ).setState( Job::Failed );
} else {
( *it ).setState( Job::Finished );
( *it ).real_msec = m->real_msec;
( *it ).user_msec = m->user_msec;
( *it ).sys_msec = m->sys_msec; /* system time used */
( *it ).pfaults = m->pfaults; /* page faults */
( *it ).in_compressed = m->in_compressed;
( *it ).in_uncompressed = m->in_uncompressed;
( *it ).out_compressed = m->out_compressed;
( *it ).out_uncompressed = m->out_uncompressed;
}
#if 0
qDebug() << "DONE: " << (*it).fileName() << " (" << (*it).jobId()
<< ")" << endl;
#endif
m_view->update( *it );
}
void IcecreamMonitor::setCurrentView( StatusView *view, bool rememberJobs )
{
m_view = view;
m_view->updateSchedulerState( m_schedulerState );
if ( rememberJobs ) {
JobList::ConstIterator it = m_rememberedJobs.constBegin();
for ( ; it != m_rememberedJobs.constEnd(); ++it )
m_view->update( *it );
}
}
void IcecreamMonitor::setCurrentNet( const QByteArray &netName )
{
m_current_netname = netName;
}
void IcecreamMonitor::setSchedulerState( bool online )
{
if (m_schedulerState == online)
return;
m_schedulerState = online;
emit schedulerStateChanged( online );
m_view->updateSchedulerState( online );
}
void IcecreamMonitor::setupDebug()
{
char *env = getenv("ICECC_DEBUG");
int debug_level = Error;
if (env) {
if (!strcasecmp(env, "info")) {
debug_level |= Info | Warning;
} else if (!strcasecmp(env, "warnings")) {
debug_level |= Warning; // taking out warning
} else { // any other value
debug_level |= Info | Debug | Warning;
}
}
std::string logfile;
if (const char *logfileEnv = getenv("ICECC_LOGFILE")) {
logfile = logfileEnv;
}
setup_debug(debug_level, logfile, "ICEMON");
}
#include "icecreammonitor.moc"
icecc-monitor-2.9.90~git20140222/src/icecreammonitor.h 0000664 0000000 0000000 00000004453 12301400275 0022205 0 ustar 00root root 0000000 0000000 /*
This file is part of Icecream.
Copyright (c) 2003 Frerich Raabe
Copyright (c) 2003,2004 Stephan Kulow
Copyright (c) 2003,2004 Cornelius Schumacher
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef ICEMON_ICECREAMMONITOR_H
#define ICEMON_ICECREAMMONITOR_H
#include "monitor.h"
#include "job.h"
#include
class HostInfoManager;
class Msg;
class MsgChannel;
class StatusView;
class DiscoverSched;
class QSocketNotifier;
class IcecreamMonitor : public Monitor
{
Q_OBJECT
public:
IcecreamMonitor(HostInfoManager *, QObject *parent);
~IcecreamMonitor();
void setCurrentView( StatusView *, bool rememberJobs );
void setSchedulerState( bool );
void setCurrentNet( const QByteArray & );
bool schedulerState() const { return m_schedulerState; }
private slots:
void slotCheckScheduler();
void msgReceived();
private:
void checkScheduler(bool deleteit = false);
void registerNotify(int fd, QSocketNotifier::Type type, const char* slot);
void setupDebug();
bool handle_activity();
void handle_getcs( Msg *m );
void handle_job_begin( Msg *m );
void handle_job_done( Msg *m );
void handle_stats( Msg *m );
void handle_local_begin( Msg *m );
void handle_local_done( Msg *m );
StatusView *m_view;
JobList m_rememberedJobs;
MsgChannel *m_scheduler;
QByteArray m_current_netname;
bool m_schedulerState;
DiscoverSched *m_discover;
QSocketNotifier *m_fd_notify;
QSocketNotifier::Type m_fd_type;
};
#endif // ICEMON_ICECREAMMONITOR_H
// vim:ts=4:sw=4:noet
icecc-monitor-2.9.90~git20140222/src/icemon.desktop 0000664 0000000 0000000 00000006171 12301400275 0021520 0 ustar 00root root 0000000 0000000 [Desktop Entry]
GenericName=Icecream Monitor
GenericName[ca]=Monitor Icecream
GenericName[ca@valencia]=Monitor Icecream
GenericName[el]=Επόπτης Icecream
GenericName[en_GB]=Icecream Monitor
GenericName[es]=Monitor Icecream
GenericName[et]=Icecreami jälgija
GenericName[fr]=Moniteur Icecream
GenericName[ga]=Monatóir Icecream
GenericName[gl]=Vixilante Icecream
GenericName[hne]=आइसक्रीम मानीटर
GenericName[hu]=Icecream figyelő
GenericName[it]=Monitor Icecream
GenericName[ja]=Icecream モニタ
GenericName[ms]=Monitor Icecream
GenericName[nds]=Icecream-Kieker
GenericName[nl]=Icecream-monitor
GenericName[pa]=ਆਈਸਕਰੀਮ ਮਾਨੀਟਰ
GenericName[pl]=Monitor Icecream
GenericName[pt]=Monitor Icecream
GenericName[pt_BR]=Monitor Icecream
GenericName[ro]=Monitor Icecream
GenericName[sv]=Övervakare av Icecream
GenericName[tr]=Icecream İzleyici
GenericName[uk]=Монітор Icecream
GenericName[x-test]=xxIcecream Monitorxx
GenericName[zh_TW]=Icecream 監視器
Name=Icemon
Name[ca]=Icemon
Name[ca@valencia]=Icemon
Name[cs]=Icemon
Name[de]=Icemon
Name[el]=Icemon
Name[en_GB]=Icemon
Name[eo]=Icemon
Name[es]=Icemon
Name[et]=Icemon
Name[fr]=Icemon
Name[ga]=Icemon
Name[gl]=Icemon
Name[hne]=आइसमान
Name[hu]=Icemon
Name[it]=Icemon
Name[ja]=Icemon
Name[ms]=Icemon
Name[nds]=Icemon
Name[nl]=Icemon
Name[pa]=ਆਈਸਮੋਨ
Name[pl]=Icemon
Name[pt]=Icemon
Name[pt_BR]=Icemon
Name[ro]=Icemon
Name[sk]=Icemon
Name[sv]=Icemon
Name[tr]=Icemon
Name[ug]=Icemon
Name[uk]=Icemon
Name[x-test]=xxIcemonxx
Name[zh_TW]=Icemon
Comment=A monitor for an Icecream compilation network
Comment[ca]=Un monitor per a una xarxa de compilació Icecream
Comment[ca@valencia]=Un monitor per a una xarxa de compilació Icecream
Comment[el]=Ένας επόπτης ενός μιας σύνθεσης δικτύου Icecream
Comment[en_GB]=A monitor for an Icecream compilation network
Comment[es]=Un monitor para una red de compilación Icecream
Comment[et]=Icecreami kompileerimisvõrgu jälgija
Comment[fr]=Un moniteur pour une compilation réseau de Icecream
Comment[ga]=Monatóir do líonra tiomsaithe Icecream
Comment[gl]=Un vixilante para unha compilación de rede Icecream
Comment[hne]=आईसक्रीम कम्पायलर नेटवर्क बर एक मानीटर
Comment[it]=Monitor per una rete di compilazione Icecream
Comment[ms]=Peninjau jaringan kompilasi Icecream
Comment[nds]=En Kieker för en Icecream-Kompileernettwark
Comment[nl]=Een monitor voor een Icecream Compilatienetwerk
Comment[pl]=Monitor dla sieci kompilacji Icecream
Comment[pt]=Um monitor para uma rede de compilação Icecream
Comment[pt_BR]=Um monitor para uma rede de compilação Icecream
Comment[sv]=En övervakare av ett Icecream-kompileringsnätverk
Comment[tr]=Icecream derleme ağı için bir izleyici
Comment[ug]=Icecream تارقاق يۇغۇرۇش تورىنى كۆزەتكۈچ
Comment[uk]=Монітор мережі компіляції Icecream
Comment[x-test]=xxA monitor for an Icecream compilation networkxx
Exec=icemon
Type=Application
Terminal=false
Categories=Qt;Development;
Icon=icemon
Keywords=icecc;icecream;monitor;network;
icecc-monitor-2.9.90~git20140222/src/icemon.qrc 0000664 0000000 0000000 00000000524 12301400275 0020630 0 ustar 00root root 0000000 0000000 images/hi128-app-icemon.pngimages/icemonnode.pngimages/hi16-app-icemon.pngimages/hi48-app-icemon.pngimages/hi22-app-icemon.pngimages/hi32-app-icemon.png
icecc-monitor-2.9.90~git20140222/src/images/ 0000775 0000000 0000000 00000000000 12301400275 0020113 5 ustar 00root root 0000000 0000000 icecc-monitor-2.9.90~git20140222/src/images/CMakeLists.txt 0000664 0000000 0000000 00000000050 12301400275 0022646 0 ustar 00root root 0000000 0000000 kde4_install_icons(${ICON_INSTALL_DIR})
icecc-monitor-2.9.90~git20140222/src/images/hi128-app-icemon.png 0000664 0000000 0000000 00000025166 12301400275 0023514 0 ustar 00root root 0000000 0000000 PNG
IHDR >a sBIT|d pHYs $ $P$ tEXtSoftware www.inkscape.org< tEXtTitle Icecream MonitorȏTv tEXtAuthor Jakub Steiner/ IDATxyU眪{ol$(3ƍHeq^_uܘ:ƅ\^%$(qpATH$k'.UuTխ{F:ݒrkyyγSJDxf/fYYz ,g0ɛizgۖYm_H4j/"xo_*{gL{>Z8!T+yT81 \aDΚ)!o}%<& 9O;@6CKB`|MQU˞S;73~Ҵ s<Yyetv;Q}ye?6LX +:ݼ4 kQ9,- q|ﳻ$O>4Hm8@Du[*M+!M+ \/<#Odqq}f}'9@R;wH(yRpyܢ `y(>:,ז; q:khZm % _
ϡf&v.yeT- Dxpcxд`j*w@zAvMF)l((Xq`=4m (KZYo7SM3 %A`9]4c`+!N@MCME:
vGAnu]$1th Ц*?@U#d0DM$ 24B~:|WjNo%NGGkw^"chڼuo}#P``+Hņו:)`