/// /// Copyright (c) 2016 Sensus Metering Systems /// using System.Collections.Generic; using TBF.BenchControl.GenericDevices; namespace TBF.BenchControl { public class HeatMetersPath { public int ItemNr; public string Name; public float TempWarmFrom; public float TempWarmTo; public float TempColdFrom; public float TempColdTo; public ITempMeter TempMeterWarmRef1; public ITempMeter TempMeterWarmRef2; public ITempMeter TempMeterColdRef1; public ITempMeter TempMeterColdRef2; public ITempMeter TempMeterBath1; public ITempMeter TempMeterBath2; public ITempMeter TempMeterBath3; public ITempMeter TempMeterBath4; /// Constructor from name, the rest is empty public HeatMetersPath(string name, int itemNr) { ItemNr = itemNr; Name = name; } /// Constructor from data entity public HeatMetersPath(Config.Entities.HeatMetersPath entity, IList components) : this(entity.Name, entity.ItemNr) { TempWarmFrom = entity.TempWarmFrom; TempWarmTo = entity.TempWarmTo; TempColdFrom = entity.TempColdFrom; TempColdTo = entity.TempColdTo; TempMeterWarmRef1 = TbfComponents.FindComponent(entity.TempWarmRef1, components) as ITempMeter; TempMeterWarmRef2 = TbfComponents.FindComponent(entity.TempWarmRef2, components) as ITempMeter; TempMeterColdRef1 = TbfComponents.FindComponent(entity.TempColdRef1, components) as ITempMeter; TempMeterColdRef2 = TbfComponents.FindComponent(entity.TempColdRef2, components) as ITempMeter; TempMeterBath1 = TbfComponents.FindComponent(entity.TempBath1, components) as ITempMeter; TempMeterBath2 = TbfComponents.FindComponent(entity.TempBath2, components) as ITempMeter; TempMeterBath3 = TbfComponents.FindComponent(entity.TempBath3, components) as ITempMeter; TempMeterBath4 = TbfComponents.FindComponent(entity.TempBath4, components) as ITempMeter; } public override string ToString() { return string.Format("{0}", Name); } } }