aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/OpenSim.GUI/Main.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Tools/OpenSim.GUI/Main.cs482
1 files changed, 241 insertions, 241 deletions
diff --git a/OpenSim/Tools/OpenSim.GUI/Main.cs b/OpenSim/Tools/OpenSim.GUI/Main.cs
index 0b5af28..5de4af4 100644
--- a/OpenSim/Tools/OpenSim.GUI/Main.cs
+++ b/OpenSim/Tools/OpenSim.GUI/Main.cs
@@ -1,242 +1,242 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.ComponentModel; 3using System.ComponentModel;
4using System.Data; 4using System.Data;
5using System.Drawing; 5using System.Drawing;
6using System.Text; 6using System.Text;
7using System.Windows.Forms; 7using System.Windows.Forms;
8 8
9namespace OpenSim.GUI 9namespace OpenSim.GUI
10{ 10{
11 public partial class Main : Form 11 public partial class Main : Form
12 { 12 {
13 13
14 public ProcessManager proc_OpenSim; 14 public ProcessManager proc_OpenSim;
15 public ProcessManager proc_UserServer; 15 public ProcessManager proc_UserServer;
16 public ProcessManager proc_GridServer; 16 public ProcessManager proc_GridServer;
17 public ProcessManager proc_AssetServer; 17 public ProcessManager proc_AssetServer;
18 18
19 public Main() 19 public Main()
20 { 20 {
21 InitializeComponent(); 21 InitializeComponent();
22 } 22 }
23 23
24 private void Main_Load(object sender, EventArgs e) 24 private void Main_Load(object sender, EventArgs e)
25 { 25 {
26 txtInputUserServer.KeyPress += new KeyPressEventHandler(txtInputUserServer_KeyPress); 26 txtInputUserServer.KeyPress += new KeyPressEventHandler(txtInputUserServer_KeyPress);
27 txtInputGridServer.KeyPress += new KeyPressEventHandler(txtInputGridServer_KeyPress); 27 txtInputGridServer.KeyPress += new KeyPressEventHandler(txtInputGridServer_KeyPress);
28 txtInputAssetServer.KeyPress += new KeyPressEventHandler(txtInputAssetServer_KeyPress); 28 txtInputAssetServer.KeyPress += new KeyPressEventHandler(txtInputAssetServer_KeyPress);
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 32
33 UpdateTabVisibility(); 33 UpdateTabVisibility();
34 } 34 }
35 35
36 void tabLogs_Selected(object sender, TabControlEventArgs e) 36 void tabLogs_Selected(object sender, TabControlEventArgs e)
37 { 37 {
38 if (e.TabPage == tabUserServer) 38 if (e.TabPage == tabUserServer)
39 txtInputUserServer.Focus(); 39 txtInputUserServer.Focus();
40 if (e.TabPage == tabGridServer) 40 if (e.TabPage == tabGridServer)
41 txtInputGridServer.Focus(); 41 txtInputGridServer.Focus();
42 if (e.TabPage == tabAssetServer) 42 if (e.TabPage == tabAssetServer)
43 txtInputAssetServer.Focus(); 43 txtInputAssetServer.Focus();
44 if (e.TabPage == tabRegionServer) 44 if (e.TabPage == tabRegionServer)
45 txtInputRegionServer.Focus(); 45 txtInputRegionServer.Focus();
46 } 46 }
47 47
48 void txtInputUserServer_KeyPress(object sender, KeyPressEventArgs e) 48 void txtInputUserServer_KeyPress(object sender, KeyPressEventArgs e)
49 { 49 {
50 50
51 if (e.KeyChar == 13) 51 if (e.KeyChar == 13)
52 { 52 {
53 // We got a command 53 // We got a command
54 e.Handled = true; 54 e.Handled = true;
55 proc_UserServer.StandardInput.WriteLine(txtInputUserServer.Text + "\r\n"); 55 proc_UserServer.StandardInput.WriteLine(txtInputUserServer.Text + "\r\n");
56 txtInputUserServer.Text = ""; 56 txtInputUserServer.Text = "";
57 } 57 }
58 } 58 }
59 59
60 void txtInputGridServer_KeyPress(object sender, KeyPressEventArgs e) 60 void txtInputGridServer_KeyPress(object sender, KeyPressEventArgs e)
61 { 61 {
62 if (e.KeyChar == 13) 62 if (e.KeyChar == 13)
63 { 63 {
64 // We got a command 64 // We got a command
65 e.Handled = true; 65 e.Handled = true;
66 proc_GridServer.StandardInput.WriteLine(txtInputGridServer.Text + "\r\n"); 66 proc_GridServer.StandardInput.WriteLine(txtInputGridServer.Text + "\r\n");
67 txtInputGridServer.Text = ""; 67 txtInputGridServer.Text = "";
68 } 68 }
69 } 69 }
70 70
71 void txtInputAssetServer_KeyPress(object sender, KeyPressEventArgs e) 71 void txtInputAssetServer_KeyPress(object sender, KeyPressEventArgs e)
72 { 72 {
73 if (e.KeyChar == 13) 73 if (e.KeyChar == 13)
74 { 74 {
75 // We got a command 75 // We got a command
76 e.Handled = true; 76 e.Handled = true;
77 proc_AssetServer.StandardInput.WriteLine(txtInputAssetServer.Text + "\r\n"); 77 proc_AssetServer.StandardInput.WriteLine(txtInputAssetServer.Text + "\r\n");
78 txtInputAssetServer.Text = ""; 78 txtInputAssetServer.Text = "";
79 } 79 }
80 } 80 }
81 81
82 void txtInputRegionServer_KeyPress(object sender, KeyPressEventArgs e) 82 void txtInputRegionServer_KeyPress(object sender, KeyPressEventArgs e)
83 { 83 {
84 if (e.KeyChar == 13) 84 if (e.KeyChar == 13)
85 { 85 {
86 // We got a command 86 // We got a command
87 e.Handled = true; 87 e.Handled = true;
88 proc_OpenSim.StandardInput.WriteLine(txtInputRegionServer.Text + "\r\n"); 88 proc_OpenSim.StandardInput.WriteLine(txtInputRegionServer.Text + "\r\n");
89 txtInputRegionServer.Text = ""; 89 txtInputRegionServer.Text = "";
90 } 90 }
91 } 91 }
92 92
93 private void btnStart_Click(object sender, EventArgs e) 93 private void btnStart_Click(object sender, EventArgs e)
94 { 94 {
95 95
96 // 96 //
97 // THIS PART NEEDS TO BE MOVED TO A SEPARATE THREAD OR A TIMER OF SOME SORT 97 // THIS PART NEEDS TO BE MOVED TO A SEPARATE THREAD OR A TIMER OF SOME SORT
98 // should not block on wait 98 // should not block on wait
99 // ALSO - IF SOME SERVICES ARE NOT CONFIGURED, POP UP CONFIGURATION BOX FOR THAT SERVICE! 99 // ALSO - IF SOME SERVICES ARE NOT CONFIGURED, POP UP CONFIGURATION BOX FOR THAT SERVICE!
100 // 100 //
101 101
102 btnStart.Enabled = false; 102 btnStart.Enabled = false;
103 btnStop.Enabled = false; 103 btnStop.Enabled = false;
104 104
105 105
106 106
107 if (rbGridServer.Checked) 107 if (rbGridServer.Checked)
108 { 108 {
109 // Start UserServer 109 // Start UserServer
110 proc_UserServer = new ProcessManager("OpenSim.Grid.UserServer.exe", ""); 110 proc_UserServer = new ProcessManager("OpenSim.Grid.UserServer.exe", "");
111 txtMainLog.AppendText("Starting: User server" + "\r\n"); 111 txtMainLog.AppendText("Starting: User server" + "\r\n");
112 proc_UserServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived); 112 proc_UserServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived);
113 proc_UserServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived); 113 proc_UserServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived);
114 proc_UserServer.StartProcess(); 114 proc_UserServer.StartProcess();
115 System.Threading.Thread.Sleep(3000); 115 System.Threading.Thread.Sleep(3000);
116 116
117 // Start GridServer 117 // Start GridServer
118 proc_GridServer = new ProcessManager("OpenSim.Grid.GridServer.exe", ""); 118 proc_GridServer = new ProcessManager("OpenSim.Grid.GridServer.exe", "");
119 txtMainLog.AppendText("Starting: Grid server" + "\r\n"); 119 txtMainLog.AppendText("Starting: Grid server" + "\r\n");
120 proc_GridServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived); 120 proc_GridServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived);
121 proc_GridServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived); 121 proc_GridServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived);
122 proc_GridServer.StartProcess(); 122 proc_GridServer.StartProcess();
123 System.Threading.Thread.Sleep(3000); 123 System.Threading.Thread.Sleep(3000);
124 124
125 // Start AssetServer 125 // Start AssetServer
126 proc_AssetServer = new ProcessManager("OpenSim.Grid.AssetServer.exe", ""); 126 proc_AssetServer = new ProcessManager("OpenSim.Grid.AssetServer.exe", "");
127 txtMainLog.AppendText("Starting: Asset server" + "\r\n"); 127 txtMainLog.AppendText("Starting: Asset server" + "\r\n");
128 proc_AssetServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived); 128 proc_AssetServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived);
129 proc_AssetServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived); 129 proc_AssetServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived);
130 proc_AssetServer.StartProcess(); 130 proc_AssetServer.StartProcess();
131 System.Threading.Thread.Sleep(3000); 131 System.Threading.Thread.Sleep(3000);
132 } 132 }
133 133
134 // Start OpenSim 134 // Start OpenSim
135 string p = ""; 135 string p = "";
136 if (rbGridServer.Checked) 136 if (rbGridServer.Checked)
137 p = "-gridmode=true"; 137 p = "-gridmode=true";
138 138
139 proc_OpenSim = new ProcessManager("OpenSim.EXE", p); 139 proc_OpenSim = new ProcessManager("OpenSim.EXE", p);
140 txtMainLog.AppendText("Starting: OpenSim (Region server)" + "\r\n"); 140 txtMainLog.AppendText("Starting: OpenSim (Region server)" + "\r\n");
141 proc_OpenSim.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived); 141 proc_OpenSim.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived);
142 proc_OpenSim.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived); 142 proc_OpenSim.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived);
143 proc_OpenSim.StartProcess(); 143 proc_OpenSim.StartProcess();
144 144
145 btnStart.Enabled = false; 145 btnStart.Enabled = false;
146 btnStop.Enabled = true; 146 btnStop.Enabled = true;
147 147
148 } 148 }
149 public delegate void AppendText(string Text); 149 public delegate void AppendText(string Text);
150 void proc_UserServer_DataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e) 150 void proc_UserServer_DataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
151 { 151 {
152 this.Invoke(new AppendText(txtUserServer.AppendText), new object[] { e.Data + "\r\n" }); 152 this.Invoke(new AppendText(txtUserServer.AppendText), new object[] { e.Data + "\r\n" });
153 this.Invoke(new AppendText(txtMainLog.AppendText), new object[] { "UserServer: " + e.Data + "\r\n" }); 153 this.Invoke(new AppendText(txtMainLog.AppendText), new object[] { "UserServer: " + e.Data + "\r\n" });
154 } 154 }
155 void proc_GridServer_DataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e) 155 void proc_GridServer_DataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
156 { 156 {
157 this.Invoke(new AppendText(txtGridServer.AppendText), new object[] { e.Data + "\r\n" }); 157 this.Invoke(new AppendText(txtGridServer.AppendText), new object[] { e.Data + "\r\n" });
158 this.Invoke(new AppendText(txtMainLog.AppendText), new object[] { "GridServer: " + e.Data + "\r\n" }); 158 this.Invoke(new AppendText(txtMainLog.AppendText), new object[] { "GridServer: " + e.Data + "\r\n" });
159 } 159 }
160 void proc_AssetServer_DataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e) 160 void proc_AssetServer_DataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
161 { 161 {
162 this.Invoke(new AppendText(txtAssetServer.AppendText), new object[] { e.Data + "\r\n" }); 162 this.Invoke(new AppendText(txtAssetServer.AppendText), new object[] { e.Data + "\r\n" });
163 this.Invoke(new AppendText(txtMainLog.AppendText), new object[] { "AssetServer: " + e.Data + "\r\n" }); 163 this.Invoke(new AppendText(txtMainLog.AppendText), new object[] { "AssetServer: " + e.Data + "\r\n" });
164 } 164 }
165 void proc_OpenSim_DataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e) 165 void proc_OpenSim_DataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
166 { 166 {
167 this.Invoke(new AppendText(txtOpenSim.AppendText), new object[] { e.Data + "\r\n" }); 167 this.Invoke(new AppendText(txtOpenSim.AppendText), new object[] { e.Data + "\r\n" });
168 this.Invoke(new AppendText(txtMainLog.AppendText), new object[] { "OpenSim: " + e.Data + "\r\n" }); 168 this.Invoke(new AppendText(txtMainLog.AppendText), new object[] { "OpenSim: " + e.Data + "\r\n" });
169 } 169 }
170 170
171 private void btnStop_Click(object sender, EventArgs e) 171 private void btnStop_Click(object sender, EventArgs e)
172 { 172 {
173 btnStart.Enabled = false; 173 btnStart.Enabled = false;
174 btnStop.Enabled = false; 174 btnStop.Enabled = false;
175 175
176 if (proc_UserServer != null) 176 if (proc_UserServer != null)
177 { 177 {
178 txtMainLog.AppendText("Shutting down UserServer. CPU time used: " + proc_UserServer.TotalProcessorTime.ToString() + "\r\n"); 178 txtMainLog.AppendText("Shutting down UserServer. CPU time used: " + proc_UserServer.TotalProcessorTime.ToString() + "\r\n");
179 proc_UserServer.StopProcess(); 179 proc_UserServer.StopProcess();
180 } 180 }
181 if (proc_GridServer != null) 181 if (proc_GridServer != null)
182 { 182 {
183 txtMainLog.AppendText("Shutting down GridServer. CPU time used: " + proc_GridServer.TotalProcessorTime.ToString() + "\r\n"); 183 txtMainLog.AppendText("Shutting down GridServer. CPU time used: " + proc_GridServer.TotalProcessorTime.ToString() + "\r\n");
184 proc_GridServer.StopProcess(); 184 proc_GridServer.StopProcess();
185 } 185 }
186 if (proc_AssetServer != null) 186 if (proc_AssetServer != null)
187 { 187 {
188 txtMainLog.AppendText("Shutting down AssetServer. CPU time used: " + proc_AssetServer.TotalProcessorTime.ToString() + "\r\n"); 188 txtMainLog.AppendText("Shutting down AssetServer. CPU time used: " + proc_AssetServer.TotalProcessorTime.ToString() + "\r\n");
189 proc_AssetServer.StopProcess(); 189 proc_AssetServer.StopProcess();
190 } 190 }
191 if (proc_OpenSim != null) 191 if (proc_OpenSim != null)
192 { 192 {
193 txtMainLog.AppendText("Shutting down OpenSim. CPU time used: " + proc_OpenSim.TotalProcessorTime.ToString() + "\r\n"); 193 txtMainLog.AppendText("Shutting down OpenSim. CPU time used: " + proc_OpenSim.TotalProcessorTime.ToString() + "\r\n");
194 proc_OpenSim.StopProcess(); 194 proc_OpenSim.StopProcess();
195 } 195 }
196 196
197 btnStart.Enabled = true; 197 btnStart.Enabled = true;
198 btnStop.Enabled = false; 198 btnStop.Enabled = false;
199 199
200 200
201 } 201 }
202 202
203 private void UpdateTabVisibility() 203 private void UpdateTabVisibility()
204 { 204 {
205 if (rbStandAloneMode.Checked) 205 if (rbStandAloneMode.Checked)
206 { 206 {
207 if (tabLogs.TabPages.Contains(tabUserServer)) 207 if (tabLogs.TabPages.Contains(tabUserServer))
208 tabLogs.TabPages.Remove(tabUserServer); 208 tabLogs.TabPages.Remove(tabUserServer);
209 if (tabLogs.TabPages.Contains(tabGridServer)) 209 if (tabLogs.TabPages.Contains(tabGridServer))
210 tabLogs.TabPages.Remove(tabGridServer); 210 tabLogs.TabPages.Remove(tabGridServer);
211 if (tabLogs.TabPages.Contains(tabAssetServer)) 211 if (tabLogs.TabPages.Contains(tabAssetServer))
212 tabLogs.TabPages.Remove(tabAssetServer); 212 tabLogs.TabPages.Remove(tabAssetServer);
213 } 213 }
214 else 214 else
215 { 215 {
216 if (!tabLogs.TabPages.Contains(tabUserServer)) 216 if (!tabLogs.TabPages.Contains(tabUserServer))
217 tabLogs.TabPages.Add(tabUserServer); 217 tabLogs.TabPages.Add(tabUserServer);
218 if (!tabLogs.TabPages.Contains(tabGridServer)) 218 if (!tabLogs.TabPages.Contains(tabGridServer))
219 tabLogs.TabPages.Add(tabGridServer); 219 tabLogs.TabPages.Add(tabGridServer);
220 if (!tabLogs.TabPages.Contains(tabAssetServer)) 220 if (!tabLogs.TabPages.Contains(tabAssetServer))
221 tabLogs.TabPages.Add(tabAssetServer); 221 tabLogs.TabPages.Add(tabAssetServer);
222 } 222 }
223 223
224 } 224 }
225 225
226 private void rbStandAloneMode_CheckedChanged(object sender, EventArgs e) 226 private void rbStandAloneMode_CheckedChanged(object sender, EventArgs e)
227 { 227 {
228 UpdateTabVisibility(); 228 UpdateTabVisibility();
229 } 229 }
230 230
231 private void rbGridRegionMode_CheckedChanged(object sender, EventArgs e) 231 private void rbGridRegionMode_CheckedChanged(object sender, EventArgs e)
232 { 232 {
233 UpdateTabVisibility(); 233 UpdateTabVisibility();
234 } 234 }
235 235
236 private void rbGridServer_CheckedChanged(object sender, EventArgs e) 236 private void rbGridServer_CheckedChanged(object sender, EventArgs e)
237 { 237 {
238 UpdateTabVisibility(); 238 UpdateTabVisibility();
239 } 239 }
240 240
241 } 241 }
242} \ No newline at end of file 242} \ No newline at end of file