Changeset 389
- Timestamp:
- 07/22/08 14:06:42 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Core/Agent.cs
r377 r389 34 34 public string Name { get; set; } 35 35 public ProcessStatus Status { get; set; } 36 public bool Terminated { get; set; } 36 37 private OperatorGraph operatorGraph; 37 38 … … 57 58 } 58 59 59 public void Activate() {60 public void Start() { 60 61 Status = ProcessStatus.Waiting; 61 62 Save(); 62 63 } 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 } 63 80 64 81 #region persistence -
trunk/sources/HeuristicLab.CEDMA.Core/AgentListView.Designer.cs
r377 r389 50 50 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 51 51 this.agentsGroupBox = new System.Windows.Forms.GroupBox(); 52 this.agentsListView = new System.Windows.Forms.ListView();53 this.columnHeader1 = new System.Windows.Forms.ColumnHeader();54 52 this.detailsGroupBox = new System.Windows.Forms.GroupBox(); 55 53 this.addButton = new System.Windows.Forms.Button(); 54 this.agentTreeView = new System.Windows.Forms.TreeView(); 56 55 this.splitContainer1.Panel1.SuspendLayout(); 57 56 this.splitContainer1.Panel2.SuspendLayout(); … … 82 81 // agentsGroupBox 83 82 // 84 this.agentsGroupBox.Controls.Add(this.agent sListView);83 this.agentsGroupBox.Controls.Add(this.agentTreeView); 85 84 this.agentsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 86 85 this.agentsGroupBox.Location = new System.Drawing.Point(0, 0); … … 90 89 this.agentsGroupBox.TabStop = false; 91 90 this.agentsGroupBox.Text = "&Agents"; 92 //93 // agentsListView94 //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);109 91 // 110 92 // detailsGroupBox … … 129 111 this.addButton.Click += new System.EventHandler(this.addButton_Click); 130 112 // 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 132 123 // 133 124 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 134 125 this.Controls.Add(this.addButton); 135 126 this.Controls.Add(this.splitContainer1); 136 this.Name = "Agent View";127 this.Name = "AgentListView"; 137 128 this.Size = new System.Drawing.Size(276, 184); 138 129 this.splitContainer1.Panel1.ResumeLayout(false); … … 148 139 private System.Windows.Forms.SplitContainer splitContainer1; 149 140 private System.Windows.Forms.GroupBox agentsGroupBox; 150 private System.Windows.Forms.ListView agentsListView;151 private System.Windows.Forms.ColumnHeader columnHeader1;152 141 private System.Windows.Forms.GroupBox detailsGroupBox; 153 142 private System.Windows.Forms.Button addButton; 143 private TreeView agentTreeView; 154 144 } 155 145 } -
trunk/sources/HeuristicLab.CEDMA.Core/AgentListView.cs
r383 r389 56 56 if(AgentList == null) { 57 57 Caption = "Agents View"; 58 agent sListView.Enabled = false;58 agentTreeView.Enabled = false; 59 59 } else { 60 agent sListView.Enabled = true;61 agent sListView.Items.Clear();60 agentTreeView.Enabled = true; 61 agentTreeView.Nodes.Clear(); 62 62 foreach(IAgent agent in AgentList) { 63 ListViewItem item = new ListViewItem();64 item.Text = agent.Name;65 item.Tag = agent;66 agent sListView.Items.Add(item);63 TreeNode node = new TreeNode(); 64 node.Text = agent.Name; 65 node.Tag = agent; 66 agentTreeView.Nodes.Add(node); 67 67 } 68 68 } … … 74 74 detailsGroupBox.Controls.Clear(); 75 75 detailsGroupBox.Enabled = false; 76 if(agent sListView.SelectedItems.Count == 1) {77 IAgent agent = (IAgent)agent sListView.SelectedItems[0].Tag;76 if(agentTreeView.SelectedNode!=null) { 77 IAgent agent = (IAgent)agentTreeView.SelectedNode.Tag; 78 78 Control control = (Control)new AgentView(agent); 79 79 detailsGroupBox.Controls.Add(control); … … 83 83 } 84 84 85 #region Size Changed Events86 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 #endregion91 92 85 #region Button Events 93 86 private void addButton_Click(object sender, EventArgs e) { … … 96 89 } 97 90 #endregion 91 92 private void agentTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e) { 93 } 98 94 } 99 95 } -
trunk/sources/HeuristicLab.CEDMA.Core/AgentView.Designer.cs
r377 r389 80 80 this.activateButton.Size = new System.Drawing.Size(75, 23); 81 81 this.activateButton.TabIndex = 2; 82 this.activateButton.Text = "& Activate";82 this.activateButton.Text = "&Start"; 83 83 this.activateButton.UseVisualStyleBackColor = true; 84 84 this.activateButton.Click += new System.EventHandler(this.activateButton_Click); -
trunk/sources/HeuristicLab.CEDMA.Core/AgentView.cs
r377 r389 68 68 69 69 private void activateButton_Click(object sender, EventArgs e) { 70 Agent. Activate();70 Agent.Start(); 71 71 activateButton.Enabled = false; 72 72 } -
trunk/sources/HeuristicLab.CEDMA.Core/ConsoleEditor.cs
r377 r389 33 33 private System.Windows.Forms.Label uriLabel; 34 34 private System.Windows.Forms.TabControl tabControl; 35 private System.Windows.Forms.TabPage overviewPage;36 35 private System.Windows.Forms.TabPage agentsPage; 37 private System.Windows.Forms.TabPage resultsPage;38 36 private Button connectButton; 39 37 private ComboBox comboBox1; … … 51 49 this.uriLabel = new System.Windows.Forms.Label(); 52 50 this.tabControl = new System.Windows.Forms.TabControl(); 53 this.overviewPage = new System.Windows.Forms.TabPage();54 51 this.agentsPage = new System.Windows.Forms.TabPage(); 55 this.resultsPage = new System.Windows.Forms.TabPage();56 52 this.connectButton = new System.Windows.Forms.Button(); 57 53 this.comboBox1 = new System.Windows.Forms.ComboBox(); … … 82 78 | System.Windows.Forms.AnchorStyles.Left) 83 79 | System.Windows.Forms.AnchorStyles.Right))); 84 this.tabControl.Controls.Add(this.overviewPage);85 80 this.tabControl.Controls.Add(this.agentsPage); 86 this.tabControl.Controls.Add(this.resultsPage);87 81 this.tabControl.Enabled = false; 88 82 this.tabControl.Location = new System.Drawing.Point(6, 56); … … 91 85 this.tabControl.Size = new System.Drawing.Size(506, 407); 92 86 this.tabControl.TabIndex = 2; 93 //94 // overviewPage95 //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;103 87 // 104 88 // agentsPage … … 111 95 this.agentsPage.Text = "Agents"; 112 96 this.agentsPage.UseVisualStyleBackColor = true; 113 //114 // resultsPage115 //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;123 97 // 124 98 // connectButton -
trunk/sources/HeuristicLab.CEDMA.Core/HeuristicLab.CEDMA.Core.csproj
r382 r389 62 62 <SubType>UserControl</SubType> 63 63 </Compile> 64 <Compile Include="IResult.cs" /> 64 65 <Compile Include="DbPersistenceManager.cs" /> 65 66 <Compile Include="HeuristicLabCedmaCorePlugin.cs" /> -
trunk/sources/HeuristicLab.CEDMA.Core/IAgent.cs
r383 r389 32 32 ProcessStatus Status { get; } 33 33 IOperatorGraph OperatorGraph { get; } 34 void Activate(); 34 ICollection<IAgent> SubAgents { get; } 35 ICollection<IResult> Results { get; } 36 bool Terminated { get; } 37 38 void Start(); 35 39 } 36 40 } -
trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/IDatabase.cs
r375 r389 66 66 67 67 [OperationContract] 68 ICollection<RunEntry> GetRuns( );68 ICollection<RunEntry> GetRuns(long agentId); 69 69 70 70 [OperationContract] -
trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/ResultEntry.cs
r375 r389 37 37 public long ResultId { get; set; } 38 38 [DataMember] 39 public string Summary { get; set; } 40 [DataMember] 41 public string Description { get; set; } 42 [DataMember] 39 43 public DateTime CreationTime { get; set; } 40 44 [DataMember] -
trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/RunEntry.cs
r375 r389 37 37 public DateTime CreationTime { get; set; } 38 38 [DataMember] 39 public DateTime? StartTime { get; set; }40 [DataMember]41 public DateTime? FinishedTime { get; set; }42 [DataMember]43 39 public ProcessStatus Status { get; set; } 44 40 [DataMember] -
trunk/sources/HeuristicLab.CEDMA.DB/Database.cs
r380 r389 432 432 } 433 433 434 public ICollection<RunEntry> GetRuns( ) {434 public ICollection<RunEntry> GetRuns(long agentId) { 435 435 List<RunEntry> runs = new List<RunEntry>(); 436 436 rwLock.EnterReadLock(); … … 439 439 cnn.Open(); 440 440 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 442 447 using(DbDataReader r = c.ExecuteReader()) { 443 448 while(r.Read()) { … … 446 451 run.AgentId = r.GetInt32(1); 447 452 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); 452 455 runs.Add(run); 453 456 } … … 468 471 cnn.Open(); 469 472 using(DbCommand c = cnn.CreateCommand()) { 470 c.CommandText = "Select Id, AgentId, CreationTime, Sta rtTime, FinishedTime, Status, Rawdata from Run where Status=@Status";473 c.CommandText = "Select Id, AgentId, CreationTime, Status, Rawdata from Run where Status=@Status"; 471 474 DbParameter statusParameter = c.CreateParameter(); 472 475 statusParameter.ParameterName = "@Status"; … … 480 483 run.AgentId = r.GetInt32(1); 481 484 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); 486 487 runs.Add(run); 487 488 }
Note: See TracChangeset
for help on using the changeset viewer.