Free cookie consent management tool by TermsFeed Policy Generator

Changeset 514


Ignore:
Timestamp:
08/14/08 16:47:20 (16 years ago)
Author:
gkronber
Message:

added a very crude exporter in preparation for ticket #200

Location:
trunk/sources/HeuristicLab.CEDMA.Core
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Core/AgentListView.Designer.cs

    r510 r514  
    4848    /// </summary>
    4949    private void InitializeComponent() {
     50      this.components = new System.ComponentModel.Container();
    5051      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
    5152      this.agentsGroupBox = new System.Windows.Forms.GroupBox();
     
    5455      this.addButton = new System.Windows.Forms.Button();
    5556      this.refreshButton = new System.Windows.Forms.Button();
     57      this.entryContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
     58      this.exportAllResultsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    5659      this.splitContainer1.Panel1.SuspendLayout();
    5760      this.splitContainer1.Panel2.SuspendLayout();
    5861      this.splitContainer1.SuspendLayout();
    5962      this.agentsGroupBox.SuspendLayout();
     63      this.entryContextMenuStrip.SuspendLayout();
    6064      this.SuspendLayout();
    6165      //
     
    133137      this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
    134138      //
     139      // entryContextMenuStrip
     140      //
     141      this.entryContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     142            this.exportAllResultsToolStripMenuItem});
     143      this.entryContextMenuStrip.Name = "entryContextMenuStrip";
     144      this.entryContextMenuStrip.Size = new System.Drawing.Size(166, 26);
     145      //
     146      // exportAllResultsToolStripMenuItem
     147      //
     148      this.exportAllResultsToolStripMenuItem.Name = "exportAllResultsToolStripMenuItem";
     149      this.exportAllResultsToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
     150      this.exportAllResultsToolStripMenuItem.Text = "Export all results";
     151      this.exportAllResultsToolStripMenuItem.Click += new System.EventHandler(this.exportAllResultsToolStripMenuItem_Click);
     152      //
    135153      // AgentListView
    136154      //
     
    145163      this.splitContainer1.ResumeLayout(false);
    146164      this.agentsGroupBox.ResumeLayout(false);
     165      this.entryContextMenuStrip.ResumeLayout(false);
    147166      this.ResumeLayout(false);
    148167
     
    157176    private TreeView agentTreeView;
    158177    private Button refreshButton;
     178    private ContextMenuStrip entryContextMenuStrip;
     179    private ToolStripMenuItem exportAllResultsToolStripMenuItem;
    159180  }
    160181}
  • trunk/sources/HeuristicLab.CEDMA.Core/AgentListView.cs

    r510 r514  
    6565          node.Tag = agent;
    6666          node.Nodes.Add("dummy");
     67          node.ContextMenuStrip = entryContextMenuStrip;
    6768          agentTreeView.Nodes.Add(node);
    6869        }
     
    8485          node.Text = subAgent.Name;
    8586          node.Tag = subAgent;
     87          node.ContextMenuStrip = entryContextMenuStrip;
    8688          node.Nodes.Add("dummy");
    8789          e.Node.Nodes.Add(node);
     
    123125      UpdateControls();
    124126    }
     127
     128    private void exportAllResultsToolStripMenuItem_Click(object sender, EventArgs e) {
     129      TreeNode node = agentTreeView.SelectedNode;
     130      Agent agent = (Agent)node.Tag;
     131      ResultExporter exporter = new ResultExporter();
     132      ResultTable table = new ResultTable();
     133      exporter.Export(agent, table);
     134
     135      using(System.IO.FileStream s = new System.IO.FileStream("exported-results.txt", System.IO.FileMode.Create)) {
     136        table.Write(s);
     137      }
     138    }
    125139  }
    126140}
  • trunk/sources/HeuristicLab.CEDMA.Core/AgentListView.resx

    r357 r514  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
     120  <metadata name="entryContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     121    <value>17, 17</value>
     122  </metadata>
    120123</root>
  • trunk/sources/HeuristicLab.CEDMA.Core/HeuristicLab.CEDMA.Core.csproj

    r513 r514  
    6262      <SubType>UserControl</SubType>
    6363    </Compile>
     64    <Compile Include="ResultTable.cs" />
     65    <Compile Include="ResultExporter.cs" />
    6466    <Compile Include="DatabaseOperatorLibrary.cs" />
    6567    <Compile Include="DatabaseOperatorLibraryView.cs">
  • trunk/sources/HeuristicLab.CEDMA.Core/IResult.cs

    r393 r514  
    2929namespace HeuristicLab.CEDMA.Core {
    3030  public interface IResult : IDatabaseItem, IViewable {
     31    IItem Item { get; }
    3132    string Summary { get; }
    3233    string Description { get; }
  • trunk/sources/HeuristicLab.CEDMA.Core/Result.cs

    r503 r514  
    3434    public string Summary { get; set; }
    3535    public string Description { get; set; }
    36     public IItem Item { get; set; }
     36    private IItem item;
     37    public IItem Item {
     38      get {
     39        if(item == null) {
     40          byte[] rawData = Database.GetResultRawData(Id);
     41          item = (IItem)PersistenceManager.RestoreFromGZip(rawData);
     42        }
     43        return item;
     44      }
     45    }
    3746    public Result()
    3847      : base() {
     
    6069
    6170    public IView CreateView() {
    62       if(Item == null) {
    63         byte[] rawData = Database.GetResultRawData(Id);
    64         Item = (IItem)PersistenceManager.RestoreFromGZip(rawData);
    65       }
    6671      return Item.CreateView();
    6772    }
Note: See TracChangeset for help on using the changeset viewer.