- Added visualization of resources queue to resourceswidget. Task #28

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@978 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-09-01 00:23:39 +00:00
parent eb9546a63c
commit 58cf50b500
5 changed files with 138 additions and 54 deletions

View file

@ -110,6 +110,46 @@ GlobalPreferences::set_speed(int new_speed)
return old_speed;
}
Glib::ustring
GlobalPreferences::get_schedulable_color(Schedulable::state st) const
{
switch(st)
{
case Schedulable::state_running:
return "green";
case Schedulable::state_ready:
return "yellow";
case Schedulable::state_blocked:
return "red";
case Schedulable::state_terminated:
return "DimGray";
case Schedulable::state_future:
return "LightGrey";
default:
return "black";
}
}
Glib::ustring
GlobalPreferences::get_request_color(Request::state st) const
{
switch(st)
{
case Request::state_allocated:
return "green";
case Request::state_allocable:
return "yellow";
case Request::state_unallocable:
return "red";
case Request::state_exhausted:
return "DimGray";
case Request::state_future:
return "LightGrey";
default:
return "black";
}
}
void
GlobalPreferences::write_configrc()
{

View file

@ -29,6 +29,8 @@
// Do not include complete template definition here:
#include "singleton.hh"
#include "schedulable.hh"
#include "request.hh"
namespace sgpem
{
@ -101,6 +103,18 @@ namespace sgpem
*/
int set_speed(int new_speed);
/**
\return A HTML color name or hexadecimal code
*/
Glib::ustring get_schedulable_color(Schedulable::state st) const;
/**
\brief Also works with SubRequest::state
\return A HTML color name or hexadecimal code
*/
Glib::ustring get_request_color(Request::state st) const;
/**
\brief Writes preferences to disk