|
|
|
@ -1567,8 +1567,11 @@ namespace ProductionSystem.Forms
|
|
|
|
|
while (!cancellationTokenSource.IsCancellationRequested)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var readM248 = OmronHelper.GetPlcVal(M248.DataType, M248.Address);
|
|
|
|
|
string plcTiaoMa=readM248.val.ToString().Replace("\r", "").Replace("\n", "");
|
|
|
|
|
string tiaoma = txtProductCode.Text.Replace("\r", "").Replace("\n", "");
|
|
|
|
|
if (tiaoma.Contains("暂无条码") || tiaoma == "" || tiaoma.Contains("暂"))
|
|
|
|
|
//彻底解决页面闪烁的问题
|
|
|
|
|
if (string.IsNullOrEmpty(plcTiaoMa) || tiaoma.Contains("暂无条码") || tiaoma == "" || tiaoma.Contains("暂"))
|
|
|
|
|
{
|
|
|
|
|
for (int i = 1; i < 9; i++)
|
|
|
|
|
{
|
|
|
|
@ -2454,7 +2457,8 @@ namespace ProductionSystem.Forms
|
|
|
|
|
if (Program.timerEnable)
|
|
|
|
|
{
|
|
|
|
|
Program.cureManualReset.WaitOne();
|
|
|
|
|
|
|
|
|
|
if (GetPlcValue("D670") != "")
|
|
|
|
|
{
|
|
|
|
|
//模拟数据
|
|
|
|
|
for (int i = 0; i < Program.Times.Length; i++)
|
|
|
|
|
{
|
|
|
|
@ -2463,13 +2467,11 @@ 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);
|
|
|
|
|
if (GetPlcValue("D670") != "")
|
|
|
|
|
{
|
|
|
|
|
var product = result2Service.QueryLatestStep(Program.ProductType, txtProductCode.Text);
|
|
|
|
|
var electricity = product.Electricity;
|
|
|
|
|
Program.CurrentData[i] = float.Parse(electricity);
|
|
|
|
|
Program.Times[i] = DateTime.Now.AddSeconds(i - 1000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//if (Program.VoltageData.Length > 0)
|
|
|
|
|
//{
|
|
|
|
@ -2489,6 +2491,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 曲线复选框Change事件
|
|
|
|
|
private void CheckStateChanged(object sender, EventArgs e)
|
|
|
|
|