Beispiel #1
0
        private void btnGroupingLabel_Click(object sender, System.EventArgs e)
        {
            if (!_referenceData.IsLoaded)
            {
                return;
            }
            if (_groupingLabel == null)
            {
                _groupingLabel = new CodeSoftLabel(LabelType.Group, Settings, _referenceData.Reference);
                _groupingLabel.InitMine();
            }

            _groupingLabel.Show();
            _groupingLabel.BringToFront();
        }
Beispiel #2
0
        private void ReferenceDataOnReferenceDataIsLoaded(ReferenceModel model)
        {
            lblGroupSize.Text = model.QuantityGroup.ToString("000");
            txtArticle.Text   = model.ArticleNumber;
            txtEan13.Text     = Ean13.CalculateChecksumDigit(model.ArticleNumber);

            _groupingLabel = new CodeSoftLabel(LabelType.Group, Settings, _referenceData.Reference);
            _groupingLabel.InitMine();
            _individualLabel = new CodeSoftLabel(LabelType.Individual, Settings, _referenceData.Reference);
            _individualLabel.InitMine();


            docGroupPrev.Image = _groupingLabel.ResizeIfNeeded(_groupingLabel.RealSizeImage, docGroupPrev.Width,
                                                               docGroupPrev.Height);
            docIndiPrev.Image = _individualLabel.ResizeIfNeeded(_individualLabel.RealSizeImage, docIndiPrev.Width,
                                                                docIndiPrev.Height);
            try
            {
                if (_weighingStation != null)
                {
                    _weighingStation.WeighingDataUpdated  -= WeighingStationOnWeighingDataUpdated;
                    _weighingStation.WeighingDataInRange  -= WeighingStationOnWeighingDataInRange;
                    _weighingStation.WeighingDataOutRange -= WeighingStationOnWeighingDataOutRange;
                    _weighingStation.WeighingBoxRemoved   -= WeighingStationOnWeighingBoxRemoved;
                }
            }
            finally
            {
                _weighingStation = new Weighing(Settings, _referenceData.Reference);
                _weighingStation.WeighingDataUpdated  += WeighingStationOnWeighingDataUpdated;
                _weighingStation.WeighingDataInRange  += WeighingStationOnWeighingDataInRange;
                _weighingStation.WeighingDataOutRange += WeighingStationOnWeighingDataOutRange;
                _weighingStation.WeighingBoxRemoved   += WeighingStationOnWeighingBoxRemoved;
                lblHighLimit.Text = _weighingStation.UpperWeightPerBox.ToString("00000");
                lblLowLimit.Text  = _weighingStation.LowerWeightPerBox.ToString("00000");
            }
        }