|
|
|
@ -910,6 +910,12 @@ namespace ProductionSystem.Forms
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private string GetCode()
|
|
|
|
|
{
|
|
|
|
|
var readM248 = OmronHelper.GetPlcVal(M248.DataType, M248.Address);
|
|
|
|
|
string plcTiaoMa = readM248.val.ToString().Replace("\r", "").Replace("\n", "");
|
|
|
|
|
return plcTiaoMa;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void Step1()
|
|
|
|
@ -921,17 +927,20 @@ namespace ProductionSystem.Forms
|
|
|
|
|
ProductType = Program.ProductType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.ProductBarcode = GetCode();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ1_DB, Program.ProductType);
|
|
|
|
|
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ1_DB, Program.ProductType);
|
|
|
|
|
|
|
|
|
|
//四通1
|
|
|
|
|
var stf1= model.STF1;
|
|
|
|
|
int val = stf1.TargetVal.ToDouble().ToInt();
|
|
|
|
|
SitongTool sitongTool = new SitongTool(stf1.Com,val);
|
|
|
|
|
var si1 = sitongTool.ToAction();
|
|
|
|
|
sitongTool.Dispose();
|
|
|
|
|
|
|
|
|
|
step.Id = Guid.NewGuid().ToString("N");
|
|
|
|
|
step.ReturnValue = sitongTool.Val;
|
|
|
|
@ -946,6 +955,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
var stf2 = model.STF2;
|
|
|
|
|
sitongTool = new SitongTool(stf2.Com, stf2.TargetVal.ToDouble().ToInt());
|
|
|
|
|
var si2 = sitongTool.ToAction();
|
|
|
|
|
sitongTool.Dispose();
|
|
|
|
|
|
|
|
|
|
step.Id = Guid.NewGuid().ToString("N");
|
|
|
|
|
step.ReturnValue = sitongTool.Val;
|
|
|
|
@ -1010,7 +1020,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.ProductBarcode = GetCode();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ1_DB, Program.ProductType);
|
|
|
|
@ -1116,11 +1126,11 @@ namespace ProductionSystem.Forms
|
|
|
|
|
ProductType = Program.ProductType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.ProductBarcode = GetCode();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ2_DB, Program.ProductType);
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ2_DB, Program.ProductType);
|
|
|
|
|
|
|
|
|
|
//四通1
|
|
|
|
|
var stf1= model.STF1;
|
|
|
|
@ -1259,11 +1269,11 @@ namespace ProductionSystem.Forms
|
|
|
|
|
ProductType = Program.ProductType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.ProductBarcode = GetCode();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ3_DB, Program.ProductType);
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ3_DB, Program.ProductType);
|
|
|
|
|
|
|
|
|
|
//四通1
|
|
|
|
|
var stf1= model.STF1;
|
|
|
|
@ -1348,11 +1358,11 @@ namespace ProductionSystem.Forms
|
|
|
|
|
ProductType = Program.ProductType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.ProductBarcode = GetCode();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ4_DB, Program.ProductType);
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ4_DB, Program.ProductType);
|
|
|
|
|
|
|
|
|
|
//四通1
|
|
|
|
|
var stf1= model.STF1;
|
|
|
|
@ -1419,11 +1429,11 @@ namespace ProductionSystem.Forms
|
|
|
|
|
ProductType = Program.ProductType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.ProductBarcode = GetCode();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ5_DB, Program.ProductType);
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ5_DB, Program.ProductType);
|
|
|
|
|
|
|
|
|
|
//四通1
|
|
|
|
|
var stf1= model.STF1;
|
|
|
|
@ -1473,7 +1483,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
StepName = "BZ6_DB",
|
|
|
|
|
ProductType = Program.ProductType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
step.ProductBarcode = GetCode();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1524,7 +1534,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.ProductBarcode = GetCode();
|
|
|
|
|
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ5_DB, Program.ProductType);
|
|
|
|
|
|
|
|
|
@ -2206,7 +2216,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
|
|
|
|
|
//获取点位
|
|
|
|
|
var paraCode = middleMyTestResultControls[j].ParaCode;
|
|
|
|
|
var step = productStepService.QueryLatestStep(paraCategory, paraCode, Program.ProductType);
|
|
|
|
|
var step = productStepService.QueryLatestStep(paraCategory, paraCode, Program.ProductType,GetCode());
|
|
|
|
|
if (string.IsNullOrEmpty(testResultPoint) || string.IsNullOrEmpty(testValPoint))
|
|
|
|
|
{
|
|
|
|
|
//进行sql 进行查询sql
|
|
|
|
@ -2283,12 +2293,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
{
|
|
|
|
|
if (middleMyTestResultControls[j].IsHandleCreated && !middleMyTestResultControls[j].IsDisposed)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.Invoke(new Action(() =>
|
|
|
|
|
{
|
|
|
|
|
SetColor(middleMyTestResultControls[j], -1, "0.000");
|
|
|
|
@ -2458,8 +2463,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
{
|
|
|
|
|
Program.cureManualReset.WaitOne();
|
|
|
|
|
if (GetPlcValue("D670") != "")
|
|
|
|
|
{
|
|
|
|
|
var productBarcode = txtProductCode.Text;
|
|
|
|
|
{
|
|
|
|
|
//模拟数据
|
|
|
|
|
for (int i = 0; i < Program.Times.Length; i++)
|
|
|
|
|
{
|
|
|
|
@ -2468,7 +2472,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
//Program.GastankPressData[i] = Convert.ToSingle(random.NextDouble() * 60 + 600);
|
|
|
|
|
//Program.XVibrateData[i] = Convert.ToSingle(random.NextDouble() * 60 + 800);
|
|
|
|
|
//Program.YVibrateData[i] = Convert.ToSingle(random.NextDouble() * 60 + 1000);
|
|
|
|
|
var product = result2Service.QueryLatestStep(Program.ProductType, productBarcode);
|
|
|
|
|
var product = result2Service.QueryLatestStep(Program.ProductType, GetCode());
|
|
|
|
|
var electricity = product.Electricity;
|
|
|
|
|
Program.CurrentData[i] = float.Parse(electricity);
|
|
|
|
|
Program.Times[i] = DateTime.Now.AddSeconds(i - 1000);
|
|
|
|
|