aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/OpenSim.GUI/ProcessManager.cs
diff options
context:
space:
mode:
authorTedd Hansen2007-09-12 13:03:21 +0000
committerTedd Hansen2007-09-12 13:03:21 +0000
commitdcaab9103ce1b7475872ee3224ccf58c1266f95e (patch)
tree729cc307787d2ab58d40f95998bb7a2ccc66ed2c /OpenSim/Tools/OpenSim.GUI/ProcessManager.cs
parentI think 1.0f makes a better offset than 1.2f for basic physics (less floating, (diff)
downloadopensim-SC_OLD-dcaab9103ce1b7475872ee3224ccf58c1266f95e.zip
opensim-SC_OLD-dcaab9103ce1b7475872ee3224ccf58c1266f95e.tar.gz
opensim-SC_OLD-dcaab9103ce1b7475872ee3224ccf58c1266f95e.tar.bz2
opensim-SC_OLD-dcaab9103ce1b7475872ee3224ccf58c1266f95e.tar.xz
Early alpha version of a GUI tool to configure and start OpenSim. Currently can start an already configured Grid server.
Diffstat (limited to 'OpenSim/Tools/OpenSim.GUI/ProcessManager.cs')
-rw-r--r--OpenSim/Tools/OpenSim.GUI/ProcessManager.cs71
1 files changed, 71 insertions, 0 deletions
diff --git a/OpenSim/Tools/OpenSim.GUI/ProcessManager.cs b/OpenSim/Tools/OpenSim.GUI/ProcessManager.cs
new file mode 100644
index 0000000..0ab074e
--- /dev/null
+++ b/OpenSim/Tools/OpenSim.GUI/ProcessManager.cs
@@ -0,0 +1,71 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Diagnostics;
5
6namespace OpenSim.GUI
7{
8 public class ProcessManager : Process
9 {
10 private string m_FileName;
11 private string m_Arguments;
12 public ProcessManager(string FileName,string Arguments)
13 {
14 m_FileName = FileName;
15 m_Arguments = Arguments;
16
17// MyProc = new Process();
18 StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory;
19 Console.WriteLine("WorkingDirectory: " + StartInfo.WorkingDirectory);
20 StartInfo.FileName = m_FileName;
21
22 //p.StartInfo.Arguments = "";
23 StartInfo.UseShellExecute = false;
24 StartInfo.RedirectStandardError = true;
25 StartInfo.RedirectStandardInput = true;
26 StartInfo.RedirectStandardOutput = true;
27 StartInfo.CreateNoWindow = true;
28
29
30
31 }
32
33 public void StartProcess()
34 {
35 try
36 {
37 Start();
38 BeginOutputReadLine();
39 BeginErrorReadLine();
40 }
41 catch (Exception ex)
42 {
43 Console.WriteLine("Exception Occurred :{0},{1}",
44 ex.Message, ex.StackTrace.ToString());
45 }
46 }
47 public void StopProcess()
48 {
49 try
50 {
51 CancelErrorRead();
52 CancelErrorRead();
53 if (!HasExited)
54 {
55 StandardInput.WriteLine("quit");
56 StandardInput.WriteLine("shutdown");
57 System.Threading.Thread.Sleep(500);
58 if (!HasExited)
59 {
60 Kill();
61 }
62 }
63 }
64 catch (Exception ex)
65 {
66 Console.WriteLine("Exception Occurred :{0},{1}",
67 ex.Message, ex.StackTrace.ToString());
68 }
69 }
70 }
71}