Changeset 2824


Ignore:
Timestamp:
02/17/10 23:11:32 (11 years ago)
Author:
gkronber
Message:

Quick fix: ported CEDMA server form to HL.MainForm to be able to open and edit algorithms. #758 (CEDMA server should be based on new HL.MainForm)

Location:
trunk/sources/HeuristicLab.CEDMA.Server/3.3
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.Designer.cs

    r2422 r2824  
    5252      this.testLabel = new System.Windows.Forms.Label();
    5353      this.setAllButton = new System.Windows.Forms.Button();
     54      this.editEngineButton = new System.Windows.Forms.Button();
    5455      this.splitContainer.Panel1.SuspendLayout();
    5556      this.splitContainer.Panel2.SuspendLayout();
     
    130131      //
    131132      this.learningTaskGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     133      this.learningTaskGroupBox.Controls.Add(this.editEngineButton);
    132134      this.learningTaskGroupBox.Controls.Add(this.setAlgorithmDefault);
    133135      this.learningTaskGroupBox.Controls.Add(this.autoregressiveLabel);
     
    193195      this.algorithmsListBox.Size = new System.Drawing.Size(331, 124);
    194196      this.algorithmsListBox.TabIndex = 4;
     197      this.algorithmsListBox.SelectedIndexChanged += new System.EventHandler(this.algorithmsListBox_SelectedIndexChanged);
    195198      this.algorithmsListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.algorithmsListBox_ItemCheck);
    196199      //
     
    380383      this.setAllButton.UseVisualStyleBackColor = true;
    381384      this.setAllButton.Click += new System.EventHandler(this.setAllButton_Click);
     385      //
     386      // editEngineButton
     387      //
     388      this.editEngineButton.Location = new System.Drawing.Point(108, 292);
     389      this.editEngineButton.Name = "editEngineButton";
     390      this.editEngineButton.Size = new System.Drawing.Size(75, 23);
     391      this.editEngineButton.TabIndex = 37;
     392      this.editEngineButton.Text = "Edit engine";
     393      this.editEngineButton.UseVisualStyleBackColor = true;
     394      this.editEngineButton.Click += new System.EventHandler(this.editEngineButton_Click);
    382395      //
    383396      // DispatcherView
     
    431444    private System.Windows.Forms.CheckBox autoregressiveCheckBox;
    432445    private System.Windows.Forms.Button setAlgorithmDefault;
     446    private System.Windows.Forms.Button editEngineButton;
    433447  }
    434448}
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.cs

    r2471 r2824  
    1818      this.dispatcher = dispatcher;
    1919      InitializeComponent();
     20      editEngineButton.Enabled = false;
    2021      dispatcher.Changed += (sender, args) => UpdateControls();
    2122      UpdateControls();
     
    246247    }
    247248
     249    private void editEngineButton_Click(object sender, EventArgs e) {
     250      var algo = (HeuristicLab.Modeling.IAlgorithm)algorithmsListBox.SelectedItem;
     251      HeuristicLab.PluginInfrastructure.ControlManager.Manager.ShowControl(algo.Engine.CreateView());
     252    }
     253
     254    private void algorithmsListBox_SelectedIndexChanged(object sender, EventArgs e) {
     255      editEngineButton.Enabled = algorithmsListBox.SelectedItems.Count > 0;
     256    }
     257
    248258  }
    249259}
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/HeuristicLab.CEDMA.Server-3.3.csproj

    r2566 r2824  
    9191  </ItemGroup>
    9292  <ItemGroup>
     93    <Compile Include="EngineViewWrapper.cs">
     94      <SubType>UserControl</SubType>
     95    </Compile>
     96    <Compile Include="IUserInterfaceItemProvider.cs" />
     97    <Compile Include="MainForm.cs">
     98      <SubType>Form</SubType>
     99    </Compile>
    93100    <Compile Include="ProblemSpecification.cs" />
    94101    <Compile Include="LearningTask.cs" />
     
    159166      <Project>{545CE756-98D8-423B-AC2E-6E7D70926E5C}</Project>
    160167      <Name>HeuristicLab.Grid-3.2</Name>
     168    </ProjectReference>
     169    <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.2\HeuristicLab.MainForm.WindowsForms-3.2.csproj">
     170      <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>
     171      <Name>HeuristicLab.MainForm.WindowsForms-3.2</Name>
     172    </ProjectReference>
     173    <ProjectReference Include="..\..\HeuristicLab.MainForm\3.2\HeuristicLab.MainForm-3.2.csproj">
     174      <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>
     175      <Name>HeuristicLab.MainForm-3.2</Name>
    161176    </ProjectReference>
    162177    <ProjectReference Include="..\..\HeuristicLab.Modeling.Database.SQLServerCompact\3.2\HeuristicLab.Modeling.Database.SQLServerCompact-3.2.csproj">
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/Server.cs

    r2451 r2824  
    7979
    8080    public IView CreateView() {
    81       return new ServerView(this);
     81      return null;
    8282    }
    8383    #endregion
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ServerApplication.cs

    r2621 r2824  
    3030  class ServerApplication : ApplicationBase {
    3131    public override void Run() {
    32       Server server = new Server();
    33       Form mainForm = new Form();
    34       mainForm.Size = new System.Drawing.Size(800, 600);
    35       UserControl serverControl = (UserControl)server.CreateView();
    36       serverControl.Dock = DockStyle.Fill;
    37       mainForm.Controls.Add(serverControl);
    38       mainForm.Text = "CEDMA";
     32      MainForm mainForm = new MainForm(typeof(IUserInterfaceItemProvider));
     33      mainForm.Title = "CEDMA Server Controller";
     34      PluginInfrastructure.ControlManager.RegisterManager(mainForm);
    3935      Application.Run(mainForm);
    4036    }
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ServerView.cs

    r2375 r2824  
    3939
    4040namespace HeuristicLab.CEDMA.Server {
    41   public partial class ServerView : ViewBase {
     41  public partial class ServerView : HeuristicLab.MainForm.WindowsForms.View {
    4242    private Server server;
    4343
     
    4646      this.server = server;
    4747      InitializeComponent();
     48      Caption = "Cedma Server Controller";
    4849    }
    4950
Note: See TracChangeset for help on using the changeset viewer.