dep
我叫锄头 11 months ago
parent b1c553ddd7
commit c4b9956e26

@ -65,7 +65,10 @@ namespace ProductionSystem.Forms
{
#region 各工序的采集点位
Program.electricTestPoints = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "ElectricTest").ToList();
Program.electricTestPoints = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "BZ1").ToList();
Program.idlingPoints = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "Idling").ToList();
Program.speedUp1Points = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "SpeedUp1").ToList();
Program.speedUp2Points = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "SpeedUp2").ToList();
@ -101,22 +104,22 @@ namespace ProductionSystem.Forms
#endregion
#region 页面第一次加载的时候读取一遍PLC数据
//空载
GetIdlingPointsVal();
//一段速
GetSpeedUp1PointsVal();
//二段升速
GetSpeedUp2Points();
//二段速稳定
GetSteady2Points();
//三段升速
GetSpeedUp3Points();
//三段速稳定
GetSteady3Points();
//内漏
GetEndoleadPoints();
//单驱
GetSingleModelPoints();
////空载
//GetIdlingPointsVal();
////一段速
//GetSpeedUp1PointsVal();
////二段升速
//GetSpeedUp2Points();
////二段速稳定
//GetSteady2Points();
////三段升速
//GetSpeedUp3Points();
////三段速稳定
//GetSteady3Points();
////内漏
//GetEndoleadPoints();
////单驱
//GetSingleModelPoints();
#endregion
//PLC心跳监测
@ -492,8 +495,8 @@ namespace ProductionSystem.Forms
continue;
}
//条码值
var readM248 = OmronHelper.GetPlcVal(M248.DataType, M248.Address);
UpdateControlContent(txtProductCode, readM248.val);
//var readM248 = OmronHelper.GetPlcVal(M248.DataType, M248.Address);
//UpdateControlContent(txtProductCode, readM248.val);
#region 顶部采集项目赋值
if (Program.TopPointKeyValues.Count > 0)
@ -642,20 +645,23 @@ namespace ProductionSystem.Forms
var M249 = Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == "M249");
M249.Val = OmronHelper.GetPlcVal(M249.DataType, M249.Address).val;
#region 电检一直采集
#region 模拟一个值
for (int i = 0; i < Program.electricTestPoints.Count; i++)
{
var electricReadResult = OmronHelper.GetPlcVal(Program.electricTestPoints[i].DataType, Program.electricTestPoints[i].Address);
Program.electricTestPoints[i].Val = electricReadResult.val;
}
var electricPoint = Program.electricTestPoints.FirstOrDefault(m => m.Key == "M44");
var electricStatus = OmronHelper.GetPlcVal(electricPoint.DataType, electricPoint.Address).val;
if (electricStatus == "1.000" || electricStatus == "2.000")
{
SetMiddleData(Program.electricTestPoints, "ElectricTest");
}
SetMiddleData(Program.electricTestPoints, "BZ1");
//var electricPoint = Program.electricTestPoints.FirstOrDefault(m => m.Key == "M44");
//var electricStatus = OmronHelper.GetPlcVal(electricPoint.DataType, electricPoint.Address).val;
//if (electricStatus == "1.000" || electricStatus == "2.000")
//{
// SetMiddleData(Program.electricTestPoints, "ElectricTest");
//}
#endregion
M249.Val = "23234234234234";
switch (M249.Val)
{
//空载
@ -924,6 +930,9 @@ namespace ProductionSystem.Forms
//}
}
/// <summary>
/// 一段速
/// </summary>

@ -37,7 +37,7 @@ namespace ProductionSystem.Untils
while (true)
{
Thread.Sleep(Program.ReadPlcRate);
DataChange();
// DataChange();
}
});
}

@ -5,6 +5,8 @@ using DevExpress.XtraEditors.Repository;
using ProductionSystem_Model.Enum;
using ProductionSystem_Service;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
@ -362,7 +364,26 @@ namespace ProductionSystem.Untils.System
var defaultSelected = list.FirstOrDefault(m => m.IsUsed);
if (defaultSelected != null)
{
cmbEdit.SelectedItem = new ListItem { Value = defaultSelected.ProductTypeCode, Text = defaultSelected.ProductTypeName };
try
{
// cmbEdit.SelectedIndex = 0;
//cmbEdit.Invoke((MethodInvoker)delegate {
// cmbEdit.SelectedItem = new ListItem { Value = defaultSelected.ProductTypeCode, Text = defaultSelected.ProductTypeName };
// // 进行操作
//});
//
}
catch (Exception ex)
{
}
}
else
{

@ -40,10 +40,10 @@ namespace ProductionSystem_Service
{
//(A)全局生效配置点
//调试SQL事件可以删掉
//db.Aop.OnLogExecuting = (sql, pars) =>
//{
// Console.WriteLine(sql);//输出sql,查看执行sql
//};
db.Aop.OnLogExecuting = (sql, pars) =>
{
Console.WriteLine(sql);//输出sql,查看执行sql
};
db.Aop.OnError = (exp) =>
{
LogHelper.Error(exp, exp.Sql);

Loading…
Cancel
Save