Пример #1
0
        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);
        }
Пример #2
0
 /// <summary>
 /// ログ追加
 /// </summary>
 /// <param name="rowData"></param>
 public void AddLog(LogRowData rowData)
 {
     if (rowData != null)
     {
         _origDataList?.Add(rowData);
         AddLogRowDataOnViewItems(new List <LogRowData> {
             rowData
         });
     }
 }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
 public LogRowKey(long uniqueId, LogRowData data)
 {
     UniqueId = uniqueId;
     Data     = data;
 }
Пример #6
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="logRowData"></param>
 public ListViewConverter(LogRowData logRowData)
 {
     _logRowData = logRowData;
 }
Пример #7
0
 public static bool HasExpression(this LogRowData source)
 {
     return(source.User.Contains("["));
 }
Пример #8
0
 /// <summary>
 /// とりあえず疑似的にrecvログのみ表示するようにしている
 /// </summary>
 /// <param name="rowData"></param>
 /// <returns></returns>
 private bool FilterNoEventLog(LogRowData rowData)
 {
     return(rowData.LogType == ListViewLogType.recv);
 }