Ejemplo n.º 1
0
 static public void FillCombo(ItemBase[] items, ComboBox cb, ItemBase item)
 {
     cb.Items.Clear();
     foreach (ItemBase it in items)
     {
         cb.Items.Add(new ItemBaseCB(it));
     }
     if (cb.Items.Count > 0)
     {
         if (null == item)
         {
             cb.SelectedIndex = 0;
         }
         else
         {
             for (int i = 0; i < cb.Items.Count; ++i)
             {
                 ItemBaseCB cbItem = cb.Items[i] as ItemBaseCB;
                 if (cbItem.Item == item)
                 {
                     cb.SelectedIndex = i;
                     break;
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        private void onInputChanged(object sender, EventArgs e)
        {
            try
            {
                // get case /pallet
                ItemBaseCB itemBaseCase = cbCases.SelectedItem as ItemBaseCB;
                if (null == itemBaseCase)
                {
                    return;
                }
                BProperties bProperties = itemBaseCase.Item as BProperties;

                ItemBaseCB itemBasePallet = cbPallets.SelectedItem as ItemBaseCB;
                if (null == itemBasePallet)
                {
                    return;
                }
                PalletProperties palletProperties = itemBasePallet.Item as PalletProperties;
                // compute
                LayerSolver    solver = new LayerSolver();
                List <Layer2D> layers = solver.BuildLayers(
                    bProperties.OuterDimensions
                    , new Vector2D(palletProperties.Length + 2.0 * uCtrlOverhang.ValueX, palletProperties.Width + 2.0 * uCtrlOverhang.ValueY)
                    , BuildConstraintSet()
                    , checkBoxBestLayersOnly.Checked);
                // update control
                uCtrlLayerList.BProperties     = bProperties;
                uCtrlLayerList.ContainerHeight = uCtrlOptMaximumHeight.Value.Value;
                uCtrlLayerList.LayerList       = layers;
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
            }
        }
Ejemplo n.º 3
0
        protected void onCaseChanged(object sender, EventArgs e)
        {
            ItemBaseCB itemBaseCase = cbCases.SelectedItem as ItemBaseCB;

            if (null == itemBaseCase)
            {
                return;
            }
            uCtrlCaseOrientation.BProperties = itemBaseCase.Item as BProperties;

            onLayerSelected(sender, e);
        }
Ejemplo n.º 4
0
        private void onInterlayerChanged(object sender, EventArgs e)
        {
            // get index of interlayer
            InterlayerProperties interlayer = null;

            if (chkbInterlayer.Checked)
            {
                ItemBaseCB itemInterlayer = cbInterlater.SelectedItem as ItemBaseCB;
                if (null != itemInterlayer)
                {
                    interlayer = itemInterlayer.Item as InterlayerProperties;
                }
            }
            _solution.SetInterlayerOnSelected(interlayer);
            graphCtrlSolution.Invalidate();
        }
 private void onInterlayerChanged(object sender, EventArgs e)
 {
     try
     {
         // get index of interlayer
         InterlayerProperties interlayer = null;
         if (chkbInterlayer.Checked)
         {
             ItemBaseCB itemInterlayer = cbInterlayer.SelectedItem as ItemBaseCB;
             if (null != itemInterlayer)
             {
                 interlayer = itemInterlayer.Item as InterlayerProperties;
             }
         }
         _solution.SetInterlayerOnSelected(interlayer);
         graphCtrlSolution.Invalidate();
         UpdateGrid();
     }
     catch (Exception ex)
     {
         _log.Error(ex.ToString());
     }
 }