GUI also contains option for Stand Alone mode.

afrisby
Tedd Hansen 2007-09-12 13:16:08 +00:00
parent dcaab9103c
commit b12bfb6315
2 changed files with 120 additions and 27 deletions

View File

@ -50,6 +50,9 @@ namespace OpenSim.GUI
this.gbLog = new System.Windows.Forms.GroupBox(); this.gbLog = new System.Windows.Forms.GroupBox();
this.btnStart = new System.Windows.Forms.Button(); this.btnStart = new System.Windows.Forms.Button();
this.btnStop = new System.Windows.Forms.Button(); this.btnStop = new System.Windows.Forms.Button();
this.rbGridRegionMode = new System.Windows.Forms.RadioButton();
this.rbStandAloneMode = new System.Windows.Forms.RadioButton();
this.rbGridServer = new System.Windows.Forms.RadioButton();
this.tabLogs.SuspendLayout(); this.tabLogs.SuspendLayout();
this.tabMainLog.SuspendLayout(); this.tabMainLog.SuspendLayout();
this.tabRegionServer.SuspendLayout(); this.tabRegionServer.SuspendLayout();
@ -292,11 +295,49 @@ namespace OpenSim.GUI
this.btnStop.UseVisualStyleBackColor = true; this.btnStop.UseVisualStyleBackColor = true;
this.btnStop.Click += new System.EventHandler(this.btnStop_Click); this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
// //
// rbGridRegionMode
//
this.rbGridRegionMode.AutoSize = true;
this.rbGridRegionMode.Location = new System.Drawing.Point(407, 18);
this.rbGridRegionMode.Name = "rbGridRegionMode";
this.rbGridRegionMode.Size = new System.Drawing.Size(76, 17);
this.rbGridRegionMode.TabIndex = 4;
this.rbGridRegionMode.Text = "Grid region";
this.rbGridRegionMode.UseVisualStyleBackColor = true;
this.rbGridRegionMode.CheckedChanged += new System.EventHandler(this.rbGridRegionMode_CheckedChanged);
//
// rbStandAloneMode
//
this.rbStandAloneMode.AutoSize = true;
this.rbStandAloneMode.Checked = true;
this.rbStandAloneMode.Location = new System.Drawing.Point(319, 18);
this.rbStandAloneMode.Name = "rbStandAloneMode";
this.rbStandAloneMode.Size = new System.Drawing.Size(82, 17);
this.rbStandAloneMode.TabIndex = 5;
this.rbStandAloneMode.TabStop = true;
this.rbStandAloneMode.Text = "Stand alone";
this.rbStandAloneMode.UseVisualStyleBackColor = true;
this.rbStandAloneMode.CheckedChanged += new System.EventHandler(this.rbStandAloneMode_CheckedChanged);
//
// rbGridServer
//
this.rbGridServer.AutoSize = true;
this.rbGridServer.Location = new System.Drawing.Point(484, 18);
this.rbGridServer.Name = "rbGridServer";
this.rbGridServer.Size = new System.Drawing.Size(76, 17);
this.rbGridServer.TabIndex = 6;
this.rbGridServer.Text = "Grid server";
this.rbGridServer.UseVisualStyleBackColor = true;
this.rbGridServer.CheckedChanged += new System.EventHandler(this.rbGridServer_CheckedChanged);
//
// Main // Main
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(583, 299); this.ClientSize = new System.Drawing.Size(583, 299);
this.Controls.Add(this.rbGridServer);
this.Controls.Add(this.rbStandAloneMode);
this.Controls.Add(this.rbGridRegionMode);
this.Controls.Add(this.btnStop); this.Controls.Add(this.btnStop);
this.Controls.Add(this.btnStart); this.Controls.Add(this.btnStart);
this.Controls.Add(this.gbLog); this.Controls.Add(this.gbLog);
@ -316,6 +357,7 @@ namespace OpenSim.GUI
this.tabGridServer.PerformLayout(); this.tabGridServer.PerformLayout();
this.gbLog.ResumeLayout(false); this.gbLog.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
@ -343,6 +385,9 @@ namespace OpenSim.GUI
private InputTextBoxControl txtInputUserServer; private InputTextBoxControl txtInputUserServer;
private InputTextBoxControl txtInputAssetServer; private InputTextBoxControl txtInputAssetServer;
private InputTextBoxControl txtInputGridServer; private InputTextBoxControl txtInputGridServer;
private System.Windows.Forms.RadioButton rbGridRegionMode;
private System.Windows.Forms.RadioButton rbStandAloneMode;
private System.Windows.Forms.RadioButton rbGridServer;
} }
} }

View File

@ -29,6 +29,8 @@ namespace OpenSim.GUI
txtInputRegionServer.KeyPress += new KeyPressEventHandler(txtInputRegionServer_KeyPress); txtInputRegionServer.KeyPress += new KeyPressEventHandler(txtInputRegionServer_KeyPress);
tabLogs.Selected += new TabControlEventHandler(tabLogs_Selected); tabLogs.Selected += new TabControlEventHandler(tabLogs_Selected);
UpdateTabVisibility();
} }
void tabLogs_Selected(object sender, TabControlEventArgs e) void tabLogs_Selected(object sender, TabControlEventArgs e)
@ -93,33 +95,42 @@ namespace OpenSim.GUI
btnStart.Enabled = false; btnStart.Enabled = false;
btnStop.Enabled = false; btnStop.Enabled = false;
// Start UserServer
proc_UserServer = new ProcessManager("OpenSim.Grid.UserServer.exe", "");
txtMainLog.AppendText("Starting: UserServer");
proc_UserServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived);
proc_UserServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived);
proc_UserServer.StartProcess();
System.Threading.Thread.Sleep(2000);
// Start GridServer
proc_GridServer = new ProcessManager("OpenSim.Grid.GridServer.exe", "");
txtMainLog.AppendText("Starting: GridServer");
proc_GridServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived);
proc_GridServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived);
proc_GridServer.StartProcess();
System.Threading.Thread.Sleep(2000);
// Start AssetServer if (rbGridServer.Checked)
proc_AssetServer = new ProcessManager("OpenSim.Grid.AssetServer.exe", ""); {
txtMainLog.AppendText("Starting: AssetServer"); // Start UserServer
proc_AssetServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived); proc_UserServer = new ProcessManager("OpenSim.Grid.UserServer.exe", "");
proc_AssetServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived); txtMainLog.AppendText("Starting: User server" + "\r\n");
proc_AssetServer.StartProcess(); proc_UserServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived);
System.Threading.Thread.Sleep(2000); proc_UserServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_UserServer_DataReceived);
proc_UserServer.StartProcess();
System.Threading.Thread.Sleep(2000);
// Start GridServer
proc_GridServer = new ProcessManager("OpenSim.Grid.GridServer.exe", "");
txtMainLog.AppendText("Starting: Grid server" + "\r\n");
proc_GridServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived);
proc_GridServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_GridServer_DataReceived);
proc_GridServer.StartProcess();
System.Threading.Thread.Sleep(2000);
// Start AssetServer
proc_AssetServer = new ProcessManager("OpenSim.Grid.AssetServer.exe", "");
txtMainLog.AppendText("Starting: Asset server" + "\r\n");
proc_AssetServer.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived);
proc_AssetServer.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_AssetServer_DataReceived);
proc_AssetServer.StartProcess();
System.Threading.Thread.Sleep(2000);
}
// Start OpenSim // Start OpenSim
proc_OpenSim = new ProcessManager("OpenSim.EXE", "-gridmode=true"); string p = "";
txtMainLog.AppendText("Starting: OpenSim"); if (rbGridServer.Checked)
p = "-gridmode=true";
proc_OpenSim = new ProcessManager("OpenSim.EXE", p);
txtMainLog.AppendText("Starting: OpenSim (Region server)" + "\r\n");
proc_OpenSim.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived); proc_OpenSim.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived);
proc_OpenSim.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived); proc_OpenSim.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(proc_OpenSim_DataReceived);
proc_OpenSim.StartProcess(); proc_OpenSim.StartProcess();
@ -157,22 +168,22 @@ namespace OpenSim.GUI
if (proc_UserServer != null) if (proc_UserServer != null)
{ {
txtMainLog.AppendText("Shutting down UserServer. CPU time used: " + proc_UserServer.TotalProcessorTime); txtMainLog.AppendText("Shutting down UserServer. CPU time used: " + proc_UserServer.TotalProcessorTime.ToString() + "\r\n");
proc_UserServer.StopProcess(); proc_UserServer.StopProcess();
} }
if (proc_GridServer != null) if (proc_GridServer != null)
{ {
txtMainLog.AppendText("Shutting down GridServer. CPU time used: " + proc_GridServer.TotalProcessorTime); txtMainLog.AppendText("Shutting down GridServer. CPU time used: " + proc_GridServer.TotalProcessorTime.ToString() + "\r\n");
proc_GridServer.StopProcess(); proc_GridServer.StopProcess();
} }
if (proc_AssetServer != null) if (proc_AssetServer != null)
{ {
txtMainLog.AppendText("Shutting down AssetServer. CPU time used: " + proc_AssetServer.TotalProcessorTime); txtMainLog.AppendText("Shutting down AssetServer. CPU time used: " + proc_AssetServer.TotalProcessorTime.ToString() + "\r\n");
proc_AssetServer.StopProcess(); proc_AssetServer.StopProcess();
} }
if (proc_OpenSim != null) if (proc_OpenSim != null)
{ {
txtMainLog.AppendText("Shutting down OpenSim. CPU time used: " + proc_OpenSim.TotalProcessorTime); txtMainLog.AppendText("Shutting down OpenSim. CPU time used: " + proc_OpenSim.TotalProcessorTime.ToString() + "\r\n");
proc_OpenSim.StopProcess(); proc_OpenSim.StopProcess();
} }
@ -182,6 +193,43 @@ namespace OpenSim.GUI
} }
private void UpdateTabVisibility()
{
if (rbStandAloneMode.Checked)
{
if (tabLogs.TabPages.Contains(tabUserServer))
tabLogs.TabPages.Remove(tabUserServer);
if (tabLogs.TabPages.Contains(tabGridServer))
tabLogs.TabPages.Remove(tabGridServer);
if (tabLogs.TabPages.Contains(tabAssetServer))
tabLogs.TabPages.Remove(tabAssetServer);
}
else
{
if (!tabLogs.TabPages.Contains(tabUserServer))
tabLogs.TabPages.Add(tabUserServer);
if (!tabLogs.TabPages.Contains(tabGridServer))
tabLogs.TabPages.Add(tabGridServer);
if (!tabLogs.TabPages.Contains(tabAssetServer))
tabLogs.TabPages.Add(tabAssetServer);
}
}
private void rbStandAloneMode_CheckedChanged(object sender, EventArgs e)
{
UpdateTabVisibility();
}
private void rbGridRegionMode_CheckedChanged(object sender, EventArgs e)
{
UpdateTabVisibility();
}
private void rbGridServer_CheckedChanged(object sender, EventArgs e)
{
UpdateTabVisibility();
}
} }
} }