Added Teams data source.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25010 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2008-04-17 20:02:43 +00:00
parent cbd4bc9573
commit 8cda9a8ead
2 changed files with 61 additions and 0 deletions

View File

@ -18,6 +18,7 @@ const DataSource* kSources[] = {
new UsedMemoryDataSource(),
new CachedMemoryDataSource(),
new ThreadsDataSource(),
new TeamsDataSource(),
new CPUUsageDataSource(),
new CPUCombinedUsageDataSource(),
new NetworkUsageDataSource(true),
@ -386,6 +387,53 @@ ThreadsDataSource::AdaptiveScale() const
// #pragma mark -
TeamsDataSource::TeamsDataSource()
{
SystemInfo info;
fMinimum = 0;
fMaximum = info.MaxTeams();
fColor = (rgb_color){0, 150, 255};
}
TeamsDataSource::~TeamsDataSource()
{
}
DataSource*
TeamsDataSource::Copy() const
{
return new TeamsDataSource(*this);
}
int64
TeamsDataSource::NextValue(SystemInfo& info)
{
return info.UsedTeams();
}
const char*
TeamsDataSource::Label() const
{
return "Teams";
}
bool
TeamsDataSource::AdaptiveScale() const
{
return true;
}
// #pragma mark -
CPUUsageDataSource::CPUUsageDataSource(int32 cpu)
:
fPreviousActive(0),

View File

@ -102,6 +102,19 @@ public:
};
class TeamsDataSource : public DataSource {
public:
TeamsDataSource();
virtual ~TeamsDataSource();
virtual DataSource* Copy() const;
virtual int64 NextValue(SystemInfo& info);
virtual const char* Label() const;
virtual bool AdaptiveScale() const;
};
class CPUUsageDataSource : public DataSource {
public:
CPUUsageDataSource(int32 cpu = 0);