Reservoir(s) in Elde component : T and SP display.
This commit is contained in:
parent
0fa621bd6a
commit
a7a7fbd403
@ -268,9 +268,9 @@ namespace TBF.Rig.Elde
|
||||
}
|
||||
|
||||
|
||||
public void SetReservoirTemp(int nr, float temp)
|
||||
public void SetReservoirTemp(int nr, string tempStr, float temp)
|
||||
{
|
||||
controlCom.SetReservoirTemp(nr, temp);
|
||||
controlCom.SetReservoirTemp(nr, tempStr, temp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ namespace TBF.Rig.Elde
|
||||
}
|
||||
bool manualUIAllowed = true;
|
||||
|
||||
public void SetReservoirTemp(int nr, float temp) { }
|
||||
public void SetReservoirTemp(int nr, string tempStr, float temp) { }
|
||||
|
||||
|
||||
///
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2020 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using Dirichlet.Numerics;
|
||||
using log4net;
|
||||
using Common;
|
||||
using TBF.Rig.Sequences;
|
||||
|
||||
namespace TBF.Rig.Elde
|
||||
{
|
||||
@ -159,30 +161,27 @@ namespace TBF.Rig.Elde
|
||||
log.DebugFormat("SetWeight(pos={0}, mass={1}", pos, mass);
|
||||
}
|
||||
|
||||
public void SetReservoirTemp(int nr, float temp)
|
||||
public void SetReservoirTemp(int nr, string tempStr, float temp)
|
||||
{
|
||||
#if GENESIS
|
||||
if (nr > 0 && nr <= 3) ctrlBrdComponent.TankTemp[nr - 1] = temp;
|
||||
#elif MILWAUKEE
|
||||
if (nr >= 0 && nr < ctrlBrdComponent.ThermostatState.Length)
|
||||
{
|
||||
string text;
|
||||
|
||||
if (nr % 2 == 1)
|
||||
string toDisplay;
|
||||
if (!string.IsNullOrEmpty(tempStr))
|
||||
{
|
||||
text = string.Format("T = {0:F1} °F", Common.Units.ConvertTo(Common.Unit.F, temp));
|
||||
}
|
||||
else if (temp != 0)
|
||||
{
|
||||
text = string.Format("SP = {0:F1} °F", Common.Units.ConvertTo(Common.Unit.F, temp));
|
||||
toDisplay = tempStr;
|
||||
}
|
||||
else
|
||||
{
|
||||
text = string.Empty;
|
||||
float tempCorF = Common.Units.ConvertTo(ProcessData.TempUnit, temp);
|
||||
string format = (nr % 2 == 0) ? "T = {0:F1} {1}" : "SP = {0:F1} {1}"; /// T = temperature (nr = 0,2), SP = setpoint (nr = 1,3)
|
||||
toDisplay = string.Format(format, tempCorF, ProcessData.TempUnit.ToDescription());
|
||||
}
|
||||
|
||||
ctrlBrdComponent.ThermostatState[nr] = text;
|
||||
log.DebugFormat("SetReservoirTemp({0}, {1}) ... cbrd.ThermostatState[{0}] = {2}", nr, temp, text);
|
||||
ctrlBrdComponent.ThermostatState[nr] = toDisplay;
|
||||
log.DebugFormat("SetReservoirTemp({0}, {1}, {2}) displayed {3}", nr, (tempStr == null ? "null" : tempStr), temp, toDisplay);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace TBF.Rig.Elde
|
||||
float ValveOpenCloseTime { get; }
|
||||
void SetDivLimit(int divNr, uint limLoPct, uint limHiPct);
|
||||
|
||||
void SetReservoirTemp(int nr, float temp);
|
||||
void SetReservoirTemp(int nr, string tempStr, float temp);
|
||||
|
||||
/// <summary>
|
||||
/// Sends calibration and configuration data to the control board.
|
||||
|
||||
@ -77,7 +77,7 @@ namespace TBF.Rig.Modbus.TempControl.Easytherm
|
||||
|
||||
if (easythermCfg.ReservoirNr > 0 && easythermCfg.ReservoirNr <= 3)
|
||||
{
|
||||
StateMachine.ControlBoard.SetReservoirTemp(easythermCfg.ReservoirNr, (float)actualTemperature);
|
||||
StateMachine.ControlBoard.SetReservoirTemp(easythermCfg.ReservoirNr, null, (float)actualTemperature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,6 +169,9 @@ namespace TBF.Rig.Modbus.TempControl.Novus
|
||||
|
||||
novusDataValid = true;
|
||||
|
||||
StateMachine.ControlBoard.SetReservoirTemp(2 * (novusCfg.ReservoirNr - 1), temperatureStr, Convert.ToSingle(actualTemperature));
|
||||
StateMachine.ControlBoard.SetReservoirTemp(2 * (novusCfg.ReservoirNr - 1) + 1, setpointStr, Convert.ToSingle(temperatureSetpoint));
|
||||
|
||||
log.InfoFormat("[{0}] setpoint = {1} temperature = {2}", Name, temperatureSetpoint, actualTemperature);
|
||||
log.InfoFormat("[{0}] s1=0x{1} s2=0x{2} s3=0x{3} fw={4} id={5}",
|
||||
Name, status1.ToString("X4"), status2.ToString("X4"), status3.ToString("X4"),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user