aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/OpenSim.GUI/Main.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tools/OpenSim.GUI/Main.cs')
-rw-r--r--OpenSim/Tools/OpenSim.GUI/Main.cs106
1 files changed, 77 insertions, 29 deletions
diff --git a/OpenSim/Tools/OpenSim.GUI/Main.cs b/OpenSim/Tools/OpenSim.GUI/Main.cs
index b9ea209..fb2cdae 100644
--- a/OpenSim/Tools/OpenSim.GUI/Main.cs
+++ b/OpenSim/Tools/OpenSim.GUI/Main.cs
@@ -29,6 +29,8 @@ namespace OpenSim.GUI
29 txtInputRegionServer.KeyPress += new KeyPressEventHandler(txtInputRegionServer_KeyPress); 29 txtInputRegionServer.KeyPress += new KeyPressEventHandler(txtInputRegionServer_KeyPress);
30 30
31 tabLogs.Selected += new TabControlEventHandler(tabLogs_Selected); 31 tabLogs.Selected += new TabControlEventHandler(tabLogs_Selected);
32
33 UpdateTabVisibility();
32 } 34 }
33 35
34 void tabLogs_Selected(object sender, TabControlEventArgs e) 36 void tabLogs_Selected(object sender, TabControlEventArgs e)
@@ -93,33 +95,42 @@ namespace OpenSim.GUI
93 btnStart.Enabled = false; 95 btnStart.Enabled = false;
94 btnStop.Enabled = false; 96 btnStop.Enabled = false;
95 97
96 // Start UserServer 98
97 proc_UserServer = new ProcessManager("OpenSim.Grid.UserServer.exe", ""); 99
98 txtMainLog.AppendText("Starting: UserServer"); 100 if (rbGridServer.Checked)
99 proc_UserServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived); 101 {
100 proc_UserServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived); 102 // Start UserServer
101 proc_UserServer.StartProcess(); 103 proc_UserServer = new ProcessManager("OpenSim.Grid.UserServer.exe", "");
102 System.Threading.Thread.Sleep(2000); 104 txtMainLog.AppendText("Starting: User server" + "\r\n");
103 105 proc_UserServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived);
104 // Start GridServer 106 proc_UserServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived);
105 proc_GridServer = new ProcessManager("OpenSim.Grid.GridServer.exe", ""); 107 proc_UserServer.StartProcess();
106 txtMainLog.AppendText("Starting: GridServer"); 108 System.Threading.Thread.Sleep(2000);
107 proc_GridServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived); 109
108 proc_GridServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived); 110 // Start GridServer
109 proc_GridServer.StartProcess(); 111 proc_GridServer = new ProcessManager("OpenSim.Grid.GridServer.exe", "");
110 System.Threading.Thread.Sleep(2000); 112 txtMainLog.AppendText("Starting: Grid server" + "\r\n");
111 113 proc_GridServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived);
112 // Start AssetServer 114 proc_GridServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived);
113 proc_AssetServer = new ProcessManager("OpenSim.Grid.AssetServer.exe", ""); 115 proc_GridServer.StartProcess();
114 txtMainLog.AppendText("Starting: AssetServer"); 116 System.Threading.Thread.Sleep(2000);
115 proc_AssetServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived); 117
116 proc_AssetServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived); 118 // Start AssetServer
117 proc_AssetServer.StartProcess(); 119 proc_AssetServer = new ProcessManager("OpenSim.Grid.AssetServer.exe", "");
118 System.Threading.Thread.Sleep(2000); 120 txtMainLog.AppendText("Starting: Asset server" + "\r\n");
121 proc_AssetServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived);
122 proc_AssetServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived);
123 proc_AssetServer.StartProcess();
124 System.Threading.Thread.Sleep(2000);
125 }
119 126
120 // Start OpenSim 127 // Start OpenSim
121 proc_OpenSim = new ProcessManager("OpenSim.EXE", "-gridmode=true"); 128 string p = "";
122 txtMainLog.AppendText("Starting: OpenSim"); 129 if (rbGridServer.Checked)
130 p = "-gridmode=true";
131
132 proc_OpenSim = new ProcessManager("OpenSim.EXE", p);
133 txtMainLog.AppendText("Starting: OpenSim (Region server)" + "\r\n");
123 proc_OpenSim.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived); 134 proc_OpenSim.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived);
124 proc_OpenSim.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived); 135 proc_OpenSim.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived);
125 proc_OpenSim.StartProcess(); 136 proc_OpenSim.StartProcess();
@@ -157,22 +168,22 @@ namespace OpenSim.GUI
157 168
158 if (proc_UserServer != null) 169 if (proc_UserServer != null)
159 { 170 {
160 txtMainLog.AppendText("Shutting down UserServer. CPU time used: " + proc_UserServer.TotalProcessorTime); 171 txtMainLog.AppendText("Shutting down UserServer. CPU time used: " + proc_UserServer.TotalProcessorTime.ToString() + "\r\n");
161 proc_UserServer.StopProcess(); 172 proc_UserServer.StopProcess();
162 } 173 }
163 if (proc_GridServer != null) 174 if (proc_GridServer != null)
164 { 175 {
165 txtMainLog.AppendText("Shutting down GridServer. CPU time used: " + proc_GridServer.TotalProcessorTime); 176 txtMainLog.AppendText("Shutting down GridServer. CPU time used: " + proc_GridServer.TotalProcessorTime.ToString() + "\r\n");
166 proc_GridServer.StopProcess(); 177 proc_GridServer.StopProcess();
167 } 178 }
168 if (proc_AssetServer != null) 179 if (proc_AssetServer != null)
169 { 180 {
170 txtMainLog.AppendText("Shutting down AssetServer. CPU time used: " + proc_AssetServer.TotalProcessorTime); 181 txtMainLog.AppendText("Shutting down AssetServer. CPU time used: " + proc_AssetServer.TotalProcessorTime.ToString() + "\r\n");
171 proc_AssetServer.StopProcess(); 182 proc_AssetServer.StopProcess();
172 } 183 }
173 if (proc_OpenSim != null) 184 if (proc_OpenSim != null)
174 { 185 {
175 txtMainLog.AppendText("Shutting down OpenSim. CPU time used: " + proc_OpenSim.TotalProcessorTime); 186 txtMainLog.AppendText("Shutting down OpenSim. CPU time used: " + proc_OpenSim.TotalProcessorTime.ToString() + "\r\n");
176 proc_OpenSim.StopProcess(); 187 proc_OpenSim.StopProcess();
177 } 188 }
178 189
@@ -182,6 +193,43 @@ namespace OpenSim.GUI
182 193
183 } 194 }
184 195
196 private void UpdateTabVisibility()
197 {
198 if (rbStandAloneMode.Checked)
199 {
200 if (tabLogs.TabPages.Contains(tabUserServer))
201 tabLogs.TabPages.Remove(tabUserServer);
202 if (tabLogs.TabPages.Contains(tabGridServer))
203 tabLogs.TabPages.Remove(tabGridServer);
204 if (tabLogs.TabPages.Contains(tabAssetServer))
205 tabLogs.TabPages.Remove(tabAssetServer);
206 }
207 else
208 {
209 if (!tabLogs.TabPages.Contains(tabUserServer))
210 tabLogs.TabPages.Add(tabUserServer);
211 if (!tabLogs.TabPages.Contains(tabGridServer))
212 tabLogs.TabPages.Add(tabGridServer);
213 if (!tabLogs.TabPages.Contains(tabAssetServer))
214 tabLogs.TabPages.Add(tabAssetServer);
215 }
216
217 }
218
219 private void rbStandAloneMode_CheckedChanged(object sender, EventArgs e)
220 {
221 UpdateTabVisibility();
222 }
223
224 private void rbGridRegionMode_CheckedChanged(object sender, EventArgs e)
225 {
226 UpdateTabVisibility();
227 }
228
229 private void rbGridServer_CheckedChanged(object sender, EventArgs e)
230 {
231 UpdateTabVisibility();
232 }
185 233
186 } 234 }
187} \ No newline at end of file 235} \ No newline at end of file