|
|
@ -134,10 +134,7 @@ namespace ProductionSystem.Forms
|
|
|
|
cureCancellationTokenSource = new CancellationTokenSource();
|
|
|
|
cureCancellationTokenSource = new CancellationTokenSource();
|
|
|
|
cureCancellationToken = cureCancellationTokenSource.Token;
|
|
|
|
cureCancellationToken = cureCancellationTokenSource.Token;
|
|
|
|
Program.cureManualReset = new ManualResetEvent(true);
|
|
|
|
Program.cureManualReset = new ManualResetEvent(true);
|
|
|
|
Task.Run(() =>
|
|
|
|
Task.Run(ShowCure, cureCancellationToken);
|
|
|
|
{
|
|
|
|
|
|
|
|
ShowCure();
|
|
|
|
|
|
|
|
}, cureCancellationToken);
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 页面第一次加载的时候,读取一遍PLC数据
|
|
|
|
#region 页面第一次加载的时候,读取一遍PLC数据
|
|
|
@ -757,22 +754,45 @@ namespace ProductionSystem.Forms
|
|
|
|
if(Convert.ToInt32(Double.Parse(d1300Value).ToString("0")) == 0)
|
|
|
|
if(Convert.ToInt32(Double.Parse(d1300Value).ToString("0")) == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
T_Product_Step step=new T_Product_Step();
|
|
|
|
T_Product_Step step=new T_Product_Step();
|
|
|
|
|
|
|
|
step.StepName = "BZ1_DB";
|
|
|
|
|
|
|
|
step.ProductType = Program.ProductType;
|
|
|
|
|
|
|
|
|
|
|
|
middleIsCanRound = false;
|
|
|
|
middleIsCanRound = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ1_DB, Program.ProductType);
|
|
|
|
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ1_DB, Program.ProductType);
|
|
|
|
//var stf1= model.STF1;
|
|
|
|
|
|
|
|
//SitongTool sitongTool = new SitongTool(stf1.Com,stf1.TargetVal.ToDouble().ToInt());
|
|
|
|
|
|
|
|
//var si1 = sitongTool.ToAction();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//var stf2 = model.STF2;
|
|
|
|
//四通1
|
|
|
|
|
|
|
|
var stf1= model.STF1;
|
|
|
|
|
|
|
|
int val = stf1.TargetVal.ToDouble().ToInt();
|
|
|
|
|
|
|
|
SitongTool sitongTool = new SitongTool(stf1.Com,val);
|
|
|
|
|
|
|
|
var si1 = sitongTool.ToAction();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.Id = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
step.ReturnValue = sitongTool.Val;
|
|
|
|
|
|
|
|
step.WriteValue = val.ToString();
|
|
|
|
|
|
|
|
step.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.EquipmentName = "FKSTF1ZT_DB";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stepService.AddProductStep(step);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//四通2
|
|
|
|
|
|
|
|
var stf2 = model.STF2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sitongTool = new SitongTool(stf2.Com, stf2.TargetVal.ToDouble().ToInt());
|
|
|
|
|
|
|
|
var si2 = sitongTool.ToAction();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.Id = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
step.ReturnValue = sitongTool.Val;
|
|
|
|
|
|
|
|
step.WriteValue = val.ToString();
|
|
|
|
|
|
|
|
step.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.EquipmentName = "FKSTF2ZT_DB";
|
|
|
|
|
|
|
|
stepService.AddProductStep(step);
|
|
|
|
|
|
|
|
|
|
|
|
//sitongTool = new SitongTool(stf2.Com, stf2.TargetVal.ToDouble().ToInt());
|
|
|
|
|
|
|
|
//var si2 = sitongTool.ToAction();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// lin 1 com10
|
|
|
|
//// lin 1 com10
|
|
|
|
////1 调试成功
|
|
|
|
////1 调试成功
|
|
|
@ -780,9 +800,17 @@ namespace ProductionSystem.Forms
|
|
|
|
//电子膨胀阀
|
|
|
|
//电子膨胀阀
|
|
|
|
|
|
|
|
|
|
|
|
var pzf1 = model.PZF1;
|
|
|
|
var pzf1 = model.PZF1;
|
|
|
|
|
|
|
|
val = pzf1.TargetVal.ToDouble().ToInt();
|
|
|
|
|
|
|
|
ExvTool exv = new ExvTool(pzf1.Com,val);
|
|
|
|
|
|
|
|
var exv1 = exv.ToAction();
|
|
|
|
|
|
|
|
|
|
|
|
ExvTool exv = new ExvTool(pzf1.Com, pzf1.TargetVal.ToDouble().ToInt());
|
|
|
|
step.Id = Guid.NewGuid().ToString("N");
|
|
|
|
// var exv1 = exv.ToAction();
|
|
|
|
step.ReturnValue = exv.Val;
|
|
|
|
|
|
|
|
step.WriteValue = val.ToString();
|
|
|
|
|
|
|
|
step.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
step.EquipmentName = "DZPZF1_DB";
|
|
|
|
|
|
|
|
stepService.AddProductStep(step);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//水泵1
|
|
|
|
//水泵1
|
|
|
@ -797,9 +825,9 @@ namespace ProductionSystem.Forms
|
|
|
|
step.ReturnValue = uxTool.Val;
|
|
|
|
step.ReturnValue = uxTool.Val;
|
|
|
|
step.WriteValue = uxTool.Write;
|
|
|
|
step.WriteValue = uxTool.Write;
|
|
|
|
step.CreateTime = DateTime.Now;
|
|
|
|
step.CreateTime = DateTime.Now;
|
|
|
|
step.ProductType = Program.ProductType;
|
|
|
|
|
|
|
|
step.EquipmentName = "SB1";
|
|
|
|
step.EquipmentName = "SB1ZS_DB";
|
|
|
|
step.StepName = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stepService.AddProductStep(step);
|
|
|
|
stepService.AddProductStep(step);
|
|
|
|
|
|
|
|
|
|
|
@ -1001,7 +1029,6 @@ namespace ProductionSystem.Forms
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public string GetPlcValue(string key)
|
|
|
|
public string GetPlcValue(string key)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity= Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == key);
|
|
|
|
var entity= Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == key);
|
|
|
@ -1205,131 +1232,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 一段速
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
//private void GetSpeedUp1PointsVal()
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// responsePoint = Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == "M263");
|
|
|
|
|
|
|
|
// for (int i = 0; i < Program.speedUp1Points.Count; i++)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var speedUp1ReadResult = OmronHelper.GetPlcVal(Program.speedUp1Points[i].DataType, Program.speedUp1Points[i].Address);
|
|
|
|
|
|
|
|
// Program.speedUp1Points[i].Val = speedUp1ReadResult.val;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //var speedUp1Status = Program.speedUp1Points.FirstOrDefault(m => m.Key == "M129").Val;
|
|
|
|
|
|
|
|
// //if (speedUp1Status == "1.000" || speedUp1Status == "2.000")
|
|
|
|
|
|
|
|
// //{
|
|
|
|
|
|
|
|
// // SetMiddleData(Program.speedUp1Points, "SpeedUp1", responsePoint, 3);
|
|
|
|
|
|
|
|
// //}
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 二段升速
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
//private void GetSpeedUp2Points()
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// responsePoint = Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == "M265");
|
|
|
|
|
|
|
|
// for (int i = 0; i < Program.speedUp2Points.Count; i++)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var speedUp2ReadResult = OmronHelper.GetPlcVal(Program.speedUp2Points[i].DataType, Program.speedUp2Points[i].Address);
|
|
|
|
|
|
|
|
// Program.speedUp2Points[i].Val = speedUp2ReadResult.val;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //var speedUp2Status = Program.speedUp2Points.FirstOrDefault(m => m.Key == "M143").Val;
|
|
|
|
|
|
|
|
// //if (speedUp2Status == "1.000" || speedUp2Status == "2.000")
|
|
|
|
|
|
|
|
// //{
|
|
|
|
|
|
|
|
// // SetMiddleData(Program.speedUp2Points, "SpeedUp2", responsePoint, 3);
|
|
|
|
|
|
|
|
// //}
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 二段稳定
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
//private void GetSteady2Points()
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// responsePoint = Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == "M265");
|
|
|
|
|
|
|
|
// for (int i = 0; i < Program.steady2Points.Count; i++)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var steady2ReadResult = OmronHelper.GetPlcVal(Program.steady2Points[i].DataType, Program.steady2Points[i].Address);
|
|
|
|
|
|
|
|
// Program.steady2Points[i].Val = steady2ReadResult.val;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// var steady2Status = Program.steady2Points.FirstOrDefault(m => m.Key == "M182").Val;
|
|
|
|
|
|
|
|
// if (steady2Status == "1.000" || steady2Status == "2.000")
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// SetMiddleData(Program.steady2Points, "Steady2", responsePoint, 4);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 三段升速
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
//private void GetSpeedUp3Points()
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// responsePoint = Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == "M267");
|
|
|
|
|
|
|
|
// for (int i = 0; i < Program.speedUp3Points.Count; i++)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var speedUp3PointsReadResult = OmronHelper.GetPlcVal(Program.speedUp3Points[i].DataType, Program.speedUp3Points[i].Address);
|
|
|
|
|
|
|
|
// Program.speedUp3Points[i].Val = speedUp3PointsReadResult.val;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// var speedUp3Status = Program.speedUp3Points.FirstOrDefault(m => m.Key == "M196").Val;
|
|
|
|
|
|
|
|
// if (speedUp3Status == "1.000" || speedUp3Status == "2.000")
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// SetMiddleData(Program.speedUp3Points, "SpeedUp3", responsePoint, 3);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 三段稳定
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
//private void GetSteady3Points()
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// responsePoint = Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == "M267");
|
|
|
|
|
|
|
|
// for (int i = 0; i < Program.steady3Points.Count; i++)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var steady3PointsReadResult = OmronHelper.GetPlcVal(Program.steady3Points[i].DataType, Program.steady3Points[i].Address);
|
|
|
|
|
|
|
|
// Program.steady3Points[i].Val = steady3PointsReadResult.val;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// var steady3Status = Program.steady3Points.FirstOrDefault(m => m.Key == "M231").Val;
|
|
|
|
|
|
|
|
// if (steady3Status == "1.000" || steady3Status == "2.000")
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// SetMiddleData(Program.steady3Points, "Steady3", responsePoint, 4);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 内漏
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
//private void GetEndoleadPoints()
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// responsePoint = Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == "M269");
|
|
|
|
|
|
|
|
// for (int i = 0; i < Program.endoleadPoints.Count; i++)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var endoleadPointsReadResult = OmronHelper.GetPlcVal(Program.endoleadPoints[i].DataType, Program.endoleadPoints[i].Address);
|
|
|
|
|
|
|
|
// Program.endoleadPoints[i].Val = endoleadPointsReadResult.val;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// var endoleadStatus = Program.endoleadPoints.FirstOrDefault(m => m.Key == "M239").Val;
|
|
|
|
|
|
|
|
// if (endoleadStatus == "1.000" || endoleadStatus == "2.000")
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// SetMiddleData(Program.endoleadPoints, "Endolead", responsePoint, 3);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 单驱
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
//private void GetSingleModelPoints()
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// responsePoint = Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == "M271");
|
|
|
|
|
|
|
|
// for (int i = 0; i < Program.singleModelPoints.Count; i++)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var singleModelPointsReadResult = OmronHelper.GetPlcVal(Program.singleModelPoints[i].DataType, Program.singleModelPoints[i].Address);
|
|
|
|
|
|
|
|
// Program.singleModelPoints[i].Val = singleModelPointsReadResult.val;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// var singleModelStatus = Program.singleModelPoints.FirstOrDefault(m => m.Key == "M247").Val;
|
|
|
|
|
|
|
|
// if (singleModelStatus == "1.000" || singleModelStatus == "2.000")
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// SetMiddleData(Program.singleModelPoints, "SingleModel", responsePoint, 3);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|