Exemple #1
0
        void GetProcess()
        {
            soDictionary = SortingProgress.GetSortingProcessInfo(taskdate, taskno, SortingLine.GetNonSortingLineCode());
            foreach (Control control in panelEx3.Controls)
            {
                if (control is PanelEx)
                {
                    var panelex = (PanelEx)control as PanelEx;
                    if (panelex.Tag != null)
                    {
                        try
                        {
                            panelex.Text = soDictionary[panelex.Tag.ToString()];
                        }
                        catch (Exception)
                        {
                        }
                    }
                }
            }

            panelEx4.Text = "目标分拣效率15000条/小时,今日平均分拣效率" + soDictionary["EFFICIENCY"];

            panelEx10.Text = "分拣效率  " + soDictionary["EFFICIENCY"];

            progressBarX1.Text    = soDictionary["QTY_PRODUCT"] + "/" + soDictionary["QTY_PRODCUT_TOT"] + "条 - " + soDictionary["Progress"] + "%";
            progressBarX1.Maximum = Convert.ToInt32(soDictionary["QTY_PRODCUT_TOT"]);
            progressBarX1.Value   = Convert.ToInt32(soDictionary["QTY_PRODUCT"]);
        }
Exemple #2
0
        private void customButton1_Click(object sender, EventArgs e)
        {
            soDictionary = null;
            string batch    = null;
            string linecode = null;

            if (!string.IsNullOrEmpty(cobbatch.SelectedValue as string))
            {
                batch = cobbatch.SelectedValue as string;
            }
            if (!string.IsNullOrEmpty(cobSortingLine.SelectedValue as string))
            {
                linecode = cobSortingLine.SelectedValue as string;
            }

            soDictionary = SortingProgress.GetSortingProcessInfo(dateTimeInput1.Value.ToString("yyyy-MM-dd"), batch, linecode);
            foreach (Control control in panelEx2.Controls)
            {
                if (control is LabelX)
                {
                    var labelX = (LabelX)control as LabelX;
                    if (labelX.Tag != null)
                    {
                        try
                        {
                            labelX.Text = soDictionary[labelX.Tag.ToString()];
                        }
                        catch (Exception)
                        {
                        }
                    }
                }
            }


            Thread thread = new Thread(StartProgress);

            thread.Start();
            try
            {
                labProcess.Text = soDictionary["QTY_PRODUCT"] + "/" + soDictionary["QTY_PRODCUT_TOT"] + "条 - " + soDictionary["Progress"] + "%";
            }
            catch
            { }
        }
Exemple #3
0
        private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            try
            {
                //获取当前,上一个,下一个客户的基本信息
                GetOutPortInfo();
                GetPOutPortInfo();
                GetNOutPortInfo();

                //获取平均效率的列表(当天所有打完码的客户)
                List <PrintInfo> printinfos = PrintBarCodes.GetAVGPrintEffice();
                //获取当前效率的列表(现在系统所有打完码的客户)
                List <PrintInfo> cutprintinfos = PrintBarCodes.GetCUTPrintEffice();

                //计算当前效率
                double tzeff = SetEff(cutprintinfos);

                labavgeffice.Text = tzeff.ToString() + "条/小时";

                if (labavgeffice.Text.Contains("非数字"))
                {
                    labavgeffice.Text = "0" + "条/小时";
                }

                using (var cn = new MySqlConnection(AppUtility.AppUtil._LocalConnectionString))
                {
                    cn.Open();
                    using (var cm = cn.CreateCommand())
                    {
                        cm.CommandText = "select MaxcutEFFICIENCY from t_sortline_process WHERE ORDERDATE = '" + SortingLineTask.GetSortingLineTaskDate() + "' AND PICKLINECODE = '" + SortingLine.GetSortingLineCode() + "' AND SORTINGTASKNO = '" + SortingLineTask.GetMinSortingLineTask().SORTINGTASKNO + "'";
                        using (var dr = new SafeDataReader(cm.ExecuteReader()))
                        {
                            while (dr.Read())
                            {
                                labcuteffice.Text = dr.GetDouble("MaxcutEFFICIENCY").ToString() + "条/小时";
                            }
                        }
                    }
                }

                //计算平均效率
                //tzeff = SetEff(printinfos);

                //labavgeffice.Text = tzeff.ToString() + "条/小时";;

                //if (labavgeffice.Text.Contains("非数字"))
                //    labavgeffice.Text = "0" + "条/小时";

                //计算分拣进度
                SortingProgress sortingprogress = SortingProgress.GetSortingTaskProgress();
                prosorting.Maximum = sortingprogress.TotQty;
                prosorting.Value   = sortingprogress.Qty;
                prosorting.Text    = (sortingprogress.Qty + "/" + sortingprogress.TotQty).PadRight(15, ' ') +
                                     Math.Round(
                    Convert.ToDouble(sortingprogress.Qty) / Convert.ToDouble(sortingprogress.TotQty), 3) *
                                     100 + "%";
            }
            catch
            {
            }
        }