aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-01-24 18:30:53 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-01-24 18:30:53 +0200
commit11e64f69d00d84974bb09bef6f921c7eeab7c47e (patch)
tree4981a4e079bb4d4c669901ffad6387fcfc9ed1ff /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers
parente82bd25172095f1a521a95179b35cb01db7e8a62 (diff)
downloadTango-11e64f69d00d84974bb09bef6f921c7eeab7c47e.tar.gz
Tango-11e64f69d00d84974bb09bef6f921c7eeab7c47e.zip
Added Graphs Drag & Drop to Developer Module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs
new file mode 100644
index 000000000..53e832eb5
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Settings;
+
+namespace Tango.MachineStudio.Common.Helpers
+{
+ /// <summary>
+ /// Contains RealTimeGraphEx helper methods.
+ /// </summary>
+ public static class GraphsHelper
+ {
+ /// <summary>
+ /// Gets the maximum points graph points by correlating between seconds duration from settings and expected graph points per frame.
+ /// </summary>
+ /// <param name="pointsPerFrame">Length of graph points per frame.</param>
+ /// <returns></returns>
+ public static int GetMaxPoints(double pointsPerFrame)
+ {
+ try
+ {
+ double seconds = SettingsManager.Default.MachineStudio.TechnicianModule.GraphsDuration;
+ double pullRate = SettingsManager.Default.MachineStudio.TechnicianModule.GraphsPullingInterval;
+ return (int)(((pullRate * pointsPerFrame * 10 * seconds) * (10 / pullRate)) * 0.65);
+ }
+ catch (Exception)
+ {
+ return 300;
+ }
+ }
+ }
+}