|
|
@@ -311,6 +311,7 @@ namespace MECF.Framework.UI.Client.CenterViews.DataLogs.ProcessHistory
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ private IEnumerable<StepInfo> stepDescending;
|
|
|
#endregion
|
|
|
private RealtimeProvider _realtimeProvider;
|
|
|
#region Function
|
|
|
@@ -440,17 +441,16 @@ namespace MECF.Framework.UI.Client.CenterViews.DataLogs.ProcessHistory
|
|
|
{
|
|
|
EndTime = StartTime.AddSeconds(stepTime);
|
|
|
}
|
|
|
- else
|
|
|
+ if (_stepInfo.Any())//临时处理表中recipe_step_data step_end_time数据不能真实反映步次结束时间的问题
|
|
|
{
|
|
|
- if (_stepInfo.Any())//临时处理表中recipe_step_data step_end_time数据不能真实反映步次结束时间的问题
|
|
|
- {
|
|
|
- int lastIndex = _stepInfo.Count - 1;
|
|
|
- if (_stepInfo[lastIndex].EndTime > StartTime) _stepInfo[lastIndex].EndTime = StartTime;
|
|
|
- }
|
|
|
- _stepInfo.Add(new StepInfo() { StartTime = StartTime, EndTime = EndTime, StepName = stepName, StepTime = stepTime, StepNo = stepNo });
|
|
|
+ int lastIndex = _stepInfo.Count - 1;
|
|
|
+ if (_stepInfo[lastIndex].EndTime > StartTime) _stepInfo[lastIndex].EndTime = StartTime;
|
|
|
}
|
|
|
- }
|
|
|
+ _stepInfo.Add(new StepInfo() { StartTime = StartTime, EndTime = EndTime, StepName = stepName, StepTime = stepTime, StepNo = stepNo });
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
+ stepDescending = _stepInfo.OrderByDescending(r => r.StartTime);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1129,7 +1129,7 @@ namespace MECF.Framework.UI.Client.CenterViews.DataLogs.ProcessHistory
|
|
|
//float.TryParse(item.Key.ToString(), out timeIndex);
|
|
|
//DateTime dateTimeKey = startTime.AddMilliseconds(timeIndex * 1000); ;// DateTime.Parse(item.Key.ToString());
|
|
|
DateTime dateTimeKey = new DateTime(pmRow != null ? (long)pmRow[0] : (long)systemRow[0]);
|
|
|
- var tempStepInfo = _stepInfo.FirstOrDefault(x => x.StartTime < dateTimeKey && x.EndTime > dateTimeKey);
|
|
|
+ var tempStepInfo = stepDescending.FirstOrDefault(x => x.StartTime <= dateTimeKey);
|
|
|
if (tempStepInfo != null)// && dateTimeKey > _stepInfo[iIndex].StartTime
|
|
|
{
|
|
|
stepID = tempStepInfo.StepNo;
|
|
|
@@ -1404,7 +1404,7 @@ namespace MECF.Framework.UI.Client.CenterViews.DataLogs.ProcessHistory
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
- #endregion
|
|
|
+ #endregion
|
|
|
public void GetCursorPoint(IEnumerable<SeriesInfo> infos)
|
|
|
{
|
|
|
if (infos.Any())
|
|
|
@@ -1415,7 +1415,7 @@ namespace MECF.Framework.UI.Client.CenterViews.DataLogs.ProcessHistory
|
|
|
_lastPointX = xvalue;
|
|
|
PointTime = StepStartTime.AddSeconds(xvalue);
|
|
|
if (PointTime == DateTime.MinValue) return;
|
|
|
- var step = _stepInfo.Find(r => r.StartTime <= PointTime && r.EndTime >= PointTime);
|
|
|
+ var step = stepDescending.FirstOrDefault(r => r.StartTime <= PointTime);
|
|
|
if (step == null)
|
|
|
{
|
|
|
LOG.Info($"couldn't find CurrentTime:{PointTime:yyyy/MM/dd HH:mm:ss.FFF} in steps ,display last step:{StepNameDisPlay}");
|