Exemple #1
0
        private IList <LoadingMonitorOverviewViewResult> UpdateChartData()
        {
            List <LoadingMonitorOverviewViewResult> tmpData = new List <LoadingMonitorOverviewViewResult>();

            ChartDataValues chartValues = new ChartDataValues();

            int index = 0;

            if (_originalData != null)
            {
                foreach (LoadingMonitorOverviewViewResult data in _originalData)
                {
                    if (data.TimeStamp == null)
                    {
                        chartValues.SetLaggingValues(data);

                        continue;
                    }

                    index++;

                    if (index == 1)
                    {
                        chartValues.SetDateTimeForNewTimeSlot(data.TimeStamp.GetValueOrDefault());

                        chartValues.LoadSaldoToNewTimeSlot(data);
                    }


                    chartValues.IncValuesInTimeSlot(data);

                    chartValues.RecalcSaldoInTimeSlot(data);

                    if (index == _duration)
                    {
                        //chartValues.CalcBurnDown();

                        LoadingMonitorOverviewViewResult newData = new LoadingMonitorOverviewViewResult();

                        newData.NoCars = Math.Round(chartValues.noCars);
                        newData.Weight = chartValues.weight;
                        newData.Volume = chartValues.volume;

                        newData.NoCarsLate = Math.Round(chartValues.noCarsLate);
                        newData.WeightLate = chartValues.weightLate;
                        newData.VolumeLate = chartValues.volumeLate;

                        newData.NoUsersInc     = chartValues.noUsersCapacity;
                        newData.NoCarsCapacity = Math.Round(chartValues.noCarsCapacity);
                        newData.WeightCapacity = chartValues.weightCapacity;
                        newData.VolumeCapacity = chartValues.volumeCapacity;

                        //newData.NoCarsCapacityDec = chartValues.noCarsBurnDown == 0 ? null : (decimal?)chartValues.noCarsBurnDown;
                        //newData.WeightCapacityDec = chartValues.weightBurnDown == 0 ? null : (decimal?)chartValues.weightBurnDown;
                        //newData.VolumeCapacityDec = chartValues.volumeBurnDown == 0 ? null : (decimal?)chartValues.volumeBurnDown;

                        newData.TimeStamp    = chartValues.date;
                        newData.TimeSpanText = chartValues.date.ToString("HH:mm") + "-" + chartValues.date.AddMinutes((_duration - 1)).ToString("HH:mm") + "\r" + chartValues.date.ToString("dd MMM");

                        tmpData.Add(newData);

                        chartValues.ResetValues();

                        index = 0;
                    }
                }
            }

            try
            {
                if (tmpData.Count > 0)
                {
                    LoadingMonitorOverviewViewResult laggingWork = new LoadingMonitorOverviewViewResult();

                    laggingWork.TimeStamp    = tmpData[0].TimeStamp.GetValueOrDefault().AddMinutes(-_duration);
                    laggingWork.TimeSpanText = "<";

                    LoadingMonitorOverviewViewResult laggingWorkDummy = new LoadingMonitorOverviewViewResult();

                    laggingWorkDummy.TimeStamp    = laggingWork.TimeStamp;
                    laggingWorkDummy.TimeSpanText = "<";

                    tmpData.Insert(0, laggingWorkDummy);

                    laggingWork.NoCarsLate = chartValues.LaggingCars;
                    laggingWork.WeightLate = chartValues.Laggingweight;
                    laggingWork.VolumeLate = chartValues.Laggingvolume;

                    laggingSerie.ValueBinding = new Telerik.Windows.Controls.ChartView.PropertyNameDataPointBinding()
                    {
                        PropertyName = _valueBinding + "Late"
                    };

                    laggingSerie.ItemsSource = new LoadingMonitorOverviewViewResult[] { laggingWork };


                    workloadSerie.ValueBinding = new Telerik.Windows.Controls.ChartView.PropertyNameDataPointBinding()
                    {
                        PropertyName = _valueBinding
                    };
                    workloadLateSerie.ValueBinding = new Telerik.Windows.Controls.ChartView.PropertyNameDataPointBinding()
                    {
                        PropertyName = _valueBinding + "Late"
                    };
                    _capacitySerie.ValueBinding = new Telerik.Windows.Controls.ChartView.PropertyNameDataPointBinding()
                    {
                        PropertyName = _valueBinding + "Capacity"
                    };
                    //_burndownSerie.ValueBinding = new Telerik.Windows.Controls.ChartView.PropertyNameDataPointBinding() { PropertyName = _valueBinding.Substring(0, _valueBinding.Length - 3) + "CapacityDec" };

                    //_burndownSerie.ItemsSource = tmpData;
                    _capacitySerie.ItemsSource    = tmpData;
                    workloadSerie.ItemsSource     = tmpData;
                    workloadLateSerie.ItemsSource = tmpData;

                    tmpData.RemoveAt(0);
                }
                else
                {
                    //_burndownSerie.ItemsSource = null;
                    laggingSerie.ItemsSource      = null;
                    _capacitySerie.ItemsSource    = null;
                    workloadSerie.ItemsSource     = null;
                    workloadLateSerie.ItemsSource = null;
                }
            }
            catch (Exception ex)
            {
            }

            return(tmpData);
        }
Exemple #2
0
        private IList <MovementMonitorOverviewViewResult> UpdateChartData()
        {
            List <MovementMonitorOverviewViewResult> tmpData = new List <MovementMonitorOverviewViewResult>();

            ChartDataValues chartValues = new ChartDataValues();

            int index = 0;

            if (_originalData != null)
            {
                foreach (MovementMonitorOverviewViewResult data in _originalData)
                {
                    if (data.TimeStamp == null)
                    {
                        chartValues.SetLaggingValues(data);

                        continue;
                    }

                    index++;

                    if (index == 1)
                    {
                        chartValues.SetDateTimeForNewTimeSlot(data.TimeStamp.GetValueOrDefault());

                        chartValues.LoadSaldoToNewTimeSlot(data);
                    }


                    chartValues.IncValuesInTimeSlot(data);

                    chartValues.RecalcSaldoInTimeSlot(data);

                    if (index == _duration)
                    {
                        MovementMonitorOverviewViewResult newData = new MovementMonitorOverviewViewResult();

                        newData.NoTrpAssInc = chartValues.noTrpAss;

                        newData.NoTrpAssLateInc = chartValues.noTrpAssLate;

                        newData.NoLiftTruksCapacityInc = chartValues.noLiftTruksCapacity;


                        newData.TimeStamp    = chartValues.date;
                        newData.TimeSpanText = chartValues.date.ToString("HH:mm") + "-" + chartValues.date.AddMinutes((_duration - 1)).ToString("HH:mm") + "\r" + chartValues.date.ToString("dd MMM");

                        tmpData.Add(newData);

                        chartValues.ResetValues();

                        index = 0;
                    }
                }
            }

            try
            {
                if (tmpData.Count > 0)
                {
                    MovementMonitorOverviewViewResult laggingWork = new MovementMonitorOverviewViewResult();

                    laggingWork.TimeStamp    = tmpData[0].TimeStamp.GetValueOrDefault().AddMinutes(-_duration);
                    laggingWork.TimeSpanText = "<";

                    MovementMonitorOverviewViewResult laggingWorkDummy = new MovementMonitorOverviewViewResult();

                    laggingWorkDummy.TimeStamp    = laggingWork.TimeStamp;
                    laggingWorkDummy.TimeSpanText = "<";

                    tmpData.Insert(0, laggingWorkDummy);

                    laggingWork.NoTrpAssLateInc = chartValues.LaggingTrpAss;

                    laggingSerie.ItemsSource = new MovementMonitorOverviewViewResult[] { laggingWork };

                    _capacitySerie.ItemsSource    = tmpData;
                    workloadSerie.ItemsSource     = tmpData;
                    workloadLateSerie.ItemsSource = tmpData;

                    tmpData.RemoveAt(0);
                }
                else
                {
                    laggingSerie.ItemsSource      = null;
                    _capacitySerie.ItemsSource    = null;
                    workloadSerie.ItemsSource     = null;
                    workloadLateSerie.ItemsSource = null;
                }
            }
            catch (Exception ex)
            {
            }

            return(tmpData);
        }
Exemple #3
0
        private IList <PickPaceMonitorOverviewViewResult> UpdateChartData()
        {
            List <PickPaceMonitorOverviewViewResult> tmpData = new List <PickPaceMonitorOverviewViewResult>();


            ChartDataValues chartValues = new ChartDataValues();

            int index = 0;

            if (_originalData != null)
            {
                foreach (PickPaceMonitorOverviewViewResult data in _originalData)
                {
                    if (data.TimeStamp == null)
                    {
                        chartValues.SetRemaningValues(data);
                        continue;
                    }

                    index++;

                    if (index == 1)
                    {
                        chartValues.SetDateTimeForNewTimeSlot(data.TimeStamp.GetValueOrDefault());
                    }


                    chartValues.IncValuesInTimeSlot(data);


                    if (index == (_duration / 5))
                    {
                        chartValues.ReCalculateValuesInTimeSlot();

                        PickPaceMonitorOverviewViewResult newData = new PickPaceMonitorOverviewViewResult();

                        newData.PickedQuantity = (chartValues.pickedQty != null ? (decimal?)Math.Round(chartValues.pickedQty.GetValueOrDefault(), 2) : null);
                        newData.Weight         = (chartValues.weight != null ? (decimal?)Math.Round(chartValues.weight.GetValueOrDefault(), 2) : null);
                        newData.Volume         = (chartValues.volume != null ? (decimal?)Math.Round(chartValues.volume.GetValueOrDefault(), 2) : null);

                        newData.AveragePickedQuantity = (chartValues.avgPickedQty != null ? (decimal?)Math.Round(chartValues.avgPickedQty.GetValueOrDefault(), 2) : null);
                        newData.AverageWeight         = (chartValues.avgWeight != null ? (decimal?)Math.Round(chartValues.avgWeight.GetValueOrDefault(), 2) : null);
                        newData.AverageVolume         = (chartValues.avgVolume != null ? (decimal?)Math.Round(chartValues.avgVolume.GetValueOrDefault(), 2) : null);

                        newData.LongTimeAvgPickedQuantity = data.LongTimeAvgPickedQuantity;
                        newData.LongTimeAvgWeight         = data.LongTimeAvgWeight;
                        newData.LongTimeAvgVolume         = data.LongTimeAvgVolume;

                        newData.TimeStamp    = chartValues.date;
                        newData.TimeSpanText = chartValues.date.ToString("HH:mm") + "-" + chartValues.date.AddMinutes((_duration)).ToString("HH:mm") + "\r" + chartValues.date.ToString("dd MMM");

                        tmpData.Add(newData);

                        chartValues.ResetValues();

                        index = 0;
                    }
                }

                chartValues.CalcPreliminaryEndTime(_duration, _valueBinding);
            }

            try
            {
                if (tmpData.Count > 0)
                {
                    pickPaceSerie.ValueBinding = new Telerik.Windows.Controls.ChartView.PropertyNameDataPointBinding()
                    {
                        PropertyName = _valueBinding
                    };

                    avgPickPaceSerie.ValueBinding = new Telerik.Windows.Controls.ChartView.PropertyNameDataPointBinding()
                    {
                        PropertyName = "Average" + _valueBinding
                    };

                    longTimeAvgpickPaceSerie.ValueBinding = new Telerik.Windows.Controls.ChartView.PropertyNameDataPointBinding()
                    {
                        PropertyName = "LongTimeAvg" + _valueBinding
                    };

                    pickPaceSerie.ItemsSource            = tmpData;
                    avgPickPaceSerie.ItemsSource         = tmpData;
                    longTimeAvgpickPaceSerie.ItemsSource = tmpData;

                    if (chartValues.lastDate.Date == DateTime.Now.Date) //Show remaining only if last value is today.
                    {
                        RemainingText.Text     = Math.Round(chartValues.remaining, 2).ToString();
                        RemainingTimeText.Text = chartValues.estFinishTime.ToString("t");
                    }
                    else
                    {
                        RemainingText.Text     = string.Empty;
                        RemainingTimeText.Text = string.Empty;
                    }
                }
                else
                {
                    pickPaceSerie.ItemsSource            = null;
                    avgPickPaceSerie.ItemsSource         = null;
                    longTimeAvgpickPaceSerie.ItemsSource = null;

                    RemainingText.Text     = string.Empty;
                    RemainingTimeText.Text = string.Empty;
                }
            }
            catch (Exception ex)
            {
            }

            return(tmpData);
        }