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
+18 -190
View File
@@ -11,56 +11,21 @@ namespace Config.Entities
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string TempWarmRef { get; set; }
public virtual string TempColdRef { get; set; }
public virtual float TempWarmFrom { get; set; } /// Warm temperature range from [°C]
public virtual float TempWarmTo { get; set; } /// Warm temperature range to [°C]
public virtual float TempColdFrom { get; set; } /// Cold temperature range from [°C]
public virtual float TempColdTo { get; set; } /// Cold temperature renge to [°C]
public virtual string TempWarmRef1 { get; set; }
public virtual string TempWarmRef2 { get; set; }
public virtual string TempColdRef1 { get; set; }
public virtual string TempColdRef2 { get; set; }
public virtual string TempBath1 { get; set; }
public virtual string TempBath2 { get; set; }
public virtual string TempBath3 { get; set; }
public virtual string TempBath4 { get; set; }
public virtual string TempWarm1 { get; set; }
public virtual string TempWarm2 { get; set; }
public virtual string TempWarm3 { get; set; }
public virtual string TempWarm4 { get; set; }
public virtual string TempWarm5 { get; set; }
public virtual string TempWarm6 { get; set; }
public virtual string TempWarm7 { get; set; }
public virtual string TempWarm8 { get; set; }
public virtual string TempWarm9 { get; set; }
public virtual string TempWarm10 { get; set; }
public virtual string TempWarm11 { get; set; }
public virtual string TempWarm12 { get; set; }
public virtual string TempWarm13 { get; set; }
public virtual string TempWarm14 { get; set; }
public virtual string TempWarm15 { get; set; }
public virtual string TempWarm16 { get; set; }
public virtual string TempWarm17 { get; set; }
public virtual string TempWarm18 { get; set; }
public virtual string TempWarm19 { get; set; }
public virtual string TempWarm20 { get; set; }
public virtual string TempCold1 { get; set; }
public virtual string TempCold2 { get; set; }
public virtual string TempCold3 { get; set; }
public virtual string TempCold4 { get; set; }
public virtual string TempCold5 { get; set; }
public virtual string TempCold6 { get; set; }
public virtual string TempCold7 { get; set; }
public virtual string TempCold8 { get; set; }
public virtual string TempCold9 { get; set; }
public virtual string TempCold10 { get; set; }
public virtual string TempCold11 { get; set; }
public virtual string TempCold12 { get; set; }
public virtual string TempCold13 { get; set; }
public virtual string TempCold14 { get; set; }
public virtual string TempCold15 { get; set; }
public virtual string TempCold16 { get; set; }
public virtual string TempCold17 { get; set; }
public virtual string TempCold18 { get; set; }
public virtual string TempCold19 { get; set; }
public virtual string TempCold20 { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public HeatMetersPath()
@@ -78,159 +43,22 @@ namespace Config.Entities
{
HeatMetersPath result = new HeatMetersPath(name, itemNr);
result.TempWarmRef = TempWarmRef;
result.TempColdRef = TempColdRef;
result.TempWarmFrom = TempWarmFrom;
result.TempWarmTo = TempWarmTo;
result.TempColdFrom = TempColdFrom;
result.TempColdTo = TempColdTo;
result.TempWarmRef1 = TempWarmRef1;
result.TempWarmRef2 = TempWarmRef2;
result.TempColdRef1 = TempColdRef1;
result.TempColdRef2 = TempColdRef2;
result.TempBath1 = TempBath1;
result.TempBath2 = TempBath2;
result.TempBath3 = TempBath3;
result.TempBath4 = TempBath4;
result.TempWarm1 = TempWarm1;
result.TempWarm2 = TempWarm2;
result.TempWarm3 = TempWarm3;
result.TempWarm4 = TempWarm4;
result.TempWarm5 = TempWarm5;
result.TempWarm6 = TempWarm6;
result.TempWarm7 = TempWarm7;
result.TempWarm8 = TempWarm8;
result.TempWarm9 = TempWarm9;
result.TempWarm10 = TempWarm10;
result.TempWarm11 = TempWarm11;
result.TempWarm12 = TempWarm12;
result.TempWarm13 = TempWarm13;
result.TempWarm14 = TempWarm14;
result.TempWarm15 = TempWarm15;
result.TempWarm16 = TempWarm16;
result.TempWarm17 = TempWarm17;
result.TempWarm18 = TempWarm18;
result.TempWarm19 = TempWarm19;
result.TempWarm20 = TempWarm20;
result.TempCold1 = TempCold1;
result.TempCold2 = TempCold2;
result.TempCold3 = TempCold3;
result.TempCold4 = TempCold4;
result.TempCold5 = TempCold5;
result.TempCold6 = TempCold6;
result.TempCold7 = TempCold7;
result.TempCold8 = TempCold8;
result.TempCold9 = TempCold9;
result.TempCold10 = TempCold10;
result.TempCold11 = TempCold11;
result.TempCold12 = TempCold12;
result.TempCold13 = TempCold13;
result.TempCold14 = TempCold14;
result.TempCold15 = TempCold15;
result.TempCold16 = TempCold16;
result.TempCold17 = TempCold17;
result.TempCold18 = TempCold18;
result.TempCold19 = TempCold19;
result.TempCold20 = TempCold20;
return result;
}
/// Returns a temperature component name
public virtual string GetTempWarm(int i)
{
if (i == 0) return TempWarm1;
else if (i == 1) return TempWarm2;
else if (i == 2) return TempWarm3;
else if (i == 3) return TempWarm4;
else if (i == 4) return TempWarm5;
else if (i == 5) return TempWarm6;
else if (i == 6) return TempWarm7;
else if (i == 7) return TempWarm8;
else if (i == 8) return TempWarm9;
else if (i == 9) return TempWarm10;
else if (i == 10) return TempWarm11;
else if (i == 11) return TempWarm12;
else if (i == 12) return TempWarm13;
else if (i == 13) return TempWarm14;
else if (i == 14) return TempWarm15;
else if (i == 15) return TempWarm16;
else if (i == 16) return TempWarm17;
else if (i == 17) return TempWarm18;
else if (i == 18) return TempWarm19;
else if (i == 19) return TempWarm20;
else return null;
}
/// Returns a temperature component name
public virtual string GetTempCold(int i)
{
if (i == 0) return TempCold1;
else if (i == 1) return TempCold2;
else if (i == 2) return TempCold3;
else if (i == 3) return TempCold4;
else if (i == 4) return TempCold5;
else if (i == 5) return TempCold6;
else if (i == 6) return TempCold7;
else if (i == 7) return TempCold8;
else if (i == 8) return TempCold9;
else if (i == 9) return TempCold10;
else if (i == 10) return TempCold11;
else if (i == 11) return TempCold12;
else if (i == 12) return TempCold13;
else if (i == 13) return TempCold14;
else if (i == 14) return TempCold15;
else if (i == 15) return TempCold16;
else if (i == 16) return TempCold17;
else if (i == 17) return TempCold18;
else if (i == 18) return TempCold19;
else if (i == 19) return TempCold20;
else return null;
}
/// Sets a temperature component name
public virtual void SetTempWarm(int i, string cmpntName)
{
if (i == 0) TempWarm1 = cmpntName;
else if (i == 1) TempWarm2 = cmpntName;
else if (i == 2) TempWarm3 = cmpntName;
else if (i == 3) TempWarm4 = cmpntName;
else if (i == 4) TempWarm5 = cmpntName;
else if (i == 5) TempWarm6 = cmpntName;
else if (i == 6) TempWarm7 = cmpntName;
else if (i == 7) TempWarm8 = cmpntName;
else if (i == 8) TempWarm9 = cmpntName;
else if (i == 9) TempWarm10 = cmpntName;
else if (i == 10) TempWarm11 = cmpntName;
else if (i == 11) TempWarm12 = cmpntName;
else if (i == 12) TempWarm13 = cmpntName;
else if (i == 13) TempWarm14 = cmpntName;
else if (i == 14) TempWarm15 = cmpntName;
else if (i == 15) TempWarm16 = cmpntName;
else if (i == 16) TempWarm17 = cmpntName;
else if (i == 17) TempWarm18 = cmpntName;
else if (i == 18) TempWarm19 = cmpntName;
else if (i == 19) TempWarm20 = cmpntName;
}
/// Sets a temperature component name
public virtual void SetTempCold(int i, string cmpntName)
{
if (i == 0) TempCold1 = cmpntName;
else if (i == 1) TempCold2 = cmpntName;
else if (i == 2) TempCold3 = cmpntName;
else if (i == 3) TempCold4 = cmpntName;
else if (i == 4) TempCold5 = cmpntName;
else if (i == 5) TempCold6 = cmpntName;
else if (i == 6) TempCold7 = cmpntName;
else if (i == 7) TempCold8 = cmpntName;
else if (i == 8) TempCold9 = cmpntName;
else if (i == 9) TempCold10 = cmpntName;
else if (i == 10) TempCold11 = cmpntName;
else if (i == 11) TempCold12 = cmpntName;
else if (i == 12) TempCold13 = cmpntName;
else if (i == 13) TempCold14 = cmpntName;
else if (i == 14) TempCold15 = cmpntName;
else if (i == 15) TempCold16 = cmpntName;
else if (i == 16) TempCold17 = cmpntName;
else if (i == 17) TempCold18 = cmpntName;
else if (i == 18) TempCold19 = cmpntName;
else if (i == 19) TempCold20 = cmpntName;
}
}
}
+9 -46
View File
@@ -15,57 +15,20 @@ namespace Config.Mappings
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.TempWarmRef);
Map(x => x.TempColdRef);
Map(x => x.TempWarmFrom);
Map(x => x.TempWarmTo);
Map(x => x.TempColdFrom);
Map(x => x.TempColdTo);
Map(x => x.TempWarmRef1);
Map(x => x.TempWarmRef2);
Map(x => x.TempColdRef1);
Map(x => x.TempColdRef2);
Map(x => x.TempBath1);
Map(x => x.TempBath2);
Map(x => x.TempBath3);
Map(x => x.TempBath4);
#pragma warning disable
Map(x => x.TempWarm1);
if (Config.Data.WMsCount >= 2) Map(x => x.TempWarm2);
if (Config.Data.WMsCount >= 3) Map(x => x.TempWarm3);
if (Config.Data.WMsCount >= 4) Map(x => x.TempWarm4);
if (Config.Data.WMsCount >= 5) Map(x => x.TempWarm5);
if (Config.Data.WMsCount >= 6) Map(x => x.TempWarm6);
if (Config.Data.WMsCount >= 7) Map(x => x.TempWarm7);
if (Config.Data.WMsCount >= 8) Map(x => x.TempWarm8);
if (Config.Data.WMsCount >= 9) Map(x => x.TempWarm9);
if (Config.Data.WMsCount >= 10) Map(x => x.TempWarm10);
if (Config.Data.WMsCount >= 11) Map(x => x.TempWarm11);
if (Config.Data.WMsCount >= 12) Map(x => x.TempWarm12);
if (Config.Data.WMsCount >= 13) Map(x => x.TempWarm13);
if (Config.Data.WMsCount >= 14) Map(x => x.TempWarm14);
if (Config.Data.WMsCount >= 15) Map(x => x.TempWarm15);
if (Config.Data.WMsCount >= 16) Map(x => x.TempWarm16);
if (Config.Data.WMsCount >= 17) Map(x => x.TempWarm17);
if (Config.Data.WMsCount >= 18) Map(x => x.TempWarm18);
if (Config.Data.WMsCount >= 19) Map(x => x.TempWarm19);
if (Config.Data.WMsCount >= 20) Map(x => x.TempWarm20);
Map(x => x.TempCold1);
if (Config.Data.WMsCount >= 2) Map(x => x.TempCold2);
if (Config.Data.WMsCount >= 3) Map(x => x.TempCold3);
if (Config.Data.WMsCount >= 4) Map(x => x.TempCold4);
if (Config.Data.WMsCount >= 5) Map(x => x.TempCold5);
if (Config.Data.WMsCount >= 6) Map(x => x.TempCold6);
if (Config.Data.WMsCount >= 7) Map(x => x.TempCold7);
if (Config.Data.WMsCount >= 8) Map(x => x.TempCold8);
if (Config.Data.WMsCount >= 9) Map(x => x.TempCold9);
if (Config.Data.WMsCount >= 10) Map(x => x.TempCold10);
if (Config.Data.WMsCount >= 11) Map(x => x.TempCold11);
if (Config.Data.WMsCount >= 12) Map(x => x.TempCold12);
if (Config.Data.WMsCount >= 13) Map(x => x.TempCold13);
if (Config.Data.WMsCount >= 14) Map(x => x.TempCold14);
if (Config.Data.WMsCount >= 15) Map(x => x.TempCold15);
if (Config.Data.WMsCount >= 16) Map(x => x.TempCold16);
if (Config.Data.WMsCount >= 17) Map(x => x.TempCold17);
if (Config.Data.WMsCount >= 18) Map(x => x.TempCold18);
if (Config.Data.WMsCount >= 19) Map(x => x.TempCold19);
if (Config.Data.WMsCount >= 20) Map(x => x.TempCold20);
#pragma warning restore
}
}
#endif
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.9.330.0")]
[assembly: AssemblyFileVersion("2.9.330.0")]
[assembly: AssemblyVersion("2.9.332.0")]
[assembly: AssemblyFileVersion("2.9.332.0")]
@@ -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());
}
}
}
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.9.331.1")]
[assembly: AssemblyFileVersion("2.9.331.1")]
[assembly: AssemblyVersion("2.9.332.1")]
[assembly: AssemblyFileVersion("2.9.332.1")]
+36
View File
@@ -3444,6 +3444,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to T cold from.
/// </summary>
internal static string T_cold_from {
get {
return ResourceManager.GetString("T_cold_from", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to T lo. ref..
/// </summary>
@@ -3453,6 +3462,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to T cold to.
/// </summary>
internal static string T_cold_to {
get {
return ResourceManager.GetString("T_cold_to", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to T div..
/// </summary>
@@ -3534,6 +3552,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to T warm from.
/// </summary>
internal static string T_warm_from {
get {
return ResourceManager.GetString("T_warm_from", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to T hi. ref..
/// </summary>
@@ -3543,6 +3570,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to T warm to.
/// </summary>
internal static string T_warm_to {
get {
return ResourceManager.GetString("T_warm_to", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Target flow high [m3/h]:.
/// </summary>
+12
View File
@@ -1519,4 +1519,16 @@
<data name="Header" xml:space="preserve">
<value>Header</value>
</data>
<data name="T_cold_from" xml:space="preserve">
<value>T cold from</value>
</data>
<data name="T_cold_to" xml:space="preserve">
<value>T cold to</value>
</data>
<data name="T_warm_from" xml:space="preserve">
<value>T warm from</value>
</data>
<data name="T_warm_to" xml:space="preserve">
<value>T warm to</value>
</data>
</root>
@@ -21,8 +21,14 @@ namespace TBF.UiControls
enum Column
{
Name,
TwarmRef,
TcoldRef,
TWarmFrom,
TWarmTo,
TColdFrom,
TColdTo,
TwarmRef1,
TwarmRef2,
TcoldRef1,
TcoldRef2,
Tbath1,
Tbath2,
Tbath3,
@@ -63,24 +69,18 @@ namespace TBF.UiControls
/// ListViewEx columns
TBF.LocalSettings ls = Program.LocalSettings;
Columns.Add(Strings.Name, (ls.HeatMetersColumnCount > 0) ? ls.HeatMetersColumnWidths[0] : 60 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(Strings.T_warm_ref, (ls.HeatMetersColumnCount > 1) ? ls.HeatMetersColumnWidths[1] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(Strings.T_cold_ref, (ls.HeatMetersColumnCount > 2) ? ls.HeatMetersColumnWidths[2] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_bath, 1), (ls.HeatMetersColumnCount > 3) ? ls.HeatMetersColumnWidths[3] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_bath, 2), (ls.HeatMetersColumnCount > 4) ? ls.HeatMetersColumnWidths[4] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_bath, 3), (ls.HeatMetersColumnCount > 5) ? ls.HeatMetersColumnWidths[5] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_bath, 4), (ls.HeatMetersColumnCount > 6) ? ls.HeatMetersColumnWidths[6] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
int clmn = (int)Column.FixedColumnsCount;
for (int i = 0; i < Config.Data.WMsCount; i++)
{
Columns.Add(string.Format("{0} {1}", Strings.T_warm, i + 1), (ls.MetersColumnCount > clmn) ? ls.MetersColumnWidths[clmn] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
clmn++;
}
for (int i = 0; i < Config.Data.WMsCount; i++)
{
Columns.Add(string.Format("{0} {1}", Strings.T_cold, i + 1), (ls.MetersColumnCount > clmn) ? ls.MetersColumnWidths[clmn] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
clmn++;
}
Columns.Add(Strings.T_warm_from, (ls.HeatMetersColumnCount > 1) ? ls.HeatMetersColumnWidths[1] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(Strings.T_warm_to, (ls.HeatMetersColumnCount > 2) ? ls.HeatMetersColumnWidths[2] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(Strings.T_cold_from, (ls.HeatMetersColumnCount > 3) ? ls.HeatMetersColumnWidths[3] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(Strings.T_cold_to, (ls.HeatMetersColumnCount > 4) ? ls.HeatMetersColumnWidths[4] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_warm_ref, 1), (ls.HeatMetersColumnCount > 5) ? ls.HeatMetersColumnWidths[5] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_warm_ref, 2), (ls.HeatMetersColumnCount > 6) ? ls.HeatMetersColumnWidths[6] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_cold_ref, 1), (ls.HeatMetersColumnCount > 7) ? ls.HeatMetersColumnWidths[7] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_cold_ref, 2), (ls.HeatMetersColumnCount > 8) ? ls.HeatMetersColumnWidths[8] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_bath, 1), (ls.HeatMetersColumnCount > 9) ? ls.HeatMetersColumnWidths[9] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_bath, 2), (ls.HeatMetersColumnCount > 10) ? ls.HeatMetersColumnWidths[10] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_bath, 3), (ls.HeatMetersColumnCount > 11) ? ls.HeatMetersColumnWidths[11] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
Columns.Add(string.Format("{0} {1}", Strings.T_bath, 4), (ls.HeatMetersColumnCount > 12) ? ls.HeatMetersColumnWidths[12] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
/// Temperatures, pressures
ComboBox tWarmCBox = new ComboBox();
@@ -94,13 +94,15 @@ namespace TBF.UiControls
}
}
editors = new Control[fixedColumnsCount + 2 * Config.Data.WMsCount];
editors = new Control[fixedColumnsCount];
///
editors[0] = new TextBox(); /// Name
editors[0].Visible = false;
parent.Controls.Add(editors[0]);
///
for (int i = 1; i < editors.Length; i++)
for (int i = 0; i < (int)Column.TwarmRef1; i++)
{
editors[i] = new TextBox(); /// Name
editors[i].Visible = false;
parent.Controls.Add(editors[i]);
}
for (int i = (int)Column.TwarmRef1; i < editors.Length; i++)
{
editors[i] = new ComboBox();
(editors[i] as ComboBox).Items.Add("---");
@@ -127,7 +129,20 @@ namespace TBF.UiControls
void listViewEx_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e)
{
}
if (e.SubItem >= (int)Column.TWarmFrom && e.SubItem <= (int)Column.TColdTo)
{
try
{
Utils.ParseUFloat(e.DisplayText);
}
catch
{
/// NOK -> revert
e.DisplayText = e.Item.SubItems[e.SubItem].Text;
e.Cancel = true;
}
}
}
public override void DrawOne(object myItem)
{
@@ -135,24 +150,22 @@ namespace TBF.UiControls
BenchControl.HeatMetersPath path = new BenchControl.HeatMetersPath(entity, parent.TbfComponents);
ListViewItem lvi = new ListViewItem(entity.Name);
lvi.SubItems.Add(path.TempMeterWarmRef != null ? path.TempMeterWarmRef.Cfg.Name : "---");
lvi.SubItems.Add(path.TempMeterColdRef != null ? path.TempMeterColdRef.Cfg.Name : "---");
lvi.SubItems.Add(path.TempWarmFrom.ToString());
lvi.SubItems.Add(path.TempWarmTo.ToString());
lvi.SubItems.Add(path.TempColdFrom.ToString());
lvi.SubItems.Add(path.TempColdTo.ToString());
lvi.SubItems.Add(path.TempMeterWarmRef1 != null ? path.TempMeterWarmRef1.Cfg.Name : "---");
lvi.SubItems.Add(path.TempMeterWarmRef2 != null ? path.TempMeterWarmRef2.Cfg.Name : "---");
lvi.SubItems.Add(path.TempMeterColdRef1 != null ? path.TempMeterColdRef1.Cfg.Name : "---");
lvi.SubItems.Add(path.TempMeterColdRef2 != null ? path.TempMeterColdRef2.Cfg.Name : "---");
lvi.SubItems.Add(path.TempMeterBath1 != null ? path.TempMeterBath1.Cfg.Name : "---");
lvi.SubItems.Add(path.TempMeterBath2 != null ? path.TempMeterBath2.Cfg.Name : "---");
lvi.SubItems.Add(path.TempMeterBath3 != null ? path.TempMeterBath3.Cfg.Name : "---");
lvi.SubItems.Add(path.TempMeterBath4 != null ? path.TempMeterBath4.Cfg.Name : "---");
for (int i = 0; i < Config.Data.WMsCount; i++)
{
lvi.SubItems.Add(path.TempMetersWarm[i] != null ? path.TempMetersWarm[i].Cfg.Name : "---");
}
for (int i = 0; i < Config.Data.WMsCount; i++)
{
lvi.SubItems.Add(path.TempMetersCold[i] != null ? path.TempMetersCold[i].Cfg.Name : "---");
}
lvi.Tag = entity;
Items.Add(lvi);
@@ -164,21 +177,20 @@ namespace TBF.UiControls
entity.Name = lvi.Text;
entity.TempWarmRef = lvi.SubItems[(int)Column.TwarmRef].Text == "---" ? null : lvi.SubItems[(int)Column.TwarmRef].Text;
entity.TempColdRef = lvi.SubItems[(int)Column.TcoldRef].Text == "---" ? null : lvi.SubItems[(int)Column.TcoldRef].Text;
entity.TempWarmFrom = Utils.ParseUFloat(lvi.SubItems[(int)Column.TWarmFrom].Text);
entity.TempWarmTo = Utils.ParseUFloat(lvi.SubItems[(int)Column.TWarmTo].Text);
entity.TempColdFrom = Utils.ParseUFloat(lvi.SubItems[(int)Column.TColdFrom].Text);
entity.TempColdTo = Utils.ParseUFloat(lvi.SubItems[(int)Column.TColdTo].Text);
entity.TempWarmRef1 = lvi.SubItems[(int)Column.TwarmRef1].Text == "---" ? null : lvi.SubItems[(int)Column.TwarmRef1].Text;
entity.TempWarmRef2 = lvi.SubItems[(int)Column.TwarmRef2].Text == "---" ? null : lvi.SubItems[(int)Column.TwarmRef2].Text;
entity.TempColdRef1 = lvi.SubItems[(int)Column.TcoldRef1].Text == "---" ? null : lvi.SubItems[(int)Column.TcoldRef1].Text;
entity.TempColdRef2 = lvi.SubItems[(int)Column.TcoldRef2].Text == "---" ? null : lvi.SubItems[(int)Column.TcoldRef2].Text;
entity.TempBath1 = lvi.SubItems[(int)Column.Tbath1].Text == "---" ? null : lvi.SubItems[(int)Column.Tbath1].Text;
entity.TempBath2 = lvi.SubItems[(int)Column.Tbath2].Text == "---" ? null : lvi.SubItems[(int)Column.Tbath2].Text;
entity.TempBath3 = lvi.SubItems[(int)Column.Tbath3].Text == "---" ? null : lvi.SubItems[(int)Column.Tbath3].Text;
entity.TempBath4 = lvi.SubItems[(int)Column.Tbath4].Text == "---" ? null : lvi.SubItems[(int)Column.Tbath4].Text;
for (int i = 0; i < Config.Data.WMsCount; i++)
{
int j = (int)Column.FixedColumnsCount + i;
entity.SetTempWarm(i, lvi.SubItems[j].Text == "---" ? null : lvi.SubItems[j].Text);
int k = (int)Column.FixedColumnsCount + Config.Data.WMsCount + i;
entity.SetTempCold(i, lvi.SubItems[k].Text == "---" ? null : lvi.SubItems[k].Text);
}
}
/// <summary>