private ListViewItem CreateItemFromIndex(LogRowData data) { ListViewItem item = new ListViewItem(data.TimeStamp.ToString("yyyy-MM-dd HH:mm:ss.fff")); item.SubItems.Add(data.ItemID); item.SubItems.Add(data.Value); item.SubItems.Add(data.CycleIndex.ToString()); item.SubItems.Add(data.User); item.Tag = data; if (data.OaTimeStamp == m_StartTime) { item.BackColor = Color.Chartreuse; for (int i = 0; i < item.SubItems.Count; i++) { item.SubItems[i].BackColor = Color.Chartreuse; } } else if (m_ColorMap.TryGetValue(data.ItemID, out var color)) { item.BackColor = color; for (int i = 0; i < item.SubItems.Count; i++) { item.SubItems[i].BackColor = color; } } return(item); }
/// <summary> /// ログ追加 /// </summary> /// <param name="rowData"></param> public void AddLog(LogRowData rowData) { if (rowData != null) { _origDataList?.Add(rowData); AddLogRowDataOnViewItems(new List <LogRowData> { rowData }); } }
public static LogRowKey FindClosestRowKey(this IItemDatabase db, long sourceUniqueId, long sourceCycleIndex, string itemId, long[] uniqueIds) { for (int i = uniqueIds.Length - 1; i >= 0; i--) { if (uniqueIds[i] >= sourceUniqueId) { continue; } LogRowData row = db.GetItemRow(itemId, uniqueIds[i]); if (row.CycleIndex == sourceCycleIndex && row.HasExpression()) { continue; } return(new LogRowKey(uniqueIds[i], db.GetItemRow(itemId, uniqueIds[i]))); } return(null); }
public string ApproximatedTimeData() { try { string estBuildDone = "Process.TimeApproximation.BuildDoneTime"; string buildDone = "Alarms.BuildDone"; //string estimatedTotalTime = "Process.TimeApproximation.EstimatedBuildDoneTime"; string heatStartPlateDone = "Process.ProcessManager.HeatStartPlateDone"; //var allBuildDone = new FullnameEnumerator(currents, m_Database).ToArray(); //var allFeedback = new FullnameEnumerator(feedback, m_Database).ToArray(); LogRowData buildDoneItem = m_Database.GetLastItem(buildDone, p => p.Value == "Set"); string output = string.Empty; if (buildDoneItem != null) { DateTime buildDoneTime = buildDoneItem.TimeStamp; LogRowData buildStartMeltTime = m_Database.GetLastItem(heatStartPlateDone); IEnumerable <LogRowData> allEstBuildDoneItems = m_Database.GetAll(estBuildDone).Where(p => p.TimeStamp >= buildStartMeltTime.TimeStamp && p.TimeStamp < buildDoneTime - TimeSpan.FromMinutes(15)); output = $"Build done: \t\t{buildDoneTime}\r\n\r\n"; foreach (LogRowData estBuildDoneItem in allEstBuildDoneItems) { DateTime estDoneTime = DateTime.Parse(estBuildDoneItem.Value); TimeSpan totalTimeDiff = estDoneTime - buildDoneTime; TimeSpan timeForEstimation = buildDoneTime - estBuildDoneItem.TimeStamp; double diff = Math.Abs(totalTimeDiff.TotalSeconds / timeForEstimation.TotalSeconds); output += $"{estBuildDoneItem.TimeStamp}:\t{estDoneTime} \t{totalTimeDiff:d\\.hh\\:mm} \t{100 * diff:0.0}%\r\n"; } } return(output); } catch (Exception) { } return(string.Empty); }
public LogRowKey(long uniqueId, LogRowData data) { UniqueId = uniqueId; Data = data; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="logRowData"></param> public ListViewConverter(LogRowData logRowData) { _logRowData = logRowData; }
public static bool HasExpression(this LogRowData source) { return(source.User.Contains("[")); }
/// <summary> /// とりあえず疑似的にrecvログのみ表示するようにしている /// </summary> /// <param name="rowData"></param> /// <returns></returns> private bool FilterNoEventLog(LogRowData rowData) { return(rowData.LogType == ListViewLogType.recv); }