using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Settings; namespace Tango.MachineStudio.Common.Helpers { /// /// Contains RealTimeGraphEx helper methods. /// public static class GraphsHelper { /// /// Gets the maximum points graph points by correlating between seconds duration from settings and expected graph points per frame. /// /// Length of graph points per frame. /// public static int GetMaxPoints(double pointsPerFrame) { try { var settings = SettingsManager.Default.GetOrCreate(); double seconds = settings.GraphsViewDurationSeconds; double pullRate = settings.DiagnosticsResponseIntervalMilli; return (int)(((pullRate * pointsPerFrame * 10 * seconds) * (10 / pullRate)) * 0.65); } catch (Exception) { return 300; } } } }