wangsr
wangsr 1 year ago
commit 034d3b1a92

@ -68,13 +68,13 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
RecipePlcView recipe1 = new RecipePlcView()
{
Bin = (ushort)StockMaterrialDbHelp.GetCodeById(bin1),
Bin = (short)StockMaterrialDbHelp.GetCodeById(bin1),
Set = Convert.ToSingle(ControlsEntity.MaterialWeight1.MCValue.ToString()),
Tolerance = Convert.ToSingle(ControlsEntity.MaterialTolerance1.MCValue.ToString()),
};
RecipePlcView recipe2 = new RecipePlcView()
{
Bin = (ushort)StockMaterrialDbHelp.GetCodeById(bin2),
Bin = (short)StockMaterrialDbHelp.GetCodeById(bin2),
Set = Convert.ToSingle(ControlsEntity.MaterialWeight2.MCValue.ToString()),
Tolerance = Convert.ToSingle(ControlsEntity.MaterialTolerance2.MCValue.ToString()),
};
@ -96,7 +96,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
Step step3 = new Step()
{
MixCode = 3,
MixTime = Convert.ToUInt16(ControlsEntity.GelPosTimeC.MCValue.ToString()),
MixTime = Convert.ToInt16(ControlsEntity.GelPosTimeC.MCValue.ToString()),
MixTemp = Convert.ToSingle(ControlsEntity.GelPosTimeA.MCValue.ToString()),
MixSpeed = Convert.ToSingle(ControlsEntity.GelNagTimeB.MCValue.ToString())
};
@ -107,7 +107,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
Step step5 = new Step()
{
MixCode = 5,
MixTime = Convert.ToUInt16(ControlsEntity.GelWaterTime.MCValue.ToString())
MixTime = Convert.ToInt16(ControlsEntity.GelWaterTime.MCValue.ToString())
};
Step step6 = new Step()
{
@ -116,12 +116,12 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
Step step7 = new Step()
{
MixCode = 5,
MixTime = Convert.ToUInt16(ControlsEntity.GelWaitTime.MCValue.ToString())
MixTime = Convert.ToInt16(ControlsEntity.GelWaitTime.MCValue.ToString())
};
Step step8 = new Step()
{
MixCode = 7,
MixTime = Convert.ToUInt16(ControlsEntity.GelCloseHeatTime.MCValue.ToString()),
MixTime = Convert.ToInt16(ControlsEntity.GelCloseHeatTime.MCValue.ToString()),
MixTemp = Convert.ToSingle(ControlsEntity.GelOutDelayTime.MCValue.ToString())
};
@ -148,7 +148,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
MixStep mixStep3 = new MixStep()
{
MixCode = 3,
MixTime = Convert.ToUInt16(ControlsEntity.WetMixTime.MCValue.ToString())
MixTime = Convert.ToInt16(ControlsEntity.WetMixTime.MCValue.ToString())
};
MixStep mixStep4 = new MixStep()
{
@ -157,7 +157,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
MixStep mixStep5 = new MixStep()
{
MixCode = 5,
MixTime = Convert.ToUInt16(ControlsEntity.WetOutDelayTime.MCValue.ToString()),
MixTime = Convert.ToInt16(ControlsEntity.WetOutDelayTime.MCValue.ToString()),
};
mixSteps.Add(mixStep1);

@ -269,7 +269,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
{
RecipePlcView view = new RecipePlcView()
{
Bin = Convert.ToUInt16(dataTableRow["Code"]),
Bin = Convert.ToInt16(dataTableRow["Code"]),
Set = Convert.ToSingle(dataTableRow["Weight"]),
Tolerance = Convert.ToSingle(dataTableRow["Weight"])
};
@ -294,9 +294,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
{
Step step = new Step();
//代码
step.MixCode = Convert.ToUInt16(tableRow["ActionId"]);
step.MixCode = Convert.ToInt16(tableRow["ActionId"]);
//时间
step.MixTime = Convert.ToUInt16(tableRow["SecondTime"]);
step.MixTime = Convert.ToInt16(tableRow["SecondTime"]);
//温度
step.MixTemp = Convert.ToInt32(tableRow["SecondTime"]);
//速度

@ -2,15 +2,15 @@
{
public class RecipePlcView
{
public ushort Bin { get; set; }
public short Bin { get; set; }
public float Set { get; set; }
public float Tolerance { get; set; }
}
public class Step
{
public ushort MixCode { get; set; }
public ushort MixTime { get; set; }
public short MixCode { get; set; }
public short MixTime { get; set; }
public float MixTemp { get; set; }
public float MixSpeed { get; set; }
}

@ -111,7 +111,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning.Db
LjFormulaDetail detail = new LjFormulaDetail();
detail.Id = Convert.ToInt32(item["id"].ToString());
detail.FormulaId = formulaId;
detail.BinNo = Convert.ToUInt16(item["BinNo"]);
detail.BinNo = Convert.ToInt16(item["BinNo"]);
detail.MId = Convert.ToInt32(item["MId"]);
detail.MName = item["MName"].ToString();
detail.Weight = Convert.ToSingle(item["Weight"]);
@ -119,9 +119,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning.Db
detail.Machine = Convert.ToString(item["Machine"]);
detail.MachineType = item["MachineType"].ToString();
detail.FormulaType = Convert.ToInt32(item["FormulaType"]);
detail.ActionCode = Convert.ToUInt16(item["ActionCode"]);
detail.ActionCode = Convert.ToInt16(item["ActionCode"]);
detail.ActionName = item["ActionName"].ToString();
detail.TimeInfo = Convert.ToUInt16(item["TimeInfo"].ToString());
detail.TimeInfo = Convert.ToInt16(item["TimeInfo"].ToString());
detail.Temp = Convert.ToSingle(item["Temp"].ToString());
detail.Speed = Convert.ToSingle(item["Speed"].ToString());
detail.SetValue = Convert.ToSingle(item["SetValue"].ToString());

@ -7,7 +7,7 @@
public int FormulaId { get; set; }
public ushort BinNo { get; set; }
public short BinNo { get; set; }
public int MId { get; set; }
@ -23,11 +23,11 @@
public int FormulaType { get; set; }
public ushort ActionCode { get; set; }
public short ActionCode { get; set; }
public string ActionName { get; set; }
public ushort TimeInfo { get; set; }
public short TimeInfo { get; set; }
public float Temp { get; set; }

@ -157,8 +157,6 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
begin += 10;
}
begin = 1038;
for (int i = 0; i < recipeSteps.Count(); i++)
{
@ -485,7 +483,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
var bytes = data.Skip(i * 10).Take(10).ToArray();
RecipePlcView plcView = new RecipePlcView
{
Bin = byteTransform.TransUInt16(bytes, 0),
Bin = byteTransform.TransInt16(bytes, 0),
Set = byteTransform.TransSingle(bytes, 2),
Tolerance = byteTransform.TransSingle(bytes, 6)
};
@ -502,8 +500,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
var bytes = data.Skip(i * 10).Take(12).ToArray();
Step step = new Step()
{
MixCode = byteTransform.TransUInt16(bytes, 0),
MixTime = byteTransform.TransUInt16(bytes, 2),
MixCode = byteTransform.TransInt16(bytes, 0),
MixTime = byteTransform.TransInt16(bytes, 2),
MixTemp = byteTransform.TransSingle(bytes, 4),
MixSpeed = byteTransform.TransSingle(bytes, 8)
};
@ -533,7 +531,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
var bytes = data.Skip(i * 10).Take(10).ToArray();
RecipePlcView plcView = new RecipePlcView
{
Bin = byteTransform.TransUInt16(bytes, 0),
Bin = byteTransform.TransInt16(bytes, 0),
Set = byteTransform.TransSingle(bytes, 2),
Tolerance = byteTransform.TransSingle(bytes, 6)
};
@ -550,8 +548,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
var bytes = data.Skip(i * 10).Take(12).ToArray();
Step step = new Step()
{
MixCode = byteTransform.TransUInt16(bytes, 0),
MixTime = byteTransform.TransUInt16(bytes, 2),
MixCode = byteTransform.TransInt16(bytes, 0),
MixTime = byteTransform.TransInt16(bytes, 2),
MixTemp = byteTransform.TransSingle(bytes, 4),
MixSpeed = byteTransform.TransSingle(bytes, 8)
};
@ -581,13 +579,15 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
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),
MixCode = byteTransform.TransInt16(bytes, 0),
MixTime = byteTransform.TransInt16(bytes, 2),
MixTemp = byteTransform.TransSingle(bytes, 4),
MixSpeed = byteTransform.TransSingle(bytes, 8),
SetValue = byteTransform.TransSingle(bytes, 12),

Loading…
Cancel
Save