Changeset 4943 for branches/OKB
- Timestamp:
- 11/26/10 04:09:16 (14 years ago)
- Location:
- branches/OKB/HeuristicLab.Clients.OKB-3.3
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB/HeuristicLab.Clients.OKB-3.3/HeuristicLab.Clients.OKB-3.3.csproj
r4929 r4943 69 69 <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 70 70 <HintPath>..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath> 71 </Reference> 72 <Reference Include="HeuristicLab.Optimization.Views-3.3"> 73 <HintPath>..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization.Views-3.3.dll</HintPath> 71 74 </Reference> 72 75 <Reference Include="HeuristicLab.Optimizer-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> … … 167 170 <DependentUpon>AlgorithmParameterView.cs</DependentUpon> 168 171 </Compile> 172 <Compile Include="Views\RunView.cs"> 173 <SubType>UserControl</SubType> 174 </Compile> 175 <Compile Include="Views\RunView.Designer.cs"> 176 <DependentUpon>RunView.cs</DependentUpon> 177 </Compile> 178 <Compile Include="Views\ExperimentView.cs"> 179 <SubType>UserControl</SubType> 180 </Compile> 181 <Compile Include="Views\ExperimentView.Designer.cs"> 182 <DependentUpon>ExperimentView.cs</DependentUpon> 183 </Compile> 169 184 <Compile Include="Views\RunCollectionView.cs"> 170 185 <SubType>UserControl</SubType> -
branches/OKB/HeuristicLab.Clients.OKB-3.3/HeuristicLabClientsOKBPlugin.cs.frame
r4548 r4943 38 38 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 39 39 [PluginDependency("HeuristicLab.Optimization", "3.3")] 40 [PluginDependency("HeuristicLab.Optimization.Views", "3.3")] 40 41 [PluginDependency("HeuristicLab.Optimizer", "3.3")] 41 42 [PluginDependency("HeuristicLab.Persistence", "3.3")] -
branches/OKB/HeuristicLab.Clients.OKB-3.3/OKBClient.cs
r4929 r4943 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.IO; 24 25 using System.Linq; 25 26 using HeuristicLab.Clients.Common; … … 29 30 using HeuristicLab.Data; 30 31 using HeuristicLab.Optimization; 32 using HeuristicLab.Persistence.Default.Xml; 31 33 using HeuristicLab.PluginInfrastructure; 32 34 … … 246 248 } 247 249 } 250 #endregion 251 252 #region Problem Methods 253 public Guid[] GetProblemUsers(long problemId) { 254 try { 255 return CallAdminService<Guid[]>(s => s.GetProblemUsers(problemId)); 256 } 257 catch (Exception ex) { 258 ErrorHandling.ShowErrorDialog("Refresh authorized problem users failed.", ex); 259 return null; 260 } 261 } 262 public bool UpdateProblemUsers(long problemId, Guid[] users) { 263 try { 264 CallAdminService(s => s.UpdateProblemUsers(problemId, users)); 265 return true; 266 } 267 catch (Exception ex) { 268 ErrorHandling.ShowErrorDialog("Update authorized problem users failed.", ex); 269 return false; 270 } 271 } 272 public ProblemData GetProblemData(long problemId) { 273 try { 274 return CallAdminService<ProblemData>(s => s.GetProblemData(problemId)); 275 } 276 catch (Exception ex) { 277 ErrorHandling.ShowErrorDialog("Refresh problem data failed.", ex); 278 return null; 279 } 280 } 281 public bool UpdateProblemData(ProblemData problemData) { 282 try { 283 CallAdminService(s => s.UpdateProblemData(problemData)); 284 return true; 285 } 286 catch (Exception ex) { 287 ErrorHandling.ShowErrorDialog("Update problem data failed.", ex); 288 return false; 289 } 290 } 291 #endregion 292 293 #region AlgorithmParameter Methods 294 public AlgorithmParameter GetAlgorithmParameter(long id) { 295 try { 296 return CallAdminService<AlgorithmParameter>(s => s.GetAlgorithmParameter(id)); 297 } 298 catch (Exception ex) { 299 ErrorHandling.ShowErrorDialog("Refresh algorithm parameter failed.", ex); 300 return null; 301 } 302 } 248 303 public ItemCollection<AlgorithmParameter> GetAlgorithmParameters(long algorithmId) { 249 304 try { … … 257 312 } 258 313 } 314 #endregion 315 316 #region ProblemParameter Methods 317 public ProblemParameter GetProblemParameter(long id) { 318 try { 319 return CallAdminService<ProblemParameter>(s => s.GetProblemParameter(id)); 320 } 321 catch (Exception ex) { 322 ErrorHandling.ShowErrorDialog("Refresh problem parameter failed.", ex); 323 return null; 324 } 325 } 326 public ItemCollection<ProblemParameter> GetProblemParameters(long problemId) { 327 try { 328 ItemCollection<ProblemParameter> parameters = new ItemCollection<ProblemParameter>(); 329 parameters.AddRange(CallAdminService<ProblemParameter[]>(s => s.GetProblemParameters(problemId)).OrderBy(x => x.Name)); 330 return parameters; 331 } 332 catch (Exception ex) { 333 ErrorHandling.ShowErrorDialog("Refresh problem parameters failed.", ex); 334 return null; 335 } 336 } 337 #endregion 338 339 #region Result Methods 340 public Result GetResult(long id) { 341 try { 342 return CallAdminService<Result>(s => s.GetResult(id)); 343 } 344 catch (Exception ex) { 345 ErrorHandling.ShowErrorDialog("Refresh result failed.", ex); 346 return null; 347 } 348 } 259 349 public ItemCollection<Result> GetResults(long algorithmId) { 260 350 try { … … 270 360 #endregion 271 361 272 #region Problem Methods 273 public Guid[] GetProblemUsers(long problemId) { 274 try { 275 return CallAdminService<Guid[]>(s => s.GetProblemUsers(problemId)); 276 } 277 catch (Exception ex) { 278 ErrorHandling.ShowErrorDialog("Refresh authorized problem users failed.", ex); 279 return null; 280 } 281 } 282 public bool UpdateProblemUsers(long problemId, Guid[] users) { 283 try { 284 CallAdminService(s => s.UpdateProblemUsers(problemId, users)); 285 return true; 286 } 287 catch (Exception ex) { 288 ErrorHandling.ShowErrorDialog("Update authorized problem users failed.", ex); 289 return false; 290 } 291 } 292 public ProblemData GetProblemData(long problemId) { 293 try { 294 return CallAdminService<ProblemData>(s => s.GetProblemData(problemId)); 295 } 296 catch (Exception ex) { 297 ErrorHandling.ShowErrorDialog("Refresh problem data failed.", ex); 298 return null; 299 } 300 } 301 public bool UpdateProblemData(ProblemData problemData) { 302 try { 303 CallAdminService(s => s.UpdateProblemData(problemData)); 304 return true; 305 } 306 catch (Exception ex) { 307 ErrorHandling.ShowErrorDialog("Update problem data failed.", ex); 308 return false; 309 } 310 } 311 public ItemCollection<ProblemParameter> GetProblemParameters(long problemId) { 312 try { 313 ItemCollection<ProblemParameter> parameters = new ItemCollection<ProblemParameter>(); 314 parameters.AddRange(CallAdminService<ProblemParameter[]>(s => s.GetProblemParameters(problemId)).OrderBy(x => x.Name)); 315 return parameters; 316 } 317 catch (Exception ex) { 318 ErrorHandling.ShowErrorDialog("Refresh problem parameters failed.", ex); 362 #region Experiment Methods 363 public ItemCollection<Experiment> GetExperiments(long algorithmId, long problemId) { 364 try { 365 ItemCollection<Experiment> experiments = new ItemCollection<Experiment>(); 366 experiments.AddRange(CallAdminService<Experiment[]>(s => s.GetExperiments(algorithmId, problemId))); 367 return experiments; 368 } 369 catch (Exception ex) { 370 ErrorHandling.ShowErrorDialog("Refresh experiments failed.", ex); 319 371 return null; 320 372 } … … 323 375 324 376 #region Run Methods 377 public ItemCollection<Run> GetRuns(long experimentId) { 378 try { 379 ItemCollection<Run> runs = new ItemCollection<Run>(); 380 runs.AddRange(CallAdminService<Run[]>(s => s.GetRuns(experimentId)).OrderByDescending(x => x.FinishedDate)); 381 return runs; 382 } 383 catch (Exception ex) { 384 ErrorHandling.ShowErrorDialog("Refresh runs failed.", ex); 385 return null; 386 } 387 } 325 388 public bool AddRun(long algorithmId, long problemId, IAlgorithm algorithm) { 326 389 try { … … 402 465 } else { 403 466 AlgorithmParameterBlobValue value = new AlgorithmParameterBlobValue(); 404 value.Value = null; 467 try { 468 using (MemoryStream stream = new MemoryStream()) { 469 XmlGenerator.Serialize(item, stream); 470 stream.Close(); 471 value.Value = stream.ToArray(); 472 } 473 } 474 catch (Exception ex) { 475 ErrorHandling.ShowErrorDialog(ex); 476 } 405 477 return value; 406 478 } … … 451 523 } else { 452 524 ProblemParameterBlobValue value = new ProblemParameterBlobValue(); 453 value.Value = null; 525 try { 526 using (MemoryStream stream = new MemoryStream()) { 527 XmlGenerator.Serialize(item, stream); 528 stream.Close(); 529 value.Value = stream.ToArray(); 530 } 531 } 532 catch (Exception ex) { 533 ErrorHandling.ShowErrorDialog(ex); 534 } 454 535 return value; 455 536 } … … 497 578 } else { 498 579 ResultBlobValue value = new ResultBlobValue(); 499 value.Value = null; 580 try { 581 using (MemoryStream stream = new MemoryStream()) { 582 XmlGenerator.Serialize(item, stream); 583 stream.Close(); 584 value.Value = stream.ToArray(); 585 } 586 } 587 catch (Exception ex) { 588 ErrorHandling.ShowErrorDialog(ex); 589 } 500 590 return value; 501 591 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AlgorithmView.cs
r4929 r4943 133 133 134 134 private void refreshExperimentsButton_Click(object sender, EventArgs e) { 135 experimentCollectionView.Content = null; // TODO135 experimentCollectionView.Content = OKBClient.Instance.GetExperiments(Content.Id, 0); 136 136 } 137 137 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/OKBExperimentView.cs
r4558 r4943 47 47 OKBClient.Instance.Refreshing += new EventHandler(OKBClient_Refreshing); 48 48 OKBClient.Instance.Refreshed += new EventHandler(OKBClient_Refreshed); 49 // TODO: do not forget to deregister events50 49 PopulateComboBoxes(); 51 50 } … … 119 118 protected override void OnClosed(FormClosedEventArgs e) { 120 119 if ((Content != null) && (Content.ExecutionState == ExecutionState.Started)) Content.Stop(); 120 OKBClient.Instance.Refreshing -= new EventHandler(OKBClient_Refreshing); 121 OKBClient.Instance.Refreshed -= new EventHandler(OKBClient_Refreshed); 121 122 base.OnClosed(e); 122 123 }
Note: See TracChangeset
for help on using the changeset viewer.