DRCL J-Sim API

drcl.inet.sensorsim
Class CPUBase

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.inet.sensorsim.CPUBase
All Implemented Interfaces:
java.lang.Cloneable, ObjectCloneable, ObjectDuplicable, java.io.Serializable
Direct Known Subclasses:
CPUAvr

public abstract class CPUBase
extends Component

Abstract base class for CPU models.

Version:
1.0, 12/19/2003
Author:
Ahmed Sobeih
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
static int CPU_ACTIVE
           
static int CPU_IDLE
           
static int CPU_OFF
           
static int CPU_SLEEP
           
 
Fields inherited from class drcl.comp.Component
FLAG_COMPONENT_NOTIFICATION, FLAG_DEBUG_ENABLED, FLAG_DIRECT_OUTPUT_ENABLED, FLAG_ENABLED, FLAG_ERROR_ENABLED, FLAG_EVENT_ENABLED, FLAG_GARBAGE_DISPLAY_ENABLED, FLAG_GARBAGE_ENABLED, FLAG_PORT_NOTIFICATION, FLAG_STARTED, FLAG_STOPPED, FLAG_TRACE_ENABLED, FLAG_UNDEFINED_START, id, infoPort, locks, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND
 
Constructor Summary
CPUBase()
           
 
Method Summary
 void attachApp(Port port_)
          Connects to the sensor application layer.
 boolean flagIsSet()
           
 double getActiveCur()
          Gets the active current.
 double getClockSpeed()
          Gets the clock speed.
 int getCPUMode()
          Gets the CPU mode.
 double getIdleCur()
          Gets the idle current.
 double getOffCur()
          Gets the OFF current.
 double getRemainingEnergy()
          Gets the remaining energy.
 double getSleepCur()
          Gets the sleep current.
 boolean isActive()
          Returns true if the CPU is active.
 boolean isIdle()
          Returns true if the CPU is idle.
 boolean isOff()
          Returns true if the CPU is OFF.
 boolean isSleep()
          Returns true if the CPU is sleep.
 void reportCpuMode(int mode)
          Reports the CPU mode to the sensor application layer.
 double setActiveCur(double a)
          Sets the active current.
 void setClockSpeed(double a)
          Sets the clock speed.
 int setCPUMode(int a)
          Sets the CPU mode.
 double setIdleCur(double a)
          Sets the idle current.
 double setOffCur(double a)
          Sets the OFF current.
 double setSleepCur(double a)
          Sets the sleep current.
 void toggleFlag()
           
 
Methods inherited from class drcl.comp.Component
addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, duplicate, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getID, getName, getParent, getPort, getPort, getRoot, getTime, iduplicate, info, isAncestorOf, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectlyRelatedTo, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, reset, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait
 
Methods inherited from class drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CPU_IDLE

public static final int CPU_IDLE
See Also:
Constant Field Values

CPU_SLEEP

public static final int CPU_SLEEP
See Also:
Constant Field Values

CPU_ACTIVE

public static final int CPU_ACTIVE
See Also:
Constant Field Values

CPU_OFF

public static final int CPU_OFF
See Also:
Constant Field Values
Constructor Detail

CPUBase

public CPUBase()
Method Detail

attachApp

public void attachApp(Port port_)
Connects to the sensor application layer.


reportCpuMode

public void reportCpuMode(int mode)
Reports the CPU mode to the sensor application layer.


getActiveCur

public double getActiveCur()
Gets the active current.


getIdleCur

public double getIdleCur()
Gets the idle current.


getSleepCur

public double getSleepCur()
Gets the sleep current.


getOffCur

public double getOffCur()
Gets the OFF current.


getClockSpeed

public double getClockSpeed()
Gets the clock speed.


getCPUMode

public int getCPUMode()
Gets the CPU mode.


getRemainingEnergy

public double getRemainingEnergy()
Gets the remaining energy.


setActiveCur

public double setActiveCur(double a)
Sets the active current.


setIdleCur

public double setIdleCur(double a)
Sets the idle current.


setSleepCur

public double setSleepCur(double a)
Sets the sleep current.


setOffCur

public double setOffCur(double a)
Sets the OFF current.


isOff

public boolean isOff()
Returns true if the CPU is OFF.


isSleep

public boolean isSleep()
Returns true if the CPU is sleep.


isIdle

public boolean isIdle()
Returns true if the CPU is idle.


isActive

public boolean isActive()
Returns true if the CPU is active.


toggleFlag

public void toggleFlag()

flagIsSet

public boolean flagIsSet()

setCPUMode

public int setCPUMode(int a)
Sets the CPU mode.


setClockSpeed

public void setClockSpeed(double a)
Sets the clock speed.


DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~