private void BuildAnalyses(object status) { try { IProgressCallback callback = status as IProgressCallback; callback.SetRange(0, CheckedIndices.Count - 1); callback.Begin(); int expectedCount = uCtrlNumberPerCase.Value.Activated ? uCtrlNumberPerCase.Value.Value : -1; PackableBrick packable = cbBoxes.SelectedType as PackableBrick; // build list of analyses for (int i = 0; i < CheckedIndices.Count; ++i) { try { if (callback.IsAborting) { break; } callback.StepTo(i); callback.SetText(string.Format(Resources.ID_EVALUATINGCASE, i + 1, CheckedIndices.Count)); if ((chklbCases.Items[CheckedIndices[i]] as ItemBaseCB).Item is BoxProperties caseProperties) { // build constraint set ConstraintSetBoxCase constraintSet = new ConstraintSetBoxCase(caseProperties); constraintSet.SetAllowedOrientations(uCtrlCaseOrient.AllowedOrientations); if (uCtrlNumberPerCase.Value.Activated) { constraintSet.SetMaxNumber(uCtrlNumberPerCase.Value.Value); } // build solver + get analyses SolverBoxCase solver = new SolverBoxCase(packable, caseProperties); var listAnalyses = solver.BuildAnalyses(constraintSet, false); foreach (var analysis in listAnalyses) { if ((-1 == expectedCount) || (expectedCount == analysis.Solution.ItemCount)) { Analyses.Add(analysis); } } } } catch (Exception) {} } callback.SetText(Resources.ID_SORTINGSOLUTIONS); // sort analysis Analyses.Sort(new AnalysisComparer()); callback.End(); } catch (Exception) {} }
void ReportLow() { this.Total = analysisFiles.Count; analyses = new Analyses(); foreach (string analysisFile in analysisFiles) { if (this._isCancelationPending == true) { break; } ++this.Current; this.KeyCode = GetKeyCode(analysisFile); Analysis analysis = Services.TwServices.CreateAnalysis(analysisFile); analyses.Add(analysis); } analyses.Update(); }
public void VoegAnalyseToe(Analyse a) { Analyses.Add(a); }