From 2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 16 Jul 2007 15:40:11 +0000 Subject: changed to native line ending encoding --- OpenSim/Region/Examples/SimpleApp/MySceneObject.cs | 80 +++++++++++----------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'OpenSim/Region/Examples/SimpleApp/MySceneObject.cs') diff --git a/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs b/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs index aab52cc..f5c6a0f 100644 --- a/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs +++ b/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs @@ -1,40 +1,40 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Region.Environment.Scenes; -using libsecondlife; -using OpenSim.Framework.Types; -using System.Timers; -using System.Diagnostics; - -namespace SimpleApp -{ - public class MySceneObject : SceneObject - { - private PerformanceCounter m_counter; - - public MySceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) - : base(world, eventManager, ownerID, localID, pos, shape ) - { - String objectName = "Processor"; - String counterName = "% Processor Time"; - String instanceName = "_Total"; - - m_counter = new PerformanceCounter(objectName, counterName, instanceName); - - Timer timer = new Timer(); - timer.Enabled = true; - timer.Interval = 100; - timer.Elapsed += new ElapsedEventHandler(this.Heartbeat); - - } - - public void Heartbeat(object sender, EventArgs e) - { - float cpu = m_counter.NextValue() / 40f; - LLVector3 size = new LLVector3(cpu, cpu, cpu); - rootPrimitive.ResizeGoup( size ); - update(); - } - } -} +using System; +using System.Collections.Generic; +using System.Text; +using OpenSim.Region.Environment.Scenes; +using libsecondlife; +using OpenSim.Framework.Types; +using System.Timers; +using System.Diagnostics; + +namespace SimpleApp +{ + public class MySceneObject : SceneObject + { + private PerformanceCounter m_counter; + + public MySceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) + : base(world, eventManager, ownerID, localID, pos, shape ) + { + String objectName = "Processor"; + String counterName = "% Processor Time"; + String instanceName = "_Total"; + + m_counter = new PerformanceCounter(objectName, counterName, instanceName); + + Timer timer = new Timer(); + timer.Enabled = true; + timer.Interval = 100; + timer.Elapsed += new ElapsedEventHandler(this.Heartbeat); + + } + + public void Heartbeat(object sender, EventArgs e) + { + float cpu = m_counter.NextValue() / 40f; + LLVector3 size = new LLVector3(cpu, cpu, cpu); + rootPrimitive.ResizeGoup( size ); + update(); + } + } +} -- cgit v1.1