Heat meters path modified, ver. 2.9.332

This commit is contained in:
Milan Hanajik
2016-08-04 14:01:54 +02:00
parent 4a2342c015
commit faffa8a270
9 changed files with 159 additions and 310 deletions
@@ -11,43 +11,46 @@ namespace TBF.BenchControl
public int ItemNr;
public string Name;
public ITempMeter TempMeterWarmRef;
public ITempMeter TempMeterColdRef;
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;
public ITempMeter[] TempMetersWarm;
public ITempMeter[] TempMetersCold;
/// Constructor from name, the rest is empty
public HeatMetersPath(string name, int itemNr)
{
ItemNr = itemNr;
Name = name;
TempMetersWarm = new ITempMeter[Config.Data.WMsCount];
TempMetersCold = new ITempMeter[Config.Data.WMsCount];
}
/// Constructor from data entity
public HeatMetersPath(Config.Entities.HeatMetersPath entity, IList<BenchControl.Generic.IComponent> components)
: this(entity.Name, entity.ItemNr)
{
TempMeterWarmRef = TbfComponents.FindComponent(entity.TempWarmRef, components) as ITempMeter;
TempMeterColdRef = TbfComponents.FindComponent(entity.TempColdRef, components) as ITempMeter;
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;
for (int i = 0; i < Config.Data.WMsCount; i++)
{
TempMetersWarm[i] = (ITempMeter)TbfComponents.FindComponent(entity.GetTempWarm(i), components);
TempMetersCold[i] = (ITempMeter)TbfComponents.FindComponent(entity.GetTempCold(i), components);
}
}
public override string ToString()
@@ -49,8 +49,6 @@ namespace TBF.BenchControl.Operations
this.enthalpy = enthalpy;
if (path == null) throw new Exception("path argument in EnthalpyCalculationOp constructor");
if (path.TempMetersWarm == null) throw new Exception("path.TempMetersWarm argument in EnthalpyCalculationOp constructor");
if (path.TempMetersCold == null) throw new Exception("path.TempMetersCold argument in EnthalpyCalculationOp constructor");
}
/// <param name="obj">Time period (TimeSpan)</param>
@@ -83,10 +81,7 @@ namespace TBF.BenchControl.Operations
for (int i = 0; i < enthalpy.Length; i++)
{
if (path.TempMetersWarm[i] != null && path.TempMetersCold[i] != null)
{
enthalpy[i] += deltaVolume * (path.TempMetersWarm[i].ReadTemperature() - path.TempMetersCold[i].ReadTemperature());
}
//enthalpy[i] += deltaVolume * (path.TempMetersWarm[i].ReadTemperature() - path.TempMetersCold[i].ReadTemperature());
}
}
}