Пример #1
0
        private void ProcessChartQueueItem(ChartEntry entry)
        {
            // if (!LogCharting) return;
            var message = string.Empty;

            switch (entry.ItemCode)
            {
            case ChartItemCode.Start:
            case ChartItemCode.Stop:
            case ChartItemCode.Data:
                message = $"{(int)entry.ItemCode}\t{entry.Data}";
                break;

            case ChartItemCode.RaValue:
            case ChartItemCode.DecValue:
            case ChartItemCode.ThirdValue:
            case ChartItemCode.FourthValue:
                message = $"{(int)entry.ItemCode}\t{entry.X:yyyy:dd:MM:HH:mm:ss.fff}\t{entry.Y}";
                break;
            }
            if (message != string.Empty)
            {
                FileWriteAsync(_chartingFile + _instanceFileName, message);
            }
        }
Пример #2
0
 /// <summary>
 /// adds a monitor item to a blocking queue
 /// </summary>
 /// <param name="entry"></param>
 public void AddEntry(ChartEntry entry)
 {
     _chartBlockingCollection.TryAdd(entry);
 }