change -修改曲线显示逻辑

dep_yangw
frankiecao 11 months ago
commit 6d099aeb39

@ -1567,8 +1567,11 @@ namespace ProductionSystem.Forms
while (!cancellationTokenSource.IsCancellationRequested) 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", ""); 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++) for (int i = 1; i < 9; i++)
{ {
@ -2454,7 +2457,8 @@ namespace ProductionSystem.Forms
if (Program.timerEnable) if (Program.timerEnable)
{ {
Program.cureManualReset.WaitOne(); Program.cureManualReset.WaitOne();
if (GetPlcValue("D670") != "")
{
//模拟数据 //模拟数据
for (int i = 0; i < Program.Times.Length; i++) 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.GastankPressData[i] = Convert.ToSingle(random.NextDouble() * 60 + 600);
//Program.XVibrateData[i] = Convert.ToSingle(random.NextDouble() * 60 + 800); //Program.XVibrateData[i] = Convert.ToSingle(random.NextDouble() * 60 + 800);
//Program.YVibrateData[i] = Convert.ToSingle(random.NextDouble() * 60 + 1000); //Program.YVibrateData[i] = Convert.ToSingle(random.NextDouble() * 60 + 1000);
if (GetPlcValue("D670") != "")
{
var product = result2Service.QueryLatestStep(Program.ProductType, txtProductCode.Text); var product = result2Service.QueryLatestStep(Program.ProductType, txtProductCode.Text);
var electricity = product.Electricity; var electricity = product.Electricity;
Program.CurrentData[i] = float.Parse(electricity); Program.CurrentData[i] = float.Parse(electricity);
Program.Times[i] = DateTime.Now.AddSeconds(i - 1000); Program.Times[i] = DateTime.Now.AddSeconds(i - 1000);
}
} }
//if (Program.VoltageData.Length > 0) //if (Program.VoltageData.Length > 0)
//{ //{
@ -2489,6 +2491,7 @@ namespace ProductionSystem.Forms
} }
} }
} }
}
#region 曲线复选框Change事件 #region 曲线复选框Change事件
private void CheckStateChanged(object sender, EventArgs e) private void CheckStateChanged(object sender, EventArgs e)

Loading…
Cancel
Save