Exemple #1
0
        /// <summary>
        /// Edit given truck analysis
        /// </summary>
        /// <param name="truckAnalysis"></param>
        public void EditTruckAnalysis(TruckAnalysis truckAnalysis)
        {
            // instantiate form
            FormNewTruckAnalysis form = new FormNewTruckAnalysis(truckAnalysis.ParentDocument, truckAnalysis);

            form.Trucks = Trucks.ToArray();

            // show form
            bool recomputeRequired = false;

            if (recomputeRequired = (DialogResult.OK == form.ShowDialog()))
            {
                truckAnalysis.TruckProperties = form.SelectedTruck;
            }
            if (recomputeRequired)
            {
                truckAnalysis.OnEndUpdate(null);
            }
        }
        private void onCreateNewTruckAnalysis(object sender, EventArgs e)
        {
            try
            {
                NodeTag tag = SelectedNode.Tag as NodeTag;

                if (tag.SelSolution.HasDependingAnalyses)
                    return;

                FormNewTruckAnalysis form = new FormNewTruckAnalysis(tag.Document);
                form.Trucks = tag.Document.Trucks.ToArray();
                if (DialogResult.OK == form.ShowDialog())
                {
                    TruckConstraintSet constraintSet = new TruckConstraintSet();
                    constraintSet.MultilayerAllowed = form.AllowSeveralPalletLayers;
                    constraintSet.AllowPalletOrientationX = form.AllowPalletOrientationX;
                    constraintSet.AllowPalletOrientationY = form.AllowPalletOrientationY;
                    constraintSet.MinDistancePalletTruckWall = form.MinDistancePalletTruckWall;
                    constraintSet.MinDistancePalletTruckRoof = form.MinDistancePalletTruckRoof;

                    TruckAnalysis truckAnalysis = tag.SelSolution.CreateNewTruckAnalysis(form.SelectedTruck.Name, string.Empty, form.SelectedTruck, constraintSet, new TruckSolver());
                    if (null != truckAnalysis)
                        FormMain.GetInstance().CreateOrActivateViewTruckAnalysis(truckAnalysis);
                }
            }
            catch (Exception ex) { _log.Error(ex.ToString()); }
        }
        /// <summary>
        /// Edit given truck analysis
        /// </summary>
        /// <param name="truckAnalysis"></param>
        public void EditTruckAnalysis(TruckAnalysis truckAnalysis)
        {
            // instantiate form
            FormNewTruckAnalysis form = new FormNewTruckAnalysis(truckAnalysis.ParentDocument, truckAnalysis);
            form.Trucks = Trucks.ToArray();

            // show form
            bool recomputeRequired = false;
            if (recomputeRequired = (DialogResult.OK == form.ShowDialog()))
            {
                truckAnalysis.TruckProperties = form.SelectedTruck;
            }
            if (recomputeRequired)
                truckAnalysis.OnEndUpdate(null);
        }