Changeset 4559
- Timestamp:
- 10/06/10 03:27:57 (14 years ago)
- Location:
- branches/OKB
- Files:
-
- 5 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB/HeuristicLab.Clients.OKB-3.3/OKBClient.cs
r4549 r4559 27 27 using HeuristicLab.Common; 28 28 using HeuristicLab.Core; 29 using HeuristicLab.Optimization; 29 30 using HeuristicLab.PluginInfrastructure; 30 31 … … 157 158 } 158 159 } 160 public bool Store(long algorithmId, long probleId, Run run) { 161 return true; 162 } 159 163 #endregion 160 164 -
branches/OKB/HeuristicLab.Clients.OKB-3.3/OKBExperiment.cs
r4558 r4559 277 277 Algorithm.Started += new EventHandler(algorithm_Started); 278 278 Algorithm.Stopped += new EventHandler(algorithm_Stopped); 279 Algorithm.Runs.ItemsAdded += new Collections.CollectionItemsChangedEventHandler<IRun>(Runs_ItemsAdded); 279 280 } 280 281 } … … 289 290 Algorithm.Started -= new EventHandler(algorithm_Started); 290 291 Algorithm.Stopped -= new EventHandler(algorithm_Stopped); 292 Algorithm.Runs.ItemsAdded -= new Collections.CollectionItemsChangedEventHandler<IRun>(Runs_ItemsAdded); 291 293 } 292 294 } … … 314 316 private void algorithm_Stopped(object sender, EventArgs e) { 315 317 OnStopped(); 318 } 319 private void Runs_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IRun> e) { 320 try { 321 foreach (Run run in e.Items) 322 OKBClient.Instance.Store(AlgorithmId, ProblemId, run); 323 } 324 catch (Exception ex) { 325 OnExceptionOccurred(ex); 326 } 316 327 } 317 328 #endregion -
branches/OKB/HeuristicLab.Services.OKB.DataTransfer/3.3/HeuristicLab.Services.OKB.DataTransfer-3.3.csproj
r4481 r4559 51 51 <Compile Include="Algorithm.cs" /> 52 52 <Compile Include="AlgorithmData.cs" /> 53 <Compile Include="AlgorithmParameter.cs" /> 54 <Compile Include="Run.cs" /> 55 <Compile Include="Experiment.cs" /> 56 <Compile Include="Result.cs" /> 57 <Compile Include="ProblemParameter.cs" /> 53 58 <Compile Include="ProblemData.cs" /> 54 59 <Compile Include="Problem.cs" /> -
branches/OKB/HeuristicLab.Services.OKB/3.3/Convert.cs
r4481 r4559 101 101 #endregion 102 102 103 #region AlgorithmParameter 104 public static DT.AlgorithmParameter ToDto(DA.AlgorithmParameter source) { 105 if (source == null) return null; 106 return new DT.AlgorithmParameter { Id = source.Id, Name = source.Name, Description = source.Description, Alias = source.Alias, AlgorithmId = source.AlgorithmId, DataTypeId = source.DataTypeId }; 107 } 108 public static DA.AlgorithmParameter ToEntity(DT.AlgorithmParameter source) { 109 if (source == null) return null; 110 return new DA.AlgorithmParameter { Id = source.Id, Name = source.Name, Description = source.Description, Alias = source.Alias, AlgorithmId = source.AlgorithmId, DataTypeId = source.DataTypeId }; 111 } 112 public static void ToEntity(DT.AlgorithmParameter source, DA.AlgorithmParameter target) { 113 if ((source != null) && (target != null)) 114 target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; target.Alias = source.Alias; target.AlgorithmId = source.AlgorithmId; target.DataTypeId = source.DataTypeId; 115 } 116 #endregion 117 103 118 #region ProblemClass 104 119 public static DT.ProblemClass ToDto(DA.ProblemClass source) { … … 116 131 #endregion 117 132 118 #region Algorithm133 #region Problem 119 134 public static DT.Problem ToDto(DA.Problem source) { 120 135 if (source == null) return null; … … 145 160 } 146 161 #endregion 162 163 #region ProblemParameter 164 public static DT.ProblemParameter ToDto(DA.ProblemParameter source) { 165 if (source == null) return null; 166 return new DT.ProblemParameter { Id = source.Id, Name = source.Name, Description = source.Description, Alias = source.Alias, ProblemId = source.ProblemId, DataTypeId = source.DataTypeId }; 167 } 168 public static DA.ProblemParameter ToEntity(DT.ProblemParameter source) { 169 if (source == null) return null; 170 return new DA.ProblemParameter { Id = source.Id, Name = source.Name, Description = source.Description, Alias = source.Alias, ProblemId = source.ProblemId, DataTypeId = source.DataTypeId }; 171 } 172 public static void ToEntity(DT.ProblemParameter source, DA.ProblemParameter target) { 173 if ((source != null) && (target != null)) 174 target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; target.Alias = source.Alias; target.ProblemId = source.ProblemId; target.DataTypeId = source.DataTypeId; 175 } 176 #endregion 177 178 #region Result 179 public static DT.Result ToDto(DA.Result source) { 180 if (source == null) return null; 181 return new DT.Result { Id = source.Id, Name = source.Name, Description = source.Description, Alias = source.Alias, AlgorithmId = source.AlgorithmId, DataTypeId = source.DataTypeId }; 182 } 183 public static DA.Result ToEntity(DT.Result source) { 184 if (source == null) return null; 185 return new DA.Result { Id = source.Id, Name = source.Name, Description = source.Description, Alias = source.Alias, AlgorithmId = source.AlgorithmId, DataTypeId = source.DataTypeId }; 186 } 187 public static void ToEntity(DT.Result source, DA.Result target) { 188 if ((source != null) && (target != null)) 189 target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; target.Alias = source.Alias; target.AlgorithmId = source.AlgorithmId; target.DataTypeId = source.DataTypeId; 190 } 191 #endregion 192 193 #region Experiment 194 public static DT.Experiment ToDto(DA.Experiment source) { 195 if (source == null) return null; 196 return new DT.Experiment { Id = source.Id, AlgorithmId = source.AlgorithmId, ProblemId = source.ProblemId }; 197 } 198 public static DA.Experiment ToEntity(DT.Experiment source) { 199 if (source == null) return null; 200 return new DA.Experiment { Id = source.Id, AlgorithmId = source.AlgorithmId, ProblemId = source.ProblemId }; 201 } 202 public static void ToEntity(DT.Experiment source, DA.Experiment target) { 203 if ((source != null) && (target != null)) 204 target.Id = source.Id; target.AlgorithmId = source.AlgorithmId; target.ProblemId = source.ProblemId; 205 } 206 #endregion 207 208 #region Run 209 public static DT.Run ToDto(DA.Run source) { 210 if (source == null) return null; 211 return new DT.Run { Id = source.Id, RandomSeed = source.RandomSeed, FinishedDate = source.FinishedDate, ExperimentId = source.ExperimentId, UserId = source.UserId, ClientId = source.ClientId }; 212 } 213 public static DA.Run ToEntity(DT.Run source) { 214 if (source == null) return null; 215 return new DA.Run { Id = source.Id, RandomSeed = source.RandomSeed, FinishedDate = source.FinishedDate, ExperimentId = source.ExperimentId, UserId = source.UserId, ClientId = source.ClientId }; 216 } 217 public static void ToEntity(DT.Run source, DA.Run target) { 218 if ((source != null) && (target != null)) 219 target.Id = source.Id; target.RandomSeed = source.RandomSeed; target.FinishedDate = source.FinishedDate; target.ExperimentId = source.ExperimentId; target.UserId = source.UserId; target.ClientId = source.ClientId; 220 221 } 222 #endregion 147 223 } 148 224 }
Note: See TracChangeset
for help on using the changeset viewer.