コード例 #1
0
        public void OnPrinterSettingChange(SPrinterSetting ss)
        {
            _printerSetting = ss;
            //if (SPrinterProperty.IsSurportCapping())
            {
                WetParam wetParam = new WetParam();
                if (EpsonLCD.GetWetParam(ref wetParam))
                {
                    // 回保湿位置
                    checkBoxEnableCappingPosX.Checked = (wetParam.PosMask & 1) != 0;
                    checkBoxEnableCappingPosY.Checked = (wetParam.PosMask & 2) != 0;
                    checkBoxEnableCappingPosZ.Checked = (wetParam.PosMask & 4) != 0;
                    checkBoxsalverPos.Checked         = (wetParam.PosMask & 8) != 0;
                    checkBoxEnableAutoCapping.Checked = wetParam.Enable != 0;
                    if (m_sPrinterProperty.fPulsePerInchX > 0)
                    {
                        UIPreference.SetValueAndClampWithMinMax(numCappingPosX, m_CurrentUnit,
                                                                wetParam.XPos / m_sPrinterProperty.fPulsePerInchX);
                    }
                    if (m_sPrinterProperty.fPulsePerInchY > 0)
                    {
                        UIPreference.SetValueAndClampWithMinMax(numCappingPosY, m_CurrentUnit,
                                                                wetParam.YPos / m_sPrinterProperty.fPulsePerInchY);
                    }
                    if (m_sPrinterProperty.fPulsePerInchZ > 0)
                    {
                        UIPreference.SetValueAndClampWithMinMax(numCappingPosZ, m_CurrentUnit,
                                                                wetParam.ZPos / m_sPrinterProperty.fPulsePerInchZ);
                    }
                    numCappingDelayTime.Value = (decimal)(wetParam.WaitTime / 1000f);

                    // 回默认位置
                    checkBoxXHomePos.Checked        = (wetParam.DefaultBackPosMask & 1) != 0;
                    checkBoxYHomePos.Checked        = (wetParam.DefaultBackPosMask & 2) != 0;
                    checkBoxEnableHomeDelay.Checked = wetParam.DefaultBackDelayEnable != 0;
                    if (m_sPrinterProperty.fPulsePerInchX > 0)
                    {
                        UIPreference.SetValueAndClampWithMinMax(numHomePosX, m_CurrentUnit,
                                                                wetParam.DefaultBackXPos / m_sPrinterProperty.fPulsePerInchX);
                    }
                    if (m_sPrinterProperty.fPulsePerInchY > 0)
                    {
                        UIPreference.SetValueAndClampWithMinMax(numHomePosY, m_CurrentUnit,
                                                                wetParam.DefaultBackYPos / m_sPrinterProperty.fPulsePerInchY);
                    }
                    numAutoHomeDelay.Value = (decimal)(wetParam.BackDefaultPosWaitTime / 1000f);
                    numSalverPos.Value     = wetParam.cover4Place;
                }
            }
            this.isDirty = false;
        }