summaryrefslogtreecommitdiff
path: root/grapher/Program.cs
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-22 15:26:08 -0700
committerJacob Palecki <[email protected]>2020-09-22 15:26:08 -0700
commitf4ff6334df8a3fd66d13082606b69a78fa592237 (patch)
tree6db3b486a4c19ed02d5c4368fd18d29b2abec78d /grapher/Program.cs
parentSave option to show velocity and gain on gui startup (diff)
downloadrawaccel-f4ff6334df8a3fd66d13082606b69a78fa592237.tar.xz
rawaccel-f4ff6334df8a3fd66d13082606b69a78fa592237.zip
Remove sigmoidgain, only allow one instance of grapher to run at a time
Diffstat (limited to 'grapher/Program.cs')
-rw-r--r--grapher/Program.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/grapher/Program.cs b/grapher/Program.cs
index 85fd040..485e074 100644
--- a/grapher/Program.cs
+++ b/grapher/Program.cs
@@ -11,9 +11,19 @@ namespace grapher
[STAThread]
static void Main()
{
+ var mutex = new System.Threading.Mutex(true, "RawAccelGrapher", out bool result);
+
+ if (!result)
+ {
+ MessageBox.Show("Another instance of the Raw Accel Grapher is already running.");
+ return;
+ }
+
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new RawAcceleration());
+
+ GC.KeepAlive(mutex);
}
}
}