Initialization of ADC open/close values and start/stop % levels for diverters redone/fixed, ver. 2.15.630
This commit is contained in:
parent
b3e6a3f157
commit
1cb0345b37
@ -120,13 +120,13 @@ namespace TBF.BenchControl.Elde
|
||||
/// and sent to 'controlCom2panel' by SendCalibData() method.
|
||||
///
|
||||
public float[,] TempCalibData = new float[8, 5];
|
||||
public uint[] DiverterEdge; /// Created and initialized in this.Initialize()
|
||||
|
||||
// Array length is the reference flowmeters count plus one
|
||||
#if DN100 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200
|
||||
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
|
||||
public byte[] MeretRS485Address = new byte[4];
|
||||
public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 };
|
||||
public uint[] DiverterEdge = new uint[2] { 50, 50 };
|
||||
#elif GENESIS || BERLIN || PETERSBURG_200
|
||||
public uint[,] RegValveCalib = new uint[16, 2] { {100,500}, {100,500}, {100,500}, {100,500},
|
||||
{100,500}, {100,500}, {100,500}, {100,500},
|
||||
@ -134,27 +134,22 @@ namespace TBF.BenchControl.Elde
|
||||
{100,500}, {100,500}, {100,500}, {100,500} };
|
||||
public byte[] MeretRS485Address = new byte[4];
|
||||
public float[] EtCalib = new float[7] { 1, 1, 1, 1, 1, 1, 1 };
|
||||
public uint[] DiverterEdge = new uint[6] { 50, 50, 50, 50, 50, 50 };
|
||||
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272 || TURA_IPERL || TURA_SPECIAL || MURES_PT40 || FUZHOU_40 || SLM_50 || SLM_150 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50
|
||||
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
|
||||
public byte[] MeretRS485Address = new byte[4];
|
||||
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
|
||||
public uint[] DiverterEdge = new uint[2] { 50, 50 };
|
||||
#elif SLM_END || WARSAW_END
|
||||
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
|
||||
public byte[] MeretRS485Address = new byte[4];
|
||||
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
|
||||
public uint[] DiverterEdge = new uint[2] { 50, 50 };
|
||||
#elif MALTA_WSD25
|
||||
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
|
||||
public byte[] MeretRS485Address = new byte[12];
|
||||
public float[] EtCalib = new float[9] { 1, 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
public uint[] DiverterEdge = new uint[2] { 50, 50 };
|
||||
#elif BADGER_VELKA_TRAT
|
||||
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
|
||||
public byte[] MeretRS485Address = new byte[4];
|
||||
public float[] EtCalib = new float[8] { 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
public uint[] DiverterEdge = new uint[2] { 50, 50 };
|
||||
#endif
|
||||
|
||||
public uint[] BalanceRange = new uint[2];
|
||||
@ -314,10 +309,13 @@ namespace TBF.BenchControl.Elde
|
||||
/// <summary>Initialize this device</summary>
|
||||
public void Initialize()
|
||||
{
|
||||
DiverterEdge = new uint[BenchControl.Elde.Diverter.Diverter.DivertersCount];
|
||||
for (int i = 0; i < BenchControl.Elde.Diverter.Diverter.DivertersCount; i++)
|
||||
int divertersCount = BenchControl.Elde.Diverter.Diverter.DivertersCount;
|
||||
|
||||
DiverterEdge = new uint[divertersCount * 2];
|
||||
for (int i = 0; i < divertersCount; i++)
|
||||
{
|
||||
DiverterEdge[i] = (uint)BenchControl.Elde.Diverter.Diverter.DiverterLevelsPct[i];
|
||||
DiverterEdge[2 * i] = (uint)BenchControl.Elde.Diverter.Diverter.DivStartingLevelPct[i];
|
||||
DiverterEdge[2 * i + 1] = (uint)BenchControl.Elde.Diverter.Diverter.DivStoppingLevelPct[i];
|
||||
}
|
||||
|
||||
controlCom.SendCalibData(RegValveCalib,
|
||||
|
||||
@ -25,7 +25,8 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
}
|
||||
public static int DivertersCount { get { return nextIdx; } }
|
||||
public static GenericDevices.IDiverter[] Diverters;
|
||||
public static int[] DiverterLevelsPct;
|
||||
public static int[] DivStartingLevelPct;
|
||||
public static int[] DivStoppingLevelPct;
|
||||
|
||||
protected int diverterNr; /// 0-based diverter number
|
||||
|
||||
@ -63,29 +64,38 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
if (Diverters == null || Diverters.Length < nextIdx)
|
||||
{
|
||||
GenericDevices.IDiverter[] divertersSoFar = Diverters;
|
||||
int[] levelsSoFar = DiverterLevelsPct;
|
||||
int[] startingLevelsSoFar = DivStartingLevelPct;
|
||||
int[] stoppingLevelsSoFar = DivStoppingLevelPct;
|
||||
|
||||
Diverters = new GenericDevices.IDiverter[nextIdx];
|
||||
DiverterLevelsPct = new int[nextIdx];
|
||||
DivStartingLevelPct = new int[nextIdx];
|
||||
DivStoppingLevelPct = new int[nextIdx];
|
||||
|
||||
if (divertersSoFar != null)
|
||||
{
|
||||
for (int i = 0; i < divertersSoFar.Length; i++)
|
||||
{
|
||||
Diverters[i] = divertersSoFar[i];
|
||||
DiverterLevelsPct[i] = levelsSoFar[i];
|
||||
DivStartingLevelPct[i] = startingLevelsSoFar[i];
|
||||
DivStoppingLevelPct[i] = stoppingLevelsSoFar[i];
|
||||
}
|
||||
}
|
||||
|
||||
Diverters[nextIdx - 1] = this;
|
||||
DiverterLevelsPct[nextIdx - 1] = diverterCfg.StartingLevel;
|
||||
DivStartingLevelPct[nextIdx - 1] = diverterCfg.StartingLevel;
|
||||
DivStoppingLevelPct[nextIdx - 1] = diverterCfg.StoppingLevel;
|
||||
}
|
||||
|
||||
/// Prepare arguments of SendCalibData()
|
||||
if (diverterNr >= 0 && diverterNr < 3)
|
||||
if (diverterCfg.AdcNr >= 0 && diverterCfg.AdcNr < controlBoard.RegValveCalib.GetLength(0))
|
||||
{
|
||||
controlBoard.RegValveCalib[5 + diverterNr, 0] = (uint)diverterCfg.AdcValueToSink;
|
||||
controlBoard.RegValveCalib[5 + diverterNr, 1] = (uint)diverterCfg.AdcValueToTank;
|
||||
controlBoard.RegValveCalib[diverterCfg.AdcNr, 0] = (uint)diverterCfg.AdcValueToSink;
|
||||
controlBoard.RegValveCalib[diverterCfg.AdcNr, 1] = (uint)diverterCfg.AdcValueToTank;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.ErrorFormat("Unable to set {0} ADC levels: RegValveCalib array size={1}, diverter AdcNr={2}",
|
||||
Name, controlBoard.RegValveCalib.GetLength(0), diverterCfg.AdcNr);
|
||||
}
|
||||
|
||||
log.Debug(this.ToString());
|
||||
|
||||
@ -98,11 +98,16 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
|
||||
this.dict = new Dictionary<float, float>();
|
||||
|
||||
if (Idx1 != COAX_IDX)
|
||||
if (Idx1 != COAX_IDX && Idx1 < ControlBoard.RegValveCalib.GetLength(0))
|
||||
{
|
||||
this.ControlBoard.RegValveCalib[Idx1 - 1, 0] = (uint)DacValueClosed;
|
||||
this.ControlBoard.RegValveCalib[Idx1 - 1, 1] = (uint)DacValueOpen;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.ErrorFormat("Unable to set {0} ADC levels: RegValveCalib array size={1}, RV Idx1={2}, RV AdcNr={3}",
|
||||
Name, ControlBoard.RegValveCalib.GetLength(0), Idx1, Idx1 - 1);
|
||||
}
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.15.629.1")]
|
||||
[assembly: AssemblyFileVersion("2.15.629.1")]
|
||||
[assembly: AssemblyVersion("2.15.630.1")]
|
||||
[assembly: AssemblyFileVersion("2.15.630.1")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user