/// <summary> /// 设置扩展板加热保护温度 /// </summary> private void SetExtHeadOverHeat() { ExtHeadOverHeat headOverHeat = new ExtHeadOverHeat(); headOverHeat.Flag = new char[] { 'H', 'H', 'O', 'T' }; headOverHeat.OverHeatTmp = (ushort)(numHeatingProtectionTemp.Value * 100); byte[] buf = SerializationUnit.StructToBytes(headOverHeat); uint bufsize = (uint)buf.Length; int ret = CoreInterface.SetEpsonEP0Cmd(0x7f, buf, ref bufsize, 0, 3); if (ret == 0) { MessageBox.Show("Set Over Heat temp error!"); } }
public int ReadHeader(byte[] buffer) { SrcWidth = SrcHeight = 0; LiyuRipHEADER headerTemp; CoreInterface.GetLiyuRipHEADER(_workjob.FileLocation, out headerTemp, IsCsPrt); CoreInterface.GetLiyuRipHEADER(_workjob.FileLocation, out header1, IsCsPrt); SrcWidth = header1.nImageWidth; SrcHeight = header1.nImageHeight; if (_isDouble4CJob) { CoreInterface.GetLiyuRipHEADER(_workjob.FileLocation2, out header2, IsCsPrt); ColorNum = header1.nImageColorNum + header2.nImageColorNum; headerTemp.nAChannel = (byte)header1.nImageColorNum; headerTemp.nBChannel = (byte)header2.nImageColorNum; headerTemp.nImageColorNum = ColorNum; } else { ColorNum = header1.nImageColorNum; } BytePerLine = header1.nBytePerLine; byte[] buftemp = SerializationUnit.StructToBytes(headerTemp); if (IsCsPrt) { int readSize = Marshal.SizeOf(typeof(CAISHEN_HEADER)); FileStream stream = new FileStream(_workjob.FileLocation, FileMode.Open, FileAccess.Read); BinaryReader reader = new BinaryReader(stream); buftemp = reader.ReadBytes(readSize); if (_isDouble4CJob) { CAISHEN_HEADER csHeader = (CAISHEN_HEADER)SerializationUnit.BytesToStruct(buftemp, typeof(CAISHEN_HEADER)); csHeader.uColors = ColorNum; buftemp = SerializationUnit.StructToBytes(csHeader); } } Buffer.BlockCopy(buftemp, 0, buffer, 0, buftemp.Length); return(buftemp.Length); }
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); } }