Exemple #1
0
        void GanttView_BindRowAdding(object sender, GanttRowEventArgs args)
        {
            var info      = args.Item as LotGantt.GanttInfo;
            var colHeader = _gantt.ColumnHeader;

            SetRowHeaderValue(args.RowIndex, info.LotID);

            this._rowsumti    = 0; //2010.09.13 by ldw
            this._rowsumto    = 0; //2010.09.13 by ldw
            this._rowRunHours = 0;

            if (args.Node == null)
            {
                return;
            }

            var rows = args.Node.LinkedBarList;

            if (rows.Count > 1 && args.Index > 0 && args.Index < rows.Count - 1)
            {
                XtraSheetHelper.SetCellText(colHeader.GetCellInfo(args.RowIndex, ColName.LotID), info.LotID);
                //SfGridHelper.SetCellText(colHeader.GetCellInfo(args.RowIndex, ColName.LotID), info.LotID);

                PaintRowKeyedCell(args.RowIndex, _currColor);
            }
        }
Exemple #2
0
        void GanttView_BindRowAdded(object sender, GanttRowEventArgs args)
        {
            var info      = args.Item as LotGantt.GanttInfo;
            var colHeader = _gantt.ColumnHeader;

            _calCount++;
            XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate), 0);
            //SfGridHelper.SetCellFloatValue(colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate), 0);

            //SfGridHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.TIQtySum), _rowsumti);

            XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.RunQty), _rowsumto);
            //SfGridHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.TOQtySum), _rowsumto);

            double rowLoadRate  = _queryPeriod > 0 ? _rowRunHours / _queryPeriod * 100.0 : 0;
            string sRowLoadRate = rowLoadRate <= 0 ? string.Empty : Math.Round(rowLoadRate, 1).ToString() + "%";

            XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate), sRowLoadRate);
            //SfGridHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate), sRowLoadRate);

            _totalRowCnt++;

            colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Left;
            colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;
            colHeader.GetCellInfo(args.RowIndex, ColName.RunQty).Alignment.Horizontal   = SpreadsheetHorizontalAlignment.Left;
            colHeader.GetCellInfo(args.RowIndex, ColName.RunQty).Alignment.Vertical     = SpreadsheetVerticalAlignment.Center;

            _subTotalTI  += _rowsumti;
            _subTotalTO  += _rowsumto;
            _totLoadRate += rowLoadRate;
            _totalTO     += _rowsumto;
        }
Exemple #3
0
        void GanttView_BindRowAdded(object sender, GanttRowEventArgs args)
        {
            var info      = args.Item as ToolGantt.GanttInfo;
            var colHeader = _gantt.ColumnHeader;

            if (_totalLoadTImeFrBarDic.ContainsKey(info.EqpID) == false)
            {
                _totalLoadTImeFrBarDic.Add(info.EqpID, _rowsumLoadTimeFrBar);
            }

            if (this.IsOnlyToolMode)
            {
                string sLoadRate = string.Empty;
                double loadRate  = 0;
                sLoadRate = Math.Round(loadRate, 1).ToString() + "%";
                //XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.MaskChangeCnt), _rowsumJobChg);
            }

            XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.RunQtySum), _rowsumto);

            _subTotalTI  += _rowsumti;
            _subTotalTO  += _rowsumto;
            _totalTO     += _rowsumto;
            _subJobChg   += _rowsumJobChg;
            _totalJobChg += _rowsumJobChg;
        }
Exemple #4
0
        void GanttView_BindDone(object sender, EventArgs e)
        {
            var colHeader = _gantt.ColumnHeader;

            _totLoadRate = _totLoadRate / _calCount;

            double totalLoadRate  = _queryPeriod * _totalRowCnt > 0 ? _totalRunHours / (_queryPeriod * (double)_totalRowCnt) * 100 : 0;
            string sTotalLoadRate = totalLoadRate <= 0 ? string.Empty : Math.Round(totalLoadRate, 1).ToString();

            XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(0, ColName.LoadRate),
                                              string.Format("{0}\n({1}%)", ColName.LoadRate, sTotalLoadRate));

            XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(0, ColName.RunQty),
                                              string.Format("{0}\n({1})", ColName.RunQty, _totalTO.ToString("#.#")));

            _totalRunHours = 0;
            _totalRowCnt   = 0;

            colHeader.GetCellInfo(0, ColName.LotID).Alignment.Horizontal    = SpreadsheetHorizontalAlignment.Center;
            colHeader.GetCellInfo(0, ColName.LotID).Alignment.Vertical      = SpreadsheetVerticalAlignment.Center;
            colHeader.GetCellInfo(0, ColName.LoadRate).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Left;
            colHeader.GetCellInfo(0, ColName.RunQty).Alignment.Horizontal   = SpreadsheetHorizontalAlignment.Left;
            //colHeader.GetCellInfo(1, ColName.LoadRate).HorizontalAlignment = GridHorizontalAlignment.Left;

            MergeRows(_startSameRowKeyIdx, _gantt.LastRowIndex);
            //MergeRows(_startSameEqpRowIdx, _gantt.LastRowIndex, 1);

            // Sample에 없음
            //grid1.Model.Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation | GridMergeCellsMode.MergeRowsInColumn;

            PaintTotColumnCell();
        }
Exemple #5
0
        void GanttView_BindRowAdded(object sender, GanttRowEventArgs args)
        {
            this.subTotalTIQty = rowTIQty;
            this.totalTIQty   += rowTIQty;

            var colHeader = this.gantt.ColumnHeader;

            XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(typeStartRowIndex, Constants.COLUMN_QTY), this.subTotalTIQty);
            XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(lineIDStartRowIndex, Constants.COLUMN_TOTAL), this.totalTIQty);
        }
Exemple #6
0
        void GanttView_BindDone(object sender, EventArgs e)
        {
            var colHeader = _gantt.ColumnHeader;

            // 마지막 Row 값 세팅
            if (this.IsOnlyToolMode == false)
            {
                XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(_startSameEqpRowIdx, ColName.MaskChangeCnt), _subJobChg);
            }

            XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(_startSameEqpRowIdx, ColName.TotalRun), _subTotalTO);

            #region // mask count
            //totChgRate = totChgRate / calCount;
            //loadRateColName = string.Format("{0} \n({1}%)", ColName.LoadRate, totalRateForAct.ToString("#.#"));

            //var jobChgColName = string.Format("{0} \n({1})", ColName.MaskChangeCnt, _totalJobChg.ToString("#.#"));

            //XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(0, ColName.MaskChangeCnt), jobChgColName);

            //colHeader.GetCellInfo(0, ColName.MaskChangeCnt).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
            #endregion

            string totalToColName = string.Format("{0} \n({1})", "TOTAL", _totalTO.ToString("#.#"));
            XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(0, ColName.TotalRun), totalToColName);

            for (int i = 0; i < _gantt.LastRowIndex; i++)
            {
                colHeader.GetCellInfo(i, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
            }

            colHeader.GetCellInfo(0, ColName.MaskID).Alignment.Horizontal    = SpreadsheetHorizontalAlignment.Center;
            colHeader.GetCellInfo(0, ColName.RunQtySum).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
            colHeader.GetCellInfo(0, ColName.TotalRun).Alignment.Horizontal  = SpreadsheetHorizontalAlignment.Center;

            colHeader.GetCellInfo(0, ColName.MaskID).Alignment.Vertical    = SpreadsheetVerticalAlignment.Center;
            colHeader.GetCellInfo(0, ColName.RunQtySum).Alignment.Vertical = SpreadsheetVerticalAlignment.Center;
            colHeader.GetCellInfo(0, ColName.TotalRun).Alignment.Vertical  = SpreadsheetVerticalAlignment.Center;

            if (this.IsOnlyToolMode == false)
            {
                colHeader.GetCellInfo(0, ColName.EqpId).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
                colHeader.GetCellInfo(0, ColName.EqpId).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;
            }

            if (SelectViewMode == ToolGantt.ViewMode.SHOP)
            {
                int fromRowIdx = this.IsOnlyToolMode == false ? _startSameEqpRowIdx : _startSameRowKeyIdx;
                MergeRows(fromRowIdx, _gantt.LastRowIndex);
            }

            PaintTotColumnCell();
        }
Exemple #7
0
        private void SetRowHeaderValue(int rowIndex, string lotID)
        {
#if DEBUG
            if (lotID == "FAAA611A5")
            {
            }
#endif
            string curKey    = CommonHelper.CreateKey(lotID /*stepSeq*/);
            var    colHeader = _gantt.ColumnHeader;

            if (_isFirst)
            {
                this.PreLotID       = lotID;
                _preRowKey          = curKey;
                _startSameEqpRowIdx = rowIndex;
                _startSameRowKeyIdx = rowIndex;

                _isFirst = false;
            }

            if (_isFirst == false && lotID.Equals(this.PreLotID) == false)
            {
                //SfGridHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx, ColName.TITotal), _subTotalTI);
                //SfGridHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx, ColName.TOTotal), _subTotalTO);

                _startSameEqpRowIdx = rowIndex;
                _subTotalTI         = 0;
                _subTotalTO         = 0;

                this.PreLotID = lotID;
            }

            if (_isFirst == false && curKey.Equals(_preRowKey) == false)
            {
                MergeRows(_startSameRowKeyIdx, rowIndex - 1);

                Color tmp = _preColor;
                _preColor           = _currColor;
                _currColor          = tmp;
                _preRowKey          = curKey;
                _startSameRowKeyIdx = rowIndex;
            }

            PaintRowKeyedCell(rowIndex, _currColor);

            XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.LotID), lotID);
            //SfGridHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.LotID), lotID);

            colHeader.GetCellInfo(rowIndex, ColName.LotID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
            colHeader.GetCellInfo(rowIndex, ColName.LotID).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;
        }
Exemple #8
0
        private void SetBorder(int fromRowIdx, int toRowIdx)
        {
            var worksheet = this._gantt.Worksheet;
            var color     = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));

            for (int i = fromRowIdx; i <= toRowIdx; i++)
            {
                if (i == fromRowIdx)
                {
                    XtraSheetHelper.SetRowBorderTopLine(worksheet, i, color, BorderLineStyle.Thin);
                }
                else
                {
                    XtraSheetHelper.SetRowBorderTopLine(worksheet, i, Color.Transparent, BorderLineStyle.Thin);
                }

                XtraSheetHelper.SetRowBorderBottomLine(worksheet, i, Color.Transparent);
            }
        }
Exemple #9
0
        void GanttView_BindRowAdding(object sender, GanttRowEventArgs args)
        {
            var worksheet = this._gantt.Worksheet;

            var info      = args.Item as ToolGantt.GanttInfo;
            var colHeader = _gantt.ColumnHeader;

            string shopID = info.ShopID;
            string eqpID  = info.EqpID;
            string toolID = info.ToolID;

            SetRowHeaderValue(args.RowIndex, shopID, eqpID, string.IsNullOrEmpty(args.Key) ? "-" : args.Key, toolID);

            this._rowsumti            = 0;
            this._rowsumto            = 0;
            this._rowsumJobChg        = 0;
            this._rowsumLoadTimeFrBar = 0;

            if (args.Node == null)
            {
                return;
            }

            var rows = args.Node.LinkedBarList;

            if (rows.Count > 1 && args.Index > 0 && args.Index < rows.Count - 1)
            {
                XtraSheetHelper.SetCellText(colHeader.GetCellInfo(args.RowIndex, ColName.ShopID), shopID);
                XtraSheetHelper.SetCellText(colHeader.GetCellInfo(args.RowIndex, ColName.MaskID), toolID);
                if (this.IsOnlyToolMode == false)
                {
                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(args.RowIndex, ColName.EqpId), eqpID);
                }

                PaintRowKeyedCell(args.RowIndex, _currColor);
            }
        }
Exemple #10
0
        private void SetRowHeaderValue(int rowIndex, string shopID, string eqpId, string stepSeq, string toolID)
        {
            if (IsOnlyToolMode)
            {
                string curKey    = toolID;
                var    colHeader = _gantt.ColumnHeader;

                if (_isFirst)
                {
                    _preShopID          = shopID;
                    _preToolID          = toolID;
                    _preEqpID           = eqpId;
                    _preRowKey          = curKey;
                    _startSameEqpRowIdx = rowIndex;
                    _startSameRowKeyIdx = rowIndex;

                    _isFirst = false;
                }

                if (_isFirst == false && toolID.Equals(_preToolID) == false)
                {
                    MergeRows(_startSameEqpRowIdx, rowIndex - 1);
                    _startSameEqpRowIdx = rowIndex;
                }

                if (_isFirst == false && shopID.Equals(_preShopID) == false)
                {
                    MergeRows(_startSameEqpRowIdx, rowIndex - 1);
                    _startSameEqpRowIdx = rowIndex;
                }

                if (_isFirst == false && toolID.Equals(_preToolID) == false)
                {
                    if (_startSameEqpRowIdx > 1)
                    {
                        XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.TotalRun), _subTotalTO);

                        if (this.IsOnlyToolMode == false)
                        {
                            //XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.MaskChangeCnt), _subJobChg);
                        }
                    }

                    _preShopID          = shopID;
                    _preToolID          = toolID;
                    _preEqpID           = eqpId;
                    _startSameEqpRowIdx = rowIndex;
                    _subTotalTI         = 0;
                    _subTotalTO         = 0;
                    _subJobChg          = 0;
                }

                if (_isFirst == false && curKey.Equals(_preRowKey) == false)
                {
                    MergeRows(_startSameRowKeyIdx, rowIndex - 1);

                    Color tmp = _preColor;
                    _preColor  = _currColor;
                    _currColor = tmp;
                    _preRowKey = curKey;
                    //_startSameRowKeyIdx = rowIndex;
                }

                PaintRowKeyedCell(rowIndex, _currColor);

                XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.ShopID), shopID);
                XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.MaskID), toolID);

                if (this.IsOnlyToolMode == false)
                {
                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.EqpId), eqpId);
                }

                _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.ShopID)].SetCellText(shopID);
                colHeader.GetCellInfo(rowIndex, ColName.ShopID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
                colHeader.GetCellInfo(rowIndex, ColName.ShopID).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;

                _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.MaskID)].SetCellText(toolID);

                colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
                colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;

                if (this.IsOnlyToolMode == false)
                {
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;
                }
            }
            else
            {
                string curKey     = eqpId;
                string curToolKey = toolID;
                var    colHeader  = _gantt.ColumnHeader;

                if (_isFirst)
                {
                    _preToolID          = toolID;
                    _preEqpID           = eqpId;
                    _preRowKey          = curKey;
                    _startSameEqpRowIdx = rowIndex;
                    _startSameRowKeyIdx = rowIndex;

                    _isFirst = false;
                }

                if (SelectViewMode == ToolGantt.ViewMode.EQP)
                {
                    if (_isFirst == false && (toolID.Equals(_preToolID) == false || eqpId.Equals(_preEqpID) == false))
                    {
                        MergeRows(_startSameEqpRowIdx, rowIndex - 1);
                        _preToolID          = toolID;
                        _startSameEqpRowIdx = rowIndex;
                    }

                    if (_isFirst == false && eqpId.Equals(_preEqpID) == false)
                    {
                        if (_startSameEqpRowIdx > 1)
                        {
                            string sLoadRate = string.Empty;
                            XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.TotalRun), _subTotalTO);
                        }

                        _preToolID          = toolID;
                        _preEqpID           = eqpId;
                        _startSameEqpRowIdx = rowIndex;
                        _subTotalTI         = 0;
                        _subTotalTO         = 0;
                        _subJobChg          = 0;
                    }

                    if (_isFirst == false && curKey.Equals(_preRowKey) == false)
                    {
                        MergeRows(_startSameRowKeyIdx, rowIndex - 1);

                        Color tmp = _preColor;
                        _preColor           = _currColor;
                        _currColor          = tmp;
                        _preRowKey          = curKey;
                        _startSameRowKeyIdx = rowIndex;
                    }

                    PaintRowKeyedCell(rowIndex, _currColor);

                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.MaskID), toolID);
                    _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.MaskID)].SetCellText(toolID);

                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.EqpId), eqpId);
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Horizontal  = SpreadsheetHorizontalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Vertical    = SpreadsheetVerticalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;
                }

                if (SelectViewMode == ToolGantt.ViewMode.MASK)
                {
                    if (_isFirst == false && (toolID.Equals(_preToolID) == false || eqpId.Equals(_preEqpID) == false))
                    {
                        MergeRows(_startSameEqpRowIdx, rowIndex - 1, 1);
                        _preToolID          = toolID;
                        _preEqpID           = eqpId;
                        _startSameEqpRowIdx = rowIndex;
                    }

                    if (_isFirst == false && eqpId.Equals(_preToolID) == false)
                    {
                        if (_startSameEqpRowIdx > 1)
                        {
                            string sLoadRate = string.Empty;
                            XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.TotalRun), _subTotalTO);
                        }

                        _preToolID          = toolID;
                        _preEqpID           = eqpId;
                        _startSameEqpRowIdx = rowIndex;
                        _subTotalTI         = 0;
                        _subTotalTO         = 0;
                        _subJobChg          = 0;
                    }

                    if (_isFirst == false && curKey.Equals(_preRowKey) == false)
                    {
                        MergeRows(_startSameRowKeyIdx, rowIndex - 1, 1);

                        Color tmp = _preColor;
                        _preColor           = _currColor;
                        _currColor          = tmp;
                        _preRowKey          = curKey;
                        _startSameRowKeyIdx = rowIndex;
                    }

                    PaintRowKeyedCell(rowIndex, _currColor);

                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.MaskID), toolID);
                    _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.MaskID)].SetCellText(toolID);

                    XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.EqpId), eqpId);
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Horizontal  = SpreadsheetHorizontalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Vertical    = SpreadsheetVerticalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
                    colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Vertical   = SpreadsheetVerticalAlignment.Center;
                }
            }
        }