private void onNext(object sender, EventArgs e) { try { // selected analysis -> get pack AnalysisCasePallet analysisSel = SelectedAnalysis; PackProperties packSel = analysisSel.Content as PackProperties; packSel.ID.SetNameDesc(AnalysisName, AnalysisName); // create pack PackProperties packProperties = _doc.CreateNewPack(packSel); PalletProperties palletProperties = _doc.CreateNewPallet(SelectedPallet); // create analysis List <InterlayerProperties> interlayers = new List <InterlayerProperties>(); AnalysisHomo analysis = _doc.CreateNewAnalysisCasePallet( AnalysisName, AnalysisDescription, packProperties, palletProperties, interlayers, null, null, null, BuildConstraintSet(), analysisSel.Solution.LayerDescriptors); FormBrowseSolution form = new FormBrowseSolution(_doc, analysis); if (DialogResult.OK == form.ShowDialog()) { } } catch (Exception ex) { _log.Error(ex.Message); } }
private void onNext(object sender, EventArgs e) { try { Close(); List <LayerDesc> layerDescs = new List <LayerDesc>(); foreach (ILayer2D layer2D in uCtrlLayerList.Selected) { layerDescs.Add(layer2D.LayerDescriptor); } string userName = string.Empty; using (WCFClient wcfClient = new WCFClient()) { userName = wcfClient.User.Name; } Document doc = new Document(DocumentName, DocumentDescription, userName, DateTime.Now, null); Packable packable = doc.CreateNewPackable(BundleProp); BoxProperties caseProperties = doc.CreateNewCase( CaseName, CaseName , CaseInsideLength, CaseInsideWidth, CaseInsideHeight , CaseInsideLength, CaseInsideWidth, CaseInsideHeight , CaseWeight , new Color[] { Color.Chocolate, Color.Chocolate, Color.Chocolate, Color.Chocolate, Color.Chocolate, Color.Chocolate } ); if (null == packable || null == caseProperties) { return; } Solution.SetSolver(new LayerSolver()); Analysis analysis = doc.CreateNewAnalysisBoxCase( DocumentName, DocumentDescription , packable, caseProperties , new List <InterlayerProperties>() , BuildConstraintSet() , layerDescs); FormBrowseSolution form = new FormBrowseSolution(doc, analysis); if (DialogResult.OK == form.ShowDialog()) { } } catch (Exception ex) { _log.Error(ex.ToString()); } }
private void OnNext(object sender, EventArgs e) { try { Close(); List <LayerDesc> layerDescs = new List <LayerDesc>(); foreach (ILayer2D layer2D in uCtrlLayerList.Selected) { layerDescs.Add(layer2D.LayerDescriptor); } string userName = string.Empty; using (WCFClient wcfClient = new WCFClient()) { userName = wcfClient.User.Name; } Document doc = new Document(DocumentName, DocumentDescription, userName, DateTime.Now, null); Packable packable = doc.CreateNewPackable(_uctrlPackable.PackableProperties); PalletProperties palletProperties = doc.CreateNewPallet(cbPallet.SelectedPallet); if (null == packable || null == palletProperties) { return; } Solution.SetSolver(new LayerSolver()); Analysis analysis = doc.CreateNewAnalysisCasePallet( DocumentName, DocumentDescription , packable, palletProperties, new List <InterlayerProperties>(), null, null, null , BuildConstraintSet() , layerDescs); FormBrowseSolution form = new FormBrowseSolution(doc, analysis); if (DialogResult.OK == form.ShowDialog()) { } } catch (Exception ex) { _log.Error(ex.ToString()); } }