Refactoring classi obj Thermo
This commit is contained in:
@@ -152,6 +152,7 @@
|
||||
<Compile Include="Models\NcToolModel.cs" />
|
||||
<Compile Include="Models\PreAndPostPowerOnModels.cs" />
|
||||
<Compile Include="Models\SiemensToolModels.cs" />
|
||||
<Compile Include="Models\ThermoModels.cs" />
|
||||
<Compile Include="NcThermo.cs" />
|
||||
<Compile Include="Nc.cs" />
|
||||
<Compile Include="Osai\Nc_Osai.cs" />
|
||||
|
||||
@@ -533,263 +533,5 @@ namespace CMS_CORE_Library.Models
|
||||
|
||||
#endregion Data structure models
|
||||
|
||||
#region Thermo models
|
||||
|
||||
/// <summary>
|
||||
/// Represents thermo gauge data
|
||||
/// </summary>
|
||||
public class GaugeModel
|
||||
{
|
||||
public uint TimeAdv { get; set; } = 0;
|
||||
public int Power { get; set; } = 0;
|
||||
public int Vacuum { get; set; } = 0;
|
||||
public int Air { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is GaugeModel item))
|
||||
return false;
|
||||
|
||||
if (TimeAdv != item.TimeAdv)
|
||||
return false;
|
||||
|
||||
if (Power != item.Power)
|
||||
return false;
|
||||
|
||||
if (Vacuum != item.Vacuum)
|
||||
return false;
|
||||
|
||||
if (Air != item.Air)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
/// <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 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;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ModuleBlock
|
||||
{
|
||||
public short Id { get; set; } = 0;
|
||||
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 override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is ModuleBlock item))
|
||||
return false;
|
||||
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
if (ActualDelay != item.ActualDelay)
|
||||
return false;
|
||||
if (ActualDuration != item.ActualDuration)
|
||||
return false;
|
||||
if (EstimatedDelay != item.EstimatedDelay)
|
||||
return false;
|
||||
if (EstimatedDuration != item.EstimatedDuration)
|
||||
return false;
|
||||
if (PrecedingId != item.PrecedingId)
|
||||
return false;
|
||||
if (Visible != item.Visible)
|
||||
return false;
|
||||
if (Running != item.Running)
|
||||
return false;
|
||||
if (HasError != item.HasError)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public class WarmerChannel
|
||||
{
|
||||
public int IdChannel { get; set; } = 0;
|
||||
public double SetpointThermoCam { get; set; } = 0;
|
||||
public double SetpointPLC { get; set; } = 0;
|
||||
public byte ChStatus { get; set; } = 0;
|
||||
public byte PercAct { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is WarmerChannel item))
|
||||
return false;
|
||||
|
||||
if (IdChannel != item.IdChannel)
|
||||
return false;
|
||||
if (SetpointThermoCam != item.SetpointThermoCam)
|
||||
return false;
|
||||
if (SetpointPLC != item.SetpointPLC)
|
||||
return false;
|
||||
if (ChStatus != item.ChStatus)
|
||||
return false;
|
||||
if (PercAct != item.PercAct)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ProdInfo
|
||||
{
|
||||
public short NumTarget { get; set; } = 0;
|
||||
public short NumDone { 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 double VacuumReadVal { get; set; } = 0;
|
||||
public double MouldEnergyOUT { get; set; } = 0;
|
||||
public double MouldEnergyIN { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is ProdInfo item))
|
||||
return false;
|
||||
|
||||
if (NumTarget != item.NumTarget)
|
||||
return false;
|
||||
if (NumDone != item.NumDone)
|
||||
return false;
|
||||
if (TimeWarm != item.TimeWarm)
|
||||
return false;
|
||||
if (TimeVent != item.TimeVent)
|
||||
return false;
|
||||
if (TimeVacuum != item.TimeVacuum)
|
||||
return false;
|
||||
if (TimeCycleGross != item.TimeCycleGross)
|
||||
return false;
|
||||
if (TimeCycleNet != item.TimeCycleNet)
|
||||
return false;
|
||||
if (MaterialTempEndWarm != item.MaterialTempEndWarm)
|
||||
return false;
|
||||
if (MaterialTempEndVent != item.MaterialTempEndVent)
|
||||
return false;
|
||||
if (MoldTemp != item.MoldTemp)
|
||||
return false;
|
||||
if (VacuumReadVal != item.VacuumReadVal)
|
||||
return false;
|
||||
if (MouldEnergyOUT != item.MouldEnergyOUT)
|
||||
return false;
|
||||
if (MouldEnergyIN != item.MouldEnergyIN)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public class ProdCycle
|
||||
{
|
||||
public ushort Status { get; set; } = 0;
|
||||
public ushort MessageId { get; set; } = 0;
|
||||
public ushort Mode { get; set; } = 0;
|
||||
public uint TimeAdv { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is ProdCycle item))
|
||||
return false;
|
||||
|
||||
if (Status != item.Status)
|
||||
return false;
|
||||
if (MessageId != item.MessageId)
|
||||
return false;
|
||||
if (Mode != item.Mode)
|
||||
return false;
|
||||
if (TimeAdv != item.TimeAdv)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CMS_CORE_Library.Models
|
||||
{
|
||||
public class ThermoModels
|
||||
{
|
||||
#region Thermo models
|
||||
|
||||
/// <summary>
|
||||
/// Represents thermo gauge data
|
||||
/// </summary>
|
||||
public class GaugeModel
|
||||
{
|
||||
public uint TimeAdv { get; set; } = 0;
|
||||
public int Power { get; set; } = 0;
|
||||
public int Vacuum { get; set; } = 0;
|
||||
public int Air { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is GaugeModel item))
|
||||
return false;
|
||||
|
||||
if (TimeAdv != item.TimeAdv)
|
||||
return false;
|
||||
|
||||
if (Power != item.Power)
|
||||
return false;
|
||||
|
||||
if (Vacuum != item.Vacuum)
|
||||
return false;
|
||||
|
||||
if (Air != item.Air)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
/// <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 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;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ModuleBlock
|
||||
{
|
||||
public short Id { get; set; } = 0;
|
||||
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 override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is ModuleBlock item))
|
||||
return false;
|
||||
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
if (ActualDelay != item.ActualDelay)
|
||||
return false;
|
||||
if (ActualDuration != item.ActualDuration)
|
||||
return false;
|
||||
if (EstimatedDelay != item.EstimatedDelay)
|
||||
return false;
|
||||
if (EstimatedDuration != item.EstimatedDuration)
|
||||
return false;
|
||||
if (PrecedingId != item.PrecedingId)
|
||||
return false;
|
||||
if (Visible != item.Visible)
|
||||
return false;
|
||||
if (Running != item.Running)
|
||||
return false;
|
||||
if (HasError != item.HasError)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public class WarmerChannel
|
||||
{
|
||||
public int IdChannel { get; set; } = 0;
|
||||
public double SetpointThermoCam { get; set; } = 0;
|
||||
public double SetpointPLC { get; set; } = 0;
|
||||
public byte ChStatus { get; set; } = 0;
|
||||
public byte PercAct { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is WarmerChannel item))
|
||||
return false;
|
||||
|
||||
if (IdChannel != item.IdChannel)
|
||||
return false;
|
||||
if (SetpointThermoCam != item.SetpointThermoCam)
|
||||
return false;
|
||||
if (SetpointPLC != item.SetpointPLC)
|
||||
return false;
|
||||
if (ChStatus != item.ChStatus)
|
||||
return false;
|
||||
if (PercAct != item.PercAct)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ProdInfo
|
||||
{
|
||||
public short NumTarget { get; set; } = 0;
|
||||
public short NumDone { 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 double VacuumReadVal { get; set; } = 0;
|
||||
public double MouldEnergyOUT { get; set; } = 0;
|
||||
public double MouldEnergyIN { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is ProdInfo item))
|
||||
return false;
|
||||
|
||||
if (NumTarget != item.NumTarget)
|
||||
return false;
|
||||
if (NumDone != item.NumDone)
|
||||
return false;
|
||||
if (TimeWarm != item.TimeWarm)
|
||||
return false;
|
||||
if (TimeVent != item.TimeVent)
|
||||
return false;
|
||||
if (TimeVacuum != item.TimeVacuum)
|
||||
return false;
|
||||
if (TimeCycleGross != item.TimeCycleGross)
|
||||
return false;
|
||||
if (TimeCycleNet != item.TimeCycleNet)
|
||||
return false;
|
||||
if (MaterialTempEndWarm != item.MaterialTempEndWarm)
|
||||
return false;
|
||||
if (MaterialTempEndVent != item.MaterialTempEndVent)
|
||||
return false;
|
||||
if (MoldTemp != item.MoldTemp)
|
||||
return false;
|
||||
if (VacuumReadVal != item.VacuumReadVal)
|
||||
return false;
|
||||
if (MouldEnergyOUT != item.MouldEnergyOUT)
|
||||
return false;
|
||||
if (MouldEnergyIN != item.MouldEnergyIN)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public class ProdCycle
|
||||
{
|
||||
public ushort Status { get; set; } = 0;
|
||||
public ushort MessageId { get; set; } = 0;
|
||||
public ushort Mode { get; set; } = 0;
|
||||
public uint TimeAdv { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is ProdCycle item))
|
||||
return false;
|
||||
|
||||
if (Status != item.Status)
|
||||
return false;
|
||||
if (MessageId != item.MessageId)
|
||||
return false;
|
||||
if (Mode != item.Mode)
|
||||
return false;
|
||||
if (TimeAdv != item.TimeAdv)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -626,26 +626,26 @@ namespace CMS_CORE_Library
|
||||
/// <param name="onlyRT">updates only RT parameters (false = update all)</param>
|
||||
/// <param name="currParamList"></param>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_RRecipeParamList(bool onlyRT, ref Dictionary<int, RecipeParam> currParamList);
|
||||
public abstract CmsError PLC_RRecipeParamList(bool onlyRT, ref Dictionary<int, ThermoModels.RecipeParam> currParamList);
|
||||
/// <summary>
|
||||
/// Write recipe updated parameter
|
||||
/// </summary>
|
||||
/// <param name="updtParam"></param>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_WRecipeParam(RecipeParam updtParam);
|
||||
public abstract CmsError PLC_WRecipeParam(ThermoModels.RecipeParam updtParam);
|
||||
/// <summary>
|
||||
/// Get current Modules Block list
|
||||
/// </summary>
|
||||
/// <param name="onlyRT">updates only RT parameters (false = update all)</param>
|
||||
/// <param name="currModulesBlockList"></param>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_RModulesBlockList(bool onlyRT, ref Dictionary<int, ModuleBlock> currModulesBlockList);
|
||||
public abstract CmsError PLC_RModulesBlockList(bool onlyRT, ref Dictionary<int, ThermoModels.ModuleBlock> currModulesBlockList);
|
||||
/// <summary>
|
||||
/// Get current Warmers Channels list
|
||||
/// </summary>
|
||||
/// <param name="currWarmerChannelList"></param>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_RWarmerChannelList(ref Dictionary<int, WarmerChannel> currWarmerChannelList);
|
||||
public abstract CmsError PLC_RWarmerChannelList(ref Dictionary<int, ThermoModels.WarmerChannel> currWarmerChannelList);
|
||||
/// <summary>
|
||||
/// Read power gauge data
|
||||
/// <para>
|
||||
@@ -654,19 +654,19 @@ namespace CMS_CORE_Library
|
||||
/// <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
|
||||
/// </summary>
|
||||
/// <param name="gaugeData">Reference to the value of the gauge data</param>
|
||||
public abstract CmsError PLC_RGaugeData(ref GaugeModel gaugeData);
|
||||
public abstract CmsError PLC_RGaugeData(ref ThermoModels.GaugeModel gaugeData);
|
||||
/// <summary>
|
||||
/// Get current Production Info data
|
||||
/// </summary>
|
||||
/// <param name="currProdInfo"></param>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_RProdInfo(ref ProdInfo currProdInfo);
|
||||
public abstract CmsError PLC_RProdInfo(ref ThermoModels.ProdInfo currProdInfo);
|
||||
/// <summary>
|
||||
/// Get current Production Cycle data
|
||||
/// </summary>
|
||||
/// <param name="currProdCycle"></param>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_RProdCycle(ref ProdCycle currProdCycle);
|
||||
public abstract CmsError PLC_RProdCycle(ref ThermoModels.ProdCycle currProdCycle);
|
||||
|
||||
#endregion THERMO high level data
|
||||
|
||||
|
||||
@@ -58,11 +58,11 @@ namespace CMS_CORE_Library.S7Net
|
||||
|
||||
|
||||
// Dizionario parametri specifici per THERMO
|
||||
private static Dictionary<int, RecipeParam> ThermoParamList;
|
||||
private static Dictionary<int, ModuleBlock> ThermoModuleList;
|
||||
private static Dictionary<int, WarmerChannel> ThermoWarmChannels;
|
||||
private static ProdInfo ThermoProdInfo;
|
||||
private static ProdCycle ThermoProdCycle;
|
||||
private static Dictionary<int, ThermoModels.RecipeParam> ThermoParamList;
|
||||
private static Dictionary<int, ThermoModels.ModuleBlock> ThermoModuleList;
|
||||
private static Dictionary<int, ThermoModels.WarmerChannel> ThermoWarmChannels;
|
||||
private static ThermoModels.ProdInfo ThermoProdInfo;
|
||||
private static ThermoModels.ProdCycle ThermoProdCycle;
|
||||
|
||||
// connessione S7
|
||||
private CpuType tipoCpu = CpuType.S71500;
|
||||
@@ -133,11 +133,11 @@ namespace CMS_CORE_Library.S7Net
|
||||
// mesasggi generici PLC
|
||||
PlcMessages = new Dictionary<int, string>();
|
||||
// Init dati specifici Themo
|
||||
ThermoParamList = new Dictionary<int, RecipeParam>();
|
||||
ThermoModuleList = new Dictionary<int, ModuleBlock>();
|
||||
ThermoWarmChannels = new Dictionary<int, WarmerChannel>();
|
||||
ThermoProdCycle = new ProdCycle();
|
||||
ThermoProdInfo = new ProdInfo();
|
||||
ThermoParamList = new Dictionary<int, ThermoModels.RecipeParam>();
|
||||
ThermoModuleList = new Dictionary<int, ThermoModels.ModuleBlock>();
|
||||
ThermoWarmChannels = new Dictionary<int, ThermoModels.WarmerChannel>();
|
||||
ThermoProdCycle = new ThermoModels.ProdCycle();
|
||||
ThermoProdInfo = new ThermoModels.ProdInfo();
|
||||
}
|
||||
/// <summary>
|
||||
/// Connessione al PLC
|
||||
@@ -1811,7 +1811,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
/// <param name="onlyRT">updates only RT parameters (false = update all)</param>
|
||||
/// <param name="currParamList"></param>
|
||||
/// <returns></returns>
|
||||
public override CmsError PLC_RRecipeParamList(bool onlyRT, ref Dictionary<int, RecipeParam> currParamList)
|
||||
public override CmsError PLC_RRecipeParamList(bool onlyRT, ref Dictionary<int, ThermoModels.RecipeParam> currParamList)
|
||||
{
|
||||
// se richiesto NON SOLO RT faccio refresh anche dati "lenti"
|
||||
if (!onlyRT)
|
||||
@@ -1830,7 +1830,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
/// </summary>
|
||||
/// <param name="updtParam"></param>
|
||||
/// <returns></returns>
|
||||
public override CmsError PLC_WRecipeParam(RecipeParam updtParam)
|
||||
public override CmsError PLC_WRecipeParam(ThermoModels.RecipeParam updtParam)
|
||||
{
|
||||
// init variabili accessorie
|
||||
List<byte> currMem = new List<byte>();
|
||||
@@ -1859,7 +1859,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
/// <param name="onlyRT">updates only RT parameters (false = update all)</param>
|
||||
/// <param name="currModulesBlockList"></param>
|
||||
/// <returns></returns>
|
||||
public override CmsError PLC_RModulesBlockList(bool onlyRT, ref Dictionary<int, ModuleBlock> currModulesBlockList)
|
||||
public override CmsError PLC_RModulesBlockList(bool onlyRT, ref Dictionary<int, ThermoModels.ModuleBlock> currModulesBlockList)
|
||||
{
|
||||
// se richiesto NON SOLO RT faccio refresh anche dati "lenti"
|
||||
if (!onlyRT)
|
||||
@@ -1878,7 +1878,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
/// </summary>
|
||||
/// <param name="currWarmerChannelList"></param>
|
||||
/// <returns></returns>
|
||||
public override CmsError PLC_RWarmerChannelList(ref Dictionary<int, WarmerChannel> currWarmerChannelList)
|
||||
public override CmsError PLC_RWarmerChannelList(ref Dictionary<int, ThermoModels.WarmerChannel> currWarmerChannelList)
|
||||
{
|
||||
// refresh stato canale
|
||||
refreshRiscStatus();
|
||||
@@ -1900,7 +1900,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
/// </summary>
|
||||
/// <param name="gaugeData"></param>
|
||||
/// <returns></returns>
|
||||
public override CmsError PLC_RGaugeData(ref GaugeModel gaugeData)
|
||||
public override CmsError PLC_RGaugeData(ref ThermoModels.GaugeModel gaugeData)
|
||||
{
|
||||
List<int> Values = new List<int>();
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 1, MACHINE_GAUGE_DATA.MemType, MACHINE_GAUGE_DATA.Address, MACHINE_GAUGE_DATA.SubAddress, MACHINE_GAUGE_DATA.Size / 4, ref Values);
|
||||
@@ -1908,7 +1908,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
gaugeData = new GaugeModel()
|
||||
gaugeData = new ThermoModels.GaugeModel()
|
||||
{
|
||||
TimeAdv = Convert.ToUInt32(Values[0]),
|
||||
Power = Values[1],
|
||||
@@ -1923,7 +1923,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
/// </summary>
|
||||
/// <param name="currProdInfo"></param>
|
||||
/// <returns></returns>
|
||||
public override CmsError PLC_RProdInfo(ref ProdInfo currProdInfo)
|
||||
public override CmsError PLC_RProdInfo(ref ThermoModels.ProdInfo currProdInfo)
|
||||
{
|
||||
List<byte> currMem = new List<byte>();
|
||||
CmsError cmsError = MEM_RWByteList(R, 0, PROCESS_PROD_INFO.MemType, PROCESS_PROD_INFO.Address, PROCESS_PROD_INFO.SubAddress, 0, PROCESS_PROD_INFO.Size, ref currMem);
|
||||
@@ -1931,7 +1931,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
// converto!
|
||||
currProdInfo = new ProdInfo()
|
||||
currProdInfo = new ThermoModels.ProdInfo()
|
||||
{
|
||||
NumTarget = S7.Net.Types.Int.FromByteArray(currMem.Skip(0).Take(2).ToArray()),
|
||||
NumDone = S7.Net.Types.Int.FromByteArray(currMem.Skip(2).Take(2).ToArray()),
|
||||
@@ -1956,7 +1956,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
/// </summary>
|
||||
/// <param name="currProdCycle"></param>
|
||||
/// <returns></returns>
|
||||
public override CmsError PLC_RProdCycle(ref ProdCycle currProdCycle)
|
||||
public override CmsError PLC_RProdCycle(ref ThermoModels.ProdCycle currProdCycle)
|
||||
{
|
||||
List<byte> currMem = new List<byte>();
|
||||
CmsError cmsError = MEM_RWByteList(R, 0, PROCESS_PROD_CYCLE.MemType, PROCESS_PROD_CYCLE.Address, PROCESS_PROD_CYCLE.SubAddress, 0, PROCESS_PROD_CYCLE.Size, ref currMem);
|
||||
@@ -1964,7 +1964,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
// converto!
|
||||
currProdCycle = new ProdCycle()
|
||||
currProdCycle = new ThermoModels.ProdCycle()
|
||||
{
|
||||
Status = S7.Net.Types.Word.FromByteArray(currMem.Skip(0).Take(2).ToArray()),
|
||||
MessageId = S7.Net.Types.Word.FromByteArray(currMem.Skip(2).Take(2).ToArray()),
|
||||
@@ -2009,7 +2009,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
}
|
||||
else
|
||||
{
|
||||
ThermoParamList.Add(currParam.Id, new RecipeParam() { Id = currParam.Id, Enabled = currParam.Enabled, HasError = currParam.HasError, Visible = currParam.Visible, ValueAct = currParam.ValueAct });
|
||||
ThermoParamList.Add(currParam.Id, new ThermoModels.RecipeParam() { Id = currParam.Id, Enabled = currParam.Enabled, HasError = currParam.HasError, Visible = currParam.Visible, ValueAct = currParam.ValueAct });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2049,7 +2049,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
}
|
||||
else
|
||||
{
|
||||
ThermoParamList.Add(currParam.Id, new RecipeParam() { Id = currParam.Id, SetpointHMI = currParam.SetpointHMI, SetpointPLC = currParam.SetpointPLC, ValMax = currParam.ValMax, ValMin = currParam.ValMin, UnitMeasure = currParam.UnitMeasure });
|
||||
ThermoParamList.Add(currParam.Id, new ThermoModels.RecipeParam() { Id = currParam.Id, SetpointHMI = currParam.SetpointHMI, SetpointPLC = currParam.SetpointPLC, ValMax = currParam.ValMax, ValMin = currParam.ValMin, UnitMeasure = currParam.UnitMeasure });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2174,7 +2174,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
}
|
||||
else
|
||||
{
|
||||
ThermoModuleList.Add(currModBlock.Id, new ModuleBlock()
|
||||
ThermoModuleList.Add(currModBlock.Id, new ThermoModels.ModuleBlock()
|
||||
{
|
||||
Id = currModBlock.Id,
|
||||
ActualDuration = currModBlock.ActualDuration,
|
||||
@@ -2225,7 +2225,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
}
|
||||
else
|
||||
{
|
||||
ThermoModuleList.Add(currModBlock.Id, new ModuleBlock()
|
||||
ThermoModuleList.Add(currModBlock.Id, new ThermoModels.ModuleBlock()
|
||||
{
|
||||
Id = currModBlock.Id,
|
||||
EstimatedDelay = currModBlock.EstimDelay,
|
||||
@@ -2360,7 +2360,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
}
|
||||
else
|
||||
{
|
||||
ThermoWarmChannels.Add(i + 1, new WarmerChannel()
|
||||
ThermoWarmChannels.Add(i + 1, new ThermoModels.WarmerChannel()
|
||||
{
|
||||
IdChannel = i + 1,
|
||||
SetpointPLC = currVal
|
||||
@@ -2394,7 +2394,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
}
|
||||
else
|
||||
{
|
||||
ThermoWarmChannels.Add(i + 1, new WarmerChannel()
|
||||
ThermoWarmChannels.Add(i + 1, new ThermoModels.WarmerChannel()
|
||||
{
|
||||
IdChannel = i + 1,
|
||||
PercAct = memArray[i]
|
||||
@@ -2428,7 +2428,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
}
|
||||
else
|
||||
{
|
||||
ThermoWarmChannels.Add(i + 1, new WarmerChannel()
|
||||
ThermoWarmChannels.Add(i + 1, new ThermoModels.WarmerChannel()
|
||||
{
|
||||
IdChannel = i + 1,
|
||||
ChStatus = memArray[i]
|
||||
|
||||
Reference in New Issue
Block a user