private string GetRealtimeInfoString() { string text = string.Empty; float ADJUST_VOL_PER_HEAD = 8; float VOL_COUNT_PER_HEAD = 3; float Plus_COUNT_PER_HEAD = 5; int headNum = 0; PrinterHeadEnum headtype = PrinterHeadEnum.UNKOWN; SFWFactoryData factoryData = new SFWFactoryData(); if (CoreInterface.GetFWFactoryData(ref factoryData) != 0) { headtype = (PrinterHeadEnum)factoryData.m_nHeadType; if (factoryData.m_nGroupNum > 0) { headNum = factoryData.m_nGroupNum * factoryData.m_nColorNum + factoryData.m_nWhiteInkNum + factoryData.m_nOverCoatInkNum; } else { headNum = (Math.Abs(factoryData.m_nGroupNum) * factoryData.m_nColorNum) / 2 + factoryData.m_nWhiteInkNum + factoryData.m_nOverCoatInkNum; } } uint uiHtype = 0; CoreInterface.GetUIHeadType(ref uiHtype); bool m_bKonic512 = (uiHtype & 0x01) != 0; //bool m_bXaar382 = (uiHtype & 0x02) != 0; //bool m_bSpectra = (uiHtype & 0x04) != 0; bool m_bPolaris = (uiHtype & 0x08) != 0; bool m_bPolaris_V5_8 = (uiHtype & 0x10) != 0; bool m_bExcept = (uiHtype & 0x20) != 0; bool m_bPolaris_V7_16 = (uiHtype & 0x40) != 0; bool m_bKonic1024i_Gray = (uiHtype & 0x80) != 0; bool m_bSpectra_SG1024_Gray = (uiHtype & 0x100) != 0; bool m_bXaar501 = (uiHtype & 0x200) != 0; //bool m_bVerArrangement = ((sp.bSupportBit1 & 2) != 0); //bool m_bMirrorArrangement = SPrinterProperty.IsMirrorArrangement(); bool m_b1head2color = (factoryData.m_nGroupNum < 0); bool m_Konic512_1head2color = m_b1head2color && m_bKonic512; bool m_bPolaris_V7_16_Emerald = m_bPolaris_V7_16 && (headtype == PrinterHeadEnum.Spectra_Emerald_10pl || headtype == PrinterHeadEnum.Spectra_Emerald_30pl); bool m_bPolaris_V7_16_Polaris = m_bPolaris_V7_16 && (headtype == PrinterHeadEnum.Spectra_PolarisColor4_15pl || headtype == PrinterHeadEnum.Spectra_PolarisColor4_35pl || headtype == PrinterHeadEnum.Spectra_PolarisColor4_80pl || headtype == PrinterHeadEnum.Spectra_Polaris_15pl || headtype == PrinterHeadEnum.Spectra_Polaris_35pl || headtype == PrinterHeadEnum.Spectra_Polaris_80pl); bool m_bPolaris_V5_8_Emerald = m_bPolaris_V5_8 && (headtype == PrinterHeadEnum.Spectra_Emerald_10pl || headtype == PrinterHeadEnum.Spectra_Emerald_30pl); bool m_bRicoHead = headtype == PrinterHeadEnum.RICOH_GEN4_7pl || headtype == PrinterHeadEnum.RICOH_GEN4L_15pl || headtype == PrinterHeadEnum.RICOH_GEN4P_7pl; bool m_bKyocera = SPrinterProperty.IsKyocera(headtype); if (m_bPolaris) { VOL_COUNT_PER_HEAD = 2; } if (m_bSpectra_SG1024_Gray) { VOL_COUNT_PER_HEAD = 3; } if (m_bKonic1024i_Gray) { VOL_COUNT_PER_HEAD = 3; } if (m_bPolaris_V7_16_Polaris) { VOL_COUNT_PER_HEAD = 1f / 2f; } if (m_bKyocera) { VOL_COUNT_PER_HEAD = 2; } int m_HeadNum = headNum; Plus_COUNT_PER_HEAD = VOL_COUNT_PER_HEAD; if (m_bSpectra_SG1024_Gray) { Plus_COUNT_PER_HEAD = 5; } SRealTimeCurrentInfo realTimeCurrentInfo = new SRealTimeCurrentInfo(); if (CoreInterface.GetRealTimeInfo(ref realTimeCurrentInfo, AutoInkTestHelper.Rmask) != 0) { text += "\nVoltageBase="; for (int i = 0; i < m_HeadNum; i++) { string volstring = string.Join(",", realTimeCurrentInfo.cVoltageBase.Skip((int)(i * VOL_COUNT_PER_HEAD)).Take((int)VOL_COUNT_PER_HEAD)); text += string.Format("[H{0}={1}],", i + 1, volstring); } text += "\nVoltage="; for (int i = 0; i < m_HeadNum; i++) { string volstring = string.Join(",", realTimeCurrentInfo.cVoltage.Skip((int)(i * VOL_COUNT_PER_HEAD)).Take((int)VOL_COUNT_PER_HEAD)); text += string.Format("[H{0}={1}],", i + 1, volstring); } text += "\nPulseWidth="; for (int i = 0; i < m_HeadNum; i++) { string volstring = string.Join(",", realTimeCurrentInfo.cPulseWidth.Skip((int)(i * Plus_COUNT_PER_HEAD)).Take((int)VOL_COUNT_PER_HEAD)); text += string.Format("[H{0}={1}],", i + 1, volstring); } } else { text += "\n GetRealTimeInfo fail."; } return(text); }
public void OnPrinterPropertyChange(SPrinterProperty sp) { m_rsPrinterPropery = sp; #if true uint uiHtype = 0; CoreInterface.GetUIHeadType(ref uiHtype); m_bKonic512 = (uiHtype & 0x01) != 0; m_bXaar382 = (uiHtype & 0x02) != 0; m_bSpectra = (uiHtype & 0x04) != 0; m_bPolaris = (uiHtype & 0x08) != 0; m_bPolaris_V5_8 = (uiHtype & 0x10) != 0;; m_bExcept = (uiHtype & 0x20) != 0; m_bPolaris_V7_16 = (uiHtype & 0x40) != 0; m_bKonic1024i_Gray = (uiHtype & 0x80) != 0; m_bSpectra_SG1024_Gray = (uiHtype & 0x100) != 0; m_bXaar501 = (uiHtype & 0x200) != 0;//pan dan Xaar501? #else m_bSpectra = SPrinterProperty.IsSpectra(sp.ePrinterHead); m_bKonic512 = SPrinterProperty.IsKonica512(sp.ePrinterHead); m_bXaar382 = (sp.ePrinterHead == PrinterHeadEnum.Xaar_Proton382_35pl || sp.ePrinterHead == PrinterHeadEnum.Xaar_Proton382_60pl); m_bPolaris = SPrinterProperty.IsPolaris(sp.ePrinterHead); // m_bPolaris_V5_8 = SPrinterProperty.IsPolaris(sp.ePrinterHead); SBoardInfo sBoardInfo = new SBoardInfo(); if (CoreInterface.GetBoardInfo(0, ref sBoardInfo) != 0) { m_bExcept = (sBoardInfo.m_nBoardManufatureID == 0xB || sBoardInfo.m_nBoardManufatureID == 0x8b); } #endif m_bVerArrangement = ((sp.bSupportBit1 & 2) != 0); m_bMirrorArrangement = m_rsPrinterPropery.IsMirrorArrangement(); m_b1head2color = (m_rsPrinterPropery.nOneHeadDivider == 2); m_Konic512_1head2color = m_b1head2color && m_bKonic512; m_bPolaris_V7_16_Emerald = m_bPolaris_V7_16 && (sp.ePrinterHead == PrinterHeadEnum.Spectra_Emerald_10pl || sp.ePrinterHead == PrinterHeadEnum.Spectra_Emerald_30pl); m_bPolaris_V7_16_Polaris = m_bPolaris_V7_16 && (sp.ePrinterHead == PrinterHeadEnum.Spectra_PolarisColor4_15pl || sp.ePrinterHead == PrinterHeadEnum.Spectra_PolarisColor4_35pl || sp.ePrinterHead == PrinterHeadEnum.Spectra_PolarisColor4_80pl || sp.ePrinterHead == PrinterHeadEnum.Spectra_Polaris_15pl || sp.ePrinterHead == PrinterHeadEnum.Spectra_Polaris_35pl || sp.ePrinterHead == PrinterHeadEnum.Spectra_Polaris_80pl); m_bPolaris_V5_8_Emerald = m_bPolaris_V5_8 && (sp.ePrinterHead == PrinterHeadEnum.Spectra_Emerald_10pl || sp.ePrinterHead == PrinterHeadEnum.Spectra_Emerald_30pl); m_bRicoHead = sp.ePrinterHead == PrinterHeadEnum.RICOH_GEN4_7pl || sp.ePrinterHead == PrinterHeadEnum.RICOH_GEN4L_15pl || sp.ePrinterHead == PrinterHeadEnum.RICOH_GEN4P_7pl; m_bKyocera = SPrinterProperty.IsKyocera(sp.ePrinterHead); m_bKonic1800i = SPrinterProperty.IsKonic1800i(sp.ePrinterHead); m_bKonicM600 = sp.ePrinterHead == PrinterHeadEnum.Konica_M600SH_2C; m_bGma990 = sp.ePrinterHead == PrinterHeadEnum.Fujifilm_GMA9905300_5pl || sp.ePrinterHead == PrinterHeadEnum.Fujifilm_GMA3305300_5pl; m_HeadNum = NewLayoutFun.GetHeadNum(); if (m_bKonic1024i_Gray) { m_TempNum = m_HeadNum / 2; } else if (m_bSpectra_SG1024_Gray) { if (!CoreInterface.IsSG1024_AS_8_HEAD()) { if (m_b1head2color) { m_TempNum /= 2; } } } m_StartHeadIndex = 0; //int imax = Math.Max(m_HeadNum, m_TempNum); m_pMap = new byte[m_HeadNum]; for (int i = 0; i < m_HeadNum; i++) { m_pMap[i] = (byte)i; } if (GetRealTimeInfo2()) { InitHeadTextList(); InitChart(); InitCheckedListBox(); } }