Example #1
0
        private void buttonVerify_Click(object sender, EventArgs e)
        {
            string     idversion  = string.Empty;
            SBoardInfo sBoardInfo = new SBoardInfo();

            if (CoreInterface.GetBoardInfo(0, ref sBoardInfo) != 0)
            {
                //idversion = sBoardInfo.m_nBoardSerialNum.ToString();
                idversion = sBoardInfo.m_nBoardManufatureID.ToString("X4") + sBoardInfo.m_nBoardProductID.ToString("X4");
            }
            else
            {
                this.labelMSG.Visible = true;
                this.labelMSG.Image   = SystemIcons.Error.ToBitmap();
                this.labelMSG.Text    = SErrorCode.GetEnumDisplayName(typeof(COMCommand_Abort), COMCommand_Abort.IllegalPwd);
                return;
            }
            if (idversion.ToUpper() == this.textBox1.Text.Trim().ToUpper())
            {
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                this.labelMSG.Visible = true;
                this.labelMSG.Image   = SystemIcons.Error.ToBitmap();
                this.labelMSG.Text    = SErrorCode.GetEnumDisplayName(typeof(COMCommand_Abort), COMCommand_Abort.IllegalPwd);
            }
        }
Example #2
0
        public void OnPrinterStatusChanged(JetStatusEnum status)
        {
            UpdateButtonStates(status);
            SetPrinterStatusChanged(status);
            if (status == JetStatusEnum.Error)
            {
                OnErrorCodeChanged(CoreInterface.GetBoardError());

                int        errorCode  = CoreInterface.GetBoardError();
                SErrorCode sErrorCode = new SErrorCode(errorCode);
                if (SErrorCode.IsOnlyPauseError(errorCode))
                {
                    string errorInfo = SErrorCode.GetInfoFromErrCode(errorCode);

                    if (
                        MessageBox.Show(errorInfo, ResString.GetProductName(), MessageBoxButtons.RetryCancel,
                                        MessageBoxIcon.Exclamation) == DialogResult.Retry)
                    {
                        CoreInterface.Printer_Resume();
                    }
                }
            }
            else
            {
                OnErrorCodeChanged(0);
            }
            if (status != JetStatusEnum.PowerOff && status != JetStatusEnum.Initializing && m_IsFATAL == false)
            {
                if (SPrinterProperty.IsGongZeng() || SPrinterProperty.IsDocanPrintMode() || SPrinterProperty.IsRuiZhi()) // 此功能按 厂商限定
                {
                    byte[]           infos = new byte[19];
                    BYHX_SL_RetValue ret   = BYHXSoftLock.GetDongleInfo(ref infos);
                    if (ret == BYHX_SL_RetValue.SUCSESS)
                    {
                        byte[] dtV = new byte[4];
                        Buffer.BlockCopy(infos, 4, dtV, 0, dtV.Length);
                        uint boardId = BitConverter.ToUInt32(dtV, 0);
                        if (CoreInterface.IsFatal(boardId))
                        {
                            m_IsFATAL = true;
                        }
                    }
                }
                else
                {
                    m_IsFATAL = true;
                }
            }
        }
        public void printJobInfomation(int mSErrorCode, UserLevel Level, string errStr)
        {
            if (mSErrorCode == 0)
            {
                this.labelMsg.Text = string.Empty;                 //清空错误信息
            }
            else
            {
                this.labelMsg.Text = errStr;
            }

            SErrorCode err = new SErrorCode(mSErrorCode);

            if (Level != getUserLevel() ||
                this.labelMsg.Text == "" ||
                err.nErrorAction == (byte)ErrorAction.Init
                )
            {
                return;
            }
            if (mErrorlistForm != null)
            {
                Color textC = Color.Red;
                if (SErrorCode.IsOnlyPauseError(mSErrorCode))
                {
                    labelMsg.ImageIndex      = 1;
                    this.tabPage1.ImageIndex = 1;
                    textC = Color.Green;
                }
                else if (SErrorCode.IsWarningError(mSErrorCode))
                {
                    labelMsg.ImageIndex      = 3;
                    this.tabPage1.ImageIndex = 3;
                    textC = Color.Purple;
                }
                else
                {
                    labelMsg.ImageIndex      = 0;
                    this.tabPage1.ImageIndex = 0;
                    textC = Color.Red;
                }
                this.mErrorlistForm.PrintJobInfomation(this.labelMsg.Text, textC);
                if (!this.mErrorlistForm.IsExpanded)
                {
                    m_Errorring_Timer.Start();
                }
            }
        }
 private void buttonAdd_Click(object sender, System.EventArgs e)
 {
     if (FileName1 != null && FileName1 != string.Empty &&
         FileName2 != null && FileName2 != string.Empty &&
         FileName1 != FileName2)
     {
         SPrtFileInfo jobInfo  = new SPrtFileInfo();
         SPrtFileInfo jobInfo1 = new SPrtFileInfo();
         Int32        bret     = 0;
         bret = CoreInterface.Printer_GetFileInfo(FileName1, ref jobInfo, 0);
         if (bret == 1)
         {
             bret = CoreInterface.Printer_GetFileInfo(FileName2, ref jobInfo1, 0);
             if (bret == 1)
             {
                 if (
                     jobInfo.sImageInfo.nImageResolutionX != jobInfo1.sImageInfo.nImageResolutionX ||
                     jobInfo.sImageInfo.nImageResolutionY != jobInfo1.sImageInfo.nImageResolutionY ||
                     jobInfo.sImageInfo.nImageWidth != jobInfo1.sImageInfo.nImageWidth ||
                     jobInfo.sImageInfo.nImageHeight != jobInfo1.sImageInfo.nImageHeight
                     //|| jobInfo.sImageInfo.nImageColorNum !=jobInfo1.sImageInfo.nImageColorNum
                     || jobInfo.sImageInfo.nImageColorDeep != jobInfo1.sImageInfo.nImageColorDeep
                     )
                 {
                     string info = "俩个文件属性不匹配.[分辨率,尺寸,色深]";                            //SErrorCode.GetEnumDisplayName(typeof(Software),Software.Parser);
                     MessageBox.Show(info, ResString.GetProductName(), MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
                 else
                 {
                     this.DialogResult = DialogResult.OK;
                 }
             }
         }
         if (bret != 1)
         {
             string info = SErrorCode.GetEnumDisplayName(typeof(Software), Software.Parser);
             info += ":" + FileName1;
             MessageBox.Show(info, ResString.GetProductName(), MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
         }
     }
     else
     {
         string info = "必须选择俩个文件,而且是不同的.";                //SErrorCode.GetEnumDisplayName(typeof(Software),Software.Parser);
         MessageBox.Show(info, ResString.GetProductName(), MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #5
0
        private bool InvalidCheck()
        {
            AllParam allp    = m_iPrinterChange.GetAllParam();
            float    pgW     = allp.PrinterSetting.sBaseSetting.fPaperWidth;
            float    pgH     = allp.PrinterSetting.sBaseSetting.fPaperHeight;
            float    realPgW = PubFunc.CalcRealJobWidth(pgW, this.m_iPrinterChange.GetAllParam());

            float  JobW = this.m_PreviewJob.JobSize.Width;
            string info = string.Empty;

            if (JobW > realPgW)
            {
                info += SErrorCode.GetResString("Software_MediaTooSmall");
                MessageBox.Show(info, ResString.GetProductName(), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
            return(true);
        }
Example #6
0
        public MeasureQuestionForm(IPrinterChange ipc, bool isMeasureBeforePrint = false)
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
            this.Text             = ResString.GetProductName();
            this.frmMessage.Image = SystemIcons.Question.ToBitmap();
            this.frmMessage.Text  = SErrorCode.GetResString("COMCommand_Abort_NotifyMeasure");
            mIPrinterChange       = ipc;
            AllParam allp = mIPrinterChange.GetAllParam();

            checkBoxShowAttention.Visible = SPrinterProperty.IsFloraUv() && allp.PrinterProperty.IsZMeasurSupport;

            _isMeasureBeforePrint = zAixsSetting1.IsMeasureBeforePrint = isMeasureBeforePrint;

            zAixsSetting1.CustomButtonClicked += new EventHandler <Setting.csEventArgs>(zAixsSetting1_CostomButtonClicked);
        }
Example #7
0
 public void OnErrorCodeChanged(int code)
 {
     this.m_StatusBarPanelError.Text = SErrorCode.GetInfoFromErrCode(code);
 }
Example #8
0
        private void ProceedKernelMessage(IntPtr wParam, IntPtr lParam)
        {
            CoreMsgEnum kParam = (CoreMsgEnum)wParam.ToInt64();

            switch (kParam)
            {
            case CoreMsgEnum.UpdaterPercentage:
            {
                int percentage = (int)lParam.ToInt64();
                //OnPrintingProgressChanged(percentage);
                string info            = "";
                string mPrintingFormat = ResString.GetUpdatingProgress();
                info += "\n" + string.Format(mPrintingFormat, percentage);
                this.m_StatusBarPanelPercent.Text = info;
                break;
            }

            case CoreMsgEnum.Percentage:
            {
                int percentage = (int)lParam.ToInt64();
                OnPrintingProgressChanged(percentage);

                break;
            }

            case CoreMsgEnum.Job_Begin:
            {
                int startType = (int)lParam.ToInt64();

                if (startType == 0)
                {
                }
                else if (startType == 1)
                {
                    //OnPrintingStart();
                }

                break;
            }

            case CoreMsgEnum.Job_End:
            {
                int endType = (int)lParam.ToInt64();

                if (endType == 0)
                {
                }
                else if (endType == 1)
                {
                    //OnPrintingEnd();
                }

                break;
            }

            case CoreMsgEnum.Power_On:
            {
                int bPowerOn = (int)lParam.ToInt64();
                if (bPowerOn != 0)
                {
                    int bPropertyChanged, bSettingChanged;
                    SPrinterProperty sPrinterProperty;
                    SPrinterSetting  sPrinterSetting;

                    m_allParam.PowerOnEvent(out bPropertyChanged, out bSettingChanged, out sPrinterProperty, out sPrinterSetting);
                    if (bPropertyChanged != 0)
                    {
                        OnPrinterPropertyChange(sPrinterProperty);
                    }
                    if (bSettingChanged != 0)
                    {
                        OnPrinterSettingChange(sPrinterSetting);
                    }
                }
                else
                {
                    m_allParam.PowerOffEvent();
                }
                break;
            }

            case CoreMsgEnum.Status_Change:
            {
                int status = (int)lParam.ToInt64();
                OnPrinterStatusChanged((JetStatusEnum)status);
                break;
            }

            case CoreMsgEnum.ErrorCode:
            {
                OnErrorCodeChanged((int)lParam.ToInt64());
                //For Updateing
                int        errorcode  = (int)lParam.ToInt64();
                SErrorCode serrorcode = new SErrorCode(errorcode);
                ErrorCause cause      = (ErrorCause)serrorcode.nErrorCause;
                if (cause == ErrorCause.CoreBoard && (ErrorAction)serrorcode.nErrorAction == ErrorAction.Updating)
                {
                    if (0 != serrorcode.n16ErrorCode)
                    {
                        if (serrorcode.n16ErrorCode == 1)
                        {
                            string info = ResString.GetEnumDisplayName(typeof(UISuccess), UISuccess.UpdateSuccess);
                            MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            string info = ResString.GetEnumDisplayName(typeof(UIError), UIError.UpdateFail);
                            MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
#if !LIYUUSB
                        CoreInterface.SendJetCommand((int)JetCmdEnum.ClearUpdatingStatus, 0);
#endif
                    }
                }

                break;
            }

            case CoreMsgEnum.Parameter_Change:
            {
                //m_LockUpdate = true;
                SPrinterSetting sPrinterSetting = m_allParam.PrinterSetting;
                if (CoreInterface.GetPrinterSetting(ref sPrinterSetting) == 0)
                {
                    Debug.Assert(false);
                }
                else
                {
                    OnPrinterSettingChange(sPrinterSetting);
                }
                //m_LockUpdate = false;
                break;
            }

            case CoreMsgEnum.Ep6Pipe:
            {
                int    ep6Cmd = (int)lParam.ToInt64() & 0x0000ffff;
                int    index  = (((int)lParam.ToInt64()) >> 16);
                byte[] bufep6 = null;
                int    buflen = 0;
                int    ret    = (CoreInterface.GetEp6PipeData(ep6Cmd, index, bufep6, ref buflen));
                if (ret != 0 && buflen > 0)
                {
                    bufep6 = new byte[buflen];
                    if (CoreInterface.GetEp6PipeData(ep6Cmd, index, bufep6, ref buflen) != 0)
                    {
                        switch (bufep6[0])
                        {
                        case 0xD4:
                            if (QRCodeForm != null)
                            {
                                QRCodeForm.SetQrCode(bufep6);
                            }
                            break;

                        case 0xD3:
                            if (QRCodeForm != null)
                            {
                                QRCodeForm.FeedBack(bufep6);
                            }
                            break;

                        case 0xE6:
                            if (QRCodeForm != null)
                            {
                                QRCodeForm.SetQrCodeFromHead(bufep6);
                            }
                            break;
                        }
                    }
                    else
                    {
                        MessageBox.Show(ResString.GetResString("GetEp6PipeDatafail"));
                    }
                }
                //else
                //{
                //    MessageBox.Show("GetEp6PipeData  buflen fail!");
                //}
            }
            break;
            }
        }
Example #9
0
        protected override void WndProc(ref System.Windows.Forms.Message msg)
        {
            const string LineEnd = "\r\n";

            // Dispose user message.
            if (msg.Msg == m_MessageUpdater)
            {
                int         nMsg    = (int)msg.WParam;
                CoreMsgEnum coremsg = (CoreMsgEnum)nMsg;
                switch (coremsg)
                {
                case CoreMsgEnum.Status_Change:
                {
                    int status = msg.LParam.ToInt32();

//						int portid = (int)msg.LParam;
//						BoardEnum board = (BoardEnum)portid;
//						m_TextBoxStatus.Text +=  ResString.GetEnumDisplayName(typeof(UpdateDisplay),UpdateDisplay.Status)+
//							ResString.GetEnumDisplayName(typeof(UpdateDisplay),UpdateDisplay.Begin) +
//							board.ToString();

                    m_TextBoxStatus.Text += status.ToString();
                    m_TextBoxStatus.Text += LineEnd;
                }
                break;

                case CoreMsgEnum.Percentage:
                {
                    int percent = (int)msg.LParam;
                    if (percent > 100)
                    {
                        percent = 100;
                    }
                    if (percent < 0)
                    {
                        percent = 0;
                    }
                    m_ProgressBarPercent.Value = (int)percent;
#if false
                    m_TextBoxStatus.Text += ResString.GetEnumDisplayName(typeof(UpdateDisplay), UpdateDisplay.Status) + percent.ToString() +
                                            ResString.GetEnumDisplayName(typeof(UpdateDisplay), UpdateDisplay.Percentage);
                    m_TextBoxStatus.Text += LineEnd;
#endif
                }
                break;

                case CoreMsgEnum.ErrorCode:
                {
                    int errorcode = (int)msg.LParam;
//						m_TextBoxStatus.Text += ResString.GetEnumDisplayName(typeof(UpdateDisplay),UpdateDisplay.Status) +
//							ResString.GetEnumDisplayName(typeof(UpdateDisplay),UpdateDisplay.Failed);
                    m_TextBoxStatus.Text += SErrorCode.GetInfoFromErrCode(errorcode);
                    m_TextBoxStatus.Text += "[" + errorcode.ToString("X") + "]";
                    m_TextBoxStatus.Text += LineEnd;

                    SErrorCode serrorcode = new SErrorCode(errorcode);
                    ErrorCause cause      = (ErrorCause)serrorcode.nErrorCause;
                    if (cause == ErrorCause.CoreBoard && (ErrorAction)serrorcode.nErrorAction == ErrorAction.Updating)
                    {
                        if (0 != serrorcode.n16ErrorCode)
                        {
                            CoreInterface.SendJetCommand((int)JetCmdEnum.ClearUpdatingStatus, 0);
                        }
                        if (serrorcode.n16ErrorCode == 1)
                        {
                            string info = ResString.GetEnumDisplayName(typeof(UISuccess), UISuccess.UpdateSuccess);
                            MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                        {
                            string info = ResString.GetEnumDisplayName(typeof(UIError), UIError.UpdateFail);
                            MessageBox.Show(info, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
                break;

                case CoreMsgEnum.Job_Begin:
                    m_TextBoxStatus.Text += ResString.GetEnumDisplayName(typeof(UpdateDisplay), UpdateDisplay.Status) +
                                            ResString.GetEnumDisplayName(typeof(UpdateDisplay), UpdateDisplay.Begin);
                    m_TextBoxStatus.Text += LineEnd;
                    break;

                case CoreMsgEnum.Job_End:
                    m_TextBoxStatus.Text += ResString.GetEnumDisplayName(typeof(UpdateDisplay), UpdateDisplay.Status) +
                                            ResString.GetEnumDisplayName(typeof(UpdateDisplay), UpdateDisplay.Success);
                    m_TextBoxStatus.Text += LineEnd;
                    break;
                }
                return;
            }

            base.WndProc(ref msg);
        }