Free cookie consent management tool by TermsFeed Policy Generator

Changeset 389 for trunk/sources


Ignore:
Timestamp:
07/22/08 14:06:42 (16 years ago)
Author:
gkronber
Message:

worked on #188

Location:
trunk/sources
Files:
1 added
12 edited

Legend:

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

    r377 r389  
    3434    public string Name { get; set; }
    3535    public ProcessStatus Status { get; set; }
     36    public bool Terminated { get; set; }
    3637    private OperatorGraph operatorGraph;
    3738
     
    5758    }
    5859
    59     public void Activate() {
     60    public void Start() {
    6061      Status = ProcessStatus.Waiting;
    6162      Save();
    6263    }
     64
     65    public ICollection<IAgent> SubAgents {
     66      get {
     67        List<IAgent> runs = new List<IAgent>();
     68        // TASK
     69        return runs;
     70      }
     71    }
     72
     73    public ICollection<IResult> Results {
     74      get {
     75        List<IResult> results = new List<IResult>();
     76        // TASK
     77        return results;
     78      }
     79    }
    6380
    6481    #region persistence
  • trunk/sources/HeuristicLab.CEDMA.Core/AgentListView.Designer.cs

    r377 r389  
    5050      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
    5151      this.agentsGroupBox = new System.Windows.Forms.GroupBox();
    52       this.agentsListView = new System.Windows.Forms.ListView();
    53       this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
    5452      this.detailsGroupBox = new System.Windows.Forms.GroupBox();
    5553      this.addButton = new System.Windows.Forms.Button();
     54      this.agentTreeView = new System.Windows.Forms.TreeView();
    5655      this.splitContainer1.Panel1.SuspendLayout();
    5756      this.splitContainer1.Panel2.SuspendLayout();
     
    8281      // agentsGroupBox
    8382      //
    84       this.agentsGroupBox.Controls.Add(this.agentsListView);
     83      this.agentsGroupBox.Controls.Add(this.agentTreeView);
    8584      this.agentsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    8685      this.agentsGroupBox.Location = new System.Drawing.Point(0, 0);
     
    9089      this.agentsGroupBox.TabStop = false;
    9190      this.agentsGroupBox.Text = "&Agents";
    92       //
    93       // agentsListView
    94       //
    95       this.agentsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
    96             this.columnHeader1});
    97       this.agentsListView.Dock = System.Windows.Forms.DockStyle.Fill;
    98       this.agentsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
    99       this.agentsListView.HideSelection = false;
    100       this.agentsListView.Location = new System.Drawing.Point(3, 16);
    101       this.agentsListView.Name = "agentsListView";
    102       this.agentsListView.Size = new System.Drawing.Size(129, 136);
    103       this.agentsListView.Sorting = System.Windows.Forms.SortOrder.Ascending;
    104       this.agentsListView.TabIndex = 0;
    105       this.agentsListView.UseCompatibleStateImageBehavior = false;
    106       this.agentsListView.View = System.Windows.Forms.View.Details;
    107       this.agentsListView.SelectedIndexChanged += new System.EventHandler(this.variablesListView_SelectedIndexChanged);
    108       this.agentsListView.SizeChanged += new System.EventHandler(this.variablesListView_SizeChanged);
    10991      //
    11092      // detailsGroupBox
     
    129111      this.addButton.Click += new System.EventHandler(this.addButton_Click);
    130112      //
    131       // AgentView
     113      // agentTreeView
     114      //
     115      this.agentTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
     116      this.agentTreeView.Location = new System.Drawing.Point(3, 16);
     117      this.agentTreeView.Name = "agentTreeView";
     118      this.agentTreeView.Size = new System.Drawing.Size(129, 136);
     119      this.agentTreeView.TabIndex = 0;
     120      this.agentTreeView.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.agentTreeView_BeforeExpand);
     121      //
     122      // AgentListView
    132123      //
    133124      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    134125      this.Controls.Add(this.addButton);
    135126      this.Controls.Add(this.splitContainer1);
    136       this.Name = "AgentView";
     127      this.Name = "AgentListView";
    137128      this.Size = new System.Drawing.Size(276, 184);
    138129      this.splitContainer1.Panel1.ResumeLayout(false);
     
    148139    private System.Windows.Forms.SplitContainer splitContainer1;
    149140    private System.Windows.Forms.GroupBox agentsGroupBox;
    150     private System.Windows.Forms.ListView agentsListView;
    151     private System.Windows.Forms.ColumnHeader columnHeader1;
    152141    private System.Windows.Forms.GroupBox detailsGroupBox;
    153142    private System.Windows.Forms.Button addButton;
     143    private TreeView agentTreeView;
    154144  }
    155145}
  • trunk/sources/HeuristicLab.CEDMA.Core/AgentListView.cs

    r383 r389  
    5656      if(AgentList == null) {
    5757        Caption = "Agents View";
    58         agentsListView.Enabled = false;
     58        agentTreeView.Enabled = false;
    5959      } else {
    60         agentsListView.Enabled = true;
    61         agentsListView.Items.Clear();
     60        agentTreeView.Enabled = true;
     61        agentTreeView.Nodes.Clear();
    6262        foreach(IAgent agent in AgentList) {
    63           ListViewItem item = new ListViewItem();
    64           item.Text = agent.Name;
    65           item.Tag = agent;
    66           agentsListView.Items.Add(item);
     63          TreeNode node = new TreeNode();
     64          node.Text = agent.Name;
     65          node.Tag = agent;
     66          agentTreeView.Nodes.Add(node);
    6767        }
    6868      }
     
    7474      detailsGroupBox.Controls.Clear();
    7575      detailsGroupBox.Enabled = false;
    76       if(agentsListView.SelectedItems.Count == 1) {
    77         IAgent agent = (IAgent)agentsListView.SelectedItems[0].Tag;
     76      if(agentTreeView.SelectedNode!=null) {
     77        IAgent agent = (IAgent)agentTreeView.SelectedNode.Tag;
    7878        Control control = (Control)new AgentView(agent);
    7979        detailsGroupBox.Controls.Add(control);
     
    8383    }
    8484
    85     #region Size Changed Events
    86     private void variablesListView_SizeChanged(object sender, EventArgs e) {
    87       if(agentsListView.Columns.Count > 0)
    88         agentsListView.Columns[0].Width = Math.Max(0, agentsListView.Width - 25);
    89     }
    90     #endregion
    91 
    9285    #region Button Events
    9386    private void addButton_Click(object sender, EventArgs e) {
     
    9689    }
    9790    #endregion
     91
     92    private void agentTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e) {
     93    }
    9894  }
    9995}
  • trunk/sources/HeuristicLab.CEDMA.Core/AgentView.Designer.cs

    r377 r389  
    8080      this.activateButton.Size = new System.Drawing.Size(75, 23);
    8181      this.activateButton.TabIndex = 2;
    82       this.activateButton.Text = "&Activate";
     82      this.activateButton.Text = "&Start";
    8383      this.activateButton.UseVisualStyleBackColor = true;
    8484      this.activateButton.Click += new System.EventHandler(this.activateButton_Click);
  • trunk/sources/HeuristicLab.CEDMA.Core/AgentView.cs

    r377 r389  
    6868
    6969    private void activateButton_Click(object sender, EventArgs e) {
    70       Agent.Activate();
     70      Agent.Start();
    7171      activateButton.Enabled = false;
    7272    }
  • trunk/sources/HeuristicLab.CEDMA.Core/ConsoleEditor.cs

    r377 r389  
    3333    private System.Windows.Forms.Label uriLabel;
    3434    private System.Windows.Forms.TabControl tabControl;
    35     private System.Windows.Forms.TabPage overviewPage;
    3635    private System.Windows.Forms.TabPage agentsPage;
    37     private System.Windows.Forms.TabPage resultsPage;
    3836    private Button connectButton;
    3937    private ComboBox comboBox1;
     
    5149      this.uriLabel = new System.Windows.Forms.Label();
    5250      this.tabControl = new System.Windows.Forms.TabControl();
    53       this.overviewPage = new System.Windows.Forms.TabPage();
    5451      this.agentsPage = new System.Windows.Forms.TabPage();
    55       this.resultsPage = new System.Windows.Forms.TabPage();
    5652      this.connectButton = new System.Windows.Forms.Button();
    5753      this.comboBox1 = new System.Windows.Forms.ComboBox();
     
    8278                  | System.Windows.Forms.AnchorStyles.Left)
    8379                  | System.Windows.Forms.AnchorStyles.Right)));
    84       this.tabControl.Controls.Add(this.overviewPage);
    8580      this.tabControl.Controls.Add(this.agentsPage);
    86       this.tabControl.Controls.Add(this.resultsPage);
    8781      this.tabControl.Enabled = false;
    8882      this.tabControl.Location = new System.Drawing.Point(6, 56);
     
    9185      this.tabControl.Size = new System.Drawing.Size(506, 407);
    9286      this.tabControl.TabIndex = 2;
    93       //
    94       // overviewPage
    95       //
    96       this.overviewPage.Location = new System.Drawing.Point(4, 22);
    97       this.overviewPage.Name = "overviewPage";
    98       this.overviewPage.Padding = new System.Windows.Forms.Padding(3);
    99       this.overviewPage.Size = new System.Drawing.Size(498, 381);
    100       this.overviewPage.TabIndex = 0;
    101       this.overviewPage.Text = "Overview";
    102       this.overviewPage.UseVisualStyleBackColor = true;
    10387      //
    10488      // agentsPage
     
    11195      this.agentsPage.Text = "Agents";
    11296      this.agentsPage.UseVisualStyleBackColor = true;
    113       //
    114       // resultsPage
    115       //
    116       this.resultsPage.Location = new System.Drawing.Point(4, 22);
    117       this.resultsPage.Name = "resultsPage";
    118       this.resultsPage.Padding = new System.Windows.Forms.Padding(3);
    119       this.resultsPage.Size = new System.Drawing.Size(498, 381);
    120       this.resultsPage.TabIndex = 2;
    121       this.resultsPage.Text = "Results";
    122       this.resultsPage.UseVisualStyleBackColor = true;
    12397      //
    12498      // connectButton
  • trunk/sources/HeuristicLab.CEDMA.Core/HeuristicLab.CEDMA.Core.csproj

    r382 r389  
    6262      <SubType>UserControl</SubType>
    6363    </Compile>
     64    <Compile Include="IResult.cs" />
    6465    <Compile Include="DbPersistenceManager.cs" />
    6566    <Compile Include="HeuristicLabCedmaCorePlugin.cs" />
  • trunk/sources/HeuristicLab.CEDMA.Core/IAgent.cs

    r383 r389  
    3232    ProcessStatus Status { get; }
    3333    IOperatorGraph OperatorGraph { get; }
    34     void Activate();
     34    ICollection<IAgent> SubAgents { get; }
     35    ICollection<IResult> Results { get; }
     36    bool Terminated { get; }
     37   
     38    void Start();
    3539  }
    3640}
  • trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/IDatabase.cs

    r375 r389  
    6666
    6767    [OperationContract]
    68     ICollection<RunEntry> GetRuns();
     68    ICollection<RunEntry> GetRuns(long agentId);
    6969
    7070    [OperationContract]
  • trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/ResultEntry.cs

    r375 r389  
    3737    public long ResultId { get; set; }
    3838    [DataMember]
     39    public string Summary { get; set; }
     40    [DataMember]
     41    public string Description { get; set; }
     42    [DataMember]
    3943    public DateTime CreationTime { get; set; }
    4044    [DataMember]
  • trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/RunEntry.cs

    r375 r389  
    3737    public DateTime CreationTime { get; set; }
    3838    [DataMember]
    39     public DateTime? StartTime { get; set; }
    40     [DataMember]
    41     public DateTime? FinishedTime { get; set; }
    42     [DataMember]
    4339    public ProcessStatus Status { get; set; }
    4440    [DataMember]
  • trunk/sources/HeuristicLab.CEDMA.DB/Database.cs

    r380 r389  
    432432    }
    433433
    434     public ICollection<RunEntry> GetRuns() {
     434    public ICollection<RunEntry> GetRuns(long agentId) {
    435435      List<RunEntry> runs = new List<RunEntry>();
    436436      rwLock.EnterReadLock();
     
    439439          cnn.Open();
    440440          using(DbCommand c = cnn.CreateCommand()) {
    441             c.CommandText = "Select Id, AgentId, CreationTime, StartTime, FinishedTime, Status, Rawdata from Run";
     441            c.CommandText = "Select Id, AgentId, CreationTime, Status, Rawdata from Run where AgentId=@AgentId";
     442            DbParameter agentParameter = c.CreateParameter();
     443            agentParameter.ParameterName = "@AgentId";
     444            agentParameter.Value = agentId;
     445            c.Parameters.Add(agentParameter);
     446
    442447            using(DbDataReader r = c.ExecuteReader()) {
    443448              while(r.Read()) {
     
    446451                run.AgentId = r.GetInt32(1);
    447452                run.CreationTime = r.GetDateTime(2);
    448                 run.StartTime = r.GetDateTime(3);
    449                 run.FinishedTime = r.GetDateTime(4);
    450                 run.Status = (ProcessStatus)Enum.Parse(typeof(ProcessStatus), r.GetString(5));
    451                 run.RawData = (byte[])r.GetValue(6);
     453                run.Status = (ProcessStatus)Enum.Parse(typeof(ProcessStatus), r.GetString(3));
     454                run.RawData = (byte[])r.GetValue(4);
    452455                runs.Add(run);
    453456              }
     
    468471          cnn.Open();
    469472          using(DbCommand c = cnn.CreateCommand()) {
    470             c.CommandText = "Select Id, AgentId, CreationTime, StartTime, FinishedTime, Status, Rawdata from Run where Status=@Status";
     473            c.CommandText = "Select Id, AgentId, CreationTime, Status, Rawdata from Run where Status=@Status";
    471474            DbParameter statusParameter = c.CreateParameter();
    472475            statusParameter.ParameterName = "@Status";
     
    480483                run.AgentId = r.GetInt32(1);
    481484                run.CreationTime = r.GetDateTime(2);
    482                 run.StartTime = r.IsDBNull(3) ? null : new Nullable<DateTime>(r.GetDateTime(3));
    483                 run.FinishedTime = r.IsDBNull(4) ? null : new Nullable<DateTime>(r.GetDateTime(4));
    484                 run.Status = (ProcessStatus)Enum.Parse(typeof(ProcessStatus), r.GetString(5));
    485                 run.RawData = (byte[])r.GetValue(6);
     485                run.Status = (ProcessStatus)Enum.Parse(typeof(ProcessStatus), r.GetString(3));
     486                run.RawData = (byte[])r.GetValue(4);
    486487                runs.Add(run);
    487488              }
Note: See TracChangeset for help on using the changeset viewer.