|
|
@ -123,7 +123,6 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
|
|
|
|
public static void DownD1Recipe(List<RecipePlcView> recipePlcViews, List<Step> recipeSteps)
|
|
|
|
public static void DownD1Recipe(List<RecipePlcView> recipePlcViews, List<Step> recipeSteps)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int begin = 58;
|
|
|
|
int begin = 58;
|
|
|
|
DownCleanD1Recipe(begin);
|
|
|
|
DownCleanD1Recipe(begin);
|
|
|
|
for (int i = 0; i < recipePlcViews.Count(); i++)
|
|
|
|
for (int i = 0; i < recipePlcViews.Count(); i++)
|
|
|
@ -625,5 +624,175 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
|
|
|
|
PlcConnect.Instance.Write($"DB2104.56.1", true);
|
|
|
|
PlcConnect.Instance.Write($"DB2104.56.1", true);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DryerView GetDryerD1 => GetDryerView(58);
|
|
|
|
|
|
|
|
public static DryerView GetDryerD2 => GetDryerView(298);
|
|
|
|
|
|
|
|
public static DryerView GetDryerD3 => GetDryerView(538);
|
|
|
|
|
|
|
|
public static DryerView GetDryerD4 => GetDryerView(778);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DryerView GetGelatG1 => GetGelatView(1018);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DryerView GetGelatG2 => GetGelatView(1158);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DryerView GetGelatG3 => GetGelatView(1298);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DryerView GetGelatG4 => GetGelatView(1438);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DryerView GetGelatG5 => GetGelatView(1578);
|
|
|
|
|
|
|
|
public static DryerView GetGelatG6 => GetGelatView(1718);
|
|
|
|
|
|
|
|
public static DryerView GetGelatG7 => GetGelatView(1858);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DryerView GetGelatG8 => GetGelatView(1998);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static List<MixStep> GetWeterM1 = GetWeterView(2138);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static List<MixStep> GetWeterM2 = GetWeterView(2338);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static List<MixStep> GetWeterM3 = GetWeterView(2538);
|
|
|
|
|
|
|
|
public static List<MixStep> GetWeterM4 = GetWeterView(2738);
|
|
|
|
|
|
|
|
public static List<MixStep> GetWeterM5 = GetWeterView(2938);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static List<MixStep> GetWeterM6 = GetWeterView(3138);
|
|
|
|
|
|
|
|
public static List<MixStep> GetWeterM7 = GetWeterView(3338);
|
|
|
|
|
|
|
|
public static List<MixStep> GetWeterM8 = GetWeterView(3538);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static DryerView GetDryerView(int start)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var byteTransform = PlcConnect.Instance.ByteTransform;
|
|
|
|
|
|
|
|
DryerView view = new DryerView();
|
|
|
|
|
|
|
|
var operateResult = PlcConnect.Instance.Read($"DB2104.{start}.0", 240);
|
|
|
|
|
|
|
|
if (operateResult.IsSuccess)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<RecipePlcView> ls = new List<RecipePlcView>();
|
|
|
|
|
|
|
|
var convert = operateResult.Content;
|
|
|
|
|
|
|
|
var data = convert.Skip(0).Take(120);
|
|
|
|
|
|
|
|
for (int i = 0; i < 12; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var bytes = data.Skip(i * 10).Take(10).ToArray();
|
|
|
|
|
|
|
|
RecipePlcView plcView = new RecipePlcView
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Bin = byteTransform.TransUInt16(bytes, 0),
|
|
|
|
|
|
|
|
Set = byteTransform.TransSingle(bytes, 2),
|
|
|
|
|
|
|
|
TolErance = byteTransform.TransSingle(bytes, 6)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
ls.Add(plcView);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
view.RecipePlcViews = ls;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data = convert.Skip(120).Take(120);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Step> lsSteps = new List<Step>();
|
|
|
|
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var bytes = data.Skip(i * 10).Take(12).ToArray();
|
|
|
|
|
|
|
|
Step step = new Step()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MixCode = byteTransform.TransUInt16(bytes, 0),
|
|
|
|
|
|
|
|
MixTime = byteTransform.TransUInt16(bytes, 2),
|
|
|
|
|
|
|
|
MixTemp = byteTransform.TransSingle(bytes, 4),
|
|
|
|
|
|
|
|
MixSpeed =byteTransform.TransSingle(bytes,8)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
lsSteps.Add(step);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
view.RecipeSteps = lsSteps;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return view;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static DryerView GetGelatView(int start)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var byteTransform = PlcConnect.Instance.ByteTransform;
|
|
|
|
|
|
|
|
DryerView view = new DryerView();
|
|
|
|
|
|
|
|
var operateResult = PlcConnect.Instance.Read($"DB2104.{start}.0", 140);
|
|
|
|
|
|
|
|
if (operateResult.IsSuccess)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<RecipePlcView> ls = new List<RecipePlcView>();
|
|
|
|
|
|
|
|
var convert = operateResult.Content;
|
|
|
|
|
|
|
|
var data = convert.Skip(0).Take(20);
|
|
|
|
|
|
|
|
for (int i = 0; i < 2; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var bytes = data.Skip(i * 10).Take(10).ToArray();
|
|
|
|
|
|
|
|
RecipePlcView plcView = new RecipePlcView
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Bin = byteTransform.TransUInt16(bytes, 0),
|
|
|
|
|
|
|
|
Set = byteTransform.TransSingle(bytes, 2),
|
|
|
|
|
|
|
|
TolErance = byteTransform.TransSingle(bytes, 6)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
ls.Add(plcView);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
view.RecipePlcViews = ls;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data = convert.Skip(20).Take(120);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Step> lsSteps = new List<Step>();
|
|
|
|
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var bytes = data.Skip(i * 10).Take(12).ToArray();
|
|
|
|
|
|
|
|
Step step = new Step()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MixCode = byteTransform.TransUInt16(bytes, 0),
|
|
|
|
|
|
|
|
MixTime = byteTransform.TransUInt16(bytes, 2),
|
|
|
|
|
|
|
|
MixTemp = byteTransform.TransSingle(bytes, 4),
|
|
|
|
|
|
|
|
MixSpeed =byteTransform.TransSingle(bytes,8)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
lsSteps.Add(step);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
view.RecipeSteps = lsSteps;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return view;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static List<MixStep> GetWeterView(int start)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var byteTransform = PlcConnect.Instance.ByteTransform;
|
|
|
|
|
|
|
|
List<MixStep> ls = new List<MixStep>();
|
|
|
|
|
|
|
|
var operateResult = PlcConnect.Instance.Read($"DB2104.{start}.0", 200);
|
|
|
|
|
|
|
|
List<MixStep> lsSteps = new List<MixStep>();
|
|
|
|
|
|
|
|
if (operateResult.IsSuccess)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var data = operateResult.Content;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var bytes = data.Skip(i * 10).Take(20).ToArray();
|
|
|
|
|
|
|
|
MixStep step = new MixStep()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MixCode = byteTransform.TransUInt16(bytes, 0),
|
|
|
|
|
|
|
|
MixTime = byteTransform.TransUInt16(bytes, 2),
|
|
|
|
|
|
|
|
MixTemp = byteTransform.TransSingle(bytes, 4),
|
|
|
|
|
|
|
|
MixSpeed =byteTransform.TransSingle(bytes,8),
|
|
|
|
|
|
|
|
SetValue = byteTransform.TransSingle(bytes,12),
|
|
|
|
|
|
|
|
SetTolerance = byteTransform.TransSingle(bytes,16)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
lsSteps.Add(step);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return lsSteps;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|