//下面为新添加的版本信息更新的方法 public static void CheckHBVersion_New() { //bool bPowerOn = CoreInterface.GetBoardStatus() != JetStatusEnum.PowerOff; HEAD_BOARD_TYPE headBoardType = (HEAD_BOARD_TYPE)CoreInterface.get_HeadBoardType(true); SBoardInfo sBoardInfo = new SBoardInfo(); if (CoreInterface.GetBoardInfo(0, ref sBoardInfo) != 0) { SFWVersion fwv = new SFWVersion(sBoardInfo.m_nHBBoardVersion); string sVersion = fwv.m_nMainVersion.ToString() + "." + fwv.m_nSubVersion.ToString() + "." + fwv.m_nBuildVersion.ToString() + "." + fwv.m_nHWVersion.ToString(); string sql = "select VERSION_REPLACE.DISPLAY_REASON,VERSION_REPLACE.SUBMIT_TIME from VERSION_REPLACE left " + "join VERSION_INFO on VERSION_REPLACE.REPLACE_VID=VERSION_INFO.VID where VERSION_INFO.VERSION_NUM='" + sVersion + "' " + "and VERSION_INFO.HBTYPE='" + headBoardType.ToString() + "' ORDER BY VERSION_REPLACE.SUBMIT_TIME DESC"; DataTable data = SqliteHelp.SelectData(sql); if (data != null && data.Rows.Count > 0) { string msg = data.Rows[0][0].ToString(); if (!string.IsNullOrEmpty(msg.Trim())) { MessageBox.Show(msg.Trim(), @"头板版本更新提示"); } } } }
public HeadBoardPortSetting(ArrayList supportHeadList, HEAD_BOARD_TYPE headBoardType) { InitializeComponent(); //switch (headBoardType) //{ // //此处应该根据头板类型动态生成布局 //} headNumPerHb = PubFunc.GetHeadNumPerHeadborad(headBoardType); m_SupportHeadList = supportHeadList; portComboBoxs = new List <ComboBox>() { comboBoxHead8, comboBoxHead4, comboBoxHead7, comboBoxHead3, comboBoxHead6, comboBoxHead2, comboBoxHead5, comboBoxHead1, }; for (int i = 0; i < portComboBoxs.Count; i++) { portComboBoxs[i].Items.Clear(); for (int j = 0; j < m_SupportHeadList.Count; j++) { string cmode = ((VenderDisp)m_SupportHeadList[j]).DisplayName; portComboBoxs[i].Items.Add(cmode); } } }
/// <summary> /// 头版类型获得, /// </summary> private void GetHBType() { HEAD_BOARD_TYPE Type = HEAD_BOARD_TYPE.KM256_12HEAD; Type = (HEAD_BOARD_TYPE)CoreInterface.get_HeadBoardType(true); //头板类型获得 switch (Type) { //case HEAD_BOARD_TYPE.RICOH_GEN5_3H: //case HEAD_BOARD_TYPE.RICOH_GEN5_4H: // HBTypeName = "G5"; // m_CycleValue = 12f; // m_Wave_Number = 3; //最多存3个波形 // break; //case HEAD_BOARD_TYPE.HEAD_BOARD_TYPE_RICOH_GEN4_64Pin_8H: //case HEAD_BOARD_TYPE.HEAD_BOARD_TYPE_RICOH_GEN4_64Pin_8H_V2: //case HEAD_BOARD_TYPE.HEAD_BOARD_TYPE_RICOH_GEN4_64Pin_8H_GH220: default: HBTypeName = "G4"; m_CycleValue = 12f; m_Wave_Number = 3; //最多存8个波形 break; case HEAD_BOARD_TYPE.XAAR_1201_2H: //case HEAD_BOARD_TYPE.XAAR_1201_2HEAD_V2: case HEAD_BOARD_TYPE.XAAR_1201_4H: //case HEAD_BOARD_TYPE.XAAR_1201_4HEAD_V2: HBTypeName = "XAAR"; m_CycleValue = 12f; m_Wave_Number = 3; //最多存3个波形 break; } }
private void UpdateCoreBoard(byte[] wfdata, ColorEnum color, byte saveId) { HEAD_BOARD_TYPE headBoardType = (HEAD_BOARD_TYPE)CoreInterface.get_HeadBoardType(true); int nLen = 3 + wfdata.Length; byte[] val = new byte[nLen]; val[0] = (byte)headBoardType; val[1] = (byte)color; val[2] = saveId; Array.Copy(wfdata, 0, val, 3, wfdata.Length); int ret = CoreInterface.Down382WaveForm(val, nLen, 0x01); downloadedData = wfdata; }
public PrintHeadOrderTypeForm(int hbNum, ArrayList supportHeadList) { InitializeComponent(); headBoardNum = hbNum; _supportHeadList = supportHeadList; headBoardPorts = new List <HeadBoardPortSetting>(); HEAD_BOARD_TYPE headBoard = (HEAD_BOARD_TYPE)CoreInterface.get_HeadBoardType(true); tabControl1.SuspendLayout(); tabControl1.TabPages.Clear(); for (int i = 0; i < headBoardNum; i++) { TabPage tabPage = new TabPage(string.Format("头板{0}", i + 1)); HeadBoardPortSetting headBoardPort = new HeadBoardPortSetting(_supportHeadList, headBoard); headBoardPort.Dock = DockStyle.Fill; tabPage.Controls.Add(headBoardPort); tabControl1.TabPages.Add(tabPage); headBoardPorts.Add(headBoardPort); } tabControl1.ResumeLayout(true); }
private int SaveVersionInfo(string sFileName) { int ret = 0; FileStream fs = null;; try { //只保存关于窗口中的信息 //fs = new FileStream(sFileName, FileMode.Create); //if(fs != null && m_LabelVersion.Text != null && m_LabelVersion.Text.Length != 0) //{ // fs.Write(System.Text.Encoding.ASCII.GetBytes(m_LabelVersion.Text), 0, m_LabelVersion.Text.Length); // ret = 1; //} //修改于2018-5-10 压缩保存相关信息 using (FileStream fsOut = File.Create(sFileName)) { using (ZipOutputStream zipStream = new ZipOutputStream(fsOut)) { bool bPowerOn = CoreInterface.GetBoardStatus() != JetStatusEnum.PowerOff; HEAD_BOARD_TYPE headBoardType = (HEAD_BOARD_TYPE)CoreInterface.get_HeadBoardType(bPowerOn); string info = m_LabelVersion.Text + "HEAD_BOARD_TYPE: " + headBoardType + "\n" + "BOARD_SYSTEM: " + (CoreInterface.IsS_system() ? "S" : "A+" + "\n" + "PRINT_HEAD_TYPE: " + Text.Replace(ResString.GetProductName(), "") + "\n"); byte[] aboutStr = Encoding.Default.GetBytes(info); ZipEntry aboutEntry = new ZipEntry("About.txt") { DateTime = DateTime.Now }; zipStream.PutNextEntry(aboutEntry); zipStream.Write(aboutStr, 0, aboutStr.Length); zipStream.CloseEntry(); string printfile = Path.Combine(Application.StartupPath, "Print.log"); Zip(printfile, zipStream); string logfile = Path.Combine(Application.StartupPath, "log.txt"); Zip(logfile, zipStream); string usersettingfile = Path.Combine(Application.StartupPath, "UserSetting.ini"); Zip(usersettingfile, zipStream); string settingfile = Path.Combine(Application.StartupPath, "Setting.xml"); Zip(settingfile, zipStream); if (GlobalSetting.Instance.VendorProduct != null && GlobalSetting.Instance.VendorProduct.Length >= 8) { string folderName = Path.Combine(Application.StartupPath, GlobalSetting.Instance.VendorProduct.Substring(0, 4), GlobalSetting.Instance.VendorProduct.Substring(4, 4)); CompressFolder(folderName, zipStream); string factorywritefile = Application.StartupPath + Path.DirectorySeparatorChar + "PrinterProductList_" + GlobalSetting.Instance.VendorProduct.Substring(4, 4) + ".xml"; Zip(factorywritefile, zipStream); } zipStream.IsStreamOwner = false; zipStream.Finish(); zipStream.Close(); ret = 1; } } } catch {} finally { if (fs != null) { fs.Close(); } } return(ret); }
private void m_buttonFile_Click(object sender, EventArgs e) { try { OpenFileDialog fileDialog = new OpenFileDialog { Multiselect = false, CheckFileExists = true, DefaultExt = ".txt", Filter = ResString.GetEnumDisplayName(typeof(FileFilter), FileFilter.Txt) }; if (fileDialog.ShowDialog(this) == DialogResult.OK) { string path = fileDialog.FileName; if (!File.Exists(path) || numHBIndexW.SelectedIndex < 0 || headList.All(head => { return(!head.Checked); }) || abList.All(cbk => { return(!cbk.Checked); })) { MessageBox.Show(@"Input is wrong."); return; } groupBox4.Enabled = false; int hbindex = numHBIndexW.SelectedIndex; string info = ""; HEAD_BOARD_TYPE headBoardType = (HEAD_BOARD_TYPE)CoreInterface.get_HeadBoardType(true); byte[] wfdata; if (m_printerProperty.ePrinterHead == PrinterHeadEnum.Kyocera_KJ4A_RH06 || m_printerProperty.ePrinterHead == PrinterHeadEnum.Kyocera_KJ4B_YH06_5pl) { wfdata = PubFunc.GetAllDataFromFileKyocera_KJ4A_RH06_Des(path, ref info); //wfdata = PubFunc.GetAllDataFromFileKyocera_KJ4A_RH06(m_UpdaterFileName); } else { wfdata = PubFunc.GetAllDataFromFileKyocera_Des(path, ref info); //wfdata = PubFunc.GetAllDataFromFileKyocera(m_UpdaterFileName); } if (null == wfdata) { if (info == "") { MessageBox.Show("wavefrom file error!"); return; } else { MessageBox.Show(info); return; } } Task.Factory.StartNew(new Action(() => { downloadEvent.Reset(); for (int i = 0; i < headList.Count; i++) { for (int j = 0; j < abList.Count; j++) { if (headList[i].Checked && abList[j].Checked) { ColorEnum type = ColorEnum.Cyan;//(ColorEnum)(Enum.Parse(typeof(ColorEnum), m_Ctrls.InkGroupers[i].Text)); Decimal saveID = hbindex * 8 + i * 2 + j; if (m_printerProperty.ePrinterHead == PrinterHeadEnum.Kyocera_KJ4A_TA06_6pl || m_printerProperty.ePrinterHead == PrinterHeadEnum.Kyocera_KJ4A_RH06 || m_printerProperty.ePrinterHead == PrinterHeadEnum.Kyocera_KJ4B_YH06_5pl || m_printerProperty.ePrinterHead == PrinterHeadEnum.Kyocera_KJ4B_QA06_5pl || m_printerProperty.ePrinterHead == PrinterHeadEnum.Kyocera_KJ4A_AA06_3pl) { saveID = hbindex * 4 + i; } //m_nHeadId = (int)saveID; { UpdateCoreBoard(wfdata, type, (byte)saveID); //progressBarStatu.Maximum = ++nCount; } downloadEvent.WaitOne(); downloadEvent.Reset(); } } } MessageBox.Show(@"Download complete"); })); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void OnPrinterPropertyChange(SPrinterProperty sp) { property = sp; //int headNum = 0; headType = (HEAD_BOARD_TYPE)CoreInterface.get_HeadBoardType(true); if (CoreInterface.IsS_system()) { USER_SET_INFORMATION info = new USER_SET_INFORMATION(); CoreInterface.GetUserSetInfo(ref info); comboBox_HeadBoardIndex.Items.Clear(); for (int i = 0; i < info.HeadBoardNum; i++) { comboBox_HeadBoardIndex.Items.Add((i + 1).ToString("D")); } if (comboBox_HeadBoardIndex.Items.Count > 0) { comboBox_HeadBoardIndex.SelectedIndex = 0; } } else { //headNum = HeadNumPerBoard; comboBox_HeadBoardIndex.Items.Clear(); comboBox_HeadBoardIndex.Items.Add("1"); comboBox_HeadBoardIndex.SelectedIndex = 0; } switch (headType) { case HEAD_BOARD_TYPE.EPSON_S2840_4H: case HEAD_BOARD_TYPE.EPSON_I3200_4H_8DRV: { HeadNumPerBoard = 4; } break; case HEAD_BOARD_TYPE.EPSON_S1600_8H: { HeadNumPerBoard = 8; } break; } for (int i = 0; i < HeadNumPerBoard; i++) { LabelTextBox textBox1 = new LabelTextBox { String = "喷头" + i.ToString(), Text = "", MsgStringVisible = true, MsgString = 2, TextLength = TextLength, }; LabelTextBox textBox2 = new LabelTextBox { String = "喷头" + i.ToString(), Text = "", MsgStringVisible = false, MsgString = 2, TextLength = TextLength, }; flowLayoutPanel1.Controls.Add(textBox1); flowLayoutPanel2.Controls.Add(textBox2); } }
public Waveform_S2840() { InitializeComponent(); _headBoardType = (HEAD_BOARD_TYPE)CoreInterface.get_HeadBoardType(true); int headNum = 0; switch (_headBoardType) { case HEAD_BOARD_TYPE.EPSON_S1600_8H: { if (CoreInterface.IsS_system()) { USER_SET_INFORMATION info = new USER_SET_INFORMATION(); CoreInterface.GetUserSetInfo(ref info); headNum = 8 * info.HeadBoardNum; } else { headNum = 8; } } break; case HEAD_BOARD_TYPE.EPSON_S2840_4H: { if (CoreInterface.IsS_system()) { USER_SET_INFORMATION info = new USER_SET_INFORMATION(); CoreInterface.GetUserSetInfo(ref info); headNum = 4 * info.HeadBoardNum; } else { headNum = 4; } } break; case HEAD_BOARD_TYPE.EPSON_5113_2H: { if (CoreInterface.IsS_system()) { USER_SET_INFORMATION info = new USER_SET_INFORMATION(); CoreInterface.GetUserSetInfo(ref info); headNum = 2 * info.HeadBoardNum; } else { headNum = 2; } } break; case HEAD_BOARD_TYPE.EPSON_5113_8H: { if (CoreInterface.IsS_system()) { USER_SET_INFORMATION info = new USER_SET_INFORMATION(); CoreInterface.GetUserSetInfo(ref info); headNum = 8 * info.HeadBoardNum; } else { headNum = 8; } } break; case HEAD_BOARD_TYPE.EPSON_5113_6H: { if (CoreInterface.IsS_system()) { USER_SET_INFORMATION info = new USER_SET_INFORMATION(); CoreInterface.GetUserSetInfo(ref info); headNum = 6 * info.HeadBoardNum; } else { headNum = 6; } } break; case HEAD_BOARD_TYPE.Ricoh_Gen6_16H: { if (CoreInterface.IsS_system()) { USER_SET_INFORMATION info = new USER_SET_INFORMATION(); CoreInterface.GetUserSetInfo(ref info); headNum = 16 * info.HeadBoardNum; } else { headNum = 16; } } break; default: headNum = 0; //MessageBox.Show(@"Unsupported headboard type!"); break; } for (int i = 0; i < headNum; i++) { LabelButtonTextBox lbt = new LabelButtonTextBox { LabelHead = "H" + (i + 1) + ":", HeadNo = i }; flowLayoutPanel_Content.Controls.Add(lbt); } }