blob: 185d95e5b6b54daa2e208bf482952e68e841ad38 [file] [log] [blame] [raw]
package li.cil.oc.server.component
import java.util
import li.cil.oc.Constants
import li.cil.oc.api.driver.DeviceInfo.DeviceAttribute
import li.cil.oc.api.driver.DeviceInfo.DeviceClass
import li.cil.oc.Settings
import li.cil.oc.api.Network
import li.cil.oc.api.driver.DeviceInfo
import li.cil.oc.api.network.Visibility
import li.cil.oc.api.prefab
import scala.collection.convert.WrapAsJava._
class CPU(val tier: Int) extends prefab.ManagedEnvironment with DeviceInfo {
override val node = Network.newNode(this, Visibility.Neighbors).
create()
private final lazy val deviceInfo = Map(
DeviceAttribute.Class -> DeviceClass.Processor,
DeviceAttribute.Description -> "CPU",
DeviceAttribute.Vendor -> Constants.DeviceInfo.DefaultVendor,
DeviceAttribute.Product -> ("FlexiArch " + (tier + 1).toString + " Processor"),
DeviceAttribute.Clock -> (Settings.get.callBudgets(tier) * 1000).toInt.toString
)
override def getDeviceInfo: util.Map[String, String] = deviceInfo
}