|
|
|
@ -31,7 +31,8 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
public static List<int> HolderOutPutList = new List<int>();
|
|
|
|
|
public static List<int> SolidifyTimeList = new List<int>();
|
|
|
|
|
public static List<int> ActualTimeList = new List<int>();
|
|
|
|
|
public static List<double> MoldTemperatureList = new List<double>();
|
|
|
|
|
public static List<float> MoldTemperatureList = new List<float>();
|
|
|
|
|
public static List<float> ProductionCycleList = new List<float>();
|
|
|
|
|
Semaphore semaphore = new Semaphore(1, 1);
|
|
|
|
|
public CollectionFoamLine()
|
|
|
|
|
{
|
|
|
|
@ -60,15 +61,16 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
SolidifyTimeList.Clear();
|
|
|
|
|
ActualTimeList.Clear();
|
|
|
|
|
listFixtureStatus.Clear();
|
|
|
|
|
MoldTemperatureList.Clear();
|
|
|
|
|
ProductionCycleList.Clear();
|
|
|
|
|
ReadProductionCycle(obj, ProductionCycleList);
|
|
|
|
|
ReadMoldTemperature(obj,MoldTemperatureList);
|
|
|
|
|
ReadBoxType(obj, BoxTypeList); // ok
|
|
|
|
|
ReadFixtureStatus(obj, HolderStatusList); //ok
|
|
|
|
|
ReadFixtureProduction(obj, HolderOutPutList); //ok
|
|
|
|
|
ReadPlanCuringTime(obj, SolidifyTimeList); //ok
|
|
|
|
|
ReadDisplayCuringTime(obj, ActualTimeList); //ok
|
|
|
|
|
//ReadMoldTemperature(obj,MoldTemperatureList);
|
|
|
|
|
//ReadLineStatus(obj); //ok
|
|
|
|
|
// });
|
|
|
|
|
ReadBoxType(obj, BoxTypeList);
|
|
|
|
|
ReadFixtureStatus(obj, HolderStatusList);
|
|
|
|
|
ReadFixtureProduction(obj, HolderOutPutList);
|
|
|
|
|
ReadPlanCuringTime(obj, SolidifyTimeList);
|
|
|
|
|
ReadDisplayCuringTime(obj, ActualTimeList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 12; i++)
|
|
|
|
|
{
|
|
|
|
@ -113,8 +115,18 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
model.PlanCuringTime = 0;
|
|
|
|
|
model.InternalTemperature = "";
|
|
|
|
|
model.OutsideTemperature = "";
|
|
|
|
|
}
|
|
|
|
|
if (ProductionCycleList.Count > 0 && ProductionCycleList != null)
|
|
|
|
|
{
|
|
|
|
|
model.ProductionCycle = ProductionCycleList[i];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
model.ProductionCycle = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listFixtureStatus.Add(model);
|
|
|
|
|
}
|
|
|
|
|
RefreshBoxFoamDataDelegateEvent?.Invoke(listFixtureStatus);
|
|
|
|
@ -339,14 +351,14 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 模具内外温度
|
|
|
|
|
/// </summary>
|
|
|
|
|
static void ReadMoldTemperature(HwPLc.PlcModel obj, List<double> MoldTemperatureList)
|
|
|
|
|
static void ReadMoldTemperature(HwPLc.PlcModel obj, List<float> MoldTemperatureList)
|
|
|
|
|
{
|
|
|
|
|
if (obj == null) return;
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
byte[] info = obj.plc.Read("DB8.294", 284);
|
|
|
|
|
float temp1 = byteToFloat(info.Skip(0).Take(4).ToArray());
|
|
|
|
|
float temp2 = byteToFloat(info.Skip(6).Take(4).ToArray());
|
|
|
|
|
float temp2 = byteToFloat(info.Skip(16).Take(4).ToArray());
|
|
|
|
|
float temp3 = byteToFloat(info.Skip(24).Take(4).ToArray());
|
|
|
|
|
float temp4 = byteToFloat(info.Skip(40).Take(4).ToArray());
|
|
|
|
|
float temp5 = byteToFloat(info.Skip(48).Take(4).ToArray());
|
|
|
|
@ -407,6 +419,48 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 生产节拍
|
|
|
|
|
/// </summary>
|
|
|
|
|
static void ReadProductionCycle(HwPLc.PlcModel obj, List<float> ProductionCycleList)
|
|
|
|
|
{
|
|
|
|
|
if (obj == null) return;
|
|
|
|
|
if (obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
byte[] info = obj.plc.Read("DB8.578", 52);
|
|
|
|
|
float temp1 = byteToFloat(info.Skip(0).Take(4).ToArray());
|
|
|
|
|
float temp2 = byteToFloat(info.Skip(4).Take(4).ToArray());
|
|
|
|
|
float temp3 = byteToFloat(info.Skip(8).Take(4).ToArray());
|
|
|
|
|
float temp4 = byteToFloat(info.Skip(12).Take(4).ToArray());
|
|
|
|
|
float temp5 = byteToFloat(info.Skip(16).Take(4).ToArray());
|
|
|
|
|
float temp6 = byteToFloat(info.Skip(20).Take(4).ToArray());
|
|
|
|
|
float temp7 = byteToFloat(info.Skip(24).Take(4).ToArray());
|
|
|
|
|
float temp8 = byteToFloat(info.Skip(28).Take(4).ToArray());
|
|
|
|
|
float temp9 = byteToFloat(info.Skip(32).Take(4).ToArray());
|
|
|
|
|
float temp10 = byteToFloat(info.Skip(36).Take(4).ToArray());
|
|
|
|
|
float temp11 = byteToFloat(info.Skip(40).Take(4).ToArray());
|
|
|
|
|
float temp12 = byteToFloat(info.Skip(44).Take(4).ToArray());
|
|
|
|
|
// 平均节拍
|
|
|
|
|
float temp13 = byteToFloat(info.Skip(48).Take(4).ToArray());
|
|
|
|
|
ProductionCycleList.Add(temp1);
|
|
|
|
|
ProductionCycleList.Add(temp2);
|
|
|
|
|
ProductionCycleList.Add(temp3);
|
|
|
|
|
ProductionCycleList.Add(temp4);
|
|
|
|
|
ProductionCycleList.Add(temp5);
|
|
|
|
|
ProductionCycleList.Add(temp6);
|
|
|
|
|
ProductionCycleList.Add(temp7);
|
|
|
|
|
ProductionCycleList.Add(temp8);
|
|
|
|
|
ProductionCycleList.Add(temp9);
|
|
|
|
|
ProductionCycleList.Add(temp10);
|
|
|
|
|
ProductionCycleList.Add(temp11);
|
|
|
|
|
ProductionCycleList.Add(temp12);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 发泡线状态
|
|
|
|
|
/// </summary>
|
|
|
|
|