示例#1
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;
                }
            }
        }