private void onSelChangeGrid(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            try
            {
                SourceGrid.Selection.RowSelection select = sender as SourceGrid.Selection.RowSelection;
                SourceGrid.Grid g = select.Grid as SourceGrid.Grid;

                SourceGrid.RangeRegion region = g.Selection.GetSelectionRegion();
                int[] indexes = region.GetRowsIndex();
                if (indexes.Length < 1 || indexes[0] < 1)
                {
                    _selectedAnalysis = null;
                }
                else
                {
                    _selectedAnalysis = _analyses[indexes[0] - 1];
                    // analysis name/description
                    if (null != _selectedAnalysis)
                    {
                        BoxProperties  box  = SelectedBox;
                        PackProperties pack = _selectedAnalysis.Content as PackProperties;
                        UpdateStatus(string.Empty);
                    }
                }

                graphCtrlPack.Invalidate();
                graphCtrlSolution.Invalidate();
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void OnSelChangeGrid(object sender, EventArgs e)
        {
            try
            {
                SourceGrid.Selection.RowSelection select = sender as SourceGrid.Selection.RowSelection;
                SourceGrid.Grid g = select.Grid as SourceGrid.Grid;

                SourceGrid.RangeRegion region = g.Selection.GetSelectionRegion();
                int[] indexes = region.GetRowsIndex();
                if (indexes.Length < 1 || indexes[0] < 1)
                {
                    _selectedItem = null;
                }
                else
                {
                    int iSel = indexes[0] - 1;
                    if (g == gridPallets)
                    {
                        _selectedItem = _pallets[iSel];
                    }
                }
                graphCtrl.Invalidate();
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
            }
        }
Ejemplo n.º 3
0
        private void OnSelChangeGrid(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            try
            {
                SourceGrid.Selection.RowSelection select = sender as SourceGrid.Selection.RowSelection;
                SourceGrid.Grid g = select.Grid as SourceGrid.Grid;

                SourceGrid.RangeRegion region = g.Selection.GetSelectionRegion();
                int[] indexes = region.GetRowsIndex();
                if (indexes.Length < 1 || indexes[0] < 1)
                {
                    _selectedAnalysis = null;
                }
                else
                {
                    _selectedAnalysis = _analyses[indexes[0] - 1];
                    // analysis name/description
                    if (null != _selectedAnalysis)
                    {
                        BoxProperties  box  = SelectedBox;
                        PackProperties pack = _selectedAnalysis.Content as PackProperties;
                        AnalysisName = string.Format("Analysis_{0}x{1}x{2}_{3}_on_{4}",
                                                     pack.Dim0, pack.Dim1, pack.Dim2, box.Name, _selectedAnalysis.Container.Name);
                        AnalysisDescription = string.Format("Packing {0}x{1}x{2} {3} on {4}",
                                                            pack.Dim0, pack.Dim1, pack.Dim2, box.Name, _selectedAnalysis.Container.Name);

                        UpdateStatus(string.Empty);
                    }
                    else
                    {
                        AnalysisName        = string.Empty;
                        AnalysisDescription = string.Empty;
                    }
                }

                graphCtrlPack.Invalidate();
                graphCtrlSolution.Invalidate();
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
            }
        }
Ejemplo n.º 4
0
        private void onSelChangeGrid(object sender, SourceGrid.RangeRegionChangedEventArgs e)
        {
            try
            {
                SourceGrid.Selection.RowSelection select = sender as SourceGrid.Selection.RowSelection;
                SourceGrid.Grid g = select.Grid as SourceGrid.Grid;

                SourceGrid.RangeRegion region = g.Selection.GetSelectionRegion();
                int[] indexes = region.GetRowsIndex();
                if (indexes.Length < 1 || indexes[0] < 1)
                {
                    _selectedAnalysis = null;
                }
                else
                {
                    _selectedAnalysis = _analyses[indexes[0] - 1];
                    // analysis name/description
                    if (null != _selectedAnalysis)
                    {
                        AnalysisName        = string.Format("Analysis_{0}_in_{1}", _selectedAnalysis.Content.Name, _selectedAnalysis.Container.Name);
                        AnalysisDescription = string.Format(" Packing {0} in {1}", _selectedAnalysis.Content.Name, _selectedAnalysis.Container.Name);
                    }
                    else
                    {
                        AnalysisName        = string.Empty;
                        AnalysisDescription = string.Empty;
                    }
                }
                // update drawing
                graphCtrl.Invalidate();
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
            }
        }