Ejemplo n.º 1
0
        private void UpdateJobInfoTextWith(int percent)
        {
            TimeSpan time          = DateTime.Now - m_StartTime;
            string   strTime       = time.Hours.ToString() + ":" + time.Minutes.ToString() + ":" + time.Seconds.ToString();
            string   strPercentage = percent.ToString() + "%";

            string unitStr   = ResString.GetUnitSuffixDispName(UILengthUnit.Meter);
            string strArea   = (m_fArea * percent / 100.0f).ToString() + " " + unitStr + "2";
            float  efficient = 0;

            if (time.TotalSeconds != 0)
            {
                efficient = (float)(m_fArea * percent / 100.0f) / (float)time.TotalHours;
            }
            string strEff = efficient.ToString() + " " + unitStr + "2/h";

            //this.m_LabelPrintingJobInfo.Text = strTime
            //+ "\n" + strPercentage
            //+ "\n" + strArea
            //+ "\n" + strEff
            //+ "\n" + m_sJobInfo;
            this.labelstrTime.Text       = strTime;
            this.labelstrPercentage.Text = strPercentage;
            this.labelstrArea.Text       = strArea;
            this.labelstrEff.Text        = strEff;
        }
Ejemplo n.º 2
0
        public void SaveDataBase(int percent)
        {
            string printInfo = "";
            string JobName   = "";

            if (CoreInterface.PrintType == 1)//喷检
            {
                printInfo = "打印测试条";
                JobName   = "测试条";
            }
            else if (CoreInterface.PrintType == 2)//校准
            {
                printInfo = "打印校准";
                JobName   = "校准";
            }
            else if (CoreInterface.PrintType == 0)
            {
                TimeSpan time          = DateTime.Now - m_StartTime;
                string   strTime       = time.Hours.ToString() + ":" + time.Minutes.ToString() + ":" + time.Seconds.ToString();
                string   strPercentage = percent.ToString() + "%";
                string   strLengthProg = "";

                string unitStr = ResString.GetUnitSuffixDispName(UILengthUnit.Meter);
                string strArea = (m_fArea * percent / 100.0f).ToString() + " " + unitStr + "2";
                strLengthProg = (m_fLength * percent / 100.0f).ToString() + " " + unitStr;

                float efficient        = 0;
                float efficient_Length = 0;
                if (time.TotalSeconds != 0)
                {
                    efficient        = (float)(m_fArea * percent / 100.0f) / (float)time.TotalHours;
                    efficient_Length = (float)(m_fLength * percent / 100.0f) / (float)time.TotalHours;
                }
                string strEff      = efficient.ToString() + " " + unitStr + "2/h";
                string strLengthPh = efficient_Length.ToString() + " " + unitStr + "/h";


                //插入数据库
                printInfo = strPercentage + " 打印长度:" + strLengthProg + " 打印面积:" + strArea + " 产能:" + strEff;
                JobName   = m_curJob != null ? m_curJob.Name : "";
            }

            string sql = "Insert into AreaData(JobName,BeginTime,PrintInfo) values('" + JobName + "','" + CoreInterface.JobBegin.ToString("s") + "','" + printInfo + "')";

            DataBase DB = new DataBase();

            if (DB.OpenDB())
            {
                DB.ExecSQL(sql);
                DB.CloseDB();
            }
        }
Ejemplo n.º 3
0
        public string GetJobSize(float xRes, float yRes, Size jobSize, UIPreference options)
        {
            float width  = 0;
            float height = 0;

            if (xRes != 0)
            {
                width = options.ToDisplayLength((float)jobSize.Width / xRes);
            }
            if (yRes != 0)
            {
                height = options.ToDisplayLength((float)jobSize.Height / yRes);
            }

            return(width.ToString("f2") + "x" + height.ToString("f2") + " " + ResString.GetUnitSuffixDispName(options.Unit));
        }
Ejemplo n.º 4
0
        public string GetJobSize(float xRes, float yRes, Size jobSize)
        {
            float width  = 0;
            float height = 0;

            if (xRes != 0)
            {
                width = (float)jobSize.Width / xRes;
            }
            if (yRes != 0)
            {
                height = (float)jobSize.Height / yRes;
            }

            return(width.ToString("f2") + "x" + height.ToString("f2") + " " + ResString.GetUnitSuffixDispName(UILengthUnit.Inch));
        }
Ejemplo n.º 5
0
        private void UpdateJobInfoTextWith(int percent)
        {
            TimeSpan time          = DateTime.Now - m_StartTime;
            string   strTime       = time.Hours.ToString() + ":" + time.Minutes.ToString() + ":" + time.Seconds.ToString();
            string   strPercentage = percent.ToString() + "%";

            string unitStr   = ResString.GetUnitSuffixDispName(UILengthUnit.Meter);
            string strArea   = (m_fArea * percent / 100.0f).ToString() + " " + unitStr + "2";
            float  efficient = 0;

            if (time.TotalSeconds != 0)
            {
                efficient = (float)(m_fArea * percent / 100.0f) / (float)time.TotalHours;
            }
            string strEff = efficient.ToString() + " " + unitStr + "2/h";
            string sjobId = "JobID:";

            if (PubFunc.Is3DPrintMachine())
            {
                sjobId = ResString.GetResString("JobID3D");
            }
            if (m_bJobIDVisible)
            {
                this.m_LabelPrintingJobInfo.Text = strTime
                                                   + "\n" + strPercentage
                                                   + "\n" + strArea
                                                   + "\n" + strEff
                                                   + "\n" + sjobId + m_JobID.ToString()
                                                   + "\n" + m_sJobInfo;
            }
            else
            {
                this.m_LabelPrintingJobInfo.Text = strTime
                                                   + "\n" + strPercentage
                                                   + "\n" + strArea
                                                   + "\n" + strEff
                                                   + "\n" + m_sJobInfo;
            }
        }
Ejemplo n.º 6
0
        private void UpdateJobInfoText(UILengthUnit unit, float width, float height, int resX, int resY,
                                       int deep, int passnum, int direction, string filepath, int LangID)
        {
            string unitStr = ResString.GetUnitSuffixDispName(unit);
            string pass    = ResString.GetDisplayPass();

            string strSize = string.Format("{0}x{1} {2}",
                                           UIPreference.ToDisplayLength(unit, width).ToString("f1"),
                                           UIPreference.ToDisplayLength(unit, height).ToString("f1"), unitStr);

            width   = this.CalcRealJobWidth(unit, width);
            m_fArea = UIPreference.ToDisplayLength(UILengthUnit.Meter, width) * UIPreference.ToDisplayLength(UILengthUnit.Meter, height);

            string strRes = string.Format("{0}x{1}",
                                          (resX),
                                          (resY));

            string strDeep;

            if (1 == deep)
            {
                strDeep = "Normal";
            }
            else
            {
                strDeep = "High Quality";
            }


            string strPass = string.Format("{0} {1}", passnum, pass);
            string strDir  = ResString.GetEnumDisplayName(typeof(PrintDirection), (PrintDirection)direction);
            string sLangID = "";

            if (LangID != 0xffff)
            {
                try
                {
                    foreach (CultureInfo cInfo in CultureInfo.GetCultures(CultureTypes.AllCultures))
                    {
                        if (cInfo.LCID == LangID)
                        {
                            sLangID = cInfo.EnglishName;
                            break;
                        }
                    }
                }
                catch (Exception)
                {
                    sLangID = "";
                }
            }
            //DisplayName EnglishName
            m_sJobInfo =
                strSize
                + "\n" + strRes
                + "\n" + strDeep
                + "\n" + strPass
                + "\n" + strDir
                + "\n" + sLangID
                + "\n" + filepath;

            unitStr = ResString.GetUnitSuffixDispName(UILengthUnit.Meter);
            string strEff    = string.Empty;
            float  efficient = 0;

            if (m_spendTime.TotalSeconds != 0)
            {
                efficient = (float)(m_fArea) / (float)m_spendTime.TotalHours;
            }
            if (efficient > 0)
            {
                strEff = efficient.ToString() + " " + unitStr + "2/h";
            }
            this.m_LabelPrintingJobInfo.Text = strEff + "\n" + m_sJobInfo;
        }
Ejemplo n.º 7
0
        private string GetRealNoteText(JobClip jobclip, SPrinterSetting?ss = null, bool bGetBound = false)
        {
            if (!string.IsNullOrEmpty(realNoteText))
            {
                return(realNoteText);
            }
            string text = string.Empty;

            if (jobclip.AddtionInfoMask != 0)
            {
                int resolutionX = jobclip.PrtFileInfo.sFreSetting.nResolutionX * jobclip.PrtFileInfo.sImageInfo.nImageResolutionX;
                int resolutionY = jobclip.PrtFileInfo.sFreSetting.nResolutionY * jobclip.PrtFileInfo.sImageInfo.nImageResolutionY;
                if ((jobclip.AddtionInfoMask & 0x00001) > 0)        //JobSize
                {
                    UILengthUnit unit    = UILengthUnit.Centimeter; //将图片尺寸单位改为厘米
                    string       unitStr = ResString.GetUnitSuffixDispName(unit);
                    float        width   = 0;
                    float        height  = 0;
                    if (bGetBound)
                    {
                        width  = (float)jobclip.PrtFileInfo.sImageInfo.nImageWidth / (float)(jobclip.PrtFileInfo.sFreSetting.nResolutionX);
                        height = (float)jobclip.PrtFileInfo.sImageInfo.nImageHeight / (float)(jobclip.PrtFileInfo.sFreSetting.nResolutionY);
                    }
                    else
                    {
                        width  = (float)JobSize.Width / (float)resolutionX;
                        height = (float)JobSize.Height / (float)resolutionY;
                    }
                    string strSize = string.Format("{0}x{1} {2}",
                                                   UIPreference.ToDisplayLength(unit, width).ToString("f1"),
                                                   UIPreference.ToDisplayLength(unit, height).ToString("f1"), unitStr);
                    text += "\n" + strSize;
                }
                if ((jobclip.AddtionInfoMask & 0x00010) > 0)               //Resolution
                {
                    string strRes = string.Format("{0}x{1}",
                                                  (resolutionX),
                                                  (resolutionY));
                    text += "\n" + strRes;
                }
                if ((jobclip.AddtionInfoMask & 0x00100) > 0)                    //PassNum
                {
                    string strPass = string.Format("{0} {1}", jobclip.PrtFileInfo.sFreSetting.nPass, ResString.GetDisplayPass());
                    if (ss.HasValue)
                    {
                        strPass = string.Format("{0} {1}", ss.Value.sFrequencySetting.nPass, ResString.GetDisplayPass());
                    }
                    text += "\n" + strPass;
                }
                if ((jobclip.AddtionInfoMask & 0x01000) > 0)               //Direction
                {
                    string strDir = ResString.GetEnumDisplayName(typeof(PrintDirection), (PrintDirection)jobclip.PrtFileInfo.sFreSetting.nBidirection);
                    if (ss.HasValue)
                    {
                        strDir = ResString.GetEnumDisplayName(typeof(PrintDirection), (PrintDirection)ss.Value.sFrequencySetting.nBidirection);
                    }
                    text += "\n" + strDir;
                }
                if ((jobclip.AddtionInfoMask & 0x10000) > 0)                     //Filepath
                {
                    text += "\n" + jobclip.src;
                }
                if ((jobclip.AddtionInfoMask & 0x100000) > 0)             //Voltage&pluseWidth
                {
                    text += GetRealtimeInfoString();
                }
            }
            if (jobclip.Note != null && jobclip.Note != string.Empty)
            {
                text += "\n" + jobclip.Note;
            }
            return(text);
        }
Ejemplo n.º 8
0
        private void UpdateJobInfoTextWith(int percent)
        {
            //为空时,不计算
            try
            {
                if (m_curJob == null)
                {
                    return;
                }
                TimeSpan time = CalcuPrintTime.Elapsed;                                                                       // DateTime.Now - m_StartTime;
                m_curJob.AllCopiesTime = m_curJob.UsedTime + new TimeSpan(time.Days, time.Hours, time.Minutes, time.Seconds); //精确到秒,去掉毫秒
                string strTime       = time.Hours.ToString() + ":" + time.Minutes.ToString() + ":" + time.Seconds.ToString();
                string strPercentage = percent.ToString() + "%";

                string unitStr = ResString.GetUnitSuffixDispName(UILengthUnit.Meter);
                if (m_curUnit == UILengthUnit.Feet || m_curUnit == UILengthUnit.Inch)
                {
                    unitStr = ResString.GetUnitSuffixDispName(m_curUnit);
                }
                string strArea = (m_fArea * percent / 100.0f).ToString() + " " + unitStr + "²";
                if (m_IsLengthProgress)
                {
                    strArea = (m_fLength * percent / 100.0f).ToString() + " " + unitStr;
                }
                float efficient        = 0;
                float efficient_Length = 0;
                if (time.TotalSeconds != 0)
                {
                    efficient        = (float)(m_fArea * percent / 100.0f) / (float)time.TotalHours;
                    efficient_Length = (float)(m_fLength * percent / 100.0f) / (float)time.TotalHours;
                }
                string strEff = efficient.ToString() + " " + unitStr + "²/h";
                if (m_IsLengthProgress)
                {
                    strEff = efficient_Length.ToString() + " " + unitStr + "/h";
                }
                string sjobId = "JobID:";
                if (PubFunc.Is3DPrintMachine())
                {
                    sjobId = ResString.GetResString("JobID3D");
                }
                if (m_bJobIDVisible)
                {
                    this.m_LabelPrintingJobInfo.Text = strTime
                                                       + "\n" + strPercentage
                                                       + "\n" + strArea
                                                       + "\n" + strEff
                                                       + "\n" + sjobId + m_JobID.ToString()
                                                       + "\n" + m_sJobInfo;
                }
                else
                {
                    this.m_LabelPrintingJobInfo.Text = strTime
                                                       + "\n" + strPercentage
                                                       + "\n" + strArea
                                                       + "\n" + strEff
                                                       + "\n" + m_sJobInfo;
                }
            }
            catch (Exception ex)
            {
                LogWriter.SaveOptionLog("Msg:" + ex.StackTrace);
            }
        }
Ejemplo n.º 9
0
        private void UpdateJobInfoText(UILengthUnit unit, float width, float height, int resX, int resY,
                                       int deep, int passnum, int direction, string filepath, int LangID)
        {
            if (m_curJob != null && m_curJob.IsHeight)
            {
                height = m_curJob.SetHeight;
            }

            string unitStr = ResString.GetUnitSuffixDispName(unit);
            string pass    = ResString.GetDisplayPass();

            string strSize = string.Format("{0}x{1} {2}",
                                           UIPreference.ToDisplayLength(unit, width).ToString("f2"),
                                           UIPreference.ToDisplayLength(unit, height).ToString("f2"), unitStr);

//			width = this.CalcRealJobWidth(unit,width);
            m_fArea   = UIPreference.ToDisplayLength(UILengthUnit.Meter, width) * UIPreference.ToDisplayLength(UILengthUnit.Meter, height);
            m_fLength = UIPreference.ToDisplayLength(UILengthUnit.Meter, height);
            if (m_curUnit == UILengthUnit.Feet || m_curUnit == UILengthUnit.Inch)
            {
                m_fArea   = UIPreference.ToDisplayLength(unit, width) * UIPreference.ToDisplayLength(unit, height);
                m_fLength = UIPreference.ToDisplayLength(unit, height);
            }
            string strRes = string.Format("{0}x{1}",
                                          (resX),
                                          (resY));

            string strDeep;

            if (1 == deep)
            {
                strDeep = "Binary";           //"Normal";
            }
            else
            {
                strDeep = "Grayscale";           //"High Quality";
            }


            string strPass = string.Format("{0} {1}", passnum, pass);
            string strDir  = ResString.GetEnumDisplayName(typeof(PrintDirection), (PrintDirection)direction);
            string sLangID = "";

            if (LangID != 0xffff)
            {
                try
                {
                    foreach (CultureInfo cInfo in CultureInfo.GetCultures(CultureTypes.AllCultures))
                    {
                        if (cInfo.LCID == LangID)
                        {
                            sLangID = cInfo.EnglishName;
                            break;
                        }
                    }
                }
                catch (Exception)
                {
                    sLangID = "";
                }
            }
            //DisplayName EnglishName

            this.m_LabelPrintingJobInfo.Text =
                m_sJobInfo =
                    strSize
                    + "\n" + strRes
                    + "\n" + strDeep
                    + "\n" + strPass
                    + "\n" + strDir
                    + "\n" + sLangID;
            crystalLabel1.Text = filepath;
        }
Ejemplo n.º 10
0
        private void UpdateJobInfoText(UILengthUnit unit, float width, float height, int resX, int resY,
                                       int deep, int passnum, int direction, string filepath, int LangID)
        {
            string unitStr = ResString.GetUnitSuffixDispName(unit);
            string pass    = ResString.GetDisplayPass();

            string strSize = string.Format("{0}x{1} {2}",
                                           UIPreference.ToDisplayLength(unit, width).ToString("f1"),
                                           UIPreference.ToDisplayLength(unit, height).ToString("f1"), unitStr);

            width   = this.CalcRealJobWidth(unit, width);
            m_fArea = UIPreference.ToDisplayLength(UILengthUnit.Meter, width) * UIPreference.ToDisplayLength(UILengthUnit.Meter, height);

            string strRes = string.Format("{0}x{1}",
                                          (resX),
                                          (resY));

            string strDeep;

            if (1 == deep)
            {
                strDeep = "Normal";
            }
            else
            {
                strDeep = "High Quality";
            }


            string strPass = string.Format("{0} {1}", passnum, pass);
            string strDir  = ResString.GetEnumDisplayName(typeof(PrintDirection), (PrintDirection)direction);
            string sLangID = "";

            if (LangID != 0xffff)
            {
                try
                {
                    foreach (CultureInfo cInfo in CultureInfo.GetCultures(CultureTypes.AllCultures))
                    {
                        if (cInfo.LCID == LangID)
                        {
                            sLangID = cInfo.EnglishName;
                            break;
                        }
                    }
                }
                catch (Exception)
                {
                    sLangID = "";
                }
            }
            //DisplayName EnglishName

            //this.m_LabelPrintingJobInfo.Text=
            //    m_sJobInfo=
            //    strSize
            //    + "\n" + strRes
            //    + "\n" + strDeep
            //    + "\n" + strPass
            //    + "\n" + strDir
            //    + "\n" + sLangID
            //    + "\n" + filepath;
            this.labelstrSize.Text  = strSize;
            this.labelstrRes.Text   = strRes;
            this.labelstrDeep.Text  = strDeep;
            this.labelstrPass.Text  = strPass;
            this.labelstrDir.Text   = strDir;
            this.labelsLangID.Text  = sLangID;
            this.labelfilepath.Text = filepath;
        }