staret thermocam modifications
This commit is contained in:
@@ -6,19 +6,151 @@ namespace CMS_CORE_Library.Models
|
||||
{
|
||||
public class ThermoModels
|
||||
{
|
||||
#region Thermo models
|
||||
|
||||
#region Fields
|
||||
|
||||
protected const double EPSILON = 0.1;
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Classes
|
||||
|
||||
/// <summary>
|
||||
/// Single AXIS Info Data
|
||||
/// </summary>
|
||||
public class AxisInfo
|
||||
{
|
||||
|
||||
#region Properties
|
||||
|
||||
public int ControlWord { get; set; } = 0;
|
||||
public int ErrorCode { get; set; } = 0;
|
||||
public int Id { get; set; } = 0;
|
||||
public int MovPhase { get; set; } = 0;
|
||||
public int StatusWord { get; set; } = 0;
|
||||
public double TargetPos { get; set; } = 0;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is AxisInfo item))
|
||||
return false;
|
||||
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
if (ErrorCode != item.ErrorCode)
|
||||
return false;
|
||||
if (MovPhase != item.MovPhase)
|
||||
return false;
|
||||
if (StatusWord != item.StatusWord)
|
||||
return false;
|
||||
if (ControlWord != item.ControlWord)
|
||||
return false;
|
||||
if (TargetPos != item.TargetPos)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Single AXIS RealTime (positions / movement) Data
|
||||
/// </summary>
|
||||
public class AxisRT
|
||||
{
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Deserializzazione da byte ad oggetto AxisRT
|
||||
/// </summary>
|
||||
/// <param name="rawData"></param>
|
||||
public AxisRT(int currId, byte[] rawData)
|
||||
{
|
||||
// converto i dati da byte grezzi ai 3 componenti...
|
||||
Id = currId;
|
||||
Position = S7.Net.Types.Double.FromByteArray(rawData.Skip(0).Take(4).ToArray());
|
||||
Speed = S7.Net.Types.Double.FromByteArray(rawData.Skip(4).Take(4).ToArray());
|
||||
Load = S7.Net.Types.Double.FromByteArray(rawData.Skip(8).Take(4).ToArray());
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public int Id { get; set; } = 0;
|
||||
public double Load { get; set; } = 0;
|
||||
public double Position { get; set; } = 0;
|
||||
public double Speed { get; set; } = 0;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Converte un singolo item in un array di byte per scrittura su PLC S7
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public byte[] convertToByte()
|
||||
{
|
||||
byte[] answ = new byte[12];
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Position), 0, answ, 0, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Speed), 0, answ, 4, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Load), 0, answ, 8, 4);
|
||||
return answ;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is AxisRT item))
|
||||
return false;
|
||||
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
if (Position != item.Position)
|
||||
return false;
|
||||
if (Speed != item.Speed)
|
||||
return false;
|
||||
if (Load != item.Load)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents thermo LIVE prod data (gauge, time adv...)
|
||||
/// </summary>
|
||||
public class LiveProdDataModel
|
||||
{
|
||||
public double TimeAdv { get; set; } = 0;
|
||||
public double Power { get; set; } = 0;
|
||||
public double Vacuum { get; set; } = 0;
|
||||
|
||||
#region Properties
|
||||
|
||||
public double Air { get; set; } = 0;
|
||||
public double Power { get; set; } = 0;
|
||||
public double TimeAdv { get; set; } = 0;
|
||||
public double Vacuum { get; set; } = 0;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
@@ -45,169 +177,31 @@ namespace CMS_CORE_Library.Models
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Recipe Parameters
|
||||
/// </summary>
|
||||
public class RecipeParam
|
||||
{
|
||||
public short Id { get; set; } = 0;
|
||||
public double SetpointHMI { get; set; } = 0;
|
||||
public double SetpointPLC { get; set; } = 0;
|
||||
public double ValMax { get; set; } = 0;
|
||||
public double ValMin { get; set; } = 0;
|
||||
public ushort UnitMeasure { get; set; } = 0;
|
||||
public bool Visible { get; set; } = false;
|
||||
public bool Enabled { get; set; } = false;
|
||||
public bool HasError { get; set; } = false;
|
||||
public double ValueAct { get; set; } = 0;
|
||||
public int ScaleFactor { get; set; } = 1;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is RecipeParam item))
|
||||
return false;
|
||||
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
if (SetpointHMI != item.SetpointHMI)
|
||||
return false;
|
||||
if (SetpointPLC != item.SetpointPLC)
|
||||
return false;
|
||||
if (ValMax != item.ValMax)
|
||||
return false;
|
||||
if (ValMin != item.ValMin)
|
||||
return false;
|
||||
if (UnitMeasure != item.UnitMeasure)
|
||||
return false;
|
||||
if (Visible != item.Visible)
|
||||
return false;
|
||||
if (Enabled != item.Enabled)
|
||||
return false;
|
||||
if (HasError != item.HasError)
|
||||
return false;
|
||||
if (ValueAct != item.ValueAct)
|
||||
return false;
|
||||
if (ScaleFactor != item.ScaleFactor)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Single AXIS RealTime (positions / movement) Data
|
||||
/// </summary>
|
||||
public class AxisRT
|
||||
{
|
||||
public int Id { get; set; } = 0;
|
||||
public double Position { get; set; } = 0;
|
||||
public double Speed { get; set; } = 0;
|
||||
public double Load { get; set; } = 0;
|
||||
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is AxisRT item))
|
||||
return false;
|
||||
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
if (Position != item.Position)
|
||||
return false;
|
||||
if (Speed != item.Speed)
|
||||
return false;
|
||||
if (Load != item.Load)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializzazione da byte ad oggetto AxisRT
|
||||
/// </summary>
|
||||
/// <param name="rawData"></param>
|
||||
public AxisRT(int currId, byte[] rawData)
|
||||
{
|
||||
// converto i dati da byte grezzi ai 3 componenti...
|
||||
Id = currId;
|
||||
Position = S7.Net.Types.Double.FromByteArray(rawData.Skip(0).Take(4).ToArray());
|
||||
Speed = S7.Net.Types.Double.FromByteArray(rawData.Skip(4).Take(4).ToArray());
|
||||
Load = S7.Net.Types.Double.FromByteArray(rawData.Skip(8).Take(4).ToArray());
|
||||
}
|
||||
/// <summary>
|
||||
/// Converte un singolo item in un array di byte per scrittura su PLC S7
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public byte[] convertToByte()
|
||||
{
|
||||
byte[] answ = new byte[12];
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Position), 0, answ, 0, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Speed), 0, answ, 4, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Load), 0, answ, 8, 4);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Single AXIS Info Data
|
||||
/// </summary>
|
||||
public class AxisInfo
|
||||
{
|
||||
public int Id { get; set; } = 0;
|
||||
public int ErrorCode { get; set; } = 0;
|
||||
public int MovPhase { get; set; } = 0;
|
||||
public int StatusWord { get; set; } = 0;
|
||||
public int ControlWord { get; set; } = 0;
|
||||
public double TargetPos { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is AxisInfo item))
|
||||
return false;
|
||||
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
if (ErrorCode != item.ErrorCode)
|
||||
return false;
|
||||
if (MovPhase != item.MovPhase)
|
||||
return false;
|
||||
if (StatusWord != item.StatusWord)
|
||||
return false;
|
||||
if (ControlWord != item.ControlWord)
|
||||
return false;
|
||||
if (TargetPos != item.TargetPos)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public class ModuleBlock
|
||||
{
|
||||
public short Id { get; set; } = 0;
|
||||
|
||||
#region Properties
|
||||
|
||||
public int ActualDelay { get; set; } = 0;
|
||||
public int ActualDuration { get; set; } = 0;
|
||||
public int EstimatedDelay { get; set; } = 0;
|
||||
public int EstimatedDuration { get; set; } = 0;
|
||||
public List<short> PrecedingId { get; set; } = new List<short>();
|
||||
public bool Visible { get; set; } = false;
|
||||
public bool Running { get; set; } = false;
|
||||
public bool HasError { get; set; } = false;
|
||||
public short Id { get; set; } = 0;
|
||||
public List<short> PrecedingId { get; set; } = new List<short>();
|
||||
public bool Running { get; set; } = false;
|
||||
public bool Terminated { get; set; } = false;
|
||||
public bool Visible { get; set; } = false;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
@@ -242,39 +236,41 @@ namespace CMS_CORE_Library.Models
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
|
||||
}
|
||||
|
||||
public class WarmerChannel
|
||||
public class ProdCycleModel
|
||||
{
|
||||
public int IdChannel { get; set; } = 0;
|
||||
public byte IdRefl { get; set; } = 0;
|
||||
public byte SetpointHMI { get; set; } = 0;
|
||||
public byte SetpointThermoCam { get; set; } = 0;
|
||||
public byte SetpointPLC { get; set; } = 0;
|
||||
public byte ChStatus { get; set; } = 0;
|
||||
public double CurrAct { get; set; } = 0;
|
||||
public byte PercAct { get; set; } = 0;
|
||||
public int MaxPower { get; set; } = 0;
|
||||
|
||||
#region Properties
|
||||
|
||||
public ushort MessageId { get; set; } = 0;
|
||||
public ushort Mode { get; set; } = 0;
|
||||
public ushort Status { get; set; } = 0;
|
||||
public ushort Submode { get; set; } = 0;
|
||||
public uint TimeAdv { get; set; } = 0;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is WarmerChannel item))
|
||||
if (!(obj is ProdCycleModel item))
|
||||
return false;
|
||||
|
||||
if (IdChannel != item.IdChannel)
|
||||
if (Status != item.Status)
|
||||
return false;
|
||||
if (SetpointHMI != item.SetpointHMI)
|
||||
if (MessageId != item.MessageId)
|
||||
return false;
|
||||
if (SetpointThermoCam != item.SetpointThermoCam)
|
||||
if (Mode != item.Mode)
|
||||
return false;
|
||||
if (SetpointPLC != item.SetpointPLC)
|
||||
if (Submode != item.Submode)
|
||||
return false;
|
||||
if (ChStatus != item.ChStatus)
|
||||
return false;
|
||||
if (CurrAct != item.CurrAct)
|
||||
return false;
|
||||
if (PercAct != item.PercAct)
|
||||
if (TimeAdv != item.TimeAdv)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -283,28 +279,61 @@ namespace CMS_CORE_Library.Models
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
|
||||
}
|
||||
|
||||
public class ProdInfoModel
|
||||
{
|
||||
|
||||
#region Properties
|
||||
|
||||
public DateTime DtEvent { get; set; } = DateTime.Now;
|
||||
public short NumTarget { get; set; } = 0;
|
||||
public bool IsScrap { get; set; } = false;
|
||||
public double MaterialTempEndVent { get; set; } = 0;
|
||||
public double MaterialTempEndWarm { get; set; } = 0;
|
||||
public double MoldTemp { get; set; } = 0;
|
||||
public double MouldEnergyIN { get; set; } = 0;
|
||||
public double MouldEnergyOUT { get; set; } = 0;
|
||||
public short NumDone { get; set; } = 0;
|
||||
public short NumPreHot { get; set; } = 0;
|
||||
public short NumTarget { get; set; } = 0;
|
||||
public short PreWarmCycle { get; set; } = 0;
|
||||
public int TimeWarm { get; set; } = 0;
|
||||
public int TimeVent { get; set; } = 0;
|
||||
public int TimeVacuum { get; set; } = 0;
|
||||
public int TimeCycleGross { get; set; } = 0;
|
||||
public int TimeCycleNet { get; set; } = 0;
|
||||
public double MaterialTempEndWarm { get; set; } = 0;
|
||||
public double MaterialTempEndVent { get; set; } = 0;
|
||||
public double MoldTemp { get; set; } = 0;
|
||||
public int TimeVacuum { get; set; } = 0;
|
||||
public int TimeVent { get; set; } = 0;
|
||||
public int TimeWarm { get; set; } = 0;
|
||||
public double VacuumReadVal { get; set; } = 0;
|
||||
public double MouldEnergyOUT { get; set; } = 0;
|
||||
public double MouldEnergyIN { get; set; } = 0;
|
||||
public bool IsScrap { get; set; } = false;
|
||||
public short NumPreHot { get; set; } = 0;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Converte un singolo item in un array di byte per scrittura su PLC S7
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public byte[] convertToByte()
|
||||
{
|
||||
byte[] answ = new byte[50];
|
||||
Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(NumTarget), 0, answ, 0, 2);
|
||||
Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(NumDone), 0, answ, 2, 2);
|
||||
Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(PreWarmCycle), 0, answ, 4, 2);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeWarm), 0, answ, 6, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeVent), 0, answ, 10, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeVacuum), 0, answ, 14, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeCycleGross), 0, answ, 18, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeCycleNet), 0, answ, 22, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MaterialTempEndWarm), 0, answ, 26, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MaterialTempEndVent), 0, answ, 30, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MoldTemp), 0, answ, 34, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(VacuumReadVal), 0, answ, 38, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MouldEnergyOUT), 0, answ, 42, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MouldEnergyIN), 0, answ, 46, 4);
|
||||
return answ;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
@@ -354,54 +383,61 @@ namespace CMS_CORE_Library.Models
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converte un singolo item in un array di byte per scrittura su PLC S7
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public byte[] convertToByte()
|
||||
{
|
||||
byte[] answ = new byte[50];
|
||||
Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(NumTarget), 0, answ, 0, 2);
|
||||
Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(NumDone), 0, answ, 2, 2);
|
||||
Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(PreWarmCycle), 0, answ, 4, 2);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeWarm), 0, answ, 6, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeVent), 0, answ, 10, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeVacuum), 0, answ, 14, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeCycleGross), 0, answ, 18, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeCycleNet), 0, answ, 22, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MaterialTempEndWarm), 0, answ, 26, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MaterialTempEndVent), 0, answ, 30, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MoldTemp), 0, answ, 34, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(VacuumReadVal), 0, answ, 38, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MouldEnergyOUT), 0, answ, 42, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MouldEnergyIN), 0, answ, 46, 4);
|
||||
return answ;
|
||||
}
|
||||
#endregion Methods
|
||||
|
||||
}
|
||||
|
||||
public class ProdCycleModel
|
||||
/// <summary>
|
||||
/// Recipe Parameters
|
||||
/// </summary>
|
||||
public class RecipeParam
|
||||
{
|
||||
public ushort Status { get; set; } = 0;
|
||||
public ushort MessageId { get; set; } = 0;
|
||||
public ushort Mode { get; set; } = 0;
|
||||
public ushort Submode { get; set; } = 0;
|
||||
public uint TimeAdv { get; set; } = 0;
|
||||
|
||||
#region Properties
|
||||
|
||||
public bool Enabled { get; set; } = false;
|
||||
public bool HasError { get; set; } = false;
|
||||
public short Id { get; set; } = 0;
|
||||
public int ScaleFactor { get; set; } = 1;
|
||||
public double SetpointHMI { get; set; } = 0;
|
||||
public double SetpointPLC { get; set; } = 0;
|
||||
public ushort UnitMeasure { get; set; } = 0;
|
||||
public double ValMax { get; set; } = 0;
|
||||
public double ValMin { get; set; } = 0;
|
||||
public double ValueAct { get; set; } = 0;
|
||||
public bool Visible { get; set; } = false;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is ProdCycleModel item))
|
||||
if (!(obj is RecipeParam item))
|
||||
return false;
|
||||
|
||||
if (Status != item.Status)
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
if (MessageId != item.MessageId)
|
||||
if (SetpointHMI != item.SetpointHMI)
|
||||
return false;
|
||||
if (Mode != item.Mode)
|
||||
if (SetpointPLC != item.SetpointPLC)
|
||||
return false;
|
||||
if (Submode != item.Submode)
|
||||
if (ValMax != item.ValMax)
|
||||
return false;
|
||||
if (TimeAdv != item.TimeAdv)
|
||||
if (ValMin != item.ValMin)
|
||||
return false;
|
||||
if (UnitMeasure != item.UnitMeasure)
|
||||
return false;
|
||||
if (Visible != item.Visible)
|
||||
return false;
|
||||
if (Enabled != item.Enabled)
|
||||
return false;
|
||||
if (HasError != item.HasError)
|
||||
return false;
|
||||
if (ValueAct != item.ValueAct)
|
||||
return false;
|
||||
if (ScaleFactor != item.ScaleFactor)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -410,8 +446,121 @@ namespace CMS_CORE_Library.Models
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
|
||||
}
|
||||
public class WarmerChannel
|
||||
{
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Channel status
|
||||
/// </summary>
|
||||
public byte ChStatus { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Channel AMPERE actual value
|
||||
/// </summary>
|
||||
public double CurrAct { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Channel Unique ID (from risk2007)
|
||||
/// </summary>
|
||||
public int IdChannel { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Reflector ID
|
||||
/// </summary>
|
||||
public byte IdRefl { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Channel MaxPower
|
||||
/// </summary>
|
||||
public int MaxPower { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Channel actual value %
|
||||
/// </summary>
|
||||
public byte PercAct { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Setpoint from HMI (%)
|
||||
/// </summary>
|
||||
public byte SetpointHMI { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Setpoint from PLC (%)
|
||||
/// </summary>
|
||||
public byte SetpointPLC { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Define if camera is active for channel
|
||||
/// </summary>
|
||||
public bool ThermocamActive { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Actual value from last ThermoCam image acquisition (° Celsius)
|
||||
/// </summary>
|
||||
public double ThermocamActualTemp { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Setpoint from HMI (° Celsius)
|
||||
/// </summary>
|
||||
public byte ThermocamSetpoint { get; set; } = 0;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Equality test for class object
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is WarmerChannel item))
|
||||
return false;
|
||||
|
||||
if (ChStatus != item.ChStatus)
|
||||
return false;
|
||||
if (CurrAct != item.CurrAct)
|
||||
return false;
|
||||
if (IdChannel != item.IdChannel)
|
||||
return false;
|
||||
if (PercAct != item.PercAct)
|
||||
return false;
|
||||
if (SetpointHMI != item.SetpointHMI)
|
||||
return false;
|
||||
if (SetpointPLC != item.SetpointPLC)
|
||||
return false;
|
||||
if (ThermocamActive != item.ThermocamActive)
|
||||
return false;
|
||||
if (ThermocamActualTemp != item.ThermocamActualTemp)
|
||||
return false;
|
||||
if (ThermocamSetpoint != item.ThermocamSetpoint)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hash gen
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Classes
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -684,11 +684,17 @@ namespace CMS_CORE_Library
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_WWarmerChSetpHmi(Dictionary<int, int> newData);
|
||||
/// <summary>
|
||||
/// Set current Warmers Channels setpoints
|
||||
/// Set current Warmers Channels ThermocamSetpoints (°C)
|
||||
/// </summary>
|
||||
/// <param name="newData"></param>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_WWarmerChSetpTCam(Dictionary<int, int> newData);
|
||||
public abstract CmsError PLC_WWarmerChTCamSetp(Dictionary<int, double> newData);
|
||||
/// <summary>
|
||||
/// Set current Warmers Channels Thermocam read (actual) value (°C)
|
||||
/// </summary>
|
||||
/// <param name="newData"></param>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_WWarmerChTCamActual(Dictionary<int, double> newData);
|
||||
/// <summary>
|
||||
/// Set current Warmers Channels reflector's data
|
||||
/// </summary>
|
||||
|
||||
@@ -2359,8 +2359,12 @@ namespace CMS_CORE_Library.S7Net
|
||||
refreshRiscSetpointHMI();
|
||||
// refresh setpoint PLC
|
||||
refreshRiscSetpointPLC();
|
||||
// refresh setpoint termocamera ???
|
||||
refreshRiscSetpointTermoCam();
|
||||
|
||||
// refresh dati termocamera
|
||||
refreshRiscTermoCamAbilit();
|
||||
refreshRiscTermoCamCommStatus();
|
||||
refreshRiscTermoCamTempAct();
|
||||
refreshRiscTermoCamTempSet();
|
||||
|
||||
// copio lista act in output
|
||||
currWarmerChannelList = ThermoWarmChannels;
|
||||
@@ -2945,9 +2949,30 @@ namespace CMS_CORE_Library.S7Net
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refresh Canali Riscaldi: SetPoint Termocamera
|
||||
/// Refresh dati ThermoCamera dal PLC: temperatura impostata come riferimento
|
||||
/// </summary>
|
||||
private void refreshRiscSetpointTermoCam()
|
||||
private void refreshRiscTermoCamTempSet()
|
||||
{
|
||||
// FIXME TODO ???? da dove prendere info?
|
||||
}
|
||||
/// <summary>
|
||||
/// Refresh dati ThermoCamera dal PLC: ultima temp letta
|
||||
/// </summary>
|
||||
private void refreshRiscTermoCamTempAct()
|
||||
{
|
||||
// FIXME TODO ???? da dove prendere info?
|
||||
}
|
||||
/// <summary>
|
||||
/// Refresh dati ThermoCamera dal PLC x area command/status
|
||||
/// </summary>
|
||||
private void refreshRiscTermoCamCommStatus()
|
||||
{
|
||||
// FIXME TODO ???? da dove prendere info?
|
||||
}
|
||||
/// <summary>
|
||||
/// Refresh dati ThermoCamera dal PLC x area command/status
|
||||
/// </summary>
|
||||
private void refreshRiscTermoCamAbilit()
|
||||
{
|
||||
// FIXME TODO ???? da dove prendere info?
|
||||
}
|
||||
@@ -2956,7 +2981,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
/// </summary>
|
||||
private void refreshRiscSetpointHMI()
|
||||
{
|
||||
// leggo DB514 x area Ich
|
||||
// leggo DB614 x area Ich
|
||||
List<byte> currMem = new List<byte>();
|
||||
|
||||
// leggo da PLC a array di byte di appoggio...
|
||||
@@ -3171,11 +3196,46 @@ namespace CMS_CORE_Library.S7Net
|
||||
return NO_ERROR;
|
||||
}
|
||||
/// <summary>
|
||||
/// Write Warmers channels termocam data
|
||||
/// Set current Warmers Channels ThermocamSetpoints (°C)
|
||||
/// </summary>
|
||||
/// <param name="updtCh"></param>
|
||||
/// <returns></returns>
|
||||
public override CmsError PLC_WWarmerChSetpTCam(Dictionary<int, int> newData)
|
||||
public override CmsError PLC_WWarmerChTCamSetp(Dictionary<int, double> newData)
|
||||
{
|
||||
// FIXME TODO serve nuova area termocamera
|
||||
#if false
|
||||
// memory area
|
||||
byte[] newMem = new byte[newData.Count];
|
||||
List<byte> currMem = new List<byte>();
|
||||
|
||||
// read actual data on memory...
|
||||
CmsError libraryError = MEM_RWByteList(R, 0, RISC_CHP_DATA.MemType, RISC_CHP_DATA.Address, RISC_CHP_DATA.SubAddress, 0, RISC_CHP_DATA.Size, ref currMem);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
|
||||
newMem = currMem.ToArray();
|
||||
|
||||
// update only given data...
|
||||
foreach (var item in newData)
|
||||
{
|
||||
newMem[item.Key - 1] = (byte)item.Value;
|
||||
}
|
||||
// return as list...
|
||||
currMem = newMem.ToList();
|
||||
// scrivo sul PLC array di byte...
|
||||
libraryError = MEM_RWByteList(W, 0, RISC_CHP_DATA.MemType, RISC_CHP_DATA.Address, RISC_CHP_DATA.SubAddress, 0, RISC_CHP_DATA.Size, ref currMem);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
#endif
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
/// <summary>
|
||||
/// Set current Warmers Channels Thermocam read (actual) value (°C)
|
||||
/// </summary>
|
||||
/// <param name="updtCh"></param>
|
||||
/// <returns></returns>
|
||||
public override CmsError PLC_WWarmerChTCamActual(Dictionary<int, double> newData)
|
||||
{
|
||||
// FIXME TODO serve nuova area termocamera
|
||||
#if false
|
||||
@@ -4926,6 +4986,15 @@ namespace CMS_CORE_Library.S7Net
|
||||
internal static MEMORY_CELL RISC_OVP_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 514, 10752, 1024);
|
||||
internal static MEMORY_CELL RISC_ICH_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 514, 11776, 4096);
|
||||
|
||||
// ThermoCamera
|
||||
internal static MEMORY_CELL TCAM_STAT_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 626, 0, 2);
|
||||
internal static MEMORY_CELL TCAM_COMM_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 626, 2, 2);
|
||||
internal static MEMORY_CELL TCAM_CH_ENAB_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 626, 4, 128);
|
||||
internal static MEMORY_CELL TCAM_TEMP_REQ_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 624, 0, 2048);
|
||||
internal static MEMORY_CELL TCAM_TEMP_ACT_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 625, 0, 2048);
|
||||
internal static MEMORY_CELL TCAM_CHP_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 627, 0, 1024);
|
||||
|
||||
|
||||
// produzione
|
||||
internal static MEMORY_CELL PROCESS_PROD_INFO = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 606, 0, 52);
|
||||
internal static MEMORY_CELL PROCESS_PROD_CYCLE = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 605, 0, 22);
|
||||
|
||||
Reference in New Issue
Block a user