Ejemplo n.º 1
0
        public void ApplyToBoard()
        {
            int status = 0;

            status = OnGetRealTimeFromUI();
#if false
            ////////////////////////////////
            byte onelight = 1;
            if (m_CheckBoxOneLight.Checked)
            {
                onelight = 1;
            }
            else
            {
                onelight = 0;
            }
            const int  port = 1;
            const byte PRINTER_PIPECMDSIZE = 26;
            byte []    m_pData             = new byte[PRINTER_PIPECMDSIZE + 2];
            //First Send Begin Updater
            m_pData[0] = 2 + 1;
            m_pData[1] = 0x45;             //One Light mode
            m_pData[2] = onelight;

            if (CoreInterface.SetPipeCmdPackage(m_pData, m_pData[0], port) == 0)
            {
                MessageBox.Show(ResString.GetEnumDisplayName(typeof(UIError), UIError.SaveRealTimeFail));
                return;
            }
#endif
            byte[] uvPowerLevelMap = SerializationUnit.StructToBytes(_UvPowerLevelMap);
            uint   length          = (uint)uvPowerLevelMap.Length;
            int    ret             = CoreInterface.SetEpsonEP0Cmd(0x68, uvPowerLevelMap, ref length, 0, 0x01);
            if (ret == 0)
            {
                MessageBox.Show(ResString.GetResString("SetFailed"));
            }
            if (SPrinterProperty.IsGongZengUv())
            {
                GZUVX2Param.UVX1Power = (ushort)numUVX1Power.Value;
                GZUVX2Param.UVX2Power = (ushort)numUVX2Power.Value;
                if (!EpsonLCD.SetGZUVX2Param(GZUVX2Param))
                {
                    MessageBox.Show(ResString.GetResString("SetFailed"));
                }
            }
            if (CoreInterface.SetUVStatus(status) != 0)
            {
                if ((status & 0xf) == 0 || (status & 0xf0) == 0)
                {
                    MessageBox.Show(ResString.GetResString("OpenUV"));
                }
            }
            else
            {
                MessageBox.Show(ResString.GetEnumDisplayName(typeof(UIError), UIError.SaveRealTimeFail));
            }

            if (PubFunc.IsSupportUVOffsetDistance())
            {
                UVOffsetDistanceUI uvOffset = GetUVOffsetFromUI();
                EpsonLCD.SetUVOffsetDistToFw(uvOffset, fPulsePerInchX);
            }
        }