from components.aheater import AHeater


class HeaterSim(AHeater):
	def __init__(self, params):
		AHeater.__init__(self)
		self.power_set = 0
		self.power_eff = 0
		self.powers = [0, 500,  600,  700,  800,  900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000, 3100, 3200, 3300, 3400, 3500]

	def get_power_min(self):
		return self.powers[0]

	def get_power_max(self):
		return self.powers[-1]

	def get_powers(self):
		return self.powers

	def process(self):
		power = 100*round(self.power_set/100, 0)
		self.power_eff = power if self.power_set > 0 else 0

	def set_power(self, power):
		self.power_set = min(self.get_power_max(), power)

	def get_power(self):
		return self.power_eff
