示例#1
0
        public void OnPrinterSettingChange(AllParam allParam)
        {
            SPrinterSetting ss = allParam.PrinterSetting;

            m_uvLightType = (UvLightType)ss.UVSetting.eUvLightType;

            this.m_ComboBoxLeftSet.Items.Clear();
            this.m_ComboBoxRightSet.Items.Clear();
            this.m_ComboBoxPLeftSet.Items.Clear();
            this.m_ComboBoxPRightSet.Items.Clear();
            Type enumtype = typeof(UVStatus);

            if (m_uvLightType == UvLightType.UvLightType2 || m_uvLightType == UvLightType.UvLightType3)//(sp.IsAllWinZMeasurSensorSupport())
            {
                enumtype = typeof(UVStatus_ALLWIN);
                UVStatus_ALLWIN[] vals = (UVStatus_ALLWIN[])Enum.GetValues(enumtype);
                for (int i = 0; i < vals.Length; i++)
                {
                    string item = ResString.GetEnumDisplayName(enumtype, vals[i]);
                    this.m_ComboBoxLeftSet.Items.Add(item);
                    this.m_ComboBoxRightSet.Items.Add(item);
                    this.m_ComboBoxPLeftSet.Items.Add(item);
                    this.m_ComboBoxPRightSet.Items.Add(item);
                }
            }
            else
            {
                UVStatus[] vals = (UVStatus[])Enum.GetValues(enumtype);
                for (int i = 0; i < vals.Length; i++)
                {
                    string item = ResString.GetEnumDisplayName(enumtype, vals[i]);
                    this.m_ComboBoxLeftSet.Items.Add(item);
                    this.m_ComboBoxRightSet.Items.Add(item);
                    this.m_ComboBoxPLeftSet.Items.Add(item);
                    this.m_ComboBoxPRightSet.Items.Add(item);
                }
            }

            SUVSetting uvseting = ss.UVSetting;

            UIPreference.SetValueAndClampWithMinMax(this.numericUpDownShutterDis, uvseting.fShutterOpenDistance);
#if !DOUBLE_SIDE_PRINT_HAPOND
            UIPreference.SetValueAndClampWithMinMax(this.numericUpDownLeftDis, uvseting.fLeftDisFromNozzel);
            UIPreference.SetValueAndClampWithMinMax(this.numericUpDownRightDis, uvseting.fRightDisFromNozzel);
            this.checkBox1Leftprinton.Checked  = (uvseting.iLeftRightMask & 0x02) != 0;
            this.checkBox1Rightprinton.Checked = (uvseting.iLeftRightMask & 0x01) != 0;
            this.checkBox2Leftprinton.Checked  = (uvseting.iLeftRightMask & 0x08) != 0;
            this.checkBox2Rightprinton.Checked = (uvseting.iLeftRightMask & 0x04) != 0;
#else
            UIPreference.SetValueAndClampWithMinMax(this.numericUpDownLeftDis, uvseting.fRightDisFromNozzel);
            UIPreference.SetValueAndClampWithMinMax(this.numericUpDownRightDis, uvseting.fLeftDisFromNozzel);
            this.checkBox1Leftprinton.Checked  = (uvseting.iLeftRightMask & 0x04) != 0;
            this.checkBox1Rightprinton.Checked = (uvseting.iLeftRightMask & 0x08) != 0;
            this.checkBox2Leftprinton.Checked  = (uvseting.iLeftRightMask & 0x01) != 0;
            this.checkBox2Rightprinton.Checked = (uvseting.iLeftRightMask & 0x02) != 0;
#endif
            this.cmb_UvLightType.SelectedIndex = ss.UVSetting.eUvLightType;
            if (SPrinterProperty.IsGongZengUv())
            {
                if (EpsonLCD.GetGZUVX2Param(ref GZUVX2Param))
                {
                    numUVX1Power.Value = GZUVX2Param.UVX1Power <= 100 ? GZUVX2Param.UVX1Power : 0;
                    numUVX2Power.Value = GZUVX2Param.UVX2Power <= 100 ? GZUVX2Param.UVX2Power : 0;
                }
            }

            if (PubFunc.IsSupportUVOffsetDistance())
            {
                if (allParam.ExtendedSettings.UVOffsetDis.OffsetDistArray != null && allParam.ExtendedSettings.UVOffsetDis.OffsetDistArray.Length >= 8)
                {
                    UIPreference.SetValueAndClampWithMinMax(this.numPLOpen, allParam.ExtendedSettings.UVOffsetDis.OffsetDistArray[0]);
                    UIPreference.SetValueAndClampWithMinMax(this.numPLClose, allParam.ExtendedSettings.UVOffsetDis.OffsetDistArray[1]);
                    UIPreference.SetValueAndClampWithMinMax(this.numPROpen, allParam.ExtendedSettings.UVOffsetDis.OffsetDistArray[2]);
                    UIPreference.SetValueAndClampWithMinMax(this.numPRClose, allParam.ExtendedSettings.UVOffsetDis.OffsetDistArray[3]);

                    UIPreference.SetValueAndClampWithMinMax(this.numPLOpen2, allParam.ExtendedSettings.UVOffsetDis.OffsetDistArray[4]);
                    UIPreference.SetValueAndClampWithMinMax(this.numPLClose2, allParam.ExtendedSettings.UVOffsetDis.OffsetDistArray[5]);
                    UIPreference.SetValueAndClampWithMinMax(this.numPROpen2, allParam.ExtendedSettings.UVOffsetDis.OffsetDistArray[6]);
                    UIPreference.SetValueAndClampWithMinMax(this.numPRClose2, allParam.ExtendedSettings.UVOffsetDis.OffsetDistArray[7]);
                }
            }
        }